]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/macros/CreateTrackCutsPWG4.C
Added tpcrefit requirement for QA task, cut configuration for ESD Filter
[u/mrichter/AliRoot.git] / PWG4 / macros / CreateTrackCutsPWG4.C
1 AliESDtrackCuts *CreateTrackCutsPWG4(Int_t cutMode) {
2
3   //
4   // Macro to create track cuts for PWG4 Jet analysis
5   // User can select a specific set by indicating cutMode
6   // cutMode has 8 digits: first 4 digits additional cuts, last 4 digits standard cuts
7   //                       additional cuts are variations of standard cuts (used for hybrid track selection and QA)
8   // Numbering starts from 1000 for standard and additional cut numbers
9
10   AliESDtrackCuts *trackCuts  = new AliESDtrackCuts("AliESDtrackCuts");
11
12   TString tag;
13
14   Int_t mod = 10000;
15
16   Bool_t bStdCutsDefined = kFALSE;
17
18
19   //_____________________________________________________________________
20   //                     STANDARD CUTS
21
22   //Get standard cuts: last 4 digits of cutMode
23   Int_t stdCutMode = cutMode%mod;
24
25   if(stdCutMode == 1000) {
26
27     bStdCutsDefined = kTRUE;
28
29     trackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE,1);
30     trackCuts->SetMinNCrossedRowsTPC(120);
31     trackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);
32     trackCuts->SetMaxChi2PerClusterITS(36);
33     trackCuts->SetMaxFractionSharedTPCClusters(0.4);
34     trackCuts->SetMaxChi2TPCConstrainedGlobal(36);
35
36     trackCuts->SetEtaRange(-0.9,0.9);
37     trackCuts->SetPtRange(0.15, 1e10);
38
39     tag = "Global track RAA analysis QM2011 + Chi2ITS<36";
40
41   }
42
43   if(stdCutMode == 1001) {
44
45     bStdCutsDefined = kTRUE;
46
47     // TPC  
48     trackCuts->SetMinNClustersTPC(90);
49     trackCuts->SetMaxChi2PerClusterTPC(4);
50     trackCuts->SetRequireTPCStandAlone(kTRUE); //cut on NClustersTPC and chi2TPC Iter1
51     trackCuts->SetAcceptKinkDaughters(kFALSE);
52     trackCuts->SetRequireTPCRefit(kTRUE);
53     trackCuts->SetMaxFractionSharedTPCClusters(0.4);
54     // ITS
55     trackCuts->SetRequireITSRefit(kTRUE);
56     //accept secondaries
57     trackCuts->SetMaxDCAToVertexXY(2.4);
58     trackCuts->SetMaxDCAToVertexZ(3.2);
59     trackCuts->SetDCAToVertex2D(kTRUE);
60     //reject fakes
61     trackCuts->SetMaxChi2PerClusterITS(36);
62
63     trackCuts->SetRequireSigmaToVertex(kFALSE);
64
65     trackCuts->SetEtaRange(-0.9,0.9);
66     trackCuts->SetPtRange(0.15, 100.);
67
68  
69     tag = "Global tracks jet analysis with ITSrefit and NclsIter1=90, noSPD requirement";
70
71   }
72
73   if(stdCutMode == 1002) {
74
75     bStdCutsDefined = kTRUE;
76
77     // TPC  
78     trackCuts->SetMinNClustersTPC(80);
79     trackCuts->SetMaxChi2PerClusterTPC(4);
80     trackCuts->SetAcceptKinkDaughters(kFALSE);
81     trackCuts->SetRequireTPCRefit(kTRUE);
82     trackCuts->SetMaxFractionSharedTPCClusters(0.4);
83     // ITS
84     trackCuts->SetRequireITSRefit(kTRUE);
85     //accept secondaries
86     trackCuts->SetMaxDCAToVertexXY(2.4);
87     trackCuts->SetMaxDCAToVertexZ(3.2);
88     trackCuts->SetDCAToVertex2D(kTRUE);
89     //reject fakes
90     trackCuts->SetMaxChi2PerClusterITS(36);
91
92     trackCuts->SetRequireSigmaToVertex(kFALSE);
93
94     trackCuts->SetEtaRange(-0.9,0.9);
95     trackCuts->SetPtRange(0.15, 100.);
96
97  
98     tag = "Global tracks jet analysis with ITSrefit and Ncls=80, noSPD requirement";
99
100   }
101
102   if(stdCutMode == 1003) {
103
104     bStdCutsDefined = kTRUE;
105
106     // tight global tracks
107     trackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kFALSE,1);
108     trackCuts->SetMinNClustersTPC(0);
109     trackCuts->SetMinNCrossedRowsTPC(120);
110     trackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.1);// essentially switches it off
111     trackCuts->SetMaxDCAToVertexXY(2.4);
112     trackCuts->SetMaxDCAToVertexZ(3.2);
113     trackCuts->SetDCAToVertex2D(kTRUE);
114     trackCuts->SetMaxChi2PerClusterITS(36);
115     trackCuts->SetMaxFractionSharedTPCClusters(0.4);
116
117     tag = "Global tracks ITSTPC2010 + NCrossedRows + loose ITS";
118
119   }
120   
121   if(stdCutMode == 1004) {
122
123     bStdCutsDefined = kTRUE;
124
125     // TPC  
126     trackCuts->SetMinNClustersTPC(70);
127     trackCuts->SetMaxChi2PerClusterTPC(4);
128     trackCuts->SetRequireTPCStandAlone(kTRUE); //cut on NClustersTPC and chi2TPC Iter1
129     trackCuts->SetAcceptKinkDaughters(kFALSE);
130     trackCuts->SetRequireTPCRefit(kTRUE);
131     trackCuts->SetMaxFractionSharedTPCClusters(0.4);
132     // ITS
133     trackCuts->SetRequireITSRefit(kTRUE);
134     //accept secondaries
135     trackCuts->SetMaxDCAToVertexXY(2.4);
136     trackCuts->SetMaxDCAToVertexZ(3.2);
137     trackCuts->SetDCAToVertex2D(kTRUE);
138     //reject fakes
139     trackCuts->SetMaxChi2PerClusterITS(36);
140
141     trackCuts->SetRequireSigmaToVertex(kFALSE);
142
143     trackCuts->SetEtaRange(-0.9,0.9);
144     trackCuts->SetPtRange(0.15, 100.);
145  
146     tag = "Global tracks jet analysis with ITSrefit and NclsIter1=70, noSPD requirement";
147
148   }
149   if(stdCutMode == 1005) {
150
151     bStdCutsDefined = kTRUE;
152
153     // TPC  
154     trackCuts->SetMinNClustersTPC(70);
155     trackCuts->SetMaxChi2PerClusterTPC(4);
156     trackCuts->SetRequireTPCStandAlone(kTRUE); //cut on NClustersTPC and chi2TPC Iter1
157     trackCuts->SetAcceptKinkDaughters(kFALSE);
158     trackCuts->SetRequireTPCRefit(kTRUE);
159     trackCuts->SetMaxFractionSharedTPCClusters(0.4);
160     // ITS
161     trackCuts->SetRequireITSRefit(kTRUE);
162     //accept secondaries
163     trackCuts->SetMaxDCAToVertexXY(2.4);
164     trackCuts->SetMaxDCAToVertexZ(3.2);
165     trackCuts->SetDCAToVertex2D(kTRUE);
166     //reject fakes
167     trackCuts->SetMaxChi2PerClusterITS(36);
168
169     trackCuts->SetRequireSigmaToVertex(kFALSE);
170
171     trackCuts->SetEtaRange(-0.9,0.9);
172     trackCuts->SetPtRange(0.15, 1E+15.);
173  
174     tag = "Global tracks jet analysis with ITSrefit and NclsIter1=70, noSPD requirement, no upper pt cut";
175
176   }
177   if(stdCutMode == 1006) {
178
179     bStdCutsDefined = kTRUE;
180
181     // TPC  
182     TFormula *f1NClustersTPCLinearPtDep = new TFormula("f1NClustersTPCLinearPtDep","70.+30./20.*x");
183     trackCuts->SetMinNClustersTPCPtDep(f1NClustersTPCLinearPtDep,20.);
184     trackCuts->SetMinNClustersTPC(70);
185     trackCuts->SetMaxChi2PerClusterTPC(4);
186     trackCuts->SetRequireTPCStandAlone(kTRUE); //cut on NClustersTPC and chi2TPC Iter1
187     trackCuts->SetAcceptKinkDaughters(kFALSE);
188     trackCuts->SetRequireTPCRefit(kTRUE);
189     trackCuts->SetMaxFractionSharedTPCClusters(0.4);
190     // ITS
191     trackCuts->SetRequireITSRefit(kTRUE);
192     //accept secondaries
193     trackCuts->SetMaxDCAToVertexXY(2.4);
194     trackCuts->SetMaxDCAToVertexZ(3.2);
195     trackCuts->SetDCAToVertex2D(kTRUE);
196     //reject fakes
197     trackCuts->SetMaxChi2PerClusterITS(36);
198     trackCuts->SetMaxChi2TPCConstrainedGlobal(36);
199
200     trackCuts->SetRequireSigmaToVertex(kFALSE);
201
202     trackCuts->SetEtaRange(-0.9,0.9);
203     trackCuts->SetPtRange(0.15, 1E+15.);
204  
205     tag = "Global tracks jet analysis with ITSrefit and NclsIter1=PtDep, noSPD requirement, no upper pt cut, golden chi2";
206
207   }
208
209
210
211   if(stdCutMode == 2000) {
212
213     bStdCutsDefined = kTRUE;
214
215     // TPC  
216     trackCuts->SetMinNClustersTPC(90);
217     trackCuts->SetMaxChi2PerClusterTPC(4);
218     trackCuts->SetRequireTPCStandAlone(kTRUE); //cut on NClustersTPC and chi2TPC Iter1
219     trackCuts->SetAcceptKinkDaughters(kFALSE);
220     trackCuts->SetRequireTPCRefit(kTRUE);
221     trackCuts->SetMaxFractionSharedTPCClusters(0.4);
222     //accept secondaries
223     trackCuts->SetMaxDCAToVertexXY(2.4);
224     trackCuts->SetMaxDCAToVertexZ(3.2);
225     trackCuts->SetDCAToVertex2D(kTRUE);
226
227     trackCuts->SetRequireSigmaToVertex(kFALSE);
228
229     trackCuts->SetEtaRange(-0.9,0.9);
230     trackCuts->SetPtRange(0.15, 100.);
231
232  
233     tag = "Global tracks jet analysis, loose cuts, NClsIter1=90, no ITS requirements";
234
235   }
236
237   if(stdCutMode == 2001) {
238
239     bStdCutsDefined = kTRUE;
240
241     trackCuts = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts(); 
242     trackCuts->SetMinNClustersTPC(70);
243
244     trackCuts->SetEtaRange(-0.9,0.9);
245     trackCuts->SetPtRange(0.15, 100.);
246
247  
248     tag = "TPConly track cuts, loose cuts, NCls=70, no ITS requirements";
249
250   }
251
252   if(stdCutMode == 2002) {
253
254     bStdCutsDefined = kTRUE;
255
256     trackCuts = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts(); 
257     trackCuts->SetRequireTPCRefit(kTRUE);
258     trackCuts->SetMinNClustersTPC(0);
259     trackCuts->SetMinNCrossedRowsTPC(120);
260     trackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.1);// essentially switches it off  
261
262     trackCuts->SetEtaRange(-0.9,0.9);
263     trackCuts->SetPtRange(0.15, 100.);
264
265  
266     tag = "TPConly track cuts, loose cuts, NCls=70, no ITS requirements";
267
268   }
269
270   if(!bStdCutsDefined) {
271     printf("last 4 digits do not represent a predefined set of standard cuts. Returning 0\n");
272     return 0;
273
274   }
275
276
277   //_____________________________________________________________________
278   //                     ADDITIONAL CUTS
279
280   //Get additional cut mode: first 4 digits of cutMode
281   Int_t addCutMode = (int)((float)cutMode/(float)mod);
282
283   if(addCutMode == 1000) {
284
285     trackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
286  
287     tag += " + additonal: SPD any requirement";
288
289   }
290
291   if(addCutMode == 1001) {
292
293     trackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kNone);
294  
295     tag += " + additional: w/o hits in SPD";
296
297   }
298
299   if(addCutMode == 1002) {
300
301     trackCuts->SetMaxChi2PerClusterITS(1E10);
302
303     tag += " + additional: maxITSChi2=1e10";
304
305   }
306
307   if(addCutMode == 1003) {
308
309     trackCuts->SetMinNClustersTPC(0);
310     trackCuts->SetMinNCrossedRowsTPC(0);
311     trackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.);
312
313     tag += " + additional: minClusters=0 minCrossedRows=0 minCrossedRowsOverFindable=0";
314
315   }
316
317   if(addCutMode == 1004) {
318
319     trackCuts->SetRequireITSRefit(kFALSE);
320
321     tag += " + additional: ITSrefit=kFALSE";
322
323   }
324
325   Printf("Created track cuts for: %s", tag.Data());
326
327   return trackCuts;
328
329 }