149f4da08212490857e2c1e8303aaa97d37efba3
[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
149
150
151   if(stdCutMode == 2000) {
152
153     bStdCutsDefined = kTRUE;
154
155     // TPC  
156     trackCuts->SetMinNClustersTPC(90);
157     trackCuts->SetMaxChi2PerClusterTPC(4);
158     trackCuts->SetRequireTPCStandAlone(kTRUE); //cut on NClustersTPC and chi2TPC Iter1
159     trackCuts->SetAcceptKinkDaughters(kFALSE);
160     trackCuts->SetRequireTPCRefit(kTRUE);
161     trackCuts->SetMaxFractionSharedTPCClusters(0.4);
162     //accept secondaries
163     trackCuts->SetMaxDCAToVertexXY(2.4);
164     trackCuts->SetMaxDCAToVertexZ(3.2);
165     trackCuts->SetDCAToVertex2D(kTRUE);
166
167     trackCuts->SetRequireSigmaToVertex(kFALSE);
168
169     trackCuts->SetEtaRange(-0.9,0.9);
170     trackCuts->SetPtRange(0.15, 100.);
171
172  
173     tag = "Global tracks jet analysis, loose cuts, NClsIter1=90, no ITS requirements";
174
175   }
176
177   if(stdCutMode == 2001) {
178
179     bStdCutsDefined = kTRUE;
180
181     trackCuts = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts(); 
182     trackCuts->SetMinNClustersTPC(70);
183
184     trackCuts->SetEtaRange(-0.9,0.9);
185     trackCuts->SetPtRange(0.15, 100.);
186
187  
188     tag = "TPConly track cuts, loose cuts, NCls=70, no ITS requirements";
189
190   }
191
192   if(stdCutMode == 2002) {
193
194     bStdCutsDefined = kTRUE;
195
196     trackCuts = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts(); 
197     trackCuts->SetMinNClustersTPC(0);
198     trackCuts->SetMinNCrossedRowsTPC(120);
199     trackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.1);// essentially switches it off  
200
201     trackCuts->SetEtaRange(-0.9,0.9);
202     trackCuts->SetPtRange(0.15, 100.);
203
204  
205     tag = "TPConly track cuts, loose cuts, NCls=70, no ITS requirements";
206
207   }
208
209   if(!bStdCutsDefined) {
210     printf("last 4 digits do not represent a predefined set of standard cuts. Returning 0\n");
211     return 0;
212
213   }
214
215
216   //_____________________________________________________________________
217   //                     ADDITIONAL CUTS
218
219   //Get additional cut mode: first 4 digits of cutMode
220   Int_t addCutMode = (int)((float)cutMode/(float)mod);
221
222   if(addCutMode == 1000) {
223
224     trackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
225  
226     tag += " + additonal: SPD any requirement";
227
228   }
229
230   if(addCutMode == 1001) {
231
232     trackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kNone);
233  
234     tag += " + additional: w/o hits in SPD";
235
236   }
237
238   if(addCutMode == 1002) {
239
240     trackCuts->SetMaxChi2PerClusterITS(1E10);
241
242     tag += " + additional: maxITSChi2=1e10";
243
244   }
245
246   if(addCutMode == 1003) {
247
248     trackCuts->SetMinNClustersTPC(0);
249     trackCuts->SetMinNCrossedRowsTPC(0);
250     trackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.);
251
252     tag += " + additional: minClusters=0 minCrossedRows=0 minCrossedRowsOverFindable=0";
253
254   }
255
256   if(addCutMode == 1004) {
257
258     trackCuts->SetRequireITSRefit(kFALSE);
259
260     tag += " + additional: ITSrefit=kFALSE";
261
262   }
263
264   Printf("Created track cuts for: %s", tag.Data());
265
266   return trackCuts;
267
268 }