StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Cut.cxx
1 
2 #include "Cut.h"
3 
4 #include "Stiostream.h"
5 #include <string.h>
6 
7 ClassImp(Cut)
8 
9 //
10 // initialize event and track cuts to broad values
11 //
12 //EVENT CUTS:
13 Float_t Cut::mVertexZ[2] = {-200,200};
14 Int_t Cut::mFlowCent[2] = {0,9}; //MinBias
15 Float_t Cut::mZDCSum[2] = {0,1000}; //MinBias
16 
17 //TRACK CUTS:
18 Float_t Cut::mEta[2] = {-1.,1.};
19 Int_t Cut::mFitPts[2] = {0,50};
20 Float_t Cut::mSDcaGl[2] = {-3,3};
21 Float_t Cut::mDcaXYGl[2] = {-3,3};
22 Float_t Cut::mCross[2] = {-20,20};
23 Int_t Cut::mFirstPadrow[2] = {0,99};
24 Bool_t Cut::mSameSector = false;
25 Bool_t Cut::mCrossCM = true; //Meaning, its okay to cross CM by default
26 
27 void
28 Cut::ShowCuts()
29 {
30 
31  cout << "******************************************************" << endl;
32  cout << "Cut::ShowCuts()" << endl;
33  cout << "event cuts:" << endl;
34 
35  cout << "\tflow cent : " << mFlowCent[0] << " -- " << mFlowCent[1] << endl;
36  cout << "\tvertex z : " << mVertexZ[0] << " -- " << mVertexZ[1] << endl;
37  cout << "\tZDCSum : " << mZDCSum[0] << " -- " << mZDCSum[1] << endl;
38 
39  cout << "track cuts:" << endl
40  << "\teta : " << mEta[0] << " -- " << mEta[1] << endl
41  << "\tfit pts : " << mFitPts[0] << " -- " << mFitPts[1] << endl
42  << "\tsdca : " << mSDcaGl[0] << " -- " << mSDcaGl[1] << endl
43  << "\tdcaxy : " << mDcaXYGl[0] << " -- " << mDcaXYGl[1] << endl
44  << "\tcross : " << mCross[0] << " -- " << mCross[1] << endl
45  << "\tfirst row : " << mFirstPadrow[0] << " -- " << mFirstPadrow[1] << endl
46  << "\tSameSector? : " << (Int_t)mSameSector << endl
47  << "\tCrossCM? : " << (Int_t)mCrossCM << endl
48  << endl;
49  cout << "******************************************************" << endl;
50 
51 }
52 
53 //The output of this method will eventually be used to make a conversion table for cuts on plots
54 void
55 Cut::DecodeCutList(const char *cutList)
56 {
57 
58  cout << "******************************************************" << endl;
59  cout << "Cut::DecodeCutList("<< cutList << ")" << endl;
60  cout << "Event Cuts:" << endl;
61 
62  cout << "\tFlow centrality : " << mFlowCent[0] << " -- " << mFlowCent[1] << endl;
63  cout << "\tZ vertex : " << mVertexZ[0] << " -- " << mVertexZ[1] << endl;
64  cout << "\tZDCSum : " << mZDCSum[0] << " -- " << mZDCSum[1] << endl;
65 
66  cout << "Track Cuts:" << endl
67  << "\tEta : " << mEta[0] << " -- " << mEta[1] << endl
68  << "\tFitpts : " << mFitPts[0] << " -- " << mFitPts[1] << endl
69  << "\t3dDca : " << mSDcaGl[0] << " -- " << mSDcaGl[1] << endl
70  << "\tDcaXY : " << mDcaXYGl[0] << " -- " << mDcaXYGl[1] << endl
71  << "\tCrossing Angle : " << mCross[0] << " -- " << mCross[1] << endl
72  << "\tFirst Row : " << mFirstPadrow[0] << " -- " << mFirstPadrow[1] << endl
73  << "\tSameSector? : " << (Int_t)mSameSector << endl
74  << "\tCrossCM? : " << (Int_t)mCrossCM
75  << endl
76  << endl;
77  cout << "******************************************************" << endl;
78 
79 }
80 
81 const char* Cut::SetCuts(const char* cutList) {
82 
83  char cut[7];
84 
85  if (strlen(cutList) != 7) {
86  cerr << "<W> Error, cutList has " << strlen(cutList) << " members" << endl;
87  cerr << "<W> Expecting 7 cuts. Reverting to wide open cuts!" << endl << endl;
88  cutList = "ZZZZZZZ";
89  }
90 
91  sscanf(cutList,"%c%c%c%c%c%c%c",&cut[0],&cut[1],
92  &cut[2],&cut[3],&cut[4],&cut[5],&cut[6]);
93 
94  cout << "Setting cuts:" << endl
95  << "\tcentType = " << cut[0] << endl
96  << "\tvertex = " << cut[1] << endl
97  << "\teta = " << cut[2] << endl
98  << "\tfitPts = " << cut[3] << endl
99  << "\t2dDCA = " << cut[4] << endl
100  << "\tSameSector ?= " << cut[5] << endl
101  << "\tCrossCM ?= " << cut[6] << endl << endl;
102 
103  SetCentCut(cut[0]);
104  SetZVertexCut(cut[1]);
105  SetEtaCut(cut[2]);
106  SetFitPtsCut(cut[3]);
107  SetDCACut(cut[4]);
108  SetSameSectorCut(cut[5]);
109  SetCrossCMCut(cut[6]);
110 
111  return cutList;
112 
113 }
114 
115 void Cut::SetCrossCMCut(const char crossCMCut) {
116 
117  switch(crossCMCut) {
118  case 'y': //
119  mCrossCM = true; break;
120  case 'n': //
121  mCrossCM = false; break;
122  default:
123  cerr << "<W> Unknown CrossCM Cut Type: " << crossCMCut << endl;
124  cerr << "<W> Reverting to NO cut: CrossCM = true" << endl << endl; break;
125  }
126 }
127 
128 void Cut::SetSameSectorCut(const char sameSectorCut) {
129 
130  switch(sameSectorCut) {
131  case 'y': //
132  mSameSector = true; break;
133  case 'n': //
134  mSameSector = false; break;
135  default:
136  cerr << "<W> Unknown SameSector Cut Type: " << sameSectorCut << endl;
137  cerr << "<W> Reverting to NO cut: SameSector = false" << endl << endl; break;
138  }
139 }
140 
141 void Cut::SetDCACut(const char dcaCut) {
142 
143  switch(dcaCut) {
144  case '1': //
145  mSDcaGl[0] = -1.; mSDcaGl[1] = 1.;
146  mDcaXYGl[0] = -3.; mDcaXYGl[1] = 3.; break;
147  case '2': //
148  mSDcaGl[0] = -0.9; mSDcaGl[1] = 0.9;
149  mDcaXYGl[0] = -3.; mDcaXYGl[1] = 3.; break;
150  case '3': //
151  mSDcaGl[0] = -1.5; mSDcaGl[1] = 1.5;
152  mDcaXYGl[0] = -3.; mDcaXYGl[1] = 3.; break;
153  case '4': //
154  mSDcaGl[0] = -3.; mSDcaGl[1] = 3.;
155  mDcaXYGl[0] = -1.; mDcaXYGl[1] = 1.; break;
156  case '5': //
157  mSDcaGl[0] = -3.; mSDcaGl[1] = 3.;
158  mDcaXYGl[0] = -0.9; mDcaXYGl[1] = 0.9; break;
159  case '6': //
160  mSDcaGl[0] = -3.; mSDcaGl[1] = 3.;
161  mDcaXYGl[0] = -1.5; mDcaXYGl[1] = 1.5; break;
162  default:
163  cerr << "<W> Unknown DCA Cut Type: " << dcaCut << endl;
164  cerr << "<W> Reverting to wide open cut: " << endl;
165  cerr << "\t-3. < SDcaGl < 3. " << endl;
166  cerr << "\t-3. < DcaXYGl < 3. " << endl << endl;
167  break;
168  }
169 }
170 
171 void Cut::SetFitPtsCut(const char fitPtsCut) {
172 
173  switch(fitPtsCut) {
174  case '1': //
175  mFitPts[0] = 20; mFitPts[1] = 50; break;
176  case '2': //
177  mFitPts[0] = 15; mFitPts[1] = 50; break;
178  case '3': //
179  mFitPts[0] = 10; mFitPts[1] = 50; break;
180  case '4': //
181  mFitPts[0] = 25; mFitPts[1] = 50; break;
182  case '5': //
183  mFitPts[0] = 30; mFitPts[1] = 50; break;
184  default:
185  cerr << "<W> Unknown FitPts Cut Type: " << fitPtsCut << endl;
186  cerr << "<W> Reverting to wide open cut: 0 < FitPts < 50" << endl << endl;
187  break;
188  }
189 }
190 
191 void Cut::SetEtaCut(const char etaCut) {
192 
193  switch(etaCut) {
194  case '1': //
195  mEta[0] = -0.75; mEta[1] = 0.75; break;
196  case '2': //
197  mEta[0] = -0.5; mEta[1] = -0.5; break;
198  case '3': //
199  mEta[0] = -1.; mEta[1] = 1.; break;
200  default:
201  cerr << "<W> Unknown Eta Cut Type: " << etaCut << endl;
202  cerr << "<W> Reverting to wide open cut: -1. < Eta < 1." << endl << endl;
203  break;
204  }
205 }
206 
207 void Cut::SetZVertexCut(const char zVtxCut) {
208 
209  switch(zVtxCut) {
210  case '1': //
211  mVertexZ[0] = -25.; mVertexZ[1] = 25.; break;
212  case '2': //
213  mVertexZ[0] = 0.; mVertexZ[1] = 25.; break;
214  case '3': //
215  mVertexZ[0] = -25.; mVertexZ[1] = 0.; break;
216  case '4': //
217  mVertexZ[0] = -15.; mVertexZ[1] = 15.; break;
218  case '5': //
219  mVertexZ[0] = -10.; mVertexZ[1] = 10.; break;
220  case '6': //
221  mVertexZ[0] = -5.; mVertexZ[1] = 5.; break;
222  default:
223  cerr << "<W> Unknown Vertex Z type: " << zVtxCut << endl;
224  cerr << "<W> Reverting to wide open cut: -200 < Zvtx < 200" << endl << endl;
225  break;
226  }
227 }
228 
229 void Cut::SetCentCut(const char centType) {
230 
231  switch(centType){
232  case 'C': // triggered central ALL
233  mFlowCent[0]=-1; mFlowCent[1]=-1; break;
234  case '9': // triggered central 0-5
235  mFlowCent[0]=-1; mFlowCent[1]=-1;
236  mZDCSum[0]=0; mZDCSum[1]=66; break; //Determined ZdcCut using zdcCent.C
237  case '8': // triggered central 5-10
238  mFlowCent[0]=-1; mFlowCent[1]=-1;
239  mZDCSum[0]=66; mZDCSum[1]=1000; break; //Determined ZdcCut using zdcCent.C
240  case 'M': // triggered minbias
241  mFlowCent[0]=0; mFlowCent[1]=9; break;
242 
243  case '6': // 0-5% of minbias
244  mFlowCent[0]=9; mFlowCent[1]=9; break;
245  case '5': // 5-10% of minbias
246  mFlowCent[0]=8; mFlowCent[1]=8; break;
247  case '4': // 10-20% of minbias
248  mFlowCent[0]=7; mFlowCent[1]=7; break;
249  case '3': // 20-30% of minbias
250  mFlowCent[0]=6; mFlowCent[1]=6; break;
251  case '2': // 30-40% of minbias
252  mFlowCent[0]=5; mFlowCent[1]=5; break;
253  case '1': // 40-60% of minbias
254  mFlowCent[0]=3; mFlowCent[1]=4; break;
255  case '0': // 60-80% of minbias
256  mFlowCent[0]=1; mFlowCent[1]=2; break;
257  case 'a': // 40-80% of minbias
258  mFlowCent[0]=1; mFlowCent[1]=4; break;
259  default:
260  cerr << "<W> Unknown centrality type: " << centType << endl;
261  cerr << "<W> Reverting to MinBias. " << endl << endl;
262  break;
263  }
264 
265 }
Definition: Cut.h:18