Added AliRsnCutEventUtils class: interface to /Users/bellini/alisoft/aliroot/last_tru...
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnCutSetDaughterParticle.cxx
CommitLineData
9cdd5474 1//
2// Author: Francesca Bellini (fbellini@cern.ch)
3//
4//
5
6#include <Riostream.h>
7
8#include "AliPID.h"
9#include "AliPIDResponse.h"
10#include "AliRsnCutSetDaughterParticle.h"
11
12class AliRsnCutPIDNSigma;
13class AliRsnPIDRange;
6b5662ca 14class AliRsnCutPhi;
9cdd5474 15
16ClassImp(AliRsnCutSetDaughterParticle)
17
18//__________________________________________________________________________________________________
19AliRsnCutSetDaughterParticle::AliRsnCutSetDaughterParticle() :
e6952ec7 20 AliRsnCutSet("AliRsnCutSetDaughterParticle", AliRsnTarget::kDaughter),
21 fPID(AliPID::kPion),
22 fAppliedCutSetID(AliRsnCutSetDaughterParticle::kNDaughterCuts),
23 fNsigmaTPC(1E20),
24 fNsigmaTOF(1E20),
25 fCutQuality(0x0),
26 fAODTrkCutFilterBit(0)
9cdd5474 27{
28 //
29 // Default constructor
30}
31
32//__________________________________________________________________________________________________
a6430459 33AliRsnCutSetDaughterParticle::AliRsnCutSetDaughterParticle(const char *name, AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutSetID, AliPID::EParticleType pid, Float_t nSigmaFast = -1.0, Int_t AODfilterBit = 0) :
e6952ec7 34 AliRsnCutSet(name, AliRsnTarget::kDaughter),
35 fPID(pid),
36 fAppliedCutSetID(cutSetID),
9006f1a2 37 fNsigmaTPC(nSigmaFast),
38 fNsigmaTOF(nSigmaFast),
e6952ec7 39 fCutQuality(new AliRsnCutTrackQuality("CutQuality")),
40 fAODTrkCutFilterBit(AODfilterBit)
9cdd5474 41{
42 //
43 // Constructor
44 //
9006f1a2 45 if (nSigmaFast<=0){
46 fNsigmaTPC=1e20;
47 fNsigmaTOF=1e20;
48 AliWarning("Requested fast n-sigma PID with negative value for n. --> Setting n = 1E20");
49 }
50 Init();
9cdd5474 51}
52
53//__________________________________________________________________________________________________
54AliRsnCutSetDaughterParticle::AliRsnCutSetDaughterParticle(const AliRsnCutSetDaughterParticle &copy) :
55 AliRsnCutSet(copy),
56 fPID(copy.fPID),
57 fAppliedCutSetID(copy.fAppliedCutSetID),
58 fNsigmaTPC(copy.fNsigmaTPC),
a6430459 59 fNsigmaTOF(copy.fNsigmaTOF),
60 fCutQuality(copy.fCutQuality),
61 fAODTrkCutFilterBit(copy.fAODTrkCutFilterBit)
9cdd5474 62{
63 //
64 // copy constructor
65}
66
67//__________________________________________________________________________________________________
68AliRsnCutSetDaughterParticle &AliRsnCutSetDaughterParticle::operator=(const AliRsnCutSetDaughterParticle &copy)
e6952ec7 69{
9cdd5474 70 //
71 // operator =
e6952ec7 72 //
73 AliRsnCutSet::operator=(copy);
74 if (this == &copy)
75 return *this;
76 fPID=copy.fPID;
77 fAppliedCutSetID=copy.fAppliedCutSetID;
78 fNsigmaTPC=copy.fNsigmaTPC;
79 fNsigmaTOF=copy.fNsigmaTOF;
80 fAODTrkCutFilterBit=copy.fAODTrkCutFilterBit;
81 fCutQuality=copy.fCutQuality;
82 return (*this);
9cdd5474 83}
84
85//----------------------------------------------------------------------------
a6430459 86AliRsnCutSetDaughterParticle::~AliRsnCutSetDaughterParticle()
87{
e6952ec7 88 //
89 //destructor
90 //
91 if (fCutQuality)
92 delete fCutQuality;
a6430459 93}
94//----------------------------------------------------------------------------
e6952ec7 95void AliRsnCutSetDaughterParticle::Init()
96{
97 //
98 // init cut sets by setting variable params
99 //
b307bb43 100 if ( (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kQualityStd2011) ||
101 (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kTOFMatchPPB2011) || //pA analysis
102 (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kTPCpidKstarPPB2011) ||
103 (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kTOFpidKstarPPB2011) ||
319ac306 104 (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kTPCTOFpidKstarPPB2011) ||
105 (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kTPCpidTOFvetoKStarPPB2011) ||
106 (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kTPCpidMatchPPB2011) )
b307bb43 107 {
108 fCutQuality->SetDefaults2011();
109 fCutQuality->SetAODTestFilterBit(fAODTrkCutFilterBit);
b307bb43 110 } else {
111 fCutQuality->SetDefaults2010();
b307bb43 112 fCutQuality->SetDCARPtFormula("0.0182+0.0350/pt^1.01");
113 fCutQuality->SetDCAZmax(2.0);
114 fCutQuality->SetSPDminNClusters(1);
115 fCutQuality->SetITSminNClusters(0);
116 fCutQuality->SetITSmaxChi2(36);
117 fCutQuality->SetTPCminNClusters(70);
118 fCutQuality->SetTPCmaxChi2(4.0);
119 fCutQuality->SetRejectKinkDaughters();
120 fCutQuality->SetAODTestFilterBit(fAODTrkCutFilterBit);
121 //fCutQuality->SetITSmaxChi2(36);
122 //fCutQuality->SetMaxChi2TPCConstrainedGlobal(36);
319ac306 123 }
124 fCutQuality->SetPtRange(0.15, 20.0);
125 fCutQuality->SetEtaRange(-0.8, 0.8);
126
127 AliRsnCutTOFMatch *iCutTOFMatch = new AliRsnCutTOFMatch("CutTOFMatch");
e6952ec7 128 AliRsnCutPIDNSigma *iCutTPCNSigma = new AliRsnCutPIDNSigma("CutTPCNSigma", fPID, AliRsnCutPIDNSigma::kTPC);//, AliRsnCutPIDNSigma::kTPCinnerP );
129 AliRsnCutPIDNSigma *iCutTPCTOFNSigma = new AliRsnCutPIDNSigma("CutTPCTOFNSigma", fPID, AliRsnCutPIDNSigma::kTPC);//, AliRsnCutPIDNSigma::kTPCinnerP );
130 AliRsnCutPIDNSigma *iCutTOFNSigma = new AliRsnCutPIDNSigma("CutTOFNSigma", fPID, AliRsnCutPIDNSigma::kTOF);//, AliRsnCutPIDNSigma::kP );
ec54038b 131 AliRsnCutPhi *iCutPhiTRD2010 = new AliRsnCutPhi("CutPhiTRD2010","InTRD CheckTOF");
132 AliRsnCutPhi *iCutPhiNoTRD2010 = new AliRsnCutPhi("CutPhiNoTRD2010","OutTRD CheckTOF");
6b5662ca 133
e6952ec7 134 switch (fAppliedCutSetID)
135 {
136 case AliRsnCutSetDaughterParticle::kNoCuts :
137 AliInfo("No cuts applied to daughter particle");
138 break;
139
140 case AliRsnCutSetDaughterParticle::kQualityStd2010 :
141 AddCut(fCutQuality);
142 SetCutScheme(fCutQuality->GetName());
143 break;
144
145 case AliRsnCutSetDaughterParticle::kQualityStd2011:
146 //fCutQuality->SetAODTestFilterBit(10); //1024
147 AddCut(fCutQuality);
148 SetCutScheme(fCutQuality->GetName());
149 break;
150
151 case AliRsnCutSetDaughterParticle::kTOFMatch :
152 AddCut(fCutQuality);
153 AddCut(iCutTOFMatch);
154 SetCutScheme( Form("%s&(%s)",fCutQuality->GetName(), iCutTOFMatch->GetName()) );
155 break;
156
157 case AliRsnCutSetDaughterParticle::kFastTPCpidNsigma :
158 if (fNsigmaTPC <= 0.0) {
159 AliWarning(Form("Invalid number of sigmas required for %s. Setting default nSigma = 10",iCutTPCNSigma->GetName()));
160 SetNsigmaForFastTPCpid(10.0);
161 }
162 iCutTPCNSigma->SinglePIDRange(fNsigmaTPC);
163 AddCut(fCutQuality);
164 AddCut(iCutTPCNSigma);
165 SetCutScheme( Form("%s&%s",fCutQuality->GetName(), iCutTPCNSigma->GetName()) );
166 break;
167
168 case AliRsnCutSetDaughterParticle::kFastTOFpidNsigma :
169 if (fNsigmaTOF <= 0.0) {
170 AliWarning(Form("Invalid number of sigmas required for %s. Setting default nSigma = 10",iCutTOFNSigma->GetName()));
171 SetNsigmaForFastTOFpid(10.0);
172 }
173 iCutTOFNSigma->SinglePIDRange(fNsigmaTOF);
174 //iCutTOFNSigma->AddPIDRange(3.0, 0.35, 1E20);
175 AddCut(fCutQuality);
176 AddCut(iCutTOFNSigma);
177 SetCutScheme( Form("%s&%s",fCutQuality->GetName(), iCutTOFNSigma->GetName()) );
178 break;
179
180 case AliRsnCutSetDaughterParticle::kTPCTOFpidKstarPP2010 :
181 /* Set TPC PID (if no TOF)*/
182 // all below 350 MeV: 5sigma
183 // all between 350 and 500 MeV: 3sigma
184 // pios above 500 MeV: 2sigma
185 // kaons between 500 and 700 MeV: 2sigma
186 // kaons above 700 MeV: rejected
187 iCutTPCNSigma->AddPIDRange(5.0, 0.0, 0.35);
188 iCutTPCNSigma->AddPIDRange(3.0, 0.35, 0.5);
189 if (fPID==AliPID::kPion)
190 iCutTPCNSigma->AddPIDRange(2.0, 0.5, 1E20);
191 if (fPID==AliPID::kKaon)
192 iCutTPCNSigma->AddPIDRange(2.0, 0.5, 0.7);
193
194 AddCut(fCutQuality);
195 AddCut(iCutTOFMatch);
196 AddCut(iCutTPCNSigma);
197
198 /* set TPC+TOF PID*/
199 iCutTPCTOFNSigma->SinglePIDRange(5.0);
200 iCutTOFNSigma->AddPIDRange(3.0, 0.0, 1.5);
201 iCutTOFNSigma->AddPIDRange(2.0, 1.5, 1E20);
202
203 AddCut(iCutTPCTOFNSigma);
204 AddCut(iCutTOFNSigma);
205
206 // scheme:
207 // quality & [ (TOF & TPCTOF) || (!TOFmatch & TPConly) ]
208 SetCutScheme( Form("%s&((%s&%s)|((!%s)&%s))",fCutQuality->GetName(), iCutTPCTOFNSigma->GetName(), iCutTOFNSigma->GetName(), iCutTOFMatch->GetName(), iCutTPCNSigma->GetName()) ) ;
209 break;
210
211 case AliRsnCutSetDaughterParticle::kTOFpidKstarPbPb2010:
212 if (fNsigmaTOF <= 0.0) {
213 AliWarning(Form("Invalid number of sigmas required for %s. Setting default nSigma = 10",iCutTOFNSigma->GetName()));
214 SetNsigmaForFastTOFpid(10.0);
215 }
216 iCutTOFNSigma->SinglePIDRange(fNsigmaTOF);
217 //iCutTOFNSigma->AddPIDRange(3.0, 0.35, 1E20);
218 iCutTPCTOFNSigma->SinglePIDRange(5.0); //5-sigma veto on tpc signal
219
220 AddCut(fCutQuality);
221 AddCut(iCutTOFNSigma);
222 AddCut(iCutTPCTOFNSigma);
223 SetCutScheme( Form("%s&%s&%s",fCutQuality->GetName(), iCutTOFNSigma->GetName(), iCutTPCTOFNSigma->GetName()) );
224 break;
225
226 case AliRsnCutSetDaughterParticle::kTOFTPCmismatchKstarPbPb2010:
227 iCutTPCTOFNSigma->SinglePIDRange(5.0); //5-sigma veto on tpc signal
228 AddCut(fCutQuality);
229 AddCut(iCutTOFMatch);
230 AddCut(iCutTPCTOFNSigma);
231 SetCutScheme( Form("%s&%s&%s",fCutQuality->GetName(), iCutTOFMatch->GetName(), iCutTPCTOFNSigma->GetName()) );
232 break;
319ac306 233
6b5662ca 234 case AliRsnCutSetDaughterParticle::kTOFMatchTRD2010 :
319ac306 235 AddCut(fCutQuality);
236 AddCut(iCutTOFMatch);
237 AddCut(iCutPhiTRD2010);
238 SetCutScheme( Form("%s&%s&%s",fCutQuality->GetName(), iCutTOFMatch->GetName(), iCutPhiTRD2010->GetName()) );
239 break;
6b5662ca 240
241 case AliRsnCutSetDaughterParticle::kTOFMatchNoTRD2010 :
319ac306 242 AddCut(fCutQuality);
243 AddCut(iCutTOFMatch);
244 AddCut(iCutPhiNoTRD2010);
245 SetCutScheme( Form("%s&%s&%s",fCutQuality->GetName(), iCutTOFMatch->GetName(), iCutPhiNoTRD2010->GetName()) );
246 break;
6b5662ca 247
319ac306 248 case AliRsnCutSetDaughterParticle::kTOFpidKstarPbPbTRD2010:
249 if (fNsigmaTOF <= 0.0) {
250 AliWarning(Form("Invalid number of sigmas required for %s. Setting default nSigma = 10",iCutTOFNSigma->GetName()));
251 SetNsigmaForFastTOFpid(10.0);
252 }
253 iCutTOFNSigma->SinglePIDRange(fNsigmaTOF);
254 //iCutTOFNSigma->AddPIDRange(3.0, 0.35, 1E20);
255 iCutTPCTOFNSigma->SinglePIDRange(5.0); //5-sigma veto on tpc signal
6b5662ca 256
319ac306 257 AddCut(fCutQuality);
258 AddCut(iCutTOFNSigma);
259 AddCut(iCutTPCTOFNSigma);
260 AddCut(iCutPhiTRD2010);
261 SetCutScheme( Form("%s&%s&%s&%s",fCutQuality->GetName(), iCutTOFNSigma->GetName(), iCutTPCTOFNSigma->GetName(),iCutPhiTRD2010->GetName()) );
262 break;
6b5662ca 263
319ac306 264 case AliRsnCutSetDaughterParticle::kTOFpidKstarPbPbNoTRD2010:
265 if (fNsigmaTOF <= 0.0) {
266 AliWarning(Form("Invalid number of sigmas required for %s. Setting default nSigma = 10",iCutTOFNSigma->GetName()));
267 SetNsigmaForFastTOFpid(10.0);
268 }
269 iCutTOFNSigma->SinglePIDRange(fNsigmaTOF);
270 //iCutTOFNSigma->AddPIDRange(3.0, 0.35, 1E20);
271 iCutTPCTOFNSigma->SinglePIDRange(5.0); //5-sigma veto on tpc signal
6b5662ca 272
319ac306 273 AddCut(fCutQuality);
274 AddCut(iCutTOFNSigma);
275 AddCut(iCutTPCTOFNSigma);
276 AddCut(iCutPhiNoTRD2010);
277 SetCutScheme( Form("%s&%s&%s&%s",fCutQuality->GetName(), iCutTOFNSigma->GetName(), iCutTPCTOFNSigma->GetName(),iCutPhiNoTRD2010->GetName()) );
278 break;
6b5662ca 279
280 case AliRsnCutSetDaughterParticle::kTOFMatchTPCpidNsigma :
319ac306 281 if (fNsigmaTPC <= 0.0) {
282 AliWarning(Form("Invalid number of sigmas required for %s. Setting default nSigma = 10",iCutTPCNSigma->GetName()));
283 SetNsigmaForFastTPCpid(10.0);
284 }
285 iCutTPCNSigma->SinglePIDRange(fNsigmaTPC);
286 AddCut(fCutQuality);
287 AddCut(iCutTPCNSigma);
288 AddCut(iCutTOFMatch);
289 SetCutScheme( Form("%s&%s&%s",fCutQuality->GetName(), iCutTPCNSigma->GetName(), iCutTOFMatch->GetName()) );
290 break;
9664d398 291
292 case AliRsnCutSetDaughterParticle::kQualityStd2010TRD:
293 AddCut(fCutQuality);
294 AddCut(iCutPhiTRD2010);
295 SetCutScheme( Form("%s&%s",fCutQuality->GetName(),iCutPhiTRD2010->GetName()) );
296 break;
297
298 case AliRsnCutSetDaughterParticle::kQualityStd2010NoTRD:
299 AddCut(fCutQuality);
300 AddCut(iCutPhiNoTRD2010);
301 SetCutScheme( Form("%s&%s",fCutQuality->GetName(),iCutPhiNoTRD2010->GetName()) );
302 break;
303
b307bb43 304 case AliRsnCutSetDaughterParticle::kTOFMatchPPB2011: //pA analysis
305 AddCut(fCutQuality);
306 AddCut(iCutTOFMatch);
307 SetCutScheme( Form("%s&(%s)",fCutQuality->GetName(), iCutTOFMatch->GetName()) );
308 break;
309
310 case AliRsnCutSetDaughterParticle::kTPCpidKstarPPB2011:
311 if (fNsigmaTPC <= 0.0) {
312 AliWarning(Form("Invalid number of sigmas required for %s. Setting default nSigma = 10",iCutTPCNSigma->GetName()));
313 SetNsigmaForFastTPCpid(10.0);
314 }
315 iCutTPCNSigma->SinglePIDRange(fNsigmaTPC);
316 AddCut(fCutQuality);
317 AddCut(iCutTPCNSigma);
318 SetCutScheme( Form("%s&%s",fCutQuality->GetName(), iCutTPCNSigma->GetName()) );
319 break;
320
321 case AliRsnCutSetDaughterParticle::kTOFpidKstarPPB2011:
322 if (fNsigmaTOF <= 0.0) {
323 AliWarning(Form("Invalid number of sigmas required for %s. Setting default nSigma = 10",iCutTOFNSigma->GetName()));
324 SetNsigmaForFastTOFpid(10.0);
325 }
326 iCutTOFNSigma->SinglePIDRange(fNsigmaTOF);
327 //iCutTOFNSigma->AddPIDRange(3.0, 0.35, 1E20);
328 iCutTPCTOFNSigma->SinglePIDRange(5.0); //5-sigma veto on tpc signal
329
330 AddCut(fCutQuality);
331 AddCut(iCutTOFNSigma);
332 AddCut(iCutTPCTOFNSigma);
333 SetCutScheme( Form("%s&%s&%s",fCutQuality->GetName(), iCutTOFNSigma->GetName(), iCutTPCTOFNSigma->GetName()) );
334 break;
335
336 case AliRsnCutSetDaughterParticle::kTPCTOFpidKstarPPB2011:
337 /* Set TPC PID (if no TOF)*/
338 // all below 350 MeV: 5sigma
339 // all between 350 and 500 MeV: 3sigma
340 // pios above 500 MeV: 2sigma
341 // kaons between 500 and 700 MeV: 2sigma
342 // kaons above 700 MeV: rejected
343 iCutTPCNSigma->AddPIDRange(5.0, 0.0, 0.35);
344 iCutTPCNSigma->AddPIDRange(3.0, 0.35, 0.5);
345 if (fPID==AliPID::kPion)
346 iCutTPCNSigma->AddPIDRange(2.0, 0.5, 1E20);
347 if (fPID==AliPID::kKaon)
348 iCutTPCNSigma->AddPIDRange(2.0, 0.5, 0.7);
349
350 AddCut(fCutQuality);
351 AddCut(iCutTOFMatch);
352 AddCut(iCutTPCNSigma);
353
354 /* set TPC+TOF PID*/
355 iCutTPCTOFNSigma->SinglePIDRange(5.0);
356 iCutTOFNSigma->AddPIDRange(3.0, 0.0, 1.5);
357 iCutTOFNSigma->AddPIDRange(2.0, 1.5, 1E20);
358
359 AddCut(iCutTPCTOFNSigma);
360 AddCut(iCutTOFNSigma);
361
362 // scheme:
363 // quality & [ (TOF & TPCTOF) || (!TOFmatch & TPConly) ]
364 SetCutScheme( Form("%s&((%s&%s)|((!%s)&%s))",fCutQuality->GetName(), iCutTPCTOFNSigma->GetName(), iCutTOFNSigma->GetName(), iCutTOFMatch->GetName(), iCutTPCNSigma->GetName()) ) ;
365 break;
319ac306 366
367
368 case AliRsnCutSetDaughterParticle::kTPCpidTOFvetoKStarPPB2011:
369 if (fNsigmaTPC <= 0.0) {
370 AliWarning(Form("Invalid number of sigmas required for %s. Setting nSigma = 5.0",iCutTPCNSigma->GetName()));
371 SetNsigmaForFastTPCpid(5.0);
372 }
373 iCutTPCNSigma->SinglePIDRange(fNsigmaTPC);
374
375 if(fNsigmaTPC==3.0)
376 iCutTOFNSigma->SinglePIDRange(5.0);
377 if(fNsigmaTPC==2.0)
378 iCutTOFNSigma->SinglePIDRange(3.0);
379
380 AddCut(fCutQuality);
381 AddCut(iCutTPCNSigma);
382 AddCut(iCutTOFNSigma);
383
384 // scheme:
385 // quality & [ (TPCsigma & TOFsigma-2) ]
386 SetCutScheme( Form("%s&%s&%s",fCutQuality->GetName(),iCutTPCNSigma->GetName(),iCutTOFNSigma->GetName()) ) ;
387 break;
388
389 case AliRsnCutSetDaughterParticle::kTPCpidMatchPPB2011:
390 if (fNsigmaTPC <= 0.0) {
391 AliWarning(Form("Invalid number of sigmas required for %s. Setting nSigma = 5.0",iCutTPCNSigma->GetName()));
392 SetNsigmaForFastTPCpid(5.0);
393 }
394 iCutTPCNSigma->SinglePIDRange(fNsigmaTPC);
395 AddCut(fCutQuality);
396 AddCut(iCutTPCNSigma);
397 AddCut(iCutTOFMatch);
398 SetCutScheme( Form("%s&%s&%s",fCutQuality->GetName(), iCutTPCNSigma->GetName(),iCutTOFMatch->GetName()) );
399 break;
9664d398 400
319ac306 401 default :
402 break;
e6952ec7 403 }
404
9cdd5474 405}
406
407
408