AliPhysics  vAN-20151012 (2287573)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliRDHFCutsLctoeleLambdafromAODtracks.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2010, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 /* $Id$ */
17 
19 //
20 // Class for cuts on AOD reconstructed LC->e+Lambda
21 //
22 // Modified by Y.S Watanabe - wyosuke@cns.s.u-tokyo.ac.jp
23 //
25 
26 #include <Riostream.h>
27 
28 #include <TDatabasePDG.h>
29 #include <TMath.h>
30 
31 #include "AliAnalysisManager.h"
32 #include "AliInputEventHandler.h"
33 #include "AliPIDResponse.h"
35 #include "AliAODRecoCascadeHF.h"
36 #include "AliAODTrack.h"
37 #include "AliESDtrack.h"
38 #include "AliESDVertex.h"
39 #include "AliAODVertex.h"
40 #include "AliAODv0.h"
41 #include "AliAODcascade.h"
42 #include "AliESDv0.h"
43 
44 using std::cout;
45 using std::endl;
46 
50 
51 //--------------------------------------------------------------------------
53 AliRDHFCuts(name),
54  fPIDStrategy(kNSigmaCuts),
55  fCombinedPIDThreshold(0.),
56  fUseLambdaPID(kFALSE),
57  fPidObjProton(0),
58  fPidObjPion(0),
59  fUseOnTheFlyV0(kFALSE),
60  fProdTrackTPCNclsPIDMin(0),
61  fProdTrackTPCNclsRatioMin(0.0),
62  fProdUseAODFilterBit(kTRUE),
63  fProdV0MassTolLambda(0.01),
64  fProdV0MassTolLambdaRough(0.01),
65  fProdV0PtMin(0.5),
66  fProdV0CosPointingAngleToPrimVtxMin(0.99),
67  fProdV0DcaDaughtersMax(1.5),
68  fProdV0DaughterEtaRange(0.8),
69  fProdV0DaughterPtMin(0.0),
70  fProdV0DaughterTPCClusterMin(70),
71  fProdV0DaughterTPCCrossRatioMin(0.0),
72  fProdRfidMinV0(0.6),
73  fProdRfidMaxV0(100.0),
74  fProdDcaV0ToPrimVertexMin(0.),
75  fProdDcaV0PrToPrimVertexMin(0.),
76  fProdDcaV0PiToPrimVertexMin(0.),
77  fProdV0ProperDecayLengthMax(99999.),
78  fProdMassRejK0s(0.),
79  fProdV0EtaMin(-9999.),
80  fProdV0EtaMax(9999.),
81  fProdV0RapMin(-9999.),
82  fProdV0RapMax(9999.),
83  fProdRoughMassTol(0.25),
84  fProdRoughPtMin(0.0),
85  fExcludePionTPC(kFALSE),
86  fExcludeProtonTPC(kFALSE),
87  fExcludeKaonTPC(kFALSE),
88  fExcludenSigmaPionTPC(3.),
89  fExcludenSigmaProtonTPC(3.),
90  fExcludenSigmaKaonTPC(3.),
91  fSigmaElectronTPCMin(-9999.),
92  fSigmaElectronTPCPtDepPar0(-9999.),
93  fSigmaElectronTPCPtDepPar1(-9999.),
94  fSigmaElectronTPCPtDepPar2(0.),
95  fSigmaElectronTPCMax(9999.),
96  fSigmaElectronTOFMin(-9999.),
97  fSigmaElectronTOFMax(9999.)
98 {
99  //
100  // Default Constructor
101  //
102 
103  const Int_t nvars=2;
104  SetNVars(nvars);
105  TString varNames[nvars]={
106  "InvMass [GeV/c2]", //0
107  "cos(Opening angle) [cos(rad)]" //1
108  };
109 
110  Bool_t isUpperCut[nvars]={
111  kTRUE, //0
112  kFALSE //1
113  };
114  SetVarNames(nvars,varNames,isUpperCut);
115  Bool_t forOpt[nvars]={
116  kTRUE, //0
117  kTRUE //1
118  };
119  SetVarsForOpt(nvars,forOpt);
120 
121  Float_t limits[2]={0,999999999.};
122  SetPtBins(2,limits);
123 }
124 //--------------------------------------------------------------------------
126  AliRDHFCuts(source),
127  fPIDStrategy(source.fPIDStrategy),
128  fCombinedPIDThreshold(source.fCombinedPIDThreshold),
129  fUseLambdaPID(source.fUseLambdaPID),
130  fPidObjProton(source.fPidObjProton),
131  fPidObjPion(source.fPidObjPion),
132  fUseOnTheFlyV0(source.fUseOnTheFlyV0),
133  fProdTrackTPCNclsPIDMin(source.fProdTrackTPCNclsPIDMin),
134  fProdTrackTPCNclsRatioMin(source.fProdTrackTPCNclsRatioMin),
135  fProdUseAODFilterBit(source.fProdUseAODFilterBit),
136  fProdV0MassTolLambda(source.fProdV0MassTolLambda),
137  fProdV0MassTolLambdaRough(source.fProdV0MassTolLambdaRough),
138  fProdV0PtMin(source.fProdV0PtMin),
139  fProdV0CosPointingAngleToPrimVtxMin(source.fProdV0CosPointingAngleToPrimVtxMin),
140  fProdV0DcaDaughtersMax(source.fProdV0DcaDaughtersMax),
141  fProdV0DaughterEtaRange(source.fProdV0DaughterEtaRange),
142  fProdV0DaughterPtMin(source.fProdV0DaughterPtMin),
143  fProdV0DaughterTPCClusterMin(source.fProdV0DaughterTPCClusterMin),
144  fProdV0DaughterTPCCrossRatioMin(source.fProdV0DaughterTPCCrossRatioMin),
145  fProdRfidMinV0(source.fProdRfidMinV0),
146  fProdRfidMaxV0(source.fProdRfidMaxV0),
147  fProdDcaV0ToPrimVertexMin(source.fProdDcaV0ToPrimVertexMin),
148  fProdDcaV0PrToPrimVertexMin(source.fProdDcaV0PrToPrimVertexMin),
149  fProdDcaV0PiToPrimVertexMin(source.fProdDcaV0PiToPrimVertexMin),
150  fProdV0ProperDecayLengthMax(source.fProdV0ProperDecayLengthMax),
151  fProdMassRejK0s(source.fProdMassRejK0s),
152  fProdV0EtaMin(source.fProdV0EtaMin),
153  fProdV0EtaMax(source.fProdV0EtaMax),
154  fProdV0RapMin(source.fProdV0RapMin),
155  fProdV0RapMax(source.fProdV0RapMax),
156  fProdRoughMassTol(source.fProdRoughMassTol),
157  fProdRoughPtMin(source.fProdRoughPtMin),
158  fExcludePionTPC(source.fExcludePionTPC),
159  fExcludeProtonTPC(source.fExcludeProtonTPC),
160  fExcludeKaonTPC(source.fExcludeKaonTPC),
161  fExcludenSigmaPionTPC(source.fExcludenSigmaPionTPC),
162  fExcludenSigmaProtonTPC(source.fExcludenSigmaProtonTPC),
163  fExcludenSigmaKaonTPC(source.fExcludenSigmaKaonTPC),
164  fSigmaElectronTPCMin(source.fSigmaElectronTPCMin),
165  fSigmaElectronTPCPtDepPar0(source.fSigmaElectronTPCPtDepPar0),
166  fSigmaElectronTPCPtDepPar1(source.fSigmaElectronTPCPtDepPar1),
167  fSigmaElectronTPCPtDepPar2(source.fSigmaElectronTPCPtDepPar2),
168  fSigmaElectronTPCMax(source.fSigmaElectronTPCMax),
169  fSigmaElectronTOFMin(source.fSigmaElectronTOFMin),
170  fSigmaElectronTOFMax(source.fSigmaElectronTOFMax)
171 {
172  //
173  // Copy constructor
174  //
175 }
176 //--------------------------------------------------------------------------
178 {
179  //
180  // assignment operator
181  //
182 
183  if (this != &source) {
184  AliRDHFCuts::operator=(source);
185  }
186 
187  fPIDStrategy = source.fPIDStrategy;
189  fUseLambdaPID = source.fUseLambdaPID;
190  fPidObjProton = source.fPidObjProton;
191  fPidObjPion = source.fPidObjPion;
198  fProdV0PtMin = source.fProdV0PtMin;
212  fProdV0EtaMin = source.fProdV0EtaMin;
213  fProdV0EtaMax = source.fProdV0EtaMax;
214  fProdV0RapMin = source.fProdV0RapMin;
215  fProdV0RapMax = source.fProdV0RapMax;
231 
232 
233  return *this;
234 }
235 
236 //---------------------------------------------------------------------------
238  //
239  // Default Destructor
240  //
241 
242 }
243 
244 //---------------------------------------------------------------------------
245 void AliRDHFCutsLctoeleLambdafromAODtracks::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) {
246  //
247  // Fills in vars the values of the variables
248  //
249 
250  if (pdgdaughters[0]==-9999) return; // dummy
251 
253  if(!dd){
254  AliError("No AliAODRecoCascadeHF object found\n");
255  return;
256  }
257 
258  if (nvars!=fnVarsForOpt) {
259  AliError("Cut object seems to have the wrong number of variables\n");
260  return;
261  }
262 
263  //Double_t ptD=d->Pt();
264  //Int_t ptbin=PtBin(ptD);
265  Int_t iter=-1;
266 
267 
268  if(fVarsForOpt[0]){
269  iter++;
270  UInt_t pdgdg[2]={11,3122};
271  vars[iter]= dd->InvMass(2,pdgdg);
272  }
273  if(fVarsForOpt[1]){
274  iter++;
275  Double_t v0px = dd->PxProng(1);
276  Double_t v0py = dd->PyProng(1);
277  Double_t v0pz = dd->PzProng(1);
278  Double_t epx = dd->PxProng(0);
279  Double_t epy = dd->PyProng(0);
280  Double_t epz = dd->PzProng(0);
281  vars[iter]= (v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz);
282  }
283 
284  return;
285 }
286 
287 //---------------------------------------------------------------------------
288 Int_t AliRDHFCutsLctoeleLambdafromAODtracks::IsSelected(TObject* obj, Int_t selectionLevel) {
289  //
290  // Apply selection
291  //
292 
293  if (!fCutsRD) {
294  AliFatal("Cut matrix not inizialized. Exit...");
295  return 0;
296  }
297 
299  if(!d){
300  AliDebug(2,"AliAODRecoCascadeHF null");
301  return 0;
302  }
303 
304  Double_t ptD=d->Pt();
305  if(ptD<fMinPtCand) return 0;
306  if(ptD>fMaxPtCand) return 0;
307 
308  if (selectionLevel==AliRDHFCuts::kAll ||
309  selectionLevel==AliRDHFCuts::kTracks) {
310  //Performed in production stage
311  }
312 
313  Int_t returnvalueCuts=1;
314  // selection on candidate
315  if (selectionLevel==AliRDHFCuts::kAll ||
316  selectionLevel==AliRDHFCuts::kCandidate) {
317 
318  Double_t pt=d->Pt();
319  Int_t ptbin=PtBin(pt);
320  if (ptbin==-1) {
321  return 0;
322  }
323  Bool_t okcand=kTRUE;
324 
325  Double_t mlamPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
326  UInt_t pdgdg[2]={11,3122};
327  Double_t InvMassEleLambda = d->InvMass(2,pdgdg);
328 
329  Double_t v0px = d->PxProng(1);
330  Double_t v0py = d->PyProng(1);
331  Double_t v0pz = d->PzProng(1);
332  Double_t epx = d->PxProng(0);
333  Double_t epy = d->PyProng(0);
334  Double_t epz = d->PzProng(0);
335  Double_t cosoa = (v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz);
336 
337  if(InvMassEleLambda > fCutsRD[GetGlobalIndex(0,ptbin)])
338  {
339  okcand = kFALSE;
340  }
341  if(cosoa < fCutsRD[GetGlobalIndex(1,ptbin)])
342  {
343  okcand = kFALSE;
344  }
345 
346  if(!okcand) return 0;
347  returnvalueCuts = 1;
348  }
349 
350  Int_t returnvaluePID=1;
351  if(selectionLevel==AliRDHFCuts::kAll ||
352  selectionLevel==AliRDHFCuts::kCandidate||
353  selectionLevel==AliRDHFCuts::kPID) {
354  //Not used
355  }
356 
357  Int_t returnvalue = 0;
358  if(returnvalueCuts==1 && returnvaluePID==1) returnvalue=1;
359 
360  return returnvalue;
361 }
362 
363 //---------------------------------------------------------------------------
365 {
366  //
367  // IsSelectedPID (not used)
368  //
369 
370  if(!fUsePID || !obj) return 1;
371 
373  AliAODTrack *part = dd->GetBachelor();
374 
375  Int_t returnvalue=1;
376 
377  if(fPidHF->GetPidResponse()==0x0){
378  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
379  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
380  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
381  fPidHF->SetPidResponse(pidResp);
382  }
383 
384  Int_t isElectron=fPidHF->MakeRawPid(part,0);
385  if(isElectron<1) returnvalue = 0;
386 
387  return returnvalue;
388 }
389 
390 //---------------------------------------------------------------------------
392  //
393  // IsSelectedCombinedPID (not used)
394  //
395 
396  if(!fUsePID || !obj) {return 1;}
397 
399  AliAODTrack *part = dd->GetBachelor();
400  if(!part) return 0;
401 
402  Int_t returnvalue=1;
403 
404  return returnvalue;
405 }
406 
407 //________________________________________________________________________
408 Bool_t AliRDHFCutsLctoeleLambdafromAODtracks::SingleTrkCuts(AliAODTrack *trk, AliAODVertex *primVert)
409 {
410  //
411  // Single Track Cut to be applied before object creation
412  //
413 
414  if(trk->GetStatus()&AliESDtrack::kITSpureSA) return kFALSE;
415  if(!(trk->GetStatus()&AliESDtrack::kITSin)) return kFALSE;
416  if(fProdUseAODFilterBit && !trk->TestFilterMask(BIT(4))) return kFALSE;
417  Double_t pos[3]; primVert->GetXYZ(pos);
418  Double_t cov[6]; primVert->GetCovarianceMatrix(cov);
419  const AliESDVertex vESD(pos,cov,100.,100);
420  if(fTrackCuts&&!IsDaughterSelected(trk,&vESD,fTrackCuts)) return kFALSE;
421 
422  if(trk->GetTPCsignalN()<fProdTrackTPCNclsPIDMin) return kFALSE;
423  if(trk->GetTPCNclsF()>0){
424  Float_t tpcratio = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
425  if(tpcratio<fProdTrackTPCNclsRatioMin) return kFALSE;
426  }
427 
428 
429  if(fUsePID)
430  {
431  if(fPidHF->GetPidResponse()==0x0){
432  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
433  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
434  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
435  fPidHF->SetPidResponse(pidResp);
436  }
437 
438  switch(fPIDStrategy){
439  case kNSigmaCuts:
440  return IsSelectedeID(trk);
441  break;
443  return IsSelectedCustomizedeID(trk);
444  break;
446  return IsSelectedCustomizedPtDepeID(trk);
447  break;
448  case kCombinedCuts:
449  return IsSelectedCombinedeID(trk);
450  break;
451  }
452 
453  }
454 
455  return kTRUE;
456 }
457 //________________________________________________________________________
458 Bool_t AliRDHFCutsLctoeleLambdafromAODtracks::SingleTrkCutsNoPID(AliAODTrack *trk, AliAODVertex *primVert)
459 {
460  //
461  // Single Track Cut to be applied before object creation
462  //
463 
464  if(trk->GetStatus()&AliESDtrack::kITSpureSA) return kFALSE;
465  if(!(trk->GetStatus()&AliESDtrack::kITSin)) return kFALSE;
466  if(fProdUseAODFilterBit && !trk->TestFilterMask(BIT(4))) return kFALSE;
467  Double_t pos[3]; primVert->GetXYZ(pos);
468  Double_t cov[6]; primVert->GetCovarianceMatrix(cov);
469  const AliESDVertex vESD(pos,cov,100.,100);
470  if(fTrackCuts&&!IsDaughterSelected(trk,&vESD,fTrackCuts)) return kFALSE;
471 
472  if(trk->GetTPCsignalN()<fProdTrackTPCNclsPIDMin) return kFALSE;
473  if(trk->GetTPCNclsF()>0){
474  Float_t tpcratio = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
475  if(tpcratio<fProdTrackTPCNclsRatioMin) return kFALSE;
476  }
477 
478  return kTRUE;
479 }
480 //________________________________________________________________________
482 {
483  //
484  // electron ID first shot
485  //
486 
487  Double_t nSigmaPion = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
488  if(fExcludePionTPC){
489  if(TMath::Abs(nSigmaPion)<fExcludenSigmaPionTPC){
490  return kFALSE;
491  }
492  }
493 
494  Double_t nSigmaProton = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
495  if(fExcludeProtonTPC){
496  if(TMath::Abs(nSigmaProton)<fExcludenSigmaProtonTPC){
497  return kFALSE;
498  }
499  }
500 
501  Double_t nSigmaKaon = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
502  if(fExcludeKaonTPC){
503  if(TMath::Abs(nSigmaKaon)<fExcludenSigmaKaonTPC){
504  return kFALSE;
505  }
506  }
507 
508  Int_t isElectron=fPidHF->MakeRawPid(trk,0);
509  if(isElectron<1) return kFALSE;
510 
511  return kTRUE;
512 }
513 //________________________________________________________________________
515 {
516  //
517  // electron ID first shot
518  //
519 
520  Double_t nSigmaPion = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
521  if(fExcludePionTPC){
522  if(TMath::Abs(nSigmaPion)<fExcludenSigmaPionTPC){
523  return kFALSE;
524  }
525  }
526 
527  Double_t nSigmaProton = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
528  if(fExcludeProtonTPC){
529  if(TMath::Abs(nSigmaProton)<fExcludenSigmaProtonTPC){
530  return kFALSE;
531  }
532  }
533 
534  Double_t nSigmaKaon = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
535  if(fExcludeKaonTPC){
536  if(TMath::Abs(nSigmaKaon)<fExcludenSigmaKaonTPC){
537  return kFALSE;
538  }
539  }
540 
541  Double_t nSigmaTPCele = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
542  Double_t nSigmaTOFele = fPidHF->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
543 
544  if(nSigmaTPCele<fSigmaElectronTPCMin) return kFALSE;
545  if(nSigmaTPCele>fSigmaElectronTPCMax) return kFALSE;
546  if(nSigmaTOFele<fSigmaElectronTOFMin) return kFALSE;
547  if(nSigmaTOFele>fSigmaElectronTOFMax) return kFALSE;
548 
549  return kTRUE;
550 }
551 //________________________________________________________________________
553 {
554  //
555  // electron ID first shot
556  //
557 
558  Double_t nSigmaTPCele = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
559  Double_t nSigmaTOFele = fPidHF->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
560 
561  if(nSigmaTOFele<fSigmaElectronTOFMin) return kFALSE;
562  if(nSigmaTOFele>fSigmaElectronTOFMax) return kFALSE;
563 
564  Double_t pte = trk->Pt();
565  if(nSigmaTPCele<fSigmaElectronTPCPtDepPar0+fSigmaElectronTPCPtDepPar1*pte+fSigmaElectronTPCPtDepPar2*pte*pte) return kFALSE;
566  if(nSigmaTPCele>fSigmaElectronTPCMax) return kFALSE;
567 
568  return kTRUE;
569 }
570 //________________________________________________________________________
572 {
573  //
574  // electron ID Basyian not implemented
575  //
576 
577  return kTRUE;
578 }
579 
580 //________________________________________________________________________
581 Bool_t AliRDHFCutsLctoeleLambdafromAODtracks::SingleV0Cuts(AliAODv0 *v0, AliAODVertex *primVert)
582 {
583  //
584  // Single V0 Cut to be applied before object creation
585  //
586 
587  Bool_t onFlyV0 = v0->GetOnFlyStatus(); // on-the-flight V0s
588  if ( onFlyV0 && !fUseOnTheFlyV0 ) return kFALSE;
589  if(!v0) return kFALSE;
590  if(!(v0->GetSecondaryVtx())) return kFALSE;
591 
592  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
593  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
594  if(!cptrack || !cntrack) return kFALSE;
595  if(cptrack->Charge()<0 && cntrack->Charge()>0){
596  //In case sign is wrong
597  cptrack = (AliAODTrack*)(v0->GetDaughter(1));
598  cntrack = (AliAODTrack*)(v0->GetDaughter(0));
599  }
600 
601  if ( cptrack->Charge() == cntrack->Charge() ) return kFALSE;
602  if(!(cptrack->GetStatus() & AliESDtrack::kTPCrefit) ||
603  !(cntrack->GetStatus() & AliESDtrack::kTPCrefit)) return kFALSE;
604  AliAODVertex *maybeKinkPos = (AliAODVertex*)cptrack->GetProdVertex();
605  AliAODVertex *maybeKinkNeg = (AliAODVertex*)cntrack->GetProdVertex();
606  if (maybeKinkPos->GetType()==AliAODVertex::kKink || maybeKinkNeg->GetType()==AliAODVertex::kKink)
607  return kFALSE;
608 
609  if ( ( ( cptrack->GetTPCClusterInfo(2,1) ) < (Float_t)fProdV0DaughterTPCClusterMin ) ||
610  ( ( cntrack->GetTPCClusterInfo(2,1) ) < (Float_t)fProdV0DaughterTPCClusterMin) ) return kFALSE;
611 
612 
613  if((cptrack->GetTPCNclsF()>0)&&(cptrack->GetTPCClusterInfo(2,1)/cptrack->GetTPCNclsF()<fProdV0DaughterTPCCrossRatioMin)) return kFALSE;
614  if((cntrack->GetTPCNclsF()>0)&&(cntrack->GetTPCClusterInfo(2,1)/cntrack->GetTPCNclsF()<fProdV0DaughterTPCCrossRatioMin)) return kFALSE;
615 
616  Double_t massLambda = v0->MassLambda();
617  Double_t massAntiLambda = v0->MassAntiLambda();
618  Double_t mlamPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
619  Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
620  if(!(fabs(massAntiLambda-mlamPDG)<fProdV0MassTolLambdaRough) && !(fabs(massLambda-mlamPDG)<fProdV0MassTolLambdaRough)) return kFALSE;
621 
622  Double_t massK0s = v0->MassK0Short();
623  if(TMath::Abs(massK0s-mk0sPDG)<fProdMassRejK0s)
624  return kFALSE;
625 
626  Bool_t isparticle = kTRUE;
627  if(TMath::Abs(massAntiLambda-mlamPDG)<fProdV0MassTolLambdaRough) isparticle = kFALSE;
628 
629 
630  if(TMath::Abs(v0->DcaV0Daughters())>fProdV0DcaDaughtersMax) return kFALSE;
631  Double_t posVtx[3] = {0.,0.,0.};
632  primVert->GetXYZ(posVtx);
633  Double_t cospav0 = v0->CosPointingAngle(posVtx);
634  if(cospav0<fProdV0CosPointingAngleToPrimVtxMin) return kFALSE;
635  if(v0->Pt()<fProdV0PtMin) return kFALSE;
636  if(fabs(cptrack->Eta())>fProdV0DaughterEtaRange) return kFALSE;
637  if(fabs(cntrack->Eta())>fProdV0DaughterEtaRange) return kFALSE;
638  if(cptrack->Pt()<fProdV0DaughterPtMin) return kFALSE;
639  if(cntrack->Pt()<fProdV0DaughterPtMin) return kFALSE;
640 
641  Double_t lDcaV0ToPrimVertex = v0->DcaV0ToPrimVertex();
642  Double_t lDcaPosToPrimVertex = v0->DcaPosToPrimVertex();
643  Double_t lDcaNegToPrimVertex = v0->DcaNegToPrimVertex();
644  if(lDcaV0ToPrimVertex < fProdDcaV0ToPrimVertexMin) return kFALSE;
645  if(isparticle){
646  if(lDcaPosToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
647  if(lDcaNegToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
648  }else{
649  if(lDcaPosToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
650  if(lDcaNegToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
651  }
652  Double_t lPosV0[3];
653  lPosV0[0] = v0->DecayVertexV0X();
654  lPosV0[1] = v0->DecayVertexV0Y();
655  lPosV0[2] = v0->DecayVertexV0Z();
656  Double_t decayvertV0 = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
657 
658  if(decayvertV0<fProdRfidMinV0 || decayvertV0>fProdRfidMaxV0) return kFALSE;
659 
660  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
661  Double_t properdl = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
662  if(properdl>fProdV0ProperDecayLengthMax) return kFALSE;
663 
664 
665  if(fUseLambdaPID)
666  {
667  if(fPidObjProton->GetPidResponse()==0x0){
668  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
669  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
670  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
671  fPidObjProton->SetPidResponse(pidResp);
672  }
673  if(fPidObjPion->GetPidResponse()==0x0){
674  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
675  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
676  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
677  fPidObjPion->SetPidResponse(pidResp);
678  }
679 
680  Int_t isProton= -9999;
681  Int_t isPion= -9999;
682  if(isparticle){
683  isProton=fPidObjProton->MakeRawPid(cptrack,4);
684  isPion=fPidObjPion->MakeRawPid(cntrack,2);
685  }else{
686  isProton=fPidObjProton->MakeRawPid(cntrack,4);
687  isPion=fPidObjPion->MakeRawPid(cptrack,2);
688  }
689  if(isProton<1) return kFALSE;
690  if(isPion<1) return kFALSE;
691  }
692 
693  Double_t RapLambda = v0->RapLambda();
694  if(RapLambda<fProdV0RapMin || RapLambda>fProdV0RapMax) return kFALSE;
695 
696  Double_t EtaLambda = v0->PseudoRapV0();
697  if(EtaLambda<fProdV0EtaMin || EtaLambda>fProdV0EtaMax) return kFALSE;
698 
699  return kTRUE;
700 }
701 
702 //________________________________________________________________________
703 Bool_t AliRDHFCutsLctoeleLambdafromAODtracks::SelectWithRoughCuts(AliAODv0 *v0, AliAODTrack *part)
704 {
705  //
706  // Mass and pT Cut to be applied before object creation
707  // Not used now
708  //
709  if(!v0) return kFALSE;
710  if(!part) return kFALSE;
711 
712  return kTRUE;
713 
714 }
715 
716 //________________________________________________________________________
718 {
719  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
720  Double_t massL = v0->MassLambda();
721  if(TMath::Abs(massL-mLPDG)>fProdV0MassTolLambdaRough)
722  massL = v0->MassAntiLambda();
723 
724  if(TMath::Abs(massL-mLPDG)<fProdV0MassTolLambda)
725  return kTRUE;
726  return kFALSE;
727 }
728 
729 //________________________________________________________________________
731 {
732  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
733  Double_t massL = v0->M();
734  if(TMath::Abs(massL-mLPDG)<fProdV0MassTolLambda)
735  return kTRUE;
736  return kFALSE;
737 }
738 
739 //________________________________________________________________________
741 {
742  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
743  Double_t massL = v0->MassLambda();
744  if(TMath::Abs(massL-mLPDG)>fProdV0MassTolLambdaRough)
745  massL = v0->MassAntiLambda();
746 
747  Bool_t issideband = kFALSE;
748  if((massL-mLPDG)>fProdV0MassTolLambdaRough-fProdV0MassTolLambda) issideband = kTRUE;
749  if((massL-mLPDG)<-fProdV0MassTolLambdaRough+fProdV0MassTolLambda) issideband = kTRUE;
750  return issideband;
751 }
752 
753 //________________________________________________________________________
755 {
756  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
757  Double_t massL = v0->M();
758  Bool_t issideband = kFALSE;
759  if((massL-mLPDG)>fProdV0MassTolLambdaRough-fProdV0MassTolLambda) issideband = kTRUE;
760  if((massL-mLPDG)<-fProdV0MassTolLambdaRough+fProdV0MassTolLambda) issideband = kTRUE;
761  return issideband;
762 }
763 
Bool_t SingleV0Cuts(AliAODv0 *v0, AliAODVertex *vert)
Double_t fProdV0DaughterTPCCrossRatioMin
V0 daughter Minimum TPC cluster pT used before object creation.
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Double_t fProdV0ProperDecayLengthMax
Min Dca between v0-pion and PV.
Double_t fSigmaElectronTPCMin
nSigma to exclude for Kaon band
AliAODPidHF * fPidObjProton
Use PID for proton from Lc.
Double_t fProdRoughMassTol
Maximum rapidity of cascade.
AliRDHFCutsLctoeleLambdafromAODtracks & operator=(const AliRDHFCutsLctoeleLambdafromAODtracks &source)
Double_t fProdV0CosPointingAngleToPrimVtxMin
Minimum Lambda pT used before object creation.
Double_t fProdV0PtMin
Lambda mass selection used before object creation.
Double_t fExcludenSigmaKaonTPC
nSigma to exclude for proton band
void SetNVars(Int_t nVars)
Definition: AliRDHFCuts.h:361
AliRDHFCuts & operator=(const AliRDHFCuts &source)
Bool_t fExcludePionTPC
pT cut for Lc used before object creation
Double_t fProdTrackTPCNclsRatioMin
Min. Number of TPC PID cluster.
Bool_t fUsePID
Definition: AliRDHFCuts.h:388
Double_t fSigmaElectronTPCPtDepPar1
nSigma electron lower limit (par0)
Double_t fSigmaElectronTPCPtDepPar0
nSigma to exclude for Kaon band
Double_t fExcludenSigmaProtonTPC
nSigma to exclude for pion band
Double_t fProdDcaV0PrToPrimVertexMin
Min Dca between v0 and PV.
virtual void GetCutVarsForOpt(AliAODRecoDecayHF *d, Float_t *vars, Int_t nvars, Int_t *pdgdaughters)
Double_t fProdV0DaughterEtaRange
Max DCA between V0 daughters used before object creation.
Int_t fnVarsForOpt
Definition: AliRDHFCuts.h:383
Bool_t fUseLambdaPID
Threshold used in IsSelectedCombinedPID.
Double_t fMaxPtCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:410
Double_t fSigmaElectronTOFMin
nSigma to exclude for Kaon band
AliESDtrackCuts * fTrackCuts
quality cuts on the daughter tracks
Definition: AliRDHFCuts.h:376
Bool_t fExcludeKaonTPC
Flag wheter to exlude proton band.
Double_t fProdRoughPtMin
Mass cut for Lc used before object creation.
Double_t fProdDcaV0PiToPrimVertexMin
Min Dca between v0-proton and PV.
Bool_t IsDaughterSelected(AliAODTrack *track, const AliESDVertex *primary, AliESDtrackCuts *cuts) const
Double_t fSigmaElectronTOFMax
nSigma to exclude for Kaon band
Int_t fProdTrackTPCNclsPIDMin
Flag to check if we use on-the-fly v0.
AliAODTrack * GetBachelor() const
Bool_t fUseOnTheFlyV0
PID object for proton from Lc.
Double_t fSigmaElectronTPCPtDepPar2
nSigma electron lower limit (par1)
Bool_t SelectWithRoughCuts(AliAODv0 *v0, AliAODTrack *trk1)
Int_t MakeRawPid(AliAODTrack *track, Int_t specie)
AliPIDResponse * GetPidResponse() const
Definition: AliAODPidHF.h:160
Double_t fProdV0MassTolLambda
Flag for AOD filter Bit used before object creation.
Float_t * fCutsRD
fnVars*fnPtBins
Definition: AliRDHFCuts.h:386
Double_t fProdV0EtaMin
Rejection range of Omega mass from PDG value.
void SetVarsForOpt(Int_t nVars, Bool_t *forOpt)
Double_t fProdV0DaughterTPCClusterMin
V0 Daughter pT min used before object creation.
Double_t fExcludenSigmaPionTPC
Flag wheter to exlude proton band.
void SetVarNames(Int_t nVars, TString *varNames, Bool_t *isUpperCut)
Bool_t fExcludeProtonTPC
Flag wheter to exlude pion band.
Bool_t * fVarsForOpt
number of cut vars to be optimized for candidates
Definition: AliRDHFCuts.h:384
Double_t fProdV0MassTolLambdaRough
Lambda mass selection used before object creation.
Bool_t fProdUseAODFilterBit
Min. Number of TPC PID cluster.
void SetPtBins(Int_t nPtBinLimits, Float_t *ptBinLimits)
Bool_t SingleTrkCutsNoPID(AliAODTrack *trk, AliAODVertex *vert)
Double_t fSigmaElectronTPCMax
nSigma electron lower limit (par2)
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
Double_t fProdRfidMinV0
V0 daughter Minimum TPC cluster pT used before object creation.
Double_t fProdV0DcaDaughtersMax
V0 pointing angle used before object creation.
AliRDHFCutsLctoeleLambdafromAODtracks(const char *name="CutsLctoeleLambda")
AliAODPidHF * fPidHF
enable AOD049 centrality cleanup
Definition: AliRDHFCuts.h:390
Int_t PtBin(Double_t pt) const
Int_t GetGlobalIndex(Int_t iVar, Int_t iPtBin) const
Double_t fMinPtCand
outcome of PID selection
Definition: AliRDHFCuts.h:409
AliAODPidHF * fPidObjPion
PID object for proton from Lc.
Double_t fProdV0DaughterPtMin
V0Daughter eta range used before object creation.
void SetPidResponse(AliPIDResponse *pidResp)
Definition: AliAODPidHF.h:111
Bool_t SingleTrkCuts(AliAODTrack *trk, AliAODVertex *vert)