AliPhysics  dccfc39 (dccfc39)
 All Classes Namespaces Files Functions Variables Typedefs 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  fProdV0PtMax(9999.),
67  fProdV0CosPointingAngleToPrimVtxMin(0.99),
68  fProdV0DcaDaughtersMax(1.5),
69  fProdV0DaughterEtaRange(0.8),
70  fProdV0DaughterPtMin(0.0),
71  fProdV0DaughterTPCClusterMin(70),
72  fProdV0DaughterTPCCrossRatioMin(0.0),
73  fProdRfidMinV0(0.6),
74  fProdRfidMaxV0(100.0),
75  fProdDcaV0ToPrimVertexMin(0.),
76  fProdDcaV0PrToPrimVertexMin(0.),
77  fProdDcaV0PiToPrimVertexMin(0.),
78  fProdV0ProperDecayLengthMax(99999.),
79  fProdMassRejK0s(0.),
80  fProdV0EtaMin(-9999.),
81  fProdV0EtaMax(9999.),
82  fProdV0RapMin(-9999.),
83  fProdV0RapMax(9999.),
84  fProdRoughMassTol(0.25),
85  fProdRoughPtMin(0.0),
86  fExcludePionTPC(kFALSE),
87  fExcludeProtonTPC(kFALSE),
88  fExcludeKaonTPC(kFALSE),
89  fExcludenSigmaPionTPC(3.),
90  fExcludenSigmaProtonTPC(3.),
91  fExcludenSigmaKaonTPC(3.),
92  fSigmaElectronTPCMin(-9999.),
93  fSigmaElectronTPCPtDepPar0(-9999.),
94  fSigmaElectronTPCPtDepPar1(-9999.),
95  fSigmaElectronTPCPtDepPar2(0.),
96  fSigmaElectronTPCMax(9999.),
97  fSigmaElectronTOFMin(-9999.),
98  fSigmaElectronTOFMax(9999.)
99 {
100  //
101  // Default Constructor
102  //
103 
104  const Int_t nvars=2;
105  SetNVars(nvars);
106  TString varNames[nvars]={
107  "InvMass [GeV/c2]", //0
108  "cos(Opening angle) [cos(rad)]" //1
109  };
110 
111  Bool_t isUpperCut[nvars]={
112  kTRUE, //0
113  kFALSE //1
114  };
115  SetVarNames(nvars,varNames,isUpperCut);
116  Bool_t forOpt[nvars]={
117  kTRUE, //0
118  kTRUE //1
119  };
120  SetVarsForOpt(nvars,forOpt);
121 
122  Float_t limits[2]={0,999999999.};
123  SetPtBins(2,limits);
124 }
125 //--------------------------------------------------------------------------
127  AliRDHFCuts(source),
128  fPIDStrategy(source.fPIDStrategy),
129  fCombinedPIDThreshold(source.fCombinedPIDThreshold),
130  fUseLambdaPID(source.fUseLambdaPID),
131  fPidObjProton(source.fPidObjProton),
132  fPidObjPion(source.fPidObjPion),
133  fUseOnTheFlyV0(source.fUseOnTheFlyV0),
134  fProdTrackTPCNclsPIDMin(source.fProdTrackTPCNclsPIDMin),
135  fProdTrackTPCNclsRatioMin(source.fProdTrackTPCNclsRatioMin),
136  fProdUseAODFilterBit(source.fProdUseAODFilterBit),
137  fProdV0MassTolLambda(source.fProdV0MassTolLambda),
138  fProdV0MassTolLambdaRough(source.fProdV0MassTolLambdaRough),
139  fProdV0PtMin(source.fProdV0PtMin),
140  fProdV0PtMax(source.fProdV0PtMax),
141  fProdV0CosPointingAngleToPrimVtxMin(source.fProdV0CosPointingAngleToPrimVtxMin),
142  fProdV0DcaDaughtersMax(source.fProdV0DcaDaughtersMax),
143  fProdV0DaughterEtaRange(source.fProdV0DaughterEtaRange),
144  fProdV0DaughterPtMin(source.fProdV0DaughterPtMin),
145  fProdV0DaughterTPCClusterMin(source.fProdV0DaughterTPCClusterMin),
146  fProdV0DaughterTPCCrossRatioMin(source.fProdV0DaughterTPCCrossRatioMin),
147  fProdRfidMinV0(source.fProdRfidMinV0),
148  fProdRfidMaxV0(source.fProdRfidMaxV0),
149  fProdDcaV0ToPrimVertexMin(source.fProdDcaV0ToPrimVertexMin),
150  fProdDcaV0PrToPrimVertexMin(source.fProdDcaV0PrToPrimVertexMin),
151  fProdDcaV0PiToPrimVertexMin(source.fProdDcaV0PiToPrimVertexMin),
152  fProdV0ProperDecayLengthMax(source.fProdV0ProperDecayLengthMax),
153  fProdMassRejK0s(source.fProdMassRejK0s),
154  fProdV0EtaMin(source.fProdV0EtaMin),
155  fProdV0EtaMax(source.fProdV0EtaMax),
156  fProdV0RapMin(source.fProdV0RapMin),
157  fProdV0RapMax(source.fProdV0RapMax),
158  fProdRoughMassTol(source.fProdRoughMassTol),
159  fProdRoughPtMin(source.fProdRoughPtMin),
160  fExcludePionTPC(source.fExcludePionTPC),
161  fExcludeProtonTPC(source.fExcludeProtonTPC),
162  fExcludeKaonTPC(source.fExcludeKaonTPC),
163  fExcludenSigmaPionTPC(source.fExcludenSigmaPionTPC),
164  fExcludenSigmaProtonTPC(source.fExcludenSigmaProtonTPC),
165  fExcludenSigmaKaonTPC(source.fExcludenSigmaKaonTPC),
166  fSigmaElectronTPCMin(source.fSigmaElectronTPCMin),
167  fSigmaElectronTPCPtDepPar0(source.fSigmaElectronTPCPtDepPar0),
168  fSigmaElectronTPCPtDepPar1(source.fSigmaElectronTPCPtDepPar1),
169  fSigmaElectronTPCPtDepPar2(source.fSigmaElectronTPCPtDepPar2),
170  fSigmaElectronTPCMax(source.fSigmaElectronTPCMax),
171  fSigmaElectronTOFMin(source.fSigmaElectronTOFMin),
172  fSigmaElectronTOFMax(source.fSigmaElectronTOFMax)
173 {
174  //
175  // Copy constructor
176  //
177 }
178 //--------------------------------------------------------------------------
180 {
181  //
182  // assignment operator
183  //
184 
185  if (this != &source) {
186  AliRDHFCuts::operator=(source);
187  }
188 
189  fPIDStrategy = source.fPIDStrategy;
191  fUseLambdaPID = source.fUseLambdaPID;
192  fPidObjProton = source.fPidObjProton;
193  fPidObjPion = source.fPidObjPion;
200  fProdV0PtMin = source.fProdV0PtMin;
201  fProdV0PtMax = source.fProdV0PtMax;
215  fProdV0EtaMin = source.fProdV0EtaMin;
216  fProdV0EtaMax = source.fProdV0EtaMax;
217  fProdV0RapMin = source.fProdV0RapMin;
218  fProdV0RapMax = source.fProdV0RapMax;
234 
235 
236  return *this;
237 }
238 
239 //---------------------------------------------------------------------------
241  //
242  // Default Destructor
243  //
244 
245 }
246 
247 //---------------------------------------------------------------------------
248 void AliRDHFCutsLctoeleLambdafromAODtracks::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) {
249  //
250  // Fills in vars the values of the variables
251  //
252 
253  if (pdgdaughters[0]==-9999) return; // dummy
254 
256  if(!dd){
257  AliError("No AliAODRecoCascadeHF object found\n");
258  return;
259  }
260 
261  if (nvars!=fnVarsForOpt) {
262  AliError("Cut object seems to have the wrong number of variables\n");
263  return;
264  }
265 
266  //Double_t ptD=d->Pt();
267  //Int_t ptbin=PtBin(ptD);
268  Int_t iter=-1;
269 
270 
271  if(fVarsForOpt[0]){
272  iter++;
273  UInt_t pdgdg[2]={11,3122};
274  vars[iter]= dd->InvMass(2,pdgdg);
275  }
276  if(fVarsForOpt[1]){
277  iter++;
278  Double_t v0px = dd->PxProng(1);
279  Double_t v0py = dd->PyProng(1);
280  Double_t v0pz = dd->PzProng(1);
281  Double_t epx = dd->PxProng(0);
282  Double_t epy = dd->PyProng(0);
283  Double_t epz = dd->PzProng(0);
284  vars[iter]= (v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz);
285  }
286 
287  return;
288 }
289 
290 //---------------------------------------------------------------------------
291 Int_t AliRDHFCutsLctoeleLambdafromAODtracks::IsSelected(TObject* obj, Int_t selectionLevel) {
292  //
293  // Apply selection
294  //
295 
296  if (!fCutsRD) {
297  AliFatal("Cut matrix not inizialized. Exit...");
298  return 0;
299  }
300 
302  if(!d){
303  AliDebug(2,"AliAODRecoCascadeHF null");
304  return 0;
305  }
306 
307  Double_t ptD=d->Pt();
308  if(ptD<fMinPtCand) return 0;
309  if(ptD>fMaxPtCand) return 0;
310 
311  if (selectionLevel==AliRDHFCuts::kAll ||
312  selectionLevel==AliRDHFCuts::kTracks) {
313  //Performed in production stage
314  }
315 
316  Int_t returnvalueCuts=1;
317  // selection on candidate
318  if (selectionLevel==AliRDHFCuts::kAll ||
319  selectionLevel==AliRDHFCuts::kCandidate) {
320 
321  Double_t pt=d->Pt();
322  Int_t ptbin=PtBin(pt);
323  if (ptbin==-1) {
324  return 0;
325  }
326  Bool_t okcand=kTRUE;
327 
328  Double_t mlamPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
329  UInt_t pdgdg[2]={11,3122};
330  Double_t InvMassEleLambda = d->InvMass(2,pdgdg);
331 
332  Double_t v0px = d->PxProng(1);
333  Double_t v0py = d->PyProng(1);
334  Double_t v0pz = d->PzProng(1);
335  Double_t epx = d->PxProng(0);
336  Double_t epy = d->PyProng(0);
337  Double_t epz = d->PzProng(0);
338  Double_t cosoa = (v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz);
339 
340  if(InvMassEleLambda > fCutsRD[GetGlobalIndex(0,ptbin)])
341  {
342  okcand = kFALSE;
343  }
344  if(cosoa < fCutsRD[GetGlobalIndex(1,ptbin)])
345  {
346  okcand = kFALSE;
347  }
348 
349  if(!okcand) return 0;
350  returnvalueCuts = 1;
351  }
352 
353  Int_t returnvaluePID=1;
354  if(selectionLevel==AliRDHFCuts::kAll ||
355  selectionLevel==AliRDHFCuts::kCandidate||
356  selectionLevel==AliRDHFCuts::kPID) {
357  //Not used
358  }
359 
360  Int_t returnvalue = 0;
361  if(returnvalueCuts==1 && returnvaluePID==1) returnvalue=1;
362 
363  return returnvalue;
364 }
365 
366 //---------------------------------------------------------------------------
368 {
369  //
370  // IsSelectedPID (not used)
371  //
372 
373  if(!fUsePID || !obj) return 1;
374 
376  AliAODTrack *part = dd->GetBachelor();
377 
378  Int_t returnvalue=1;
379 
380  if(fPidHF->GetPidResponse()==0x0){
381  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
382  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
383  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
384  fPidHF->SetPidResponse(pidResp);
385  }
386 
387  Int_t isElectron=fPidHF->MakeRawPid(part,0);
388  if(isElectron<1) returnvalue = 0;
389 
390  return returnvalue;
391 }
392 
393 //---------------------------------------------------------------------------
395  //
396  // IsSelectedCombinedPID (not used)
397  //
398 
399  if(!fUsePID || !obj) {return 1;}
400 
402  AliAODTrack *part = dd->GetBachelor();
403  if(!part) return 0;
404 
405  Int_t returnvalue=1;
406 
407  return returnvalue;
408 }
409 
410 //________________________________________________________________________
411 Bool_t AliRDHFCutsLctoeleLambdafromAODtracks::SingleTrkCuts(AliAODTrack *trk, AliAODVertex *primVert)
412 {
413  //
414  // Single Track Cut to be applied before object creation
415  //
416 
417  if(trk->GetStatus()&AliESDtrack::kITSpureSA) return kFALSE;
418  if(!(trk->GetStatus()&AliESDtrack::kITSin)) return kFALSE;
419  if(fProdUseAODFilterBit && !trk->TestFilterMask(BIT(4))) return kFALSE;
420  Double_t pos[3]; primVert->GetXYZ(pos);
421  Double_t cov[6]; primVert->GetCovarianceMatrix(cov);
422  const AliESDVertex vESD(pos,cov,100.,100);
423  if(fTrackCuts&&!IsDaughterSelected(trk,&vESD,fTrackCuts)) return kFALSE;
424 
425  if(trk->GetTPCsignalN()<fProdTrackTPCNclsPIDMin) return kFALSE;
426  if(trk->GetTPCNclsF()>0){
427  Float_t tpcratio = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
428  if(tpcratio<fProdTrackTPCNclsRatioMin) return kFALSE;
429  }
430 
431 
432  if(fUsePID)
433  {
434  if(fPidHF->GetPidResponse()==0x0){
435  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
436  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
437  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
438  fPidHF->SetPidResponse(pidResp);
439  }
440 
441  switch(fPIDStrategy){
442  case kNSigmaCuts:
443  return IsSelectedeID(trk);
444  break;
446  return IsSelectedCustomizedeID(trk);
447  break;
449  return IsSelectedCustomizedPtDepeID(trk);
450  break;
451  case kCombinedCuts:
452  return IsSelectedCombinedeID(trk);
453  break;
454  }
455 
456  }
457 
458  return kTRUE;
459 }
460 //________________________________________________________________________
461 Bool_t AliRDHFCutsLctoeleLambdafromAODtracks::SingleTrkCutsNoPID(AliAODTrack *trk, AliAODVertex *primVert)
462 {
463  //
464  // Single Track Cut to be applied before object creation
465  //
466 
467  if(trk->GetStatus()&AliESDtrack::kITSpureSA) return kFALSE;
468  if(!(trk->GetStatus()&AliESDtrack::kITSin)) return kFALSE;
469  if(fProdUseAODFilterBit && !trk->TestFilterMask(BIT(4))) return kFALSE;
470  Double_t pos[3]; primVert->GetXYZ(pos);
471  Double_t cov[6]; primVert->GetCovarianceMatrix(cov);
472  const AliESDVertex vESD(pos,cov,100.,100);
473  if(fTrackCuts&&!IsDaughterSelected(trk,&vESD,fTrackCuts)) return kFALSE;
474 
475  if(trk->GetTPCsignalN()<fProdTrackTPCNclsPIDMin) return kFALSE;
476  if(trk->GetTPCNclsF()>0){
477  Float_t tpcratio = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
478  if(tpcratio<fProdTrackTPCNclsRatioMin) return kFALSE;
479  }
480 
481  return kTRUE;
482 }
483 //________________________________________________________________________
485 {
486  //
487  // electron ID first shot
488  //
489 
490  Double_t nSigmaPion = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
491  if(fExcludePionTPC){
492  if(TMath::Abs(nSigmaPion)<fExcludenSigmaPionTPC){
493  return kFALSE;
494  }
495  }
496 
497  Double_t nSigmaProton = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
498  if(fExcludeProtonTPC){
499  if(TMath::Abs(nSigmaProton)<fExcludenSigmaProtonTPC){
500  return kFALSE;
501  }
502  }
503 
504  Double_t nSigmaKaon = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
505  if(fExcludeKaonTPC){
506  if(TMath::Abs(nSigmaKaon)<fExcludenSigmaKaonTPC){
507  return kFALSE;
508  }
509  }
510 
511  Int_t isElectron=fPidHF->MakeRawPid(trk,0);
512  if(isElectron<1) return kFALSE;
513 
514  return kTRUE;
515 }
516 //________________________________________________________________________
518 {
519  //
520  // electron ID first shot
521  //
522 
523  Double_t nSigmaPion = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
524  if(fExcludePionTPC){
525  if(TMath::Abs(nSigmaPion)<fExcludenSigmaPionTPC){
526  return kFALSE;
527  }
528  }
529 
530  Double_t nSigmaProton = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
531  if(fExcludeProtonTPC){
532  if(TMath::Abs(nSigmaProton)<fExcludenSigmaProtonTPC){
533  return kFALSE;
534  }
535  }
536 
537  Double_t nSigmaKaon = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
538  if(fExcludeKaonTPC){
539  if(TMath::Abs(nSigmaKaon)<fExcludenSigmaKaonTPC){
540  return kFALSE;
541  }
542  }
543 
544  Double_t nSigmaTPCele = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
545  Double_t nSigmaTOFele = fPidHF->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
546 
547  if(nSigmaTPCele<fSigmaElectronTPCMin) return kFALSE;
548  if(nSigmaTPCele>fSigmaElectronTPCMax) return kFALSE;
549  if(nSigmaTOFele<fSigmaElectronTOFMin) return kFALSE;
550  if(nSigmaTOFele>fSigmaElectronTOFMax) return kFALSE;
551 
552  return kTRUE;
553 }
554 //________________________________________________________________________
556 {
557  //
558  // electron ID first shot
559  //
560 
561  Double_t nSigmaTPCele = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
562  Double_t nSigmaTOFele = fPidHF->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
563 
564  if(nSigmaTOFele<fSigmaElectronTOFMin) return kFALSE;
565  if(nSigmaTOFele>fSigmaElectronTOFMax) return kFALSE;
566 
567  Double_t pte = trk->Pt();
570  if(nSigmaTPCele<nsigmamin) return kFALSE;
571  if(nSigmaTPCele>fSigmaElectronTPCMax) return kFALSE;
572 
573  return kTRUE;
574 }
575 //________________________________________________________________________
577 {
578  //
579  // electron ID Basyian not implemented
580  //
581 
582  return kTRUE;
583 }
584 
585 //________________________________________________________________________
586 Bool_t AliRDHFCutsLctoeleLambdafromAODtracks::SingleV0Cuts(AliAODv0 *v0, AliAODVertex *primVert)
587 {
588  //
589  // Single V0 Cut to be applied before object creation
590  //
591 
592  Bool_t onFlyV0 = v0->GetOnFlyStatus(); // on-the-flight V0s
593  if ( onFlyV0 && !fUseOnTheFlyV0 ) return kFALSE;
594  if(!v0) return kFALSE;
595  if(!(v0->GetSecondaryVtx())) return kFALSE;
596 
597  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
598  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
599  if(!cptrack || !cntrack) return kFALSE;
600  if(cptrack->Charge()<0 && cntrack->Charge()>0){
601  //In case sign is wrong
602  cptrack = (AliAODTrack*)(v0->GetDaughter(1));
603  cntrack = (AliAODTrack*)(v0->GetDaughter(0));
604  }
605 
606  if ( cptrack->Charge() == cntrack->Charge() ) return kFALSE;
607  if(!(cptrack->GetStatus() & AliESDtrack::kTPCrefit) ||
608  !(cntrack->GetStatus() & AliESDtrack::kTPCrefit)) return kFALSE;
609  AliAODVertex *maybeKinkPos = (AliAODVertex*)cptrack->GetProdVertex();
610  AliAODVertex *maybeKinkNeg = (AliAODVertex*)cntrack->GetProdVertex();
611  if (maybeKinkPos->GetType()==AliAODVertex::kKink || maybeKinkNeg->GetType()==AliAODVertex::kKink)
612  return kFALSE;
613 
614  if ( ( ( cptrack->GetTPCClusterInfo(2,1) ) < (Float_t)fProdV0DaughterTPCClusterMin ) ||
615  ( ( cntrack->GetTPCClusterInfo(2,1) ) < (Float_t)fProdV0DaughterTPCClusterMin) ) return kFALSE;
616 
617 
618  if((cptrack->GetTPCNclsF()>0)&&(cptrack->GetTPCClusterInfo(2,1)/cptrack->GetTPCNclsF()<fProdV0DaughterTPCCrossRatioMin)) return kFALSE;
619  if((cntrack->GetTPCNclsF()>0)&&(cntrack->GetTPCClusterInfo(2,1)/cntrack->GetTPCNclsF()<fProdV0DaughterTPCCrossRatioMin)) return kFALSE;
620 
621  Double_t massLambda = v0->MassLambda();
622  Double_t massAntiLambda = v0->MassAntiLambda();
623  Double_t mlamPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
624  Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
625  if(!(fabs(massAntiLambda-mlamPDG)<fProdV0MassTolLambdaRough) && !(fabs(massLambda-mlamPDG)<fProdV0MassTolLambdaRough)) return kFALSE;
626 
627  Double_t massK0s = v0->MassK0Short();
628  if(TMath::Abs(massK0s-mk0sPDG)<fProdMassRejK0s)
629  return kFALSE;
630 
631  Bool_t isparticle = kTRUE;
632  if(TMath::Abs(massAntiLambda-mlamPDG)<fProdV0MassTolLambdaRough) isparticle = kFALSE;
633 
634 
635  if(TMath::Abs(v0->DcaV0Daughters())>fProdV0DcaDaughtersMax) return kFALSE;
636  Double_t posVtx[3] = {0.,0.,0.};
637  primVert->GetXYZ(posVtx);
638  Double_t cospav0 = v0->CosPointingAngle(posVtx);
639  if(cospav0<fProdV0CosPointingAngleToPrimVtxMin) return kFALSE;
640  if(v0->Pt()<fProdV0PtMin) return kFALSE;
641  if(v0->Pt()>fProdV0PtMax) return kFALSE;
642  if(fabs(cptrack->Eta())>fProdV0DaughterEtaRange) return kFALSE;
643  if(fabs(cntrack->Eta())>fProdV0DaughterEtaRange) return kFALSE;
644  if(cptrack->Pt()<fProdV0DaughterPtMin) return kFALSE;
645  if(cntrack->Pt()<fProdV0DaughterPtMin) return kFALSE;
646 
647  Double_t lDcaV0ToPrimVertex = v0->DcaV0ToPrimVertex();
648  Double_t lDcaPosToPrimVertex = v0->DcaPosToPrimVertex();
649  Double_t lDcaNegToPrimVertex = v0->DcaNegToPrimVertex();
650  if(lDcaV0ToPrimVertex < fProdDcaV0ToPrimVertexMin) return kFALSE;
651  if(isparticle){
652  if(lDcaPosToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
653  if(lDcaNegToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
654  }else{
655  if(lDcaPosToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
656  if(lDcaNegToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
657  }
658  Double_t lPosV0[3];
659  lPosV0[0] = v0->DecayVertexV0X();
660  lPosV0[1] = v0->DecayVertexV0Y();
661  lPosV0[2] = v0->DecayVertexV0Z();
662  Double_t decayvertV0 = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
663 
664  if(decayvertV0<fProdRfidMinV0 || decayvertV0>fProdRfidMaxV0) return kFALSE;
665 
666  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
667  Double_t properdl = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
668  if(properdl>fProdV0ProperDecayLengthMax) return kFALSE;
669 
670 
671  if(fUseLambdaPID)
672  {
673  if(fPidObjProton->GetPidResponse()==0x0){
674  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
675  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
676  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
677  fPidObjProton->SetPidResponse(pidResp);
678  }
679  if(fPidObjPion->GetPidResponse()==0x0){
680  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
681  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
682  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
683  fPidObjPion->SetPidResponse(pidResp);
684  }
685 
686  Int_t isProton= -9999;
687  Int_t isPion= -9999;
688  Double_t nsigmatpc_proton = fPidObjProton->GetSigma(0);
689  Double_t nsigmatpc_pion = fPidObjPion->GetSigma(0);
690  if(isparticle){
691  Double_t nSigmaTPCpr = fPidObjProton->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kProton);
692  Double_t nSigmaTPCpi = fPidObjPion->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kPion);
693  if(fabs(nSigmaTPCpr)<nsigmatpc_proton) isProton = 1;
694  if(fabs(nSigmaTPCpi)<nsigmatpc_pion) isPion = 1;
695  }else{
696  Double_t nSigmaTPCpr = fPidObjProton->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kProton);
697  Double_t nSigmaTPCpi = fPidObjPion->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kPion);
698  if(fabs(nSigmaTPCpr)<nsigmatpc_proton) isProton = 1;
699  if(fabs(nSigmaTPCpi)<nsigmatpc_pion) isPion = 1;
700  }
701  if(isProton<1) return kFALSE;
702  if(isPion<1) return kFALSE;
703  }
704 
705  Double_t RapLambda = v0->RapLambda();
706  if(RapLambda<fProdV0RapMin || RapLambda>fProdV0RapMax) return kFALSE;
707 
708  Double_t EtaLambda = v0->PseudoRapV0();
709  if(EtaLambda<fProdV0EtaMin || EtaLambda>fProdV0EtaMax) return kFALSE;
710 
711  return kTRUE;
712 }
713 
714 //________________________________________________________________________
715 Bool_t AliRDHFCutsLctoeleLambdafromAODtracks::SelectWithRoughCuts(AliAODv0 *v0, AliAODTrack *part)
716 {
717  //
718  // Mass and pT Cut to be applied before object creation
719  // Not used now
720  //
721  if(!v0) return kFALSE;
722  if(!part) return kFALSE;
723 
724  return kTRUE;
725 
726 }
727 
728 //________________________________________________________________________
730 {
731  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
732  Double_t massL = v0->MassLambda();
733  if(TMath::Abs(massL-mLPDG)>fProdV0MassTolLambdaRough)
734  massL = v0->MassAntiLambda();
735 
736  if(TMath::Abs(massL-mLPDG)<fProdV0MassTolLambda)
737  return kTRUE;
738  return kFALSE;
739 }
740 
741 //________________________________________________________________________
743 {
744  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
745  Double_t massL = v0->M();
746  if(TMath::Abs(massL-mLPDG)<fProdV0MassTolLambda)
747  return kTRUE;
748  return kFALSE;
749 }
750 
751 //________________________________________________________________________
753 {
754  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
755  Double_t massL = v0->MassLambda();
756  if(TMath::Abs(massL-mLPDG)>fProdV0MassTolLambdaRough)
757  massL = v0->MassAntiLambda();
758 
759  Bool_t issideband = kFALSE;
760  if((massL-mLPDG)>fProdV0MassTolLambdaRough-fProdV0MassTolLambda) issideband = kTRUE;
761  if((massL-mLPDG)<-fProdV0MassTolLambdaRough+fProdV0MassTolLambda) issideband = kTRUE;
762  return issideband;
763 }
764 
765 //________________________________________________________________________
767 {
768  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
769  Double_t massL = v0->M();
770  Bool_t issideband = kFALSE;
771  if((massL-mLPDG)>fProdV0MassTolLambdaRough-fProdV0MassTolLambda) issideband = kTRUE;
772  if((massL-mLPDG)<-fProdV0MassTolLambdaRough+fProdV0MassTolLambda) issideband = kTRUE;
773  return issideband;
774 }
775 
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 GetSigma(Int_t idet) const
Definition: AliAODPidHF.h:134
Double_t fProdV0CosPointingAngleToPrimVtxMin
Max Lambda pT used before object creation.
Double_t fProdV0PtMin
Lambda mass selection used before object creation.
Double_t fProdV0PtMax
Minimum Lambda pT used before object creation.
Double_t fExcludenSigmaKaonTPC
nSigma to exclude for proton band
void SetNVars(Int_t nVars)
Definition: AliRDHFCuts.h:362
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:389
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:384
Bool_t fUseLambdaPID
Threshold used in IsSelectedCombinedPID.
Double_t fMaxPtCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:411
Double_t fSigmaElectronTOFMin
nSigma to exclude for Kaon band
AliESDtrackCuts * fTrackCuts
quality cuts on the daughter tracks
Definition: AliRDHFCuts.h:377
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:387
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:385
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:391
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:410
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)