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