AliPhysics  master (3d17d9d)
AliRDHFCutsXicZerotoXiPifromAODtracks.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->p+K0s
21 //
22 // Modified by Y.S Watanabe - wyosuke@cns.s.u-tokyo.ac.jp
23 // Modified by Jianhui Zhu, zjh@mail.ccnu.edu.cn
24 //
26 
27 #include <Riostream.h>
28 
29 #include <TDatabasePDG.h>
30 #include <TMath.h>
31 
32 #include "AliAnalysisManager.h"
33 #include "AliInputEventHandler.h"
34 #include "AliPIDResponse.h"
37 #include "AliAODTrack.h"
38 #include "AliESDtrack.h"
39 #include "AliESDVertex.h"
40 #include "AliAODVertex.h"
41 #include "AliAODv0.h"
42 #include "AliAODcascade.h"
43 #include "AliESDv0.h"
44 
45 using std::cout;
46 using std::endl;
47 
51 
52 
53 //--------------------------------------------------------------------------
55  AliRDHFCuts(name),
56  fPIDStrategy(kNSigmaCuts),
57  fCombinedPIDThreshold(0.),
58  fUseCascadePID(kFALSE),
59  fPidObjCascPi(0),
60  fPidObjCascPr(0),
61  fPidObjCascKa(0),
62  fProdTrackPtMin(0.),
63  fProdTrackEtaRange(9999.),
64  fProdUseAODFilterBit(kTRUE),
65  fProdMassTolLambda(0.010),
66  fProdMassTolXi(9999.),
67  fProdMassTolOmega(9999.),
68  fProdMassRejOmega(0.000),
69  fProdRfidMinV0(0.6),
70  fProdRfidMaxV0(100.0),
71  fProdRfidMinXi(0.6),
72  fProdRfidMaxXi(100.0),
73  fProdCascProperDecayLengthMax(100.0),
74  fProdDcaXiDaughtersMax(100.),
75  fProdDcaV0DaughtersMax(100.),
76  fProdDcaBachToPrimVertexMin(0.),
77  fProdDcaV0ToPrimVertexMin(0.),
78  fProdDcaV0PrToPrimVertexMin(0.),
79  fProdDcaV0PiToPrimVertexMin(0.),
80  fProdXiCosineOfPoiningAngleMin(-1.),
81  fProdV0CosineOfPoiningAngleXiMin(-1.),
82  fProdCascNTPCClustersMin(0.0),
83  fProdLikeSignDcaMax(2.0),
84  fProdRoughMassTol(0.25),
85  fProdRoughPtMin(0.0)
86 {
87  //
88  // Default Constructor
89  //
90 
91  const Int_t nvars=13;
92  SetNVars(nvars);
93  TString varNames[nvars]={"Xic inv. mass [GeV/c2]", // 0
94  "Xic Pt [GeV/c]", //1
95  "Xi mass Tolrelance [GeV/c2]", //2
96  "Lambda mass Tolrelance [GeV/c2]", //3
97  "Max DCA pi-pi [cm]", //4
98  "Max DCA pi-casc [cm]",//5
99  "Max d0 pi [cm]",//6
100  "Max d0 Xi [cm]",//7
101  "Min d0 Xi-Bach [cm]",//8
102  "Min d0 Xi-V0 [cm]",//9
103  "Min Xic cosPA ",//10
104  "Min DecayLengthXY ",//11
105  "Min Bachelor pT"//12
106  };
107 
108  Bool_t isUpperCut[nvars]={kTRUE, // 0
109  kFALSE, //1
110  kTRUE, //2
111  kTRUE, //3
112  kTRUE, //4
113  kTRUE, //5
114  kTRUE, //6
115  kTRUE, //7
116  kFALSE, //8
117  kFALSE, //9
118  kFALSE, //10
119  kFALSE,//11
120  kFALSE //12
121  };
122  SetVarNames(nvars,varNames,isUpperCut);
123  Bool_t forOpt[nvars]={kFALSE, // 0
124  kFALSE, //1
125  kTRUE, //2
126  kTRUE, //3
127  kTRUE, //4
128  kTRUE, //5
129  kTRUE, //6
130  kTRUE, //7
131  kTRUE, //8
132  kTRUE, //9
133  kTRUE, //10
134  kTRUE, //11
135  kTRUE //12
136  };
137  SetVarsForOpt(nvars,forOpt);
138 
139  Float_t limits[2]={0,999999999.};
140  SetPtBins(2,limits);
141 }
142 
143 //--------------------------------------------------------------------------
145  AliRDHFCuts(source),
146  fPIDStrategy(source.fPIDStrategy),
176 {
177  //
178  // Copy constructor
179  //
180 }
181 
182 //--------------------------------------------------------------------------
184 {
185  //
186  // assignment operator
187  //
188 
189  if (this != &source) {
190  AliRDHFCuts::operator=(source);
191  }
192 
193  fPIDStrategy = source.fPIDStrategy;
196  fPidObjCascPi = source.fPidObjCascPi;
197  fPidObjCascPr = source.fPidObjCascPr;
198  fPidObjCascKa = source.fPidObjCascKa;
222 
223  return *this;
224 }
225 
226 //---------------------------------------------------------------------------
228  //
229  // Default Destructor
230  //
231 }
232 
233 //---------------------------------------------------------------------------
235  //
236  // Fills in vars the values of the variables
237  //
238 
239  if (pdgdaughters[0]==-9999) return; // dummy
240 
242  if(!dd){
243  AliDebug(2," No AliAODRecoCascadeHF3Prong object found\n");
244  return;
245  }
246 
247  if (nvars!=fnVarsForOpt) {
248  AliError("AliRDHFCutsXicZerotoXiPifromAODtracks wrong number of variables\n");
249  return;
250  }
251 
252  //Double_t ptD=d->Pt();
253  //Int_t ptbin=PtBin(ptD);
254  Int_t iter=-1;
255 
256  if(fVarsForOpt[0]){
257  iter++;
258  Double_t mxicPDG = TDatabasePDG::Instance()->GetParticle(4232)->Mass();
259  vars[iter]= TMath::Abs(dd->InvMassPiXiPi()-mxicPDG) ;
260  }
261  if(fVarsForOpt[1]){
262  iter++;
263  vars[iter]= dd->Pt();
264  }
265  if(fVarsForOpt[2]){
266  iter++;
267  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
268  vars[iter]= TMath::Abs(dd->CascMassXi()-mxiPDG);
269  }
270  if(fVarsForOpt[3]){
271  iter++;
272  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
273  vars[iter]= TMath::Abs(dd->CascMassLambda()-mLPDG);
274  }
275  Double_t dca[3];
276  dd->GetDCAs(dca);
277  if(fVarsForOpt[4]){
278  iter++;
279  vars[iter]= dca[2];
280  }
281  if(fVarsForOpt[5]){
282  iter++;
283  vars[iter]= dca[0];
284  }
285  if(fVarsForOpt[6]){
286  iter++;
287  vars[iter]= dd->Getd0Prong(0);
288  }
289  if(fVarsForOpt[7]){
290  iter++;
291  vars[iter]= dd->Getd0Prong(1);
292  }
293  if(fVarsForOpt[8]){
294  iter++;
295  vars[iter]= dd->CascDcaBachToPrimVertex();
296  }
297  if(fVarsForOpt[9]){
298  iter++;
299  vars[iter]= dd->CascDcaV0ToPrimVertex();
300  }
301  if(fVarsForOpt[10]){
302  iter++;
303  vars[iter]= dd->XicCosPointingAngle();
304  }
305  if(fVarsForOpt[11]){
306  iter++;
307  vars[iter]= dd->DecayLengthXY();
308  }
309  if(fVarsForOpt[12]){
310  iter++;
311  vars[iter]= dd->PtProng(0);
312  }
313 
314  return;
315 }
316 //---------------------------------------------------------------------------
318 {
319  //
320  // Apply selection
321  //
322 
323  if (!fCutsRD) {
324  AliFatal("Cut matrice not inizialized. Exit...");
325  return 0;
326  }
327 
329  if(!d){
330  AliDebug(2," No AliAODRecoCascadeHF3Prong object found\n");
331  return 0;
332  }
333 
334  Double_t ptD=d->Pt();
335  if(ptD<fMinPtCand) return 0;
336  if(ptD>fMaxPtCand) return 0;
337 
338  if (selectionLevel==AliRDHFCuts::kAll ||
339  selectionLevel==AliRDHFCuts::kTracks) {
340  //Performed in production stage
341  }
342 
343  Int_t returnvalueCuts=1;
344  // selection on candidate
345  if (selectionLevel==AliRDHFCuts::kAll ||
346  selectionLevel==AliRDHFCuts::kCandidate) {
347 
348  Double_t pt=d->Pt();
349  Int_t ptbin=PtBin(pt);
350  if (ptbin==-1) {
351  return 0;
352  }
353  Bool_t okcand=kTRUE;
354 
355  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
356  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
357  Double_t mxicPDG = TDatabasePDG::Instance()->GetParticle(4232)->Mass();
358  if(TMath::Abs(d->InvMassPiXiPi()-mxicPDG) > fCutsRD[GetGlobalIndex(0,ptbin)])
359  {
360  okcand = kFALSE;
361  }
362  if(d->Pt()< fCutsRD[GetGlobalIndex(1,ptbin)])
363  {
364  okcand = kFALSE;
365  }
366  if(TMath::Abs(d->CascMassXi()-mxiPDG) > fCutsRD[GetGlobalIndex(2,ptbin)])
367  {
368  okcand = kFALSE;
369  }
370  if((TMath::Abs(d->CascMassLambda()-mLPDG) > fCutsRD[GetGlobalIndex(3,ptbin)]) &&(TMath::Abs(d->CascMassAntiLambda()-mLPDG) > fCutsRD[GetGlobalIndex(3,ptbin)]) )
371  {
372  okcand = kFALSE;
373  }
374  Double_t dca[3];
375  d->GetDCAs(dca);
376  if(TMath::Abs(dca[2]) > fCutsRD[GetGlobalIndex(4,ptbin)])
377  {
378  okcand = kFALSE;
379  }
380  if((TMath::Abs(dca[0]) > fCutsRD[GetGlobalIndex(5,ptbin)]) && (TMath::Abs(dca[1]) > fCutsRD[GetGlobalIndex(5,ptbin)]) )
381  {
382  okcand = kFALSE;
383  }
384  if((TMath::Abs(d->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(6,ptbin)]) && (TMath::Abs(d->Getd0Prong(2)) > fCutsRD[GetGlobalIndex(6,ptbin)]) )
385  {
386  okcand = kFALSE;
387  }
388  if((TMath::Abs(d->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(7,ptbin)]))
389  {
390  okcand = kFALSE;
391  }
392  if((TMath::Abs(d->CascDcaBachToPrimVertex()) < fCutsRD[GetGlobalIndex(8,ptbin)]))
393  {
394  okcand = kFALSE;
395  }
396  if((TMath::Abs(d->CascDcaV0ToPrimVertex()) < fCutsRD[GetGlobalIndex(9,ptbin)]))
397  {
398  okcand = kFALSE;
399  }
400  if( d->XicCosPointingAngle() < fCutsRD[GetGlobalIndex(10,ptbin)])
401  {
402  okcand = kFALSE;
403  }
404  if( d->DecayLengthXY() < fCutsRD[GetGlobalIndex(11,ptbin)])
405  {
406  okcand = kFALSE;
407  }
408  if( d->PtProng(0) < fCutsRD[GetGlobalIndex(12,ptbin)] || d->PtProng(2) < fCutsRD[GetGlobalIndex(12,ptbin)] )
409  {
410  okcand = kFALSE;
411  }
412 
413  if(!okcand) return 0;
414  returnvalueCuts = 1;
415  }
416 
417  Int_t returnvaluePID=1;
418  if(selectionLevel==AliRDHFCuts::kAll ||
419  selectionLevel==AliRDHFCuts::kCandidate||
420  selectionLevel==AliRDHFCuts::kPID) {
421 
422  switch(fPIDStrategy){
423  case kNSigmaCuts:
424  returnvaluePID = IsSelectedPID(d);
425  break;
426  case kCombinedCuts:
427  returnvaluePID = IsSelectedCombinedPID(d);
428  break;
429  }
430  }
431 
432  Int_t returnvalue = 0;
433  if(returnvalueCuts==1 && returnvaluePID==1) returnvalue=1;
434 
435  return returnvalue;
436 }
437 
438 //---------------------------------------------------------------------------
440 {
441  //
442  // PID selection
443  //
444 
445  if(!fUsePID || !obj) return 1;
446 
448  AliAODTrack *part1 = dd->GetBachelor1();
449  AliAODTrack *part2 = dd->GetBachelor2();
450 
451  Int_t returnvalue=1;
452 
453  if(fPidHF->GetPidResponse()==0x0){
454  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
455  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
456  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
457  fPidHF->SetPidResponse(pidResp);
458  }
459 
460  Int_t isPion1=fPidHF->MakeRawPid(part1,2);
461  Int_t isPion2=fPidHF->MakeRawPid(part2,2);
462 
463  if(isPion1<1) returnvalue = 0;
464  if(isPion2<1) returnvalue = 0;
465 
466  return returnvalue;
467 }
468 
469 //---------------------------------------------------------------------------
471  //
472  // Combined PID selection
473  //
474 
475  if(!fUsePID || !obj) {return 1;}
476 
478  AliAODTrack *part1 = dd->GetBachelor1();
479  AliAODTrack *part2 = dd->GetBachelor2();
480  if(!part1||!part2) return 0;
481 
482  Int_t returnvalue=1;
483  Double_t probPion1 = GetPionProbabilityTPCTOF(part1);
484  Double_t probPion2 = GetPionProbabilityTPCTOF(part2);
485  if(probPion1<fCombinedPIDThreshold) returnvalue = 0;
486  if(probPion2<fCombinedPIDThreshold) returnvalue = 0;
487  return returnvalue;
488 }
489 
490 //________________________________________________________________________
492 {
493  //
494  // Get Pion Probablility
495  //
496  //fPidHF->GetPidCombined()->SetDefaultTPCPriors();
497  if(!fPidHF->GetUseCombined()) return -9999.;
498  fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC+AliPIDResponse::kDetTOF);
499  Double_t prob1[AliPID::kSPECIES];
500  UInt_t detUsed1 = fPidHF->GetPidCombined()->ComputeProbabilities(trk, fPidHF->GetPidResponse(), prob1);
501  if (detUsed1 != (UInt_t)fPidHF->GetPidCombined()->GetDetectorMask() )
502  {
503  fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC);
504  detUsed1 = fPidHF->GetPidCombined()->ComputeProbabilities(trk, fPidHF->GetPidResponse(), prob1);
505  }
506  return prob1[AliPID::kPion];
507 }
508 
509 //________________________________________________________________________
511 {
512  //
513  // Single Track Cut
514  //
515 
516  if(trk->GetStatus()&AliESDtrack::kITSpureSA) return kFALSE;
517  if(!(trk->GetStatus()&AliESDtrack::kITSin)) return kFALSE;
518 
519  if(fProdUseAODFilterBit && !trk->TestFilterMask(BIT(4))) return kFALSE;
520  // if(!fAnalCuts->IsDaughterSelected(trk,fV1,esdTrackCuts)) return kFALSE;
521  if(fabs(trk->Eta())>fProdTrackEtaRange) return kFALSE;
522  if(trk->Pt()<fProdTrackPtMin) return kFALSE;
523 
524  return kTRUE;
525 }
526 
527 //________________________________________________________________________
529 {
530  //
531  // Single Cascade Cut
532  //
533 
534  if(!casc) return kFALSE;
535 
536  AliAODTrack *ptrack = (AliAODTrack*) (casc->GetDaughter(0));
537  AliAODTrack *ntrack = (AliAODTrack*) (casc->GetDaughter(1));
538  AliAODTrack *btrack = (AliAODTrack*) (casc->GetDecayVertexXi()->GetDaughter(0));
539 
540  if(!ptrack||!ntrack||!btrack) return kFALSE;
541 
542  if(ptrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
543  if(ntrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
544  if(btrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
545 
546 
547  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
548  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
549  Double_t momegaPDG = TDatabasePDG::Instance()->GetParticle(3334)->Mass();
550 
551  Double_t massLambda = casc->MassLambda();
552  Double_t massAntiLambda = casc->MassAntiLambda();
553  if(TMath::Abs(massLambda-mLPDG)>fProdMassTolLambda && TMath::Abs(massAntiLambda-mLPDG)>fProdMassTolLambda)
554  return kFALSE;
555 
556  Bool_t isparticle = kTRUE;
557  if(TMath::Abs(massAntiLambda-mLPDG)<fProdMassTolLambda) isparticle = kFALSE;
558 
559  Double_t massXi = casc->MassXi();
560  Double_t massOmega = casc->MassOmega();
561  if(TMath::Abs(massXi-mxiPDG)>fProdMassTolXi)
562  return kFALSE;
563  if(TMath::Abs(massOmega-momegaPDG)>fProdMassTolOmega)
564  return kFALSE;
565 
566  if(TMath::Abs(massOmega-momegaPDG)<fProdMassRejOmega)
567  return kFALSE;
568 
569  Double_t lPosXi[3];
570  lPosXi[0] = casc->DecayVertexXiX();
571  lPosXi[1] = casc->DecayVertexXiY();
572  lPosXi[2] = casc->DecayVertexXiZ();
573  Double_t decayvertXi = TMath::Sqrt(lPosXi[0]*lPosXi[0]+lPosXi[1]*lPosXi[1]);
574  Double_t lPosV0[3];
575  lPosV0[0] = casc->DecayVertexV0X();
576  lPosV0[1] = casc->DecayVertexV0Y();
577  lPosV0[2] = casc->DecayVertexV0Z();
578  Double_t decayvertV0 = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
579 
580  if(decayvertV0<fProdRfidMinV0 || decayvertV0>fProdRfidMaxV0) return kFALSE;
581  if(decayvertXi<fProdRfidMinXi || decayvertXi>fProdRfidMaxXi) return kFALSE;
582 
583  Double_t ptotxi = TMath::Sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)+pow(casc->MomXiZ(),2));
584  Double_t properdl = casc->DecayLengthXi(primvert[0],primvert[1],primvert[2])*mxiPDG/ptotxi;
585  if(properdl>fProdCascProperDecayLengthMax) return kFALSE;
586 
587  Double_t lDcaXiDaughters = casc->DcaXiDaughters();
588  Double_t lDcaV0Daughters = casc->DcaV0Daughters();
589  if(lDcaXiDaughters > fProdDcaXiDaughtersMax) return kFALSE;
590  if(lDcaV0Daughters > fProdDcaV0DaughtersMax) return kFALSE;
591 
592  Double_t lDcaBachToPrimVertex = casc->DcaBachToPrimVertex();
593  Double_t lDcaV0ToPrimVertex = casc->DcaV0ToPrimVertex();
594  Double_t lDcaPosToPrimVertex = casc->DcaPosToPrimVertex();
595  Double_t lDcaNegToPrimVertex = casc->DcaNegToPrimVertex();
596  if(lDcaBachToPrimVertex < fProdDcaBachToPrimVertexMin) return kFALSE;
597  if(lDcaV0ToPrimVertex < fProdDcaV0ToPrimVertexMin) return kFALSE;
598  if(isparticle){
599  if(lDcaPosToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
600  if(lDcaNegToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
601  }else{
602  if(lDcaPosToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
603  if(lDcaNegToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
604  }
605 
606  Double_t lXiCosineOfPointingAngle = casc->CosPointingAngleXi(primvert[0],primvert[1],primvert[2]);
607  Double_t lV0CosineOfPointingAngleXi = casc->CosPointingAngle(lPosXi);
608 
609  if(lXiCosineOfPointingAngle < fProdXiCosineOfPoiningAngleMin) return kFALSE;
610  if(lV0CosineOfPointingAngleXi < fProdV0CosineOfPoiningAngleXiMin) return kFALSE;
611 
612  if(fUseCascadePID)
613  {
614  if(fPidObjCascPi->GetPidResponse()==0x0){
615  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
616  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
617  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
618  fPidObjCascPi->SetPidResponse(pidResp);
619  }
620  if(fPidObjCascPr->GetPidResponse()==0x0){
621  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
622  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
623  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
624  fPidObjCascPr->SetPidResponse(pidResp);
625  }
626  if(anaOmegacZero && fPidObjCascKa->GetPidResponse()==0x0){
627  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
628  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
629  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
630  fPidObjCascKa->SetPidResponse(pidResp);
631  }
632  if(isparticle){
633  Int_t isProton=fPidObjCascPr->MakeRawPid(ptrack,4);
634  if(isProton<1) return kFALSE;
635  if (!anaOmegacZero) {
636  Int_t isPion1 =fPidObjCascPi->MakeRawPid(btrack,2);
637  if(isPion1<1) return kFALSE;
638  }
639  if (anaOmegacZero) {
640  Int_t isKaon =fPidObjCascKa->MakeRawPid(btrack,3);
641  if(isKaon<1) return kFALSE;
642  }
643  Int_t isPion2 =fPidObjCascPi->MakeRawPid(ntrack,2);
644  if(isPion2<1) return kFALSE;
645  }else{
646  Int_t isProton=fPidObjCascPr->MakeRawPid(ntrack,4);
647  if(isProton<1) return kFALSE;
648  if (!anaOmegacZero) {
649  Int_t isPion1 =fPidObjCascPi->MakeRawPid(btrack,2);
650  if(isPion1<1) return kFALSE;
651  }
652  if (anaOmegacZero) {
653  Int_t isKaon =fPidObjCascKa->MakeRawPid(btrack,3);
654  if(isKaon<1) return kFALSE;
655  }
656  Int_t isPion2 =fPidObjCascPi->MakeRawPid(ptrack,2);
657  if(isPion2<1) return kFALSE;
658  }
659  }
660 
661 
662  return kTRUE;
663 }
664 //________________________________________________________________________
666 {
667  //
668  // Single Cascade Cut (without Xi mass selection)
669  // Kinematical cut is applied to compare with cascade analysis note
670  //
671 
672  if(!casc) return kFALSE;
673 
674  AliAODTrack *ptrack = (AliAODTrack*) (casc->GetDaughter(0));
675  AliAODTrack *ntrack = (AliAODTrack*) (casc->GetDaughter(1));
676  AliAODTrack *btrack = (AliAODTrack*) (casc->GetDecayVertexXi()->GetDaughter(0));
677 
678  if(!ptrack||!ntrack||!btrack) return kFALSE;
679 
680  //Kinematical cut
681  //if(TMath::Abs(ptrack->Eta())>0.8) return kFALSE;
682  //if(TMath::Abs(ntrack->Eta())>0.8) return kFALSE;
683  //if(TMath::Abs(btrack->Eta())>0.8) return kFALSE;
684  //if(casc->RapXi()<-0.5) return kFALSE;
685  //if(casc->RapXi()>0.0) return kFALSE;
686 
687  if(ptrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
688  if(ntrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
689  if(btrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
690 
691  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
692  Double_t momegaPDG = TDatabasePDG::Instance()->GetParticle(3334)->Mass();
693  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
694 
695  Double_t massXi = casc->MassXi();
696  Double_t massOmega = casc->MassOmega();
697  if(TMath::Abs(massOmega-momegaPDG)<fProdMassRejOmega)
698  return kFALSE;
699 
700 
701  Double_t massLambda = casc->MassLambda();
702  Double_t massAntiLambda = casc->MassAntiLambda();
703  if(TMath::Abs(massLambda-mLPDG)>fProdMassTolLambda && TMath::Abs(massAntiLambda-mLPDG)>fProdMassTolLambda)
704  return kFALSE;
705 
706  Bool_t isparticle = kTRUE;
707  if(TMath::Abs(massAntiLambda-mLPDG)<fProdMassTolLambda) isparticle = kFALSE;
708 
709  Double_t lPosXi[3];
710  lPosXi[0] = casc->DecayVertexXiX();
711  lPosXi[1] = casc->DecayVertexXiY();
712  lPosXi[2] = casc->DecayVertexXiZ();
713  Double_t decayvertXi = TMath::Sqrt(lPosXi[0]*lPosXi[0]+lPosXi[1]*lPosXi[1]);
714  Double_t lPosV0[3];
715  lPosV0[0] = casc->DecayVertexV0X();
716  lPosV0[1] = casc->DecayVertexV0Y();
717  lPosV0[2] = casc->DecayVertexV0Z();
718  Double_t decayvertV0 = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
719 
720  if(decayvertV0<fProdRfidMinV0 || decayvertV0>fProdRfidMaxV0) return kFALSE;
721  if(decayvertXi<fProdRfidMinXi || decayvertXi>fProdRfidMaxXi) return kFALSE;
722 
723  Double_t ptotxi = TMath::Sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)+pow(casc->MomXiZ(),2));
724  Double_t properdl = casc->DecayLengthXi(primvert[0],primvert[1],primvert[2])*mxiPDG/ptotxi;
725  if(properdl>fProdCascProperDecayLengthMax) return kFALSE;
726 
727  Double_t lDcaXiDaughters = casc->DcaXiDaughters();
728  Double_t lDcaV0Daughters = casc->DcaV0Daughters();
729  if(lDcaXiDaughters > fProdDcaXiDaughtersMax) return kFALSE;
730  if(lDcaV0Daughters > fProdDcaV0DaughtersMax) return kFALSE;
731 
732  Double_t lDcaBachToPrimVertex = casc->DcaBachToPrimVertex();
733  Double_t lDcaV0ToPrimVertex = casc->DcaV0ToPrimVertex();
734  Double_t lDcaPosToPrimVertex = casc->DcaPosToPrimVertex();
735  Double_t lDcaNegToPrimVertex = casc->DcaNegToPrimVertex();
736  if(lDcaBachToPrimVertex < fProdDcaBachToPrimVertexMin) return kFALSE;
737  if(lDcaV0ToPrimVertex < fProdDcaV0ToPrimVertexMin) return kFALSE;
738  if(isparticle){
739  if(lDcaPosToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
740  if(lDcaNegToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
741  }else{
742  if(lDcaPosToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
743  if(lDcaNegToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
744  }
745 
746  Double_t lXiCosineOfPointingAngle = casc->CosPointingAngleXi(primvert[0],primvert[1],primvert[2]);
747  Double_t lV0CosineOfPointingAngleXi = casc->CosPointingAngle(lPosXi);
748 
749  if(lXiCosineOfPointingAngle < fProdXiCosineOfPoiningAngleMin) return kFALSE;
750  if(lV0CosineOfPointingAngleXi < fProdV0CosineOfPoiningAngleXiMin) return kFALSE;
751 
752  if(fUseCascadePID)
753  {
754  if(fPidObjCascPi->GetPidResponse()==0x0){
755  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
756  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
757  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
758  fPidObjCascPi->SetPidResponse(pidResp);
759  }
760  if(fPidObjCascPr->GetPidResponse()==0x0){
761  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
762  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
763  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
764  fPidObjCascPr->SetPidResponse(pidResp);
765  }
766  if(anaOmegacZero && fPidObjCascKa->GetPidResponse()==0x0){
767  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
768  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
769  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
770  fPidObjCascKa->SetPidResponse(pidResp);
771  }
772  if(isparticle){
773  Int_t isProton=fPidObjCascPr->MakeRawPid(ptrack,4);
774  if(isProton<1) return kFALSE;
775  if (!anaOmegacZero) {
776  Int_t isPion1 =fPidObjCascPi->MakeRawPid(btrack,2);
777  if(isPion1<1) return kFALSE;
778  }
779  if (anaOmegacZero) {
780  Int_t isKaon =fPidObjCascKa->MakeRawPid(btrack,3);
781  if(isKaon<1) return kFALSE;
782  }
783  Int_t isPion2 =fPidObjCascPi->MakeRawPid(ntrack,2);
784  if(isPion2<1) return kFALSE;
785  }else{
786  Int_t isProton=fPidObjCascPr->MakeRawPid(ntrack,4);
787  if(isProton<1) return kFALSE;
788  if (!anaOmegacZero) {
789  Int_t isPion1 =fPidObjCascPi->MakeRawPid(btrack,2);
790  if(isPion1<1) return kFALSE;
791  }
792  if (anaOmegacZero) {
793  Int_t isKaon =fPidObjCascKa->MakeRawPid(btrack,3);
794  if(isKaon<1) return kFALSE;
795  }
796  Int_t isPion2 =fPidObjCascPi->MakeRawPid(ptrack,2);
797  if(isPion2<1) return kFALSE;
798  }
799  }
800 
801  return kTRUE;
802 }
803 //________________________________________________________________________
805 {
806  //
807  // Select With Rough mass and pT cut before object creation
808  //
809 
810  //Constants
811  Double_t mpiPDG = TDatabasePDG::Instance()->GetParticle(211)->Mass();
812  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
813  Double_t mxicPDG = TDatabasePDG::Instance()->GetParticle(4232)->Mass();
814 
815  Double_t pxpi1_init = part1->Px();
816  Double_t pypi1_init = part1->Py();
817  Double_t pzpi1_init = part1->Pz();
818  Double_t Epi1_init = sqrt(pxpi1_init*pxpi1_init+pypi1_init*pypi1_init+pzpi1_init*pzpi1_init+mpiPDG*mpiPDG);
819  //Double_t pxpi2_init = part2->Px();
820  //Double_t pypi2_init = part2->Py();
821  //Double_t pzpi2_init = part2->Pz();
822  //Double_t Epi2_init = sqrt(pxpi2_init*pxpi2_init+pypi2_init*pypi2_init+pzpi2_init*pzpi2_init+mpiPDG*mpiPDG);
823  Double_t pxcasc_init = casc->MomXiX();
824  Double_t pycasc_init = casc->MomXiY();
825  Double_t pzcasc_init = casc->MomXiZ();
826  Double_t Ecasc_init = sqrt(pxcasc_init*pxcasc_init+pycasc_init*pycasc_init+pzcasc_init*pzcasc_init+mxiPDG*mxiPDG);
827  // Double_t pxxic_init = pxpi1_init+pxpi2_init+pxcasc_init;
828  //Double_t pyxic_init = pypi1_init+pypi2_init+pycasc_init;
829  //Double_t pzxic_init = pzpi1_init+pzpi2_init+pzcasc_init;
830  //Double_t Exic_init = Epi1_init+Epi2_init+Ecasc_init;
831  //Double_t xicmass_init = sqrt(Exic_init*Exic_init-pxxic_init*pxxic_init-pyxic_init*pyxic_init-pzxic_init*pzxic_init);
832 
833  //if(xicmass_init<mxicPDG-fProdRoughMassTol || xicmass_init>mxicPDG+fProdRoughMassTol) return kFALSE;
834  //if(sqrt(pxxic_init*pxxic_init+pyxic_init*pyxic_init)<fProdRoughPtMin) return kFALSE;
835 
836  return kTRUE;
837 }
838 
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 fProdDcaV0PiToPrimVertexMin
Min Dca between v0-proton and PV.
Double_t fProdMassTolOmega
Tolerance of Xi mass from PDG value.
Double_t fProdTrackPtMin
PID object for cascade-kaon.
Double_t fProdCascProperDecayLengthMax
Max Decay vertex of Xi.
Bool_t GetUseCombined()
Definition: AliAODPidHF.h:178
Double_t fProdMassRejOmega
Tolerance of Omega mass from PDG value.
Bool_t SingleCascadeCuts(AliAODcascade *casc, Double_t *vert, Bool_t anaOmegacZero)
void SetNVars(Int_t nVars)
Definition: AliRDHFCuts.h:445
Double_t fProdDcaBachToPrimVertexMin
Max Dca between V0 daughters.
Double_t fProdXiCosineOfPoiningAngleMin
Min Dca between v0-pion and PV.
AliRDHFCuts & operator=(const AliRDHFCuts &source)
Double_t fProdLikeSignDcaMax
Minimum number of TPC clusters.
Bool_t fUsePID
Definition: AliRDHFCuts.h:476
AliAODPidHF * fPidObjCascPi
Use PID for cascade or not.
int Int_t
Definition: External.C:63
Int_t fnVarsForOpt
Definition: AliRDHFCuts.h:471
unsigned int UInt_t
Definition: External.C:33
AliPIDCombined * GetPidCombined() const
Definition: AliAODPidHF.h:174
float Float_t
Definition: External.C:68
Double_t fProdMassTolXi
Tolerance of Lambda mass from PDG value.
Double_t fMaxPtCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:500
Bool_t SingleCascadeCutsRef(AliAODcascade *casc, Double_t *vert, Bool_t anaOmegaZero)
Double_t fProdV0CosineOfPoiningAngleXiMin
Min Xi cos pointing angle to PV.
Double_t fProdDcaV0PrToPrimVertexMin
Min Dca between v0 and PV.
AliAODTrack * GetBachelor1() const
Double_t fProdRfidMinV0
Rejection range of Omega mass from PDG value.
AliAODPidHF * fPidObjCascKa
PID object for cascade-proton.
Double_t fProdRoughPtMin
Tolerance of Xic mass from PDG value.
Int_t MakeRawPid(AliAODTrack *track, Int_t specie)
AliPIDResponse * GetPidResponse() const
Definition: AliAODPidHF.h:173
Float_t * fCutsRD
fnVars*fnPtBins
Definition: AliRDHFCuts.h:474
void GetDCAs(Double_t dca[3]) const
AliAODPidHF * fPidObjCascPr
PID object for cascade-pion.
void SetVarsForOpt(Int_t nVars, Bool_t *forOpt)
Double_t DecayLengthXY() const
Bool_t SelectWithRoughCuts(AliAODcascade *casc, AliAODTrack *trk1)
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
Bool_t fUseCascadePID
PID threshold used in IsSelectedCombinedPID.
AliRDHFCutsXicZerotoXiPifromAODtracks(const char *name="CutsXicZerotoXiPi")
void SetPtBins(Int_t nPtBinLimits, Float_t *ptBinLimits)
Double_t fProdDcaV0DaughtersMax
Max Dca between Xi daughters.
AliRDHFCutsXicZerotoXiPifromAODtracks & operator=(const AliRDHFCutsXicZerotoXiPifromAODtracks &source)
bool Bool_t
Definition: External.C:53
virtual void GetCutVarsForOpt(AliAODRecoDecayHF *d, Float_t *vars, Int_t nvars, Int_t *pdgdaughters)
AliAODPidHF * fPidHF
enable AOD049 centrality cleanup
Definition: AliRDHFCuts.h:478
Int_t GetGlobalIndex(Int_t iVar, Int_t iPtBin) const
Double_t fMinPtCand
outcome of PID selection
Definition: AliRDHFCuts.h:499
Double_t fProdDcaV0ToPrimVertexMin
Min Dca between Bachelor and PV.
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
void SetPidResponse(AliPIDResponse *pidResp)
Definition: AliAODPidHF.h:124