flag jets with too high p_T track
[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
35     trackCuts->SetEtaRange(-0.9,0.9);
36     trackCuts->SetPtRange(0.15, 1e10);
37
38     tag = "Global track RAA analysis QM2011 + Chi2ITS<36";
39
40   }
41
42   if(stdCutMode == 1001) {
43
44     bStdCutsDefined = kTRUE;
45
46     // TPC  
47     trackCuts->SetMinNClustersTPC(90);
48     trackCuts->SetMaxChi2PerClusterTPC(4);
49     trackCuts->SetRequireTPCStandAlone(kTRUE); //cut on NClustersTPC and chi2TPC Iter1
50     trackCuts->SetAcceptKinkDaughters(kFALSE);
51     trackCuts->SetRequireTPCRefit(kTRUE);
52     trackCuts->SetMaxFractionSharedTPCClusters(0.4);
53     // ITS
54     trackCuts->SetRequireITSRefit(kTRUE);
55     //accept secondaries
56     trackCuts->SetMaxDCAToVertexXY(2.4);
57     trackCuts->SetMaxDCAToVertexZ(3.2);
58     trackCuts->SetDCAToVertex2D(kTRUE);
59     //reject fakes
60     trackCuts->SetMaxChi2PerClusterITS(36);
61
62     trackCuts->SetRequireSigmaToVertex(kFALSE);
63
64     trackCuts->SetEtaRange(-0.9,0.9);
65     trackCuts->SetPtRange(0.15, 100.);
66
67  
68     tag = "Global tracks jet analysis with ITSrefit and NclsIter1=90, noSPD requirement";
69
70   }
71
72   if(stdCutMode == 1002) {
73
74     bStdCutsDefined = kTRUE;
75
76     // TPC  
77     trackCuts->SetMinNClustersTPC(80);
78     trackCuts->SetMaxChi2PerClusterTPC(4);
79     trackCuts->SetAcceptKinkDaughters(kFALSE);
80     trackCuts->SetRequireTPCRefit(kTRUE);
81     trackCuts->SetMaxFractionSharedTPCClusters(0.4);
82     // ITS
83     trackCuts->SetRequireITSRefit(kTRUE);
84     //accept secondaries
85     trackCuts->SetMaxDCAToVertexXY(2.4);
86     trackCuts->SetMaxDCAToVertexZ(3.2);
87     trackCuts->SetDCAToVertex2D(kTRUE);
88     //reject fakes
89     trackCuts->SetMaxChi2PerClusterITS(36);
90
91     trackCuts->SetRequireSigmaToVertex(kFALSE);
92
93     trackCuts->SetEtaRange(-0.9,0.9);
94     trackCuts->SetPtRange(0.15, 100.);
95
96  
97     tag = "Global tracks jet analysis with ITSrefit and Ncls=80, noSPD requirement";
98
99   }
100
101   if(stdCutMode == 1003) {
102
103     bStdCutsDefined = kTRUE;
104
105     // tight global tracks
106     trackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kFALSE,1);
107     trackCuts->SetMinNClustersTPC(0);
108     trackCuts->SetMinNCrossedRowsTPC(120);
109     trackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.1);// essentially switches it off
110     trackCuts->SetMaxDCAToVertexXY(2.4);
111     trackCuts->SetMaxDCAToVertexZ(3.2);
112     trackCuts->SetDCAToVertex2D(kTRUE);
113     trackCuts->SetMaxChi2PerClusterITS(36);
114     trackCuts->SetMaxFractionSharedTPCClusters(0.4);
115
116     tag = "Global tracks ITSTPC2010 + NCrossedRows + loose ITS";
117
118   }
119   
120   if(stdCutMode == 1004) {
121
122     bStdCutsDefined = kTRUE;
123
124     // TPC  
125     trackCuts->SetMinNClustersTPC(70);
126     trackCuts->SetMaxChi2PerClusterTPC(4);
127     trackCuts->SetRequireTPCStandAlone(kTRUE); //cut on NClustersTPC and chi2TPC Iter1
128     trackCuts->SetAcceptKinkDaughters(kFALSE);
129     trackCuts->SetRequireTPCRefit(kTRUE);
130     trackCuts->SetMaxFractionSharedTPCClusters(0.4);
131     // ITS
132     trackCuts->SetRequireITSRefit(kTRUE);
133     //accept secondaries
134     trackCuts->SetMaxDCAToVertexXY(2.4);
135     trackCuts->SetMaxDCAToVertexZ(3.2);
136     trackCuts->SetDCAToVertex2D(kTRUE);
137     //reject fakes
138     trackCuts->SetMaxChi2PerClusterITS(36);
139
140     trackCuts->SetRequireSigmaToVertex(kFALSE);
141
142     trackCuts->SetEtaRange(-0.9,0.9);
143     trackCuts->SetPtRange(0.15, 100.);
144  
145     tag = "Global tracks jet analysis with ITSrefit and NclsIter1=70, noSPD requirement";
146
147   }
148   if(stdCutMode == 1005) {
149
150     bStdCutsDefined = kTRUE;
151
152     // TPC  
153     trackCuts->SetMinNClustersTPC(70);
154     trackCuts->SetMaxChi2PerClusterTPC(4);
155     trackCuts->SetRequireTPCStandAlone(kTRUE); //cut on NClustersTPC and chi2TPC Iter1
156     trackCuts->SetAcceptKinkDaughters(kFALSE);
157     trackCuts->SetRequireTPCRefit(kTRUE);
158     trackCuts->SetMaxFractionSharedTPCClusters(0.4);
159     // ITS
160     trackCuts->SetRequireITSRefit(kTRUE);
161     //accept secondaries
162     trackCuts->SetMaxDCAToVertexXY(2.4);
163     trackCuts->SetMaxDCAToVertexZ(3.2);
164     trackCuts->SetDCAToVertex2D(kTRUE);
165     //reject fakes
166     trackCuts->SetMaxChi2PerClusterITS(36);
167
168     trackCuts->SetRequireSigmaToVertex(kFALSE);
169
170     trackCuts->SetEtaRange(-0.9,0.9);
171     trackCuts->SetPtRange(0.15, 1E+15.);
172  
173     tag = "Global tracks jet analysis with ITSrefit and NclsIter1=70, noSPD requirement, no upper pt cut";
174
175   }
176
177
178
179   if(stdCutMode == 2000) {
180
181     bStdCutsDefined = kTRUE;
182
183     // TPC  
184     trackCuts->SetMinNClustersTPC(90);
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     //accept secondaries
191     trackCuts->SetMaxDCAToVertexXY(2.4);
192     trackCuts->SetMaxDCAToVertexZ(3.2);
193     trackCuts->SetDCAToVertex2D(kTRUE);
194
195     trackCuts->SetRequireSigmaToVertex(kFALSE);
196
197     trackCuts->SetEtaRange(-0.9,0.9);
198     trackCuts->SetPtRange(0.15, 100.);
199
200  
201     tag = "Global tracks jet analysis, loose cuts, NClsIter1=90, no ITS requirements";
202
203   }
204
205   if(stdCutMode == 2001) {
206
207     bStdCutsDefined = kTRUE;
208
209     trackCuts = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts(); 
210     trackCuts->SetMinNClustersTPC(70);
211
212     trackCuts->SetEtaRange(-0.9,0.9);
213     trackCuts->SetPtRange(0.15, 100.);
214
215  
216     tag = "TPConly track cuts, loose cuts, NCls=70, no ITS requirements";
217
218   }
219
220   if(stdCutMode == 2002) {
221
222     bStdCutsDefined = kTRUE;
223
224     trackCuts = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts(); 
225     trackCuts->SetMinNClustersTPC(0);
226     trackCuts->SetMinNCrossedRowsTPC(120);
227     trackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.1);// essentially switches it off  
228
229     trackCuts->SetEtaRange(-0.9,0.9);
230     trackCuts->SetPtRange(0.15, 100.);
231
232  
233     tag = "TPConly track cuts, loose cuts, NCls=70, no ITS requirements";
234
235   }
236
237   if(!bStdCutsDefined) {
238     printf("last 4 digits do not represent a predefined set of standard cuts. Returning 0\n");
239     return 0;
240
241   }
242
243
244   //_____________________________________________________________________
245   //                     ADDITIONAL CUTS
246
247   //Get additional cut mode: first 4 digits of cutMode
248   Int_t addCutMode = (int)((float)cutMode/(float)mod);
249
250   if(addCutMode == 1000) {
251
252     trackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
253  
254     tag += " + additonal: SPD any requirement";
255
256   }
257
258   if(addCutMode == 1001) {
259
260     trackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kNone);
261  
262     tag += " + additional: w/o hits in SPD";
263
264   }
265
266   if(addCutMode == 1002) {
267
268     trackCuts->SetMaxChi2PerClusterITS(1E10);
269
270     tag += " + additional: maxITSChi2=1e10";
271
272   }
273
274   if(addCutMode == 1003) {
275
276     trackCuts->SetMinNClustersTPC(0);
277     trackCuts->SetMinNCrossedRowsTPC(0);
278     trackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.);
279
280     tag += " + additional: minClusters=0 minCrossedRows=0 minCrossedRowsOverFindable=0";
281
282   }
283
284   if(addCutMode == 1004) {
285
286     trackCuts->SetRequireITSRefit(kFALSE);
287
288     tag += " + additional: ITSrefit=kFALSE";
289
290   }
291
292   Printf("Created track cuts for: %s", tag.Data());
293
294   return trackCuts;
295
296 }