AliPhysics  master (3d17d9d)
AliRDHFCutsKFP.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 Xic0 -> Xi pi
21 //
22 // Author: Jianhui Zhu (1,2)
23 // (1) Central China Normal University
24 // (2) GSI Helmholtz Centre for Heavy Ion Research
25 // E-mail: zjh@mail.ccnu.edu.cn
26 //
28 
29 #include <Riostream.h>
30 
31 #include <TDatabasePDG.h>
32 #include <TMath.h>
33 
34 #include "AliAnalysisManager.h"
35 #include "AliInputEventHandler.h"
36 #include "AliPIDResponse.h"
37 #include "AliRDHFCutsKFP.h"
39 #include "AliAODTrack.h"
40 #include "AliESDtrack.h"
41 #include "AliESDVertex.h"
42 #include "AliAODVertex.h"
43 #include "AliAODv0.h"
44 #include "AliAODcascade.h"
45 #include "AliESDv0.h"
46 
47 using std::cout;
48 using std::endl;
49 
51 ClassImp(AliRDHFCutsKFP);
53 
54 
55 //--------------------------------------------------------------------------
56 AliRDHFCutsKFP::AliRDHFCutsKFP(const char* name) :
57  AliRDHFCuts(name),
58  fPIDStrategy(kNSigmaCuts),
59  fCombinedPIDThreshold(0.),
60  fUseXic0PID(kFALSE),
61  fPidObjPiFromXic0(0),
62  fPidObjPiFromXi(0),
63  fPidObjKaFromOmega(0),
64  fPidObjPrFromV0(0),
65  fPidObjPiFromV0(0),
66  fPtMinXic0(0.),
67  fPtMinPiFromXic0(0.),
68  fPtMinPiFromXi(0.),
69  fProdTrackEtaRange(9999.),
70  fProdUseAODFilterBit(kTRUE),
71  fProdMassTolLambda(0.010),
72  fProdMassTolXi(9999.),
73  fProdMassTolXic0(9999.),
74  fProdMassTolOmega(9999.),
75  fProdMassRejOmega(0.000),
76  fProdRfidMinV0(0.6),
77  fProdRfidMaxV0(100.0),
78  fProdRfidMinXi(0.6),
79  fProdRfidMaxXi(100.0),
80  fProdCascProperDecayLengthMax(100.0),
81  fProdDcaXiDaughtersMax(100.),
82  fProdDcaV0DaughtersMax(100.),
83  fProdDcaBachToPrimVertexMin(0.),
84  fProdDcaV0ToPrimVertexMin(0.),
85  fProdDcaV0PrToPrimVertexMin(0.),
86  fProdDcaV0PiToPrimVertexMin(0.),
87  fProdXiCosineOfPoiningAngleMin(-1.),
88  fProdV0CosineOfPoiningAngleXiMin(-1.),
89  fProdCascNTPCClustersMin(0.0),
90  fProdChi2TPCV0PrMax(9999.),
91  fProdChi2TPCV0PiMax(9999.),
92  fProdLikeSignDcaMax(2.0),
93  fProdRoughMassTol(0.25),
94  fProdRoughPtMin(0.0),
95  fKFPLam_Chi2geoMax(100.),
96  fKFPLam_Chi2topoMax(100.),
97  fKFPLam_lDeltalMin(0.),
98  fKFPXi_Chi2geoMax(100.),
99  fKFPXi_Chi2topoMax(100.),
100  fKFPXi_lDeltalMin(0.),
101  fKFPXic0_Chi2geoMax(100.)
102 {
103  //
104  // Default Constructor
105  //
106 
107  const Int_t nvars=13;
108  SetNVars(nvars);
109  TString varNames[nvars]={"Xic inv. mass [GeV/c2]", // 0
110  "Xic Pt [GeV/c]", //1
111  "Xi mass Tolrelance [GeV/c2]", //2
112  "Lambda mass Tolrelance [GeV/c2]", //3
113  "Max DCA pi-pi [cm]", //4
114  "Max DCA pi-casc [cm]",//5
115  "Max d0 pi [cm]",//6
116  "Max d0 Xi [cm]",//7
117  "Min d0 Xi-Bach [cm]",//8
118  "Min d0 Xi-V0 [cm]",//9
119  "Min Xic cosPA ",//10
120  "Min DecayLengthXY ",//11
121  "Min Bachelor pT"//12
122  };
123 
124  Bool_t isUpperCut[nvars]={kTRUE, // 0
125  kFALSE, //1
126  kTRUE, //2
127  kTRUE, //3
128  kTRUE, //4
129  kTRUE, //5
130  kTRUE, //6
131  kTRUE, //7
132  kFALSE, //8
133  kFALSE, //9
134  kFALSE, //10
135  kFALSE,//11
136  kFALSE //12
137  };
138  SetVarNames(nvars,varNames,isUpperCut);
139  Bool_t forOpt[nvars]={kFALSE, // 0
140  kFALSE, //1
141  kTRUE, //2
142  kTRUE, //3
143  kTRUE, //4
144  kTRUE, //5
145  kTRUE, //6
146  kTRUE, //7
147  kTRUE, //8
148  kTRUE, //9
149  kTRUE, //10
150  kTRUE, //11
151  kTRUE //12
152  };
153  SetVarsForOpt(nvars,forOpt);
154 
155  Float_t limits[2]={0,999999999.};
156  SetPtBins(2,limits);
157 }
158 
159 //--------------------------------------------------------------------------
161  AliRDHFCuts(source),
162  fPIDStrategy(source.fPIDStrategy),
164  fUseXic0PID(source.fUseXic0PID),
170  fPtMinXic0(source.fPtMinXic0),
206 {
207  //
208  // Copy constructor
209  //
210 }
211 
212 //--------------------------------------------------------------------------
214 {
215  //
216  // assignment operator
217  //
218 
219  if (this != &source) {
220  AliRDHFCuts::operator=(source);
221  }
222 
223  fPIDStrategy = source.fPIDStrategy;
225  fUseXic0PID = source.fUseXic0PID;
232  fPtMinXic0 = source.fPtMinXic0;
265 
266  return *this;
267 }
268 
269 //---------------------------------------------------------------------------
271  //
272  // Default Destructor
273  //
274 }
275 
276 //---------------------------------------------------------------------------
278  //
279  // Fills in vars the values of the variables
280  //
281 
282  if (pdgdaughters[0]==-9999) return; // dummy
283 
285  if(!dd){
286  AliDebug(2," No AliAODRecoCascadeHF3Prong object found\n");
287  return;
288  }
289 
290  if (nvars!=fnVarsForOpt) {
291  AliError("AliRDHFCutsKFP wrong number of variables\n");
292  return;
293  }
294 
295  //Double_t ptD=d->Pt();
296  //Int_t ptbin=PtBin(ptD);
297  Int_t iter=-1;
298 
299  if(fVarsForOpt[0]){
300  iter++;
301  Double_t mxicPDG = TDatabasePDG::Instance()->GetParticle(4232)->Mass();
302  vars[iter]= TMath::Abs(dd->InvMassPiXiPi()-mxicPDG) ;
303  }
304  if(fVarsForOpt[1]){
305  iter++;
306  vars[iter]= dd->Pt();
307  }
308  if(fVarsForOpt[2]){
309  iter++;
310  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
311  vars[iter]= TMath::Abs(dd->CascMassXi()-mxiPDG);
312  }
313  if(fVarsForOpt[3]){
314  iter++;
315  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
316  vars[iter]= TMath::Abs(dd->CascMassLambda()-mLPDG);
317  }
318  Double_t dca[3];
319  dd->GetDCAs(dca);
320  if(fVarsForOpt[4]){
321  iter++;
322  vars[iter]= dca[2];
323  }
324  if(fVarsForOpt[5]){
325  iter++;
326  vars[iter]= dca[0];
327  }
328  if(fVarsForOpt[6]){
329  iter++;
330  vars[iter]= dd->Getd0Prong(0);
331  }
332  if(fVarsForOpt[7]){
333  iter++;
334  vars[iter]= dd->Getd0Prong(1);
335  }
336  if(fVarsForOpt[8]){
337  iter++;
338  vars[iter]= dd->CascDcaBachToPrimVertex();
339  }
340  if(fVarsForOpt[9]){
341  iter++;
342  vars[iter]= dd->CascDcaV0ToPrimVertex();
343  }
344  if(fVarsForOpt[10]){
345  iter++;
346  vars[iter]= dd->XicCosPointingAngle();
347  }
348  if(fVarsForOpt[11]){
349  iter++;
350  vars[iter]= dd->DecayLengthXY();
351  }
352  if(fVarsForOpt[12]){
353  iter++;
354  vars[iter]= dd->PtProng(0);
355  }
356 
357  return;
358 }
359 //---------------------------------------------------------------------------
361 {
362  //
363  // Apply selection
364  //
365 
366  if (!fCutsRD) {
367  AliFatal("Cut matrice not inizialized. Exit...");
368  return 0;
369  }
370 
372  if(!d){
373  AliDebug(2," No AliAODRecoCascadeHF3Prong object found\n");
374  return 0;
375  }
376 
377  Double_t ptD=d->Pt();
378  if(ptD<fMinPtCand) return 0;
379  if(ptD>fMaxPtCand) return 0;
380 
381  if (selectionLevel==AliRDHFCuts::kAll ||
382  selectionLevel==AliRDHFCuts::kTracks) {
383  //Performed in production stage
384  }
385 
386  Int_t returnvalueCuts=1;
387  // selection on candidate
388  if (selectionLevel==AliRDHFCuts::kAll ||
389  selectionLevel==AliRDHFCuts::kCandidate) {
390 
391  Double_t pt=d->Pt();
392  Int_t ptbin=PtBin(pt);
393  if (ptbin==-1) {
394  return 0;
395  }
396  Bool_t okcand=kTRUE;
397 
398  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
399  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
400  Double_t mxicPDG = TDatabasePDG::Instance()->GetParticle(4232)->Mass();
401  if(TMath::Abs(d->InvMassPiXiPi()-mxicPDG) > fCutsRD[GetGlobalIndex(0,ptbin)])
402  {
403  okcand = kFALSE;
404  }
405  if(d->Pt()< fCutsRD[GetGlobalIndex(1,ptbin)])
406  {
407  okcand = kFALSE;
408  }
409  if(TMath::Abs(d->CascMassXi()-mxiPDG) > fCutsRD[GetGlobalIndex(2,ptbin)])
410  {
411  okcand = kFALSE;
412  }
413  if((TMath::Abs(d->CascMassLambda()-mLPDG) > fCutsRD[GetGlobalIndex(3,ptbin)]) &&(TMath::Abs(d->CascMassAntiLambda()-mLPDG) > fCutsRD[GetGlobalIndex(3,ptbin)]) )
414  {
415  okcand = kFALSE;
416  }
417  Double_t dca[3];
418  d->GetDCAs(dca);
419  if(TMath::Abs(dca[2]) > fCutsRD[GetGlobalIndex(4,ptbin)])
420  {
421  okcand = kFALSE;
422  }
423  if((TMath::Abs(dca[0]) > fCutsRD[GetGlobalIndex(5,ptbin)]) && (TMath::Abs(dca[1]) > fCutsRD[GetGlobalIndex(5,ptbin)]) )
424  {
425  okcand = kFALSE;
426  }
427  if((TMath::Abs(d->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(6,ptbin)]) && (TMath::Abs(d->Getd0Prong(2)) > fCutsRD[GetGlobalIndex(6,ptbin)]) )
428  {
429  okcand = kFALSE;
430  }
431  if((TMath::Abs(d->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(7,ptbin)]))
432  {
433  okcand = kFALSE;
434  }
435  if((TMath::Abs(d->CascDcaBachToPrimVertex()) < fCutsRD[GetGlobalIndex(8,ptbin)]))
436  {
437  okcand = kFALSE;
438  }
439  if((TMath::Abs(d->CascDcaV0ToPrimVertex()) < fCutsRD[GetGlobalIndex(9,ptbin)]))
440  {
441  okcand = kFALSE;
442  }
443  if( d->XicCosPointingAngle() < fCutsRD[GetGlobalIndex(10,ptbin)])
444  {
445  okcand = kFALSE;
446  }
447  if( d->DecayLengthXY() < fCutsRD[GetGlobalIndex(11,ptbin)])
448  {
449  okcand = kFALSE;
450  }
451  if( d->PtProng(0) < fCutsRD[GetGlobalIndex(12,ptbin)] || d->PtProng(2) < fCutsRD[GetGlobalIndex(12,ptbin)] )
452  {
453  okcand = kFALSE;
454  }
455 
456  if(!okcand) return 0;
457  returnvalueCuts = 1;
458  }
459 
460  Int_t returnvaluePID=1;
461  if(selectionLevel==AliRDHFCuts::kAll ||
462  selectionLevel==AliRDHFCuts::kCandidate||
463  selectionLevel==AliRDHFCuts::kPID) {
464 
465  switch(fPIDStrategy){
466  case kNSigmaCuts:
467  returnvaluePID = IsSelectedPID(d);
468  break;
469  case kCombinedCuts:
470  returnvaluePID = IsSelectedCombinedPID(d);
471  break;
472  }
473  }
474 
475  Int_t returnvalue = 0;
476  if(returnvalueCuts==1 && returnvaluePID==1) returnvalue=1;
477 
478  return returnvalue;
479 }
480 
481 //---------------------------------------------------------------------------
483 {
484  //
485  // PID selection
486  //
487 
488  if(!fUsePID || !obj) return 1;
489 
491  AliAODTrack *part1 = dd->GetBachelor1();
492  AliAODTrack *part2 = dd->GetBachelor2();
493 
494  Int_t returnvalue=1;
495 
496  if(fPidHF->GetPidResponse()==0x0){
497  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
498  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
499  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
500  fPidHF->SetPidResponse(pidResp);
501  }
502 
503  Int_t isPion1=fPidHF->MakeRawPid(part1,2);
504  Int_t isPion2=fPidHF->MakeRawPid(part2,2);
505 
506  if(isPion1<1) returnvalue = 0;
507  if(isPion2<1) returnvalue = 0;
508 
509  return returnvalue;
510 }
511 
512 //---------------------------------------------------------------------------
514  //
515  // Combined PID selection
516  //
517 
518  if(!fUsePID || !obj) {return 1;}
519 
521  AliAODTrack *part1 = dd->GetBachelor1();
522  AliAODTrack *part2 = dd->GetBachelor2();
523  if(!part1||!part2) return 0;
524 
525  Int_t returnvalue=1;
526  Double_t probPion1 = GetPionProbabilityTPCTOF(part1);
527  Double_t probPion2 = GetPionProbabilityTPCTOF(part2);
528  if(probPion1<fCombinedPIDThreshold) returnvalue = 0;
529  if(probPion2<fCombinedPIDThreshold) returnvalue = 0;
530  return returnvalue;
531 }
532 
533 //________________________________________________________________________
535 {
536  //
537  // Get Pion Probablility
538  //
539  //fPidHF->GetPidCombined()->SetDefaultTPCPriors();
540  if(!fPidHF->GetUseCombined()) return -9999.;
541  fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC+AliPIDResponse::kDetTOF);
542  Double_t prob1[AliPID::kSPECIES];
543  UInt_t detUsed1 = fPidHF->GetPidCombined()->ComputeProbabilities(trk, fPidHF->GetPidResponse(), prob1);
544  if (detUsed1 != (UInt_t)fPidHF->GetPidCombined()->GetDetectorMask() )
545  {
546  fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC);
547  detUsed1 = fPidHF->GetPidCombined()->ComputeProbabilities(trk, fPidHF->GetPidResponse(), prob1);
548  }
549  return prob1[AliPID::kPion];
550 }
551 
552 //________________________________________________________________________
554 {
555  //
556  // Single track cuts for primary pion
557  //
558 
559  if(trk->GetStatus()&AliESDtrack::kITSpureSA) return kFALSE;
560  if(!(trk->GetStatus()&AliESDtrack::kITSin)) return kFALSE;
561 
562  if(fProdUseAODFilterBit && !trk->TestFilterMask(BIT(4))) return kFALSE;
563  // if(!fAnalCuts->IsDaughterSelected(trk,fV1,esdTrackCuts)) return kFALSE;
564  if(fabs(trk->Eta())>fProdTrackEtaRange) return kFALSE;
565  if(trk->Pt()<fPtMinPiFromXic0) return kFALSE;
566 
567  return kTRUE;
568 }
569 //________________________________________________________________________
571 {
572  // Single track cuts for primary bachelor pion
573 
574  // Filter Bit Cut
575  if(fProdUseAODFilterBit && !trk->TestFilterMask(BIT(4))) return kFALSE;
576 
577  // Kinematic Cuts & Acceptance
578  if ( trk->Pt()<=fPtMinPiFromXic0 || trk->Pt()>=100.0 ) return kFALSE;
579  if ( TMath::Abs(trk->Eta()) >= 0.8 ) return kFALSE;
580 
581  // Track Selection Cuts (TPC)
582  if ( trk->GetTPCNcls() <= 70 ) return kFALSE;
583  if ( trk->GetTPCNCrossedRows() <= 70 ) return kFALSE;
584  if ( trk->GetTPCNclsF()==0 ) return kFALSE;
585  if ( static_cast<Double_t>(trk->GetTPCNCrossedRows())/static_cast<Double_t>(trk->GetTPCNclsF()) <= 0.8 ) return kFALSE;
586  if ( trk->GetTPCsignalN() <= 50 ) return kFALSE; // number of points used for TPC dE/dx
587  if ( trk->Chi2perNDF() >= 5) return kFALSE;
588 
589  // Track Selection Cuts (ITS)
590  if ( trk->GetITSNcls() <= 3 ) return kFALSE;//require at least 4 or 5
591 // if (!trk->HasPointOnITSLayer(0)) return kFALSE;
592 // if (!trk->HasPointOnITSLayer(1)) return kFALSE;
593 
594  // PID
595 // Double_t nsigmaTPC = fPIDResponse->NumberOfSigmasTPC(trk, AliPID::kPion);
596 // if (TMath::Abs(nsigmaTPC) > 3) return kFALSE;
597  if(fUseXic0PID) {
598  if(fPidObjPiFromXic0->GetPidResponse()==0x0){
599  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
600  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
601  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
603  }
604  Int_t isPion = fPidObjPiFromXic0->MakeRawPid(trk, 2);
605  if (isPion<1) return kFALSE;
606  }
607 
608  return kTRUE;
609 }
610 
611 //________________________________________________________________________
613 {
614  // Single track cuts for secondary pion
615 
616  // Filter Bit Cut
617  if(fProdUseAODFilterBit && !trk->TestFilterMask(BIT(0))) return kFALSE;
618 
619  // Kinematic Cuts & Acceptance
620  if ( trk->Pt()<=fPtMinPiFromXi || trk->Pt()>=100.0 ) return kFALSE;
621  if ( TMath::Abs(trk->Eta()) >= 0.8 ) return kFALSE;
622 
623  // Track Selection Cuts (TPC)
624  if ( trk->GetTPCNcls() <= 70 ) return kFALSE;
625  if ( trk->GetTPCNCrossedRows() <= 70 ) return kFALSE;
626  if ( trk->GetTPCNclsF()==0 ) return kFALSE;
627  if ( static_cast<Double_t>(trk->GetTPCNCrossedRows())/static_cast<Double_t>(trk->GetTPCNclsF()) <= 0.8 ) return kFALSE;
628  if ( trk->GetTPCsignalN() <= 50 ) return kFALSE;
629 // if ( trk->Chi2perNDF() >= 5) return kFALSE;
630 
631  // PID
632 // Double_t nsigmaTPC = fPIDResponse->NumberOfSigmasTPC(trk, AliPID::kPion);
633 // if (TMath::Abs(nsigmaTPC) > 3) return kFALSE;
634  if(fUseXic0PID) {
635  if(fPidObjPiFromXi->GetPidResponse()==0x0){
636  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
637  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
638  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
640  }
641  Int_t isPion = fPidObjPiFromXi->MakeRawPid(trk, 2);
642  if (isPion<1) return kFALSE;
643  }
644 
645  return kTRUE;
646 
647 }
648 
649 //________________________________________________________________________
651 {
652  if ( !trk ) return kFALSE;
653  if ( trk->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin ) return kFALSE;
654  if(fUseXic0PID) {
655  if(fPidObjPiFromXi->GetPidResponse()==0x0){
656  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
657  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
658  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
660  }
661  Int_t isPion = fPidObjPiFromXi->MakeRawPid(trk, 2);
662  if (isPion<1) return kFALSE;
663  }
664  return kTRUE;
665 }
666 
667 //________________________________________________________________________
669 {
670  // Single V0 cut for all lambda candidates
671 
672  if (!v0) return kFALSE;
673 
674  if (v0->Charge()!=0 || v0->GetNDaughters()!=2) return kFALSE;
675 
676  AliAODTrack *trackP = (AliAODTrack*) (v0->GetDaughter(0));
677  AliAODTrack *trackN = (AliAODTrack*) (v0->GetDaughter(1));
678 
679  if ( !trackP || !trackN ) return kFALSE;
680 
681  // daughter tracks eta cut
682  if ( TMath::Abs(trackP->Eta()) >= 0.8 || TMath::Abs(trackN->Eta()) >= 0.8 ) return kFALSE;
683 
684  Int_t chargeSumDau = trackP->Charge() + trackN->Charge();
685  if (chargeSumDau!=0) return kFALSE;
686 
687  if ( trackP->Charge()<0 ) {
688  trackP = (AliAODTrack*)v0->GetDaughter(1);
689  trackN = (AliAODTrack*)v0->GetDaughter(0);
690  }
691 
692  // if fProdCascNTPCClustersMin==0, do not cut anything
693 // if ( trackP->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin ) return kFALSE;
694 // if ( trackN->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin ) return kFALSE;
695 
696  // Track Selection Cuts (TPC)
697  if ( trackP->GetTPCNcls() <= 70 ) return kFALSE;
698  if ( trackP->GetTPCNCrossedRows() <= 70 ) return kFALSE;
699  if ( trackP->GetTPCNclsF()==0 ) return kFALSE;
700  if ( static_cast<Double_t>(trackP->GetTPCNCrossedRows())/static_cast<Double_t>(trackP->GetTPCNclsF()) <= 0.8) return kFALSE;
701  if ( trackP->GetTPCsignalN() <= 50 ) return kFALSE;
702 // if ( trackP->Chi2perNDF() >= 5) return kFALSE;
703 
704  if ( trackN->GetTPCNcls() <= 70 ) return kFALSE;
705  if ( trackN->GetTPCNCrossedRows() <= 70 ) return kFALSE;
706  if ( trackN->GetTPCNclsF()==0 ) return kFALSE;
707  if ( static_cast<Double_t>(trackN->GetTPCNCrossedRows())/static_cast<Double_t>(trackN->GetTPCNclsF()) <= 0.8) return kFALSE;
708  if ( trackN->GetTPCsignalN() <= 50 ) return kFALSE;
709 // if ( trackN->Chi2perNDF() >= 5) return kFALSE;
710 
711 /*
712  if ( (trackP->GetTPCchi2() > fProdChi2TPCV0PrMax) || (trackN->GetTPCchi2() > fProdChi2TPCV0PiMax) ) return kFALSE;
713  if ( (trackP->GetTPCchi2() > fProdChi2TPCV0PiMax) || (trackN->GetTPCchi2() > fProdChi2TPCV0PrMax) ) return kFALSE;
714 */
715 // if ( (v0->DcaPosToPrimVertex() < fProdDcaV0PrToPrimVertexMin) || (v0->DcaPosToPrimVertex() < fProdDcaV0PiToPrimVertexMin) ) return kFALSE;
716 // if ( (v0->DcaNegToPrimVertex() < fProdDcaV0PiToPrimVertexMin) || (v0->DcaNegToPrimVertex() < fProdDcaV0PrToPrimVertexMin) ) return kFALSE;
717 
718 // Double_t RadiusV0 = TMath::Sqrt(v0->DecayVertexV0X()*v0->DecayVertexV0X()+v0->DecayVertexV0Y()*v0->DecayVertexV0Y());
719 // if ( v0->RadiusV0() < fProdRfidMinV0 || v0->RadiusV0() > fProdRfidMaxV0 ) return kFALSE;
720 
721 // if ( v0->Chi2V0()>5. ) return kFALSE;
722 
723 // if ( v0->DcaV0ToPrimVertex() < fProdDcaV0ToPrimVertexMin ) return kFALSE;
724 
725 // if ( v0->DcaV0Daughters() > fProdDcaV0DaughtersMax ) return kFALSE;
726 
727  if (fUseXic0PID) {
728  if (fPidObjPrFromV0->GetPidResponse()==0x0) {
729  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
730  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
731  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
733  }
734  if (fPidObjPiFromV0->GetPidResponse()==0x0) {
735  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
736  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
737  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
739  }
740  Int_t isProton = fPidObjPrFromV0->MakeRawPid(trackP,4);
741  Int_t isPion = fPidObjPiFromV0->MakeRawPid(trackN,2);
742  Int_t isAntiProton = fPidObjPrFromV0->MakeRawPid(trackN,4);
743  Int_t isAntiPion = fPidObjPiFromV0->MakeRawPid(trackP,2);
744  if( (isProton<1 || isPion<1) && (isAntiProton<1 || isAntiPion<1) ) return kFALSE;
745  }
746 
747  return kTRUE;
748 
749 }
750 
751 //________________________________________________________________________
753 {
754  // Single Cascade Cut
755 
756  if (!casc) return kFALSE;
757 
758  AliAODTrack *ptrack = (AliAODTrack*) (casc->GetDaughter(0));
759  AliAODTrack *ntrack = (AliAODTrack*) (casc->GetDaughter(1));
760  AliAODTrack *btrack = (AliAODTrack*) (casc->GetDecayVertexXi()->GetDaughter(0));
761 
762  if (!ptrack||!ntrack||!btrack) return kFALSE;
763 
764  // check charge of v0
765  Int_t Charge_V0 = ptrack->Charge() + ntrack->Charge();
766  if ( Charge_V0!=0 ) return kFALSE;
767 
768  // check charge of the first daughter, if negative, define it as the second one
769  if ( ptrack->Charge()<0 ) {
770  ptrack = (AliAODTrack*) (casc->GetDaughter(1));
771  ntrack = (AliAODTrack*) (casc->GetDaughter(0));
772  }
773 
774  // v0 daughter tracks eta cut
775  if ( TMath::Abs(ptrack->Eta()) >= 0.8 || TMath::Abs(ntrack->Eta()) >= 0.8 ) return kFALSE;
776 
777  // Track Selection Cuts (TPC)
778  if ( ptrack->GetTPCNcls() <= 70 ) return kFALSE;
779  if ( ptrack->GetTPCNCrossedRows() <= 70 ) return kFALSE;
780  if ( ptrack->GetTPCNclsF()==0 ) return kFALSE;
781  if ( static_cast<Double_t>(ptrack->GetTPCNCrossedRows())/static_cast<Double_t>(ptrack->GetTPCNclsF()) <= 0.8) return kFALSE;
782  if ( ptrack->GetTPCsignalN() <= 50 ) return kFALSE;
783 // if ( ptrack->Chi2perNDF() >= 5) return kFALSE;
784 
785  if ( ntrack->GetTPCNcls() <= 70 ) return kFALSE;
786  if ( ntrack->GetTPCNCrossedRows() <= 70 ) return kFALSE;
787  if ( ntrack->GetTPCNclsF()==0 ) return kFALSE;
788  if ( static_cast<Double_t>(ntrack->GetTPCNCrossedRows())/static_cast<Double_t>(ntrack->GetTPCNclsF()) <= 0.8) return kFALSE;
789  if ( ntrack->GetTPCsignalN() <= 50 ) return kFALSE;
790 // if ( ntrack->Chi2perNDF() >= 5) return kFALSE;
791 
792 /*
793  if ( (ptrack->GetTPCchi2() > fProdChi2TPCV0PrMax) || (ntrack->GetTPCchi2() > fProdChi2TPCV0PiMax) ) return kFALSE;
794  if ( (ptrack->GetTPCchi2() > fProdChi2TPCV0PiMax) || (ntrack->GetTPCchi2() > fProdChi2TPCV0PrMax) ) return kFALSE;
795 */
796 // if ( (v0->DcaPosToPrimVertex() < fProdDcaV0PrToPrimVertexMin) || (v0->DcaPosToPrimVertex() < fProdDcaV0PiToPrimVertexMin) ) return kFALSE;
797 // if ( (v0->DcaNegToPrimVertex() < fProdDcaV0PiToPrimVertexMin) || (v0->DcaNegToPrimVertex() < fProdDcaV0PrToPrimVertexMin) ) return kFALSE;
798 
799 // Double_t RadiusV0 = TMath::Sqrt(v0->DecayVertexV0X()*v0->DecayVertexV0X()+v0->DecayVertexV0Y()*v0->DecayVertexV0Y());
800 // if ( v0->RadiusV0() < fProdRfidMinV0 || v0->RadiusV0() > fProdRfidMaxV0 ) return kFALSE;
801 
802 // if ( v0->Chi2V0()>5. ) return kFALSE;
803 
804 // if ( v0->DcaV0ToPrimVertex() < fProdDcaV0ToPrimVertexMin ) return kFALSE;
805 
806 // if ( v0->DcaV0Daughters() > fProdDcaV0DaughtersMax ) return kFALSE;
807 
808 
809 
810 // === selection for bachlor ===
811  // Kinematic Cuts & Acceptance for the bachelor
812  if ( btrack->Pt()<=fPtMinPiFromXi || btrack->Pt()>=100.0 ) return kFALSE;
813  if ( TMath::Abs(btrack->Eta()) >= 0.8 ) return kFALSE;
814 
815  // Track Selection Cuts (TPC)
816  if ( btrack->GetTPCNcls() <= 70 ) return kFALSE;
817  if ( btrack->GetTPCNCrossedRows() <= 70 ) return kFALSE;
818  if ( btrack->GetTPCNclsF()==0 ) return kFALSE;
819  if ( static_cast<Double_t>(btrack->GetTPCNCrossedRows())/static_cast<Double_t>(btrack->GetTPCNclsF()) <= 0.8 ) return kFALSE;
820  if ( btrack->GetTPCsignalN() <= 50 ) return kFALSE;
821 // if ( btrack->Chi2perNDF() >= 5) return kFALSE;
822 // ==============================
823 
824 
825  // PID
826 // Double_t nsigmaTPC = fPIDResponse->NumberOfSigmasTPC(trk, AliPID::kPion);
827 // if (TMath::Abs(nsigmaTPC) > 3) return kFALSE;
828 
829  if (fUseXic0PID) {
830  if(fPidObjPiFromXi->GetPidResponse()==0x0){
831  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
832  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
833  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
835  }
836  if (fPidObjPrFromV0->GetPidResponse()==0x0) {
837  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
838  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
839  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
841  }
842  if (fPidObjPiFromV0->GetPidResponse()==0x0) {
843  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
844  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
845  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
847  }
848  Int_t isPion2 = fPidObjPiFromXi->MakeRawPid(btrack, 2);
849  if (isPion2<1) return kFALSE;
850 
851  Int_t isProton = fPidObjPrFromV0->MakeRawPid(ptrack,4); // proton
852  Int_t isPion = fPidObjPiFromV0->MakeRawPid(ntrack,2); // pion
853  Int_t isAntiProton = fPidObjPrFromV0->MakeRawPid(ntrack,4);
854  Int_t isAntiPion = fPidObjPiFromV0->MakeRawPid(ptrack,2);
855 
856  if ( btrack->Charge()<0 ) { // Bachlor is pion
857  if ( isProton<1 || isPion<1 ) return kFALSE;
858  }
859  else { // Bachlor is anti-pion
860  if ( isAntiProton<1 || isAntiPion<1 ) return kFALSE;
861  }
862 // if( (isProton<1 || isPion<1) && (isAntiProton<1 || isAntiPion<1) ) return kFALSE;
863  }
864 
865  return kTRUE;
866 
867 }
868 
869 //________________________________________________________________________
871 {
872 
873  if (!v0) return kFALSE;
874  if (v0->GetNDaughters()!=2) return kFALSE;
875 
876  AliAODTrack *trackP = (AliAODTrack*) (v0->GetDaughter(0));
877  AliAODTrack *trackN = (AliAODTrack*) (v0->GetDaughter(1));
878 
879  if ( !trackP || !trackN ) return kFALSE;
880 
881  if ( trackP->Charge()<0 ) {
882  trackP = (AliAODTrack*)v0->GetDaughter(1);
883  trackN = (AliAODTrack*)v0->GetDaughter(0);
884  }
885 
886  if (fUseXic0PID) {
887  if (fPidObjPrFromV0->GetPidResponse()==0x0) {
888  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
889  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
890  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
892  }
893  if (fPidObjPiFromV0->GetPidResponse()==0x0) {
894  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
895  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
896  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
898  }
899  Int_t isProton = fPidObjPrFromV0->MakeRawPid(trackP,4);
900  Int_t isPion = fPidObjPiFromV0->MakeRawPid(trackN,2);
901  if( isProton<1 || isPion<1 ) return kFALSE;
902  }
903 
904  return kTRUE;
905 }
906 
907 //________________________________________________________________________
909 {
910 
911  if (!v0) return kFALSE;
912  if (v0->GetNDaughters()!=2) return kFALSE;
913 
914  AliAODTrack *trackP = (AliAODTrack*) (v0->GetDaughter(0));
915  AliAODTrack *trackN = (AliAODTrack*) (v0->GetDaughter(1));
916 
917  if ( !trackP || !trackN ) return kFALSE;
918 
919  if ( trackP->Charge()<0 ) {
920  trackP = (AliAODTrack*)v0->GetDaughter(1);
921  trackN = (AliAODTrack*)v0->GetDaughter(0);
922  }
923 
924  if (fUseXic0PID) {
925  if (fPidObjPrFromV0->GetPidResponse()==0x0) {
926  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
927  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
928  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
930  }
931  if (fPidObjPiFromV0->GetPidResponse()==0x0) {
932  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
933  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
934  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
936  }
937  Int_t isAntiProton = fPidObjPrFromV0->MakeRawPid(trackN,4);
938  Int_t isAntiPion = fPidObjPiFromV0->MakeRawPid(trackP,2);
939  if( isAntiProton<1 || isAntiPion<1 ) return kFALSE;
940  }
941 
942  return kTRUE;
943 }
944 
945 //________________________________________________________________________
946 Bool_t AliRDHFCutsKFP::SingleCascadeCuts(AliAODcascade *casc,Double_t *primvert, Bool_t anaOmegacZero)
947 {
948  //
949  // Single Cascade Cut
950  //
951 
952  if(!casc) return kFALSE;
953 
954  AliAODTrack *ptrack = (AliAODTrack*) (casc->GetDaughter(0));
955  AliAODTrack *ntrack = (AliAODTrack*) (casc->GetDaughter(1));
956  AliAODTrack *btrack = (AliAODTrack*) (casc->GetDecayVertexXi()->GetDaughter(0));
957 
958  if(!ptrack||!ntrack||!btrack) return kFALSE;
959 
960  if(ptrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
961  if(ntrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
962  if(btrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
963 
964 
965  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
966  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
967  Double_t momegaPDG = TDatabasePDG::Instance()->GetParticle(3334)->Mass();
968 
969  Double_t massLambda = casc->MassLambda();
970  Double_t massAntiLambda = casc->MassAntiLambda();
971  if(TMath::Abs(massLambda-mLPDG)>fProdMassTolLambda && TMath::Abs(massAntiLambda-mLPDG)>fProdMassTolLambda)
972  return kFALSE;
973 
974  Bool_t isparticle = kTRUE;
975  if(TMath::Abs(massAntiLambda-mLPDG)<fProdMassTolLambda) isparticle = kFALSE;
976 
977  Double_t massXi = casc->MassXi();
978  Double_t massOmega = casc->MassOmega();
979  if(TMath::Abs(massXi-mxiPDG)>fProdMassTolXi)
980  return kFALSE;
981  if(TMath::Abs(massOmega-momegaPDG)>fProdMassTolOmega)
982  return kFALSE;
983 
984  if(TMath::Abs(massOmega-momegaPDG)<fProdMassRejOmega)
985  return kFALSE;
986 
987  Double_t lPosXi[3];
988  lPosXi[0] = casc->DecayVertexXiX();
989  lPosXi[1] = casc->DecayVertexXiY();
990  lPosXi[2] = casc->DecayVertexXiZ();
991  Double_t decayvertXi = TMath::Sqrt(lPosXi[0]*lPosXi[0]+lPosXi[1]*lPosXi[1]);
992  Double_t lPosV0[3];
993  lPosV0[0] = casc->DecayVertexV0X();
994  lPosV0[1] = casc->DecayVertexV0Y();
995  lPosV0[2] = casc->DecayVertexV0Z();
996  Double_t decayvertV0 = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
997 
998  if(decayvertV0<fProdRfidMinV0 || decayvertV0>fProdRfidMaxV0) return kFALSE;
999  if(decayvertXi<fProdRfidMinXi || decayvertXi>fProdRfidMaxXi) return kFALSE;
1000 
1001  Double_t ptotxi = TMath::Sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)+pow(casc->MomXiZ(),2));
1002  Double_t properdl = casc->DecayLengthXi(primvert[0],primvert[1],primvert[2])*mxiPDG/ptotxi;
1003  if(properdl>fProdCascProperDecayLengthMax) return kFALSE;
1004 
1005  Double_t lDcaXiDaughters = casc->DcaXiDaughters();
1006  Double_t lDcaV0Daughters = casc->DcaV0Daughters();
1007  if(lDcaXiDaughters > fProdDcaXiDaughtersMax) return kFALSE;
1008  if(lDcaV0Daughters > fProdDcaV0DaughtersMax) return kFALSE;
1009 
1010  Double_t lDcaBachToPrimVertex = casc->DcaBachToPrimVertex();
1011  Double_t lDcaV0ToPrimVertex = casc->DcaV0ToPrimVertex();
1012  Double_t lDcaPosToPrimVertex = casc->DcaPosToPrimVertex();
1013  Double_t lDcaNegToPrimVertex = casc->DcaNegToPrimVertex();
1014  if(lDcaBachToPrimVertex < fProdDcaBachToPrimVertexMin) return kFALSE;
1015  if(lDcaV0ToPrimVertex < fProdDcaV0ToPrimVertexMin) return kFALSE;
1016  if(isparticle){
1017  if(lDcaPosToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
1018  if(lDcaNegToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
1019  }else{
1020  if(lDcaPosToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
1021  if(lDcaNegToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
1022  }
1023 
1024  Double_t lXiCosineOfPointingAngle = casc->CosPointingAngleXi(primvert[0],primvert[1],primvert[2]);
1025  Double_t lV0CosineOfPointingAngleXi = casc->CosPointingAngle(lPosXi);
1026 
1027  if(lXiCosineOfPointingAngle < fProdXiCosineOfPoiningAngleMin) return kFALSE;
1028  if(lV0CosineOfPointingAngleXi < fProdV0CosineOfPoiningAngleXiMin) return kFALSE;
1029 
1030  if(fUseXic0PID)
1031  {
1032  if(fPidObjPiFromXi->GetPidResponse()==0x0){
1033  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
1034  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
1035  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
1036  fPidObjPiFromXi->SetPidResponse(pidResp);
1037  }
1038  if(anaOmegacZero && fPidObjKaFromOmega->GetPidResponse()==0x0){
1039  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
1040  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
1041  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
1043  }
1044  if(isparticle){
1045  if (!anaOmegacZero) {
1046  Int_t isPion1 =fPidObjPiFromXi->MakeRawPid(btrack,2);
1047  if(isPion1<1) return kFALSE;
1048  }
1049  if (anaOmegacZero) {
1050  Int_t isKaon =fPidObjKaFromOmega->MakeRawPid(btrack,3);
1051  if(isKaon<1) return kFALSE;
1052  }
1053  Int_t isPion2 =fPidObjPiFromXi->MakeRawPid(ntrack,2);
1054  if(isPion2<1) return kFALSE;
1055  }else{
1056  if (!anaOmegacZero) {
1057  Int_t isPion1 =fPidObjPiFromXi->MakeRawPid(btrack,2);
1058  if(isPion1<1) return kFALSE;
1059  }
1060  if (anaOmegacZero) {
1061  Int_t isKaon =fPidObjKaFromOmega->MakeRawPid(btrack,3);
1062  if(isKaon<1) return kFALSE;
1063  }
1064  Int_t isPion2 =fPidObjPiFromXi->MakeRawPid(ptrack,2);
1065  if(isPion2<1) return kFALSE;
1066  }
1067  }
1068 
1069 
1070  return kTRUE;
1071 }
1072 //________________________________________________________________________
1073 Bool_t AliRDHFCutsKFP::SingleCascadeCutsRef(AliAODcascade *casc, Double_t *primvert, Bool_t anaOmegacZero)
1074 {
1075  //
1076  // Single Cascade Cut (without Xi mass selection)
1077  // Kinematical cut is applied to compare with cascade analysis note
1078  //
1079 
1080  if(!casc) return kFALSE;
1081 
1082  AliAODTrack *ptrack = (AliAODTrack*) (casc->GetDaughter(0));
1083  AliAODTrack *ntrack = (AliAODTrack*) (casc->GetDaughter(1));
1084  AliAODTrack *btrack = (AliAODTrack*) (casc->GetDecayVertexXi()->GetDaughter(0));
1085 
1086  if(!ptrack||!ntrack||!btrack) return kFALSE;
1087 
1088  //Kinematical cut
1089  //if(TMath::Abs(ptrack->Eta())>0.8) return kFALSE;
1090  //if(TMath::Abs(ntrack->Eta())>0.8) return kFALSE;
1091  //if(TMath::Abs(btrack->Eta())>0.8) return kFALSE;
1092  //if(casc->RapXi()<-0.5) return kFALSE;
1093  //if(casc->RapXi()>0.0) return kFALSE;
1094 
1095  if(ptrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
1096  if(ntrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
1097  if(btrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
1098 
1099  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
1100  Double_t momegaPDG = TDatabasePDG::Instance()->GetParticle(3334)->Mass();
1101  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
1102 
1103  Double_t massXi = casc->MassXi();
1104  Double_t massOmega = casc->MassOmega();
1105  if(TMath::Abs(massOmega-momegaPDG)<fProdMassRejOmega)
1106  return kFALSE;
1107 
1108 
1109  Double_t massLambda = casc->MassLambda();
1110  Double_t massAntiLambda = casc->MassAntiLambda();
1111  if(TMath::Abs(massLambda-mLPDG)>fProdMassTolLambda && TMath::Abs(massAntiLambda-mLPDG)>fProdMassTolLambda)
1112  return kFALSE;
1113 
1114  Bool_t isparticle = kTRUE;
1115  if(TMath::Abs(massAntiLambda-mLPDG)<fProdMassTolLambda) isparticle = kFALSE;
1116 
1117  Double_t lPosXi[3];
1118  lPosXi[0] = casc->DecayVertexXiX();
1119  lPosXi[1] = casc->DecayVertexXiY();
1120  lPosXi[2] = casc->DecayVertexXiZ();
1121  Double_t decayvertXi = TMath::Sqrt(lPosXi[0]*lPosXi[0]+lPosXi[1]*lPosXi[1]);
1122  Double_t lPosV0[3];
1123  lPosV0[0] = casc->DecayVertexV0X();
1124  lPosV0[1] = casc->DecayVertexV0Y();
1125  lPosV0[2] = casc->DecayVertexV0Z();
1126  Double_t decayvertV0 = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1127 
1128  if(decayvertV0<fProdRfidMinV0 || decayvertV0>fProdRfidMaxV0) return kFALSE;
1129  if(decayvertXi<fProdRfidMinXi || decayvertXi>fProdRfidMaxXi) return kFALSE;
1130 
1131  Double_t ptotxi = TMath::Sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)+pow(casc->MomXiZ(),2));
1132  Double_t properdl = casc->DecayLengthXi(primvert[0],primvert[1],primvert[2])*mxiPDG/ptotxi;
1133  if(properdl>fProdCascProperDecayLengthMax) return kFALSE;
1134 
1135  Double_t lDcaXiDaughters = casc->DcaXiDaughters();
1136  Double_t lDcaV0Daughters = casc->DcaV0Daughters();
1137  if(lDcaXiDaughters > fProdDcaXiDaughtersMax) return kFALSE;
1138  if(lDcaV0Daughters > fProdDcaV0DaughtersMax) return kFALSE;
1139 
1140  Double_t lDcaBachToPrimVertex = casc->DcaBachToPrimVertex();
1141  Double_t lDcaV0ToPrimVertex = casc->DcaV0ToPrimVertex();
1142  Double_t lDcaPosToPrimVertex = casc->DcaPosToPrimVertex();
1143  Double_t lDcaNegToPrimVertex = casc->DcaNegToPrimVertex();
1144  if(lDcaBachToPrimVertex < fProdDcaBachToPrimVertexMin) return kFALSE;
1145  if(lDcaV0ToPrimVertex < fProdDcaV0ToPrimVertexMin) return kFALSE;
1146  if(isparticle){
1147  if(lDcaPosToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
1148  if(lDcaNegToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
1149  }else{
1150  if(lDcaPosToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
1151  if(lDcaNegToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
1152  }
1153 
1154  Double_t lXiCosineOfPointingAngle = casc->CosPointingAngleXi(primvert[0],primvert[1],primvert[2]);
1155  Double_t lV0CosineOfPointingAngleXi = casc->CosPointingAngle(lPosXi);
1156 
1157  if(lXiCosineOfPointingAngle < fProdXiCosineOfPoiningAngleMin) return kFALSE;
1158  if(lV0CosineOfPointingAngleXi < fProdV0CosineOfPoiningAngleXiMin) return kFALSE;
1159 
1160  if(fUseXic0PID)
1161  {
1162  if(fPidObjPiFromXi->GetPidResponse()==0x0){
1163  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
1164  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
1165  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
1166  fPidObjPiFromXi->SetPidResponse(pidResp);
1167  }
1168  if(anaOmegacZero && fPidObjKaFromOmega->GetPidResponse()==0x0){
1169  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
1170  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
1171  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
1173  }
1174  if(isparticle){
1175  if (!anaOmegacZero) {
1176  Int_t isPion1 =fPidObjPiFromXi->MakeRawPid(btrack,2);
1177  if(isPion1<1) return kFALSE;
1178  }
1179  if (anaOmegacZero) {
1180  Int_t isKaon =fPidObjKaFromOmega->MakeRawPid(btrack,3);
1181  if(isKaon<1) return kFALSE;
1182  }
1183  Int_t isPion2 =fPidObjPiFromXi->MakeRawPid(ntrack,2);
1184  if(isPion2<1) return kFALSE;
1185  }else{
1186  if (!anaOmegacZero) {
1187  Int_t isPion1 =fPidObjPiFromXi->MakeRawPid(btrack,2);
1188  if(isPion1<1) return kFALSE;
1189  }
1190  if (anaOmegacZero) {
1191  Int_t isKaon =fPidObjKaFromOmega->MakeRawPid(btrack,3);
1192  if(isKaon<1) return kFALSE;
1193  }
1194  Int_t isPion2 =fPidObjPiFromXi->MakeRawPid(ptrack,2);
1195  if(isPion2<1) return kFALSE;
1196  }
1197  }
1198 
1199  return kTRUE;
1200 }
1201 //________________________________________________________________________
1202 Bool_t AliRDHFCutsKFP::SelectWithRoughCuts(AliAODcascade *casc, AliAODTrack *part1)
1203 {
1204  //
1205  // Select With Rough mass and pT cut before object creation
1206  //
1207 
1208  //Constants
1209  Double_t mpiPDG = TDatabasePDG::Instance()->GetParticle(211)->Mass();
1210  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
1211  Double_t mxicPDG = TDatabasePDG::Instance()->GetParticle(4232)->Mass();
1212 
1213  Double_t pxpi1_init = part1->Px();
1214  Double_t pypi1_init = part1->Py();
1215  Double_t pzpi1_init = part1->Pz();
1216  Double_t Epi1_init = sqrt(pxpi1_init*pxpi1_init+pypi1_init*pypi1_init+pzpi1_init*pzpi1_init+mpiPDG*mpiPDG);
1217  //Double_t pxpi2_init = part2->Px();
1218  //Double_t pypi2_init = part2->Py();
1219  //Double_t pzpi2_init = part2->Pz();
1220  //Double_t Epi2_init = sqrt(pxpi2_init*pxpi2_init+pypi2_init*pypi2_init+pzpi2_init*pzpi2_init+mpiPDG*mpiPDG);
1221  Double_t pxcasc_init = casc->MomXiX();
1222  Double_t pycasc_init = casc->MomXiY();
1223  Double_t pzcasc_init = casc->MomXiZ();
1224  Double_t Ecasc_init = sqrt(pxcasc_init*pxcasc_init+pycasc_init*pycasc_init+pzcasc_init*pzcasc_init+mxiPDG*mxiPDG);
1225  // Double_t pxxic_init = pxpi1_init+pxpi2_init+pxcasc_init;
1226  //Double_t pyxic_init = pypi1_init+pypi2_init+pycasc_init;
1227  //Double_t pzxic_init = pzpi1_init+pzpi2_init+pzcasc_init;
1228  //Double_t Exic_init = Epi1_init+Epi2_init+Ecasc_init;
1229  //Double_t xicmass_init = sqrt(Exic_init*Exic_init-pxxic_init*pxxic_init-pyxic_init*pyxic_init-pzxic_init*pzxic_init);
1230 
1231  //if(xicmass_init<mxicPDG-fProdRoughMassTol || xicmass_init>mxicPDG+fProdRoughMassTol) return kFALSE;
1232  //if(sqrt(pxxic_init*pxxic_init+pyxic_init*pyxic_init)<fProdRoughPtMin) return kFALSE;
1233 
1234  return kTRUE;
1235 }
1236 
Double_t fProdRfidMinXi
Max Decay vertex of V0.
Double_t InvMassPiXiPi() const
Xic invariant mass.
Int_t PtBin(Float_t pt) const
Definition: AliRDHFCuts.h:330
AliAODTrack * GetBachelor2() const
double Double_t
Definition: External.C:58
Double_t fProdChi2TPCV0PiMax
Max. chi2 of TPC clusters for v0-proton.
Double_t fProdV0CosineOfPoiningAngleXiMin
Min Xi cos pointing angle to PV.
Bool_t SelectWithRoughCuts(AliAODcascade *casc, AliAODTrack *trk1)
Bool_t SinglePionPoolCuts(AliAODTrack *trk)
Double_t fProdMassTolXic0
Tolerance of Xi mass from PDG value.
Double_t fKFPLam_lDeltalMin
chi2/ndf cut of lambda reconstruction from KFParticle
Bool_t GetUseCombined()
Definition: AliAODPidHF.h:178
Bool_t SingleCascCuts(AliAODcascade *casc)
Double_t fProdMassTolOmega
Tolerance of Xic0 mass from PDG value.
Bool_t LambdaPIDCuts(AliAODv0 *v0)
Double_t fProdCascProperDecayLengthMax
Max Decay vertex of Xi.
Double_t fProdMassTolLambda
Use AODfilterBit or not.
Bool_t fProdUseAODFilterBit
Bachelor Eta range.
void SetNVars(Int_t nVars)
Definition: AliRDHFCuts.h:445
Double_t fProdRoughMassTol
Maximum DCA of pions.
Double_t fProdXiCosineOfPoiningAngleMin
Min Dca between v0-pion and PV.
AliRDHFCuts & operator=(const AliRDHFCuts &source)
Double_t fProdDcaV0DaughtersMax
Max Dca between Xi daughters.
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
Bool_t fUsePID
Definition: AliRDHFCuts.h:476
AliAODPidHF * fPidObjPrFromV0
PID object for cascade-kaon.
Double_t fProdMassRejOmega
Tolerance of Omega mass from PDG value.
Double_t fProdRoughPtMin
Tolerance of Xic mass from PDG value.
Double_t fProdDcaV0ToPrimVertexMin
Min Dca between Bachelor and PV.
Double_t fPtMinPiFromXi
Minimum Bachelor pT of pion from Xic0 decay.
Double_t fCombinedPIDThreshold
PID Strategy.
Double_t fKFPLam_Chi2geoMax
Minimum pT of Xic.
Bool_t SingleCascadeCuts(AliAODcascade *casc, Double_t *vert, Bool_t anaOmegacZero)
Double_t fKFPXi_Chi2geoMax
l/Deltal cut of lambda reconstruction from KFParticle
Bool_t fUseXic0PID
PID threshold used in IsSelectedCombinedPID.
int Int_t
Definition: External.C:63
Int_t fnVarsForOpt
Definition: AliRDHFCuts.h:471
Double_t fPtMinXic0
PID object for V0-pion.
Bool_t AntiLambdaPIDCuts(AliAODv0 *v0)
EPIDStrategy fPIDStrategy
unsigned int UInt_t
Definition: External.C:33
AliPIDCombined * GetPidCombined() const
Definition: AliAODPidHF.h:174
float Float_t
Definition: External.C:68
Double_t fKFPLam_Chi2topoMax
chi2/ndf cut of lambda reconstruction from KFParticle
Bool_t SingleTrkCuts(AliAODTrack *trk)
Double_t fMaxPtCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:500
Bool_t PassedTrackQualityCuts_PrimaryPion(AliAODTrack *trk)
Double_t fProdDcaV0PiToPrimVertexMin
Min Dca between v0-proton and PV.
Double_t fKFPXi_lDeltalMin
chi2/ndf cut of Xi- reconstruction from KFParticle
AliAODTrack * GetBachelor1() const
virtual ~AliRDHFCutsKFP()
Double_t fProdRfidMinV0
Rejection range of Omega mass from PDG value.
Int_t MakeRawPid(AliAODTrack *track, Int_t specie)
AliPIDResponse * GetPidResponse() const
Definition: AliAODPidHF.h:173
Double_t fProdTrackEtaRange
Minimum Bachelor pT of pion from Xi decay.
Float_t * fCutsRD
fnVars*fnPtBins
Definition: AliRDHFCuts.h:474
void GetDCAs(Double_t dca[3]) const
AliAODPidHF * fPidObjPiFromXic0
Use PID or not.
Double_t GetPionProbabilityTPCTOF(AliAODTrack *trk)
AliAODPidHF * fPidObjPiFromXi
PID object for Xic0-pion.
void SetVarsForOpt(Int_t nVars, Bool_t *forOpt)
Double_t DecayLengthXY() const
Int_t IsSelectedCombinedPID(AliAODRecoDecayHF *obj)
void SetVarNames(Int_t nVars, TString *varNames, Bool_t *isUpperCut)
Bool_t * fVarsForOpt
number of cut vars to be optimized for candidates
Definition: AliRDHFCuts.h:472
Double_t fKFPXic0_Chi2geoMax
l/Deltal cut of lambda reconstruction from KFParticle
Double_t fPtMinPiFromXic0
Minimum pT of Xic0.
Double_t fProdDcaXiDaughtersMax
mL/p of cascade
Bool_t SingleV0LambdaTotCuts(AliAODv0 *v0)
Double_t fProdRfidMaxXi
Minimum Decay vertex of Xi.
AliRDHFCutsKFP(const char *name="CutsXicZerotoXiPi")
Double_t fKFPXi_Chi2topoMax
chi2/ndf cut of Xi- reconstruction from KFParticle
Double_t fProdDcaV0PrToPrimVertexMin
Min Dca between v0 and PV.
void SetPtBins(Int_t nPtBinLimits, Float_t *ptBinLimits)
Double_t fProdDcaBachToPrimVertexMin
Max Dca between V0 daughters.
AliAODPidHF * fPidObjKaFromOmega
PID object for cascade-pion.
bool Bool_t
Definition: External.C:53
Bool_t SingleCascadeCutsRef(AliAODcascade *casc, Double_t *vert, Bool_t anaOmegaZero)
virtual void GetCutVarsForOpt(AliAODRecoDecayHF *d, Float_t *vars, Int_t nvars, Int_t *pdgdaughters)
AliAODPidHF * fPidHF
enable AOD049 centrality cleanup
Definition: AliRDHFCuts.h:478
Double_t fProdChi2TPCV0PrMax
Minimum number of TPC clusters.
Double_t fProdCascNTPCClustersMin
Int_t GetGlobalIndex(Int_t iVar, Int_t iPtBin) const
Double_t fMinPtCand
outcome of PID selection
Definition: AliRDHFCuts.h:499
Double_t fProdRfidMaxV0
Minimum Decay vertex of V0.
Double_t fProdLikeSignDcaMax
Max. chi2 of TPC clusters for v0-pion.
Double_t fProdMassTolXi
Tolerance of K0S mass from PDG value.
virtual Int_t IsSelectedPID(AliAODRecoDecayHF *obj)
AliRDHFCutsKFP & operator=(const AliRDHFCutsKFP &source)
void SetPidResponse(AliPIDResponse *pidResp)
Definition: AliAODPidHF.h:124
Bool_t PassedTrackQualityCuts_SecondaryPion(AliAODTrack *trk)
AliAODPidHF * fPidObjPiFromV0
PID object for V0-proton.