AliPhysics  dccfc39 (dccfc39)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
AliRDHFCutsXictoeleXifromAODtracks.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 Xic->e+Xi
21 //
22 // Modified by Y.S Watanabe - wyosuke@cns.s.u-tokyo.ac.jp
23 //
25 
26 #include <Riostream.h>
27 
28 #include <TDatabasePDG.h>
29 #include <TMath.h>
30 
31 #include "AliAnalysisManager.h"
32 #include "AliInputEventHandler.h"
33 #include "AliPIDResponse.h"
35 #include "AliAODRecoCascadeHF.h"
36 #include "AliAODTrack.h"
37 #include "AliESDtrack.h"
38 #include "AliESDVertex.h"
39 #include "AliAODVertex.h"
40 #include "AliAODv0.h"
41 #include "AliAODcascade.h"
42 #include "AliESDv0.h"
43 
44 using std::cout;
45 using std::endl;
46 
50 
51 
52 //--------------------------------------------------------------------------
54 AliRDHFCuts(name),
55  fPIDStrategy(kNSigmaCuts),
56  fCombinedPIDThreshold(0.),
57  fUseCascadePID(kFALSE),
58  fPidObjCascPi(0),
59  fPidObjCascPr(0),
60  fProdTrackTPCNclsPIDMin(0),
61  fProdTrackTPCNclsRatioMin(0.0),
62  fProdUseAODFilterBit(kTRUE),
63  fProdMassTolLambda(0.010),
64  fProdMassTolXiRough(0.020),
65  fProdMassTolXi(0.008),
66  fProdMassRejOmega(0.008),
67  fProdRfidMinV0(0.6),
68  fProdRfidMaxV0(100.0),
69  fProdRfidMinXi(0.6),
70  fProdRfidMaxXi(100.0),
71  fProdCascProperDecayLengthMax(100.0),
72  fProdDcaXiDaughtersMax(100.),
73  fProdDcaV0DaughtersMax(100.),
74  fProdDcaBachToPrimVertexMin(0.),
75  fProdDcaV0ToPrimVertexMin(0.),
76  fProdDcaV0PrToPrimVertexMin(0.),
77  fProdDcaV0PiToPrimVertexMin(0.),
78  fProdXiCosineOfPoiningAngleMin(-1.),
79  fProdV0CosineOfPoiningAngleXiMin(-1.),
80  fProdCascNTPCClustersMin(0.0),
81  fProdCascEtaMin(-9999.),
82  fProdCascEtaMax(9999.),
83  fProdCascRapMin(-9999.),
84  fProdCascRapMax(9999.),
85  fProdCascPtMin(0.),
86  fProdCascPtMax(9999.),
87  fProdRoughMassTol(0.25),
88  fProdRoughPtMin(0.0),
89  fExcludePionTPC(kFALSE),
90  fExcludeProtonTPC(kFALSE),
91  fExcludeKaonTPC(kFALSE),
92  fExcludenSigmaPionTPC(3.),
93  fExcludenSigmaProtonTPC(3.),
94  fExcludenSigmaKaonTPC(3.),
95  fSigmaElectronTPCMin(-9999.),
96  fSigmaElectronTPCPtDepPar0(-9999.),
97  fSigmaElectronTPCPtDepPar1(-9999.),
98  fSigmaElectronTPCPtDepPar2(0.),
99  fSigmaElectronTPCMax(9999.),
100  fSigmaElectronTOFMin(-9999.),
101  fSigmaElectronTOFMax(9999.)
102 {
103  //
104  // Default Constructor
105  //
106 
107  const Int_t nvars=2;
108  SetNVars(nvars);
109  TString varNames[nvars]={
110  "InvMass [GeV/c2]", //0
111  "cos(Opening angle) [cos(rad)]" //1
112  };
113 
114  Bool_t isUpperCut[nvars]={
115  kTRUE, //0
116  kFALSE //1
117  };
118  SetVarNames(nvars,varNames,isUpperCut);
119  Bool_t forOpt[nvars]={
120  kTRUE, //0
121  kTRUE, //1
122  };
123  SetVarsForOpt(nvars,forOpt);
124 
125  Float_t limits[2]={0,999999999.};
126  SetPtBins(2,limits);
127 }
128 //--------------------------------------------------------------------------
130  AliRDHFCuts(source),
131  fPIDStrategy(source.fPIDStrategy),
132  fCombinedPIDThreshold(source.fCombinedPIDThreshold),
133  fUseCascadePID(source.fUseCascadePID),
134  fPidObjCascPi(source.fPidObjCascPi),
135  fPidObjCascPr(source.fPidObjCascPr),
136  fProdTrackTPCNclsPIDMin(source.fProdTrackTPCNclsPIDMin),
137  fProdTrackTPCNclsRatioMin(source.fProdTrackTPCNclsRatioMin),
138  fProdUseAODFilterBit(source.fProdUseAODFilterBit),
139  fProdMassTolLambda(source.fProdMassTolLambda),
140  fProdMassTolXiRough(source.fProdMassTolXiRough),
141  fProdMassTolXi(source.fProdMassTolXi),
142  fProdMassRejOmega(source.fProdMassRejOmega),
143  fProdRfidMinV0(source.fProdRfidMinV0),
144  fProdRfidMaxV0(source.fProdRfidMaxV0),
145  fProdRfidMinXi(source.fProdRfidMinXi),
146  fProdRfidMaxXi(source.fProdRfidMaxXi),
147  fProdCascProperDecayLengthMax(source.fProdCascProperDecayLengthMax),
148  fProdDcaXiDaughtersMax(source.fProdDcaXiDaughtersMax),
149  fProdDcaV0DaughtersMax(source.fProdDcaV0DaughtersMax),
150  fProdDcaBachToPrimVertexMin(source.fProdDcaBachToPrimVertexMin),
151  fProdDcaV0ToPrimVertexMin(source.fProdDcaV0ToPrimVertexMin),
152  fProdDcaV0PrToPrimVertexMin(source.fProdDcaV0PrToPrimVertexMin),
153  fProdDcaV0PiToPrimVertexMin(source.fProdDcaV0PiToPrimVertexMin),
154  fProdXiCosineOfPoiningAngleMin(source.fProdXiCosineOfPoiningAngleMin),
155  fProdV0CosineOfPoiningAngleXiMin(source.fProdV0CosineOfPoiningAngleXiMin),
156  fProdCascNTPCClustersMin(source.fProdCascNTPCClustersMin),
157  fProdCascEtaMin(source.fProdCascEtaMin),
158  fProdCascEtaMax(source.fProdCascEtaMax),
159  fProdCascRapMin(source.fProdCascRapMin),
160  fProdCascRapMax(source.fProdCascRapMax),
161  fProdCascPtMin(source.fProdCascPtMin),
162  fProdCascPtMax(source.fProdCascPtMax),
163  fProdRoughMassTol(source.fProdRoughMassTol),
164  fProdRoughPtMin(source.fProdRoughPtMin),
165  fExcludePionTPC(source.fExcludePionTPC),
166  fExcludeProtonTPC(source.fExcludeProtonTPC),
167  fExcludeKaonTPC(source.fExcludeKaonTPC),
168  fExcludenSigmaPionTPC(source.fExcludenSigmaPionTPC),
169  fExcludenSigmaProtonTPC(source.fExcludenSigmaProtonTPC),
170  fExcludenSigmaKaonTPC(source.fExcludenSigmaKaonTPC),
171  fSigmaElectronTPCMin(source.fSigmaElectronTPCMin),
172  fSigmaElectronTPCPtDepPar0(source.fSigmaElectronTPCPtDepPar0),
173  fSigmaElectronTPCPtDepPar1(source.fSigmaElectronTPCPtDepPar1),
174  fSigmaElectronTPCPtDepPar2(source.fSigmaElectronTPCPtDepPar2),
175  fSigmaElectronTPCMax(source.fSigmaElectronTPCMax),
176  fSigmaElectronTOFMin(source.fSigmaElectronTOFMin),
177  fSigmaElectronTOFMax(source.fSigmaElectronTOFMax)
178 {
179  //
180  // Copy constructor
181  //
182 }
183 //--------------------------------------------------------------------------
185 {
186  //
187  // assignment operator
188  //
189 
190  if (this != &source) {
191  AliRDHFCuts::operator=(source);
192  }
193 
194  fPIDStrategy = source.fPIDStrategy;
197  fPidObjCascPi = source.fPidObjCascPi;
198  fPidObjCascPr = source.fPidObjCascPr;
241 
242 
243  return *this;
244 }
245 
246 //---------------------------------------------------------------------------
248  //
249  // Default Destructor
250  //
251 
252 }
253 
254 //---------------------------------------------------------------------------
255 void AliRDHFCutsXictoeleXifromAODtracks::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) {
256  //
257  // Fills in vars the values of the variables
258  //
259 
260  if (pdgdaughters[0]==-9999) return; // dummy
261 
263  if(!dd){
264  AliError("No AliAODRecoCascadeHF object found\n");
265  return;
266  }
267 
268  if (nvars!=fnVarsForOpt) {
269  AliError("Cut object seems to have the wrong number of variables\n");
270  return;
271  }
272 
273  //Double_t ptD=d->Pt();
274  //Int_t ptbin=PtBin(ptD);
275  Int_t iter=-1;
276 
277  if(fVarsForOpt[0]){
278  iter++;
279  UInt_t pdgdg[2]={11,3312};
280  vars[iter]= dd->InvMass(2,pdgdg);
281  }
282  if(fVarsForOpt[1]){
283  iter++;
284  Double_t xipx = dd->PxProng(1);
285  Double_t xipy = dd->PyProng(1);
286  Double_t xipz = dd->PzProng(1);
287  Double_t epx = dd->PxProng(0);
288  Double_t epy = dd->PyProng(0);
289  Double_t epz = dd->PzProng(0);
290  vars[iter]= (xipx*epx+xipy*epy+xipz*epz)/sqrt(xipx*xipx+xipy*xipy+xipz*xipz)/sqrt(epx*epx+epy*epy+epz*epz);
291  }
292 
293  return;
294 }
295 
296 //---------------------------------------------------------------------------
297 Int_t AliRDHFCutsXictoeleXifromAODtracks::IsSelected(TObject* obj, Int_t selectionLevel) {
298  //
299  // Apply selection
300  //
301 
302  if (!fCutsRD) {
303  AliFatal("Cut matrix not inizialized. Exit...");
304  return 0;
305  }
306 
308  if(!d){
309  AliDebug(2,"AliAODRecoCascadeHF null");
310  return 0;
311  }
312 
313  Double_t ptD=d->Pt();
314  if(ptD<fMinPtCand) return 0;
315  if(ptD>fMaxPtCand) return 0;
316 
317  if (selectionLevel==AliRDHFCuts::kAll ||
318  selectionLevel==AliRDHFCuts::kTracks) {
319  //Performed in production stage
320  }
321 
322  Int_t returnvalueCuts=1;
323  // selection on candidate
324  if (selectionLevel==AliRDHFCuts::kAll ||
325  selectionLevel==AliRDHFCuts::kCandidate) {
326 
327  Double_t pt=d->Pt();
328  Int_t ptbin=PtBin(pt);
329  if (ptbin==-1) {
330  return 0;
331  }
332  Bool_t okcand=kTRUE;
333 
334  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
335  UInt_t pdgdg[2]={11,3312};
336  Double_t InvMassEleXi = d->InvMass(2,pdgdg);
337  Double_t xipx = d->PxProng(1);
338  Double_t xipy = d->PyProng(1);
339  Double_t xipz = d->PzProng(1);
340  Double_t epx = d->PxProng(0);
341  Double_t epy = d->PyProng(0);
342  Double_t epz = d->PzProng(0);
343  Double_t cosoa = (xipx*epx+xipy*epy+xipz*epz)/sqrt(xipx*xipx+xipy*xipy+xipz*xipz)/sqrt(epx*epx+epy*epy+epz*epz);
344 
345  if(InvMassEleXi > fCutsRD[GetGlobalIndex(0,ptbin)])
346  {
347  okcand = kFALSE;
348  }
349  if(cosoa < fCutsRD[GetGlobalIndex(1,ptbin)])
350  {
351  okcand = kFALSE;
352  }
353 
354  if(!okcand) return 0;
355  returnvalueCuts = 1;
356  }
357 
358  Int_t returnvaluePID=1;
359  if(selectionLevel==AliRDHFCuts::kAll ||
360  selectionLevel==AliRDHFCuts::kCandidate||
361  selectionLevel==AliRDHFCuts::kPID) {
362  //not used. applied at single level
363  }
364 
365  Int_t returnvalue = 0;
366  if(returnvalueCuts==1 && returnvaluePID==1) returnvalue=1;
367 
368  return returnvalue;
369 }
370 
371 //---------------------------------------------------------------------------
373 {
374  //
375  // IsSelectedPID
376  //
377 
378  if(!fUsePID || !obj) return 1;
379 
381  AliAODTrack *part = dd->GetBachelor();
382 
383  Int_t returnvalue=1;
384 
385  if(fPidHF->GetPidResponse()==0x0){
386  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
387  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
388  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
389  fPidHF->SetPidResponse(pidResp);
390  }
391 
392  Int_t isElectron=fPidHF->MakeRawPid(part,0);
393  if(isElectron<1) returnvalue = 0;
394 
395  return returnvalue;
396 }
397 
398 //---------------------------------------------------------------------------
400  //
401  // IsSelectedCombinedPID
402  //
403 
404  if(!fUsePID || !obj) {return 1;}
405 
407  AliAODTrack *part = dd->GetBachelor();
408  if(!part) return 0;
409 
410  Int_t returnvalue=1;
411 
412  return returnvalue;
413 }
414 
415 //________________________________________________________________________
416 Bool_t AliRDHFCutsXictoeleXifromAODtracks::SingleTrkCuts(AliAODTrack *trk, AliAODVertex *primVert)
417 {
418  //
419  // Single Track Cut to be applied before object creation
420  //
421 
422  if(trk->GetStatus()&AliESDtrack::kITSpureSA) return kFALSE;
423  if(!(trk->GetStatus()&AliESDtrack::kITSin)) return kFALSE;
424  if(fProdUseAODFilterBit && !trk->TestFilterMask(BIT(4))) return kFALSE;
425 
426  Double_t pos[3]; primVert->GetXYZ(pos);
427  Double_t cov[6]; primVert->GetCovarianceMatrix(cov);
428  const AliESDVertex vESD(pos,cov,100.,100);
429  if(fTrackCuts&&!IsDaughterSelected(trk,&vESD,fTrackCuts)) return kFALSE;
430 
431  if(trk->GetTPCsignalN()<fProdTrackTPCNclsPIDMin) return kFALSE;
432  if(trk->GetTPCNclsF()>0){
433  Float_t tpcratio = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
434  if(tpcratio<fProdTrackTPCNclsRatioMin) return kFALSE;
435  }
436 
437  if(fUsePID)
438  {
439  if(fPidHF->GetPidResponse()==0x0){
440  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
441  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
442  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
443  fPidHF->SetPidResponse(pidResp);
444  }
445 
446  switch(fPIDStrategy){
447  case kNSigmaCuts:
448  return IsSelectedeID(trk);
449  break;
451  return IsSelectedCustomizedeID(trk);
452  break;
454  return IsSelectedCustomizedPtDepeID(trk);
455  break;
456  case kCombinedCuts:
457  return IsSelectedCombinedeID(trk);
458  break;
459  }
460 
461  }
462 
463  return kTRUE;
464 }
465 //________________________________________________________________________
466 Bool_t AliRDHFCutsXictoeleXifromAODtracks::SingleTrkCutsNoPID(AliAODTrack *trk, AliAODVertex *primVert)
467 {
468  //
469  // Single Track Cut to be applied before object creation
470  //
471 
472  if(trk->GetStatus()&AliESDtrack::kITSpureSA) return kFALSE;
473  if(!(trk->GetStatus()&AliESDtrack::kITSin)) return kFALSE;
474  if(fProdUseAODFilterBit && !trk->TestFilterMask(BIT(4))) return kFALSE;
475 
476  Double_t pos[3]; primVert->GetXYZ(pos);
477  Double_t cov[6]; primVert->GetCovarianceMatrix(cov);
478  const AliESDVertex vESD(pos,cov,100.,100);
479  if(fTrackCuts&&!IsDaughterSelected(trk,&vESD,fTrackCuts)) return kFALSE;
480 
481  if(trk->GetTPCsignalN()<fProdTrackTPCNclsPIDMin) return kFALSE;
482  if(trk->GetTPCNclsF()>0){
483  Float_t tpcratio = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
484  if(tpcratio<fProdTrackTPCNclsRatioMin) return kFALSE;
485  }
486 
487  return kTRUE;
488 }
489 //________________________________________________________________________
491 {
492  //
493  // electron ID first shot
494  //
495 
496  Double_t nSigmaPion = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
497  if(fExcludePionTPC){
498  if(TMath::Abs(nSigmaPion)<fExcludenSigmaPionTPC){
499  return kFALSE;
500  }
501  }
502 
503  Double_t nSigmaProton = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
504  if(fExcludeProtonTPC){
505  if(TMath::Abs(nSigmaProton)<fExcludenSigmaProtonTPC){
506  return kFALSE;
507  }
508  }
509 
510  Double_t nSigmaKaon = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
511  if(fExcludeKaonTPC){
512  if(TMath::Abs(nSigmaKaon)<fExcludenSigmaKaonTPC){
513  return kFALSE;
514  }
515  }
516 
517  Int_t isElectron=fPidHF->MakeRawPid(trk,0);
518  if(isElectron<1) return kFALSE;
519 
520  return kTRUE;
521 }
522 //________________________________________________________________________
524 {
525  //
526  // electron ID first shot
527  //
528 
529  Double_t nSigmaPion = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
530  if(fExcludePionTPC){
531  if(TMath::Abs(nSigmaPion)<fExcludenSigmaPionTPC){
532  return kFALSE;
533  }
534  }
535 
536  Double_t nSigmaProton = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
537  if(fExcludeProtonTPC){
538  if(TMath::Abs(nSigmaProton)<fExcludenSigmaProtonTPC){
539  return kFALSE;
540  }
541  }
542 
543  Double_t nSigmaKaon = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
544  if(fExcludeKaonTPC){
545  if(TMath::Abs(nSigmaKaon)<fExcludenSigmaKaonTPC){
546  return kFALSE;
547  }
548  }
549 
550  Double_t nSigmaTPCele = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
551  Double_t nSigmaTOFele = fPidHF->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
552 
553  if(nSigmaTPCele<fSigmaElectronTPCMin) return kFALSE;
554  if(nSigmaTPCele>fSigmaElectronTPCMax) return kFALSE;
555  if(fabs(fSigmaElectronTOFMin)<10.&&fabs(fSigmaElectronTOFMax)<10.){
556  if(nSigmaTOFele<fSigmaElectronTOFMin) return kFALSE;
557  if(nSigmaTOFele>fSigmaElectronTOFMax) return kFALSE;
558  }
559 
560  return kTRUE;
561 }
562 //________________________________________________________________________
564 {
565  //
566  // electron ID pt dependent
567  //
568 
569  Double_t nSigmaTPCele = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
570  Double_t nSigmaTOFele = fPidHF->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
571 
572  if(nSigmaTOFele<fSigmaElectronTOFMin) return kFALSE;
573  if(nSigmaTOFele>fSigmaElectronTOFMax) return kFALSE;
574 
575  Double_t pte = trk->Pt();
578  if(nSigmaTPCele<nsigmamin) return kFALSE;
579  if(nSigmaTPCele>fSigmaElectronTPCMax) return kFALSE;
580 
581  return kTRUE;
582 }
583 //________________________________________________________________________
585 {
586  //
587  // electron ID Basyian not implemented
588  //
589 
590  return kTRUE;
591 }
592 //________________________________________________________________________
593 Bool_t AliRDHFCutsXictoeleXifromAODtracks::SingleCascadeCuts(AliAODcascade *casc,Double_t *primvert)
594 {
595  //
596  // Single Cascade Cut
597  //
598 
599  if(!casc) return kFALSE;
600  if(!(casc->GetSecondaryVtx())) return kFALSE;
601  if(!(casc->GetDecayVertexXi())) return kFALSE;
602 
603  AliAODTrack *ptrack = (AliAODTrack*) (casc->GetDaughter(0));
604  AliAODTrack *ntrack = (AliAODTrack*) (casc->GetDaughter(1));
605  AliAODTrack *btrack = (AliAODTrack*) (casc->GetDecayVertexXi()->GetDaughter(0));
606 
607  if(!ptrack||!ntrack||!btrack) return kFALSE;
608 
609  if(ptrack->Charge()<0 && ntrack->Charge()>0){
610  ptrack = (AliAODTrack*) (casc->GetDaughter(1));
611  ntrack = (AliAODTrack*) (casc->GetDaughter(0));
612  }
613 
614  if(ptrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
615  if(ntrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
616  if(btrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
617 
618  Double_t pxxi = casc->MomXiX();
619  Double_t pyxi = casc->MomXiY();
620  Double_t ptxi = sqrt(pxxi*pxxi+pyxi*pyxi);
621  if(ptxi<fProdCascPtMin || ptxi>fProdCascPtMax) return kFALSE;
622 
623  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
624  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
625  Double_t momegaPDG = TDatabasePDG::Instance()->GetParticle(3334)->Mass();
626 
627  Double_t massLambda = casc->MassLambda();
628  Double_t massAntiLambda = casc->MassAntiLambda();
629  if(TMath::Abs(massLambda-mLPDG)>fProdMassTolLambda && TMath::Abs(massAntiLambda-mLPDG)>fProdMassTolLambda)
630  return kFALSE;
631 
632  Bool_t isparticle = kTRUE;
633  //if(TMath::Abs(massAntiLambda-mLPDG)<fProdMassTolLambda) isparticle = kFALSE;
634  if(casc->ChargeXi()>0) isparticle = kFALSE;
635 
636  Double_t massXi = casc->MassXi();
637  if(TMath::Abs(massXi-mxiPDG)>fProdMassTolXiRough)
638  return kFALSE;
639 
640  Double_t massOmega = casc->MassOmega();
641  if(TMath::Abs(massOmega-momegaPDG)<fProdMassRejOmega)
642  return kFALSE;
643 
644 
645  Double_t lPosXi[3];
646  lPosXi[0] = casc->DecayVertexXiX();
647  lPosXi[1] = casc->DecayVertexXiY();
648  lPosXi[2] = casc->DecayVertexXiZ();
649  Double_t decayvertXi = TMath::Sqrt(lPosXi[0]*lPosXi[0]+lPosXi[1]*lPosXi[1]);
650  Double_t lPosV0[3];
651  lPosV0[0] = casc->DecayVertexV0X();
652  lPosV0[1] = casc->DecayVertexV0Y();
653  lPosV0[2] = casc->DecayVertexV0Z();
654  Double_t decayvertV0 = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
655 
656  if(decayvertV0<fProdRfidMinV0 || decayvertV0>fProdRfidMaxV0) return kFALSE;
657  if(decayvertXi<fProdRfidMinXi || decayvertXi>fProdRfidMaxXi) return kFALSE;
658 
659  Double_t ptotxi = TMath::Sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)+pow(casc->MomXiZ(),2));
660  Double_t properdl = casc->DecayLengthXi(primvert[0],primvert[1],primvert[2])*mxiPDG/ptotxi;
661  if(properdl>fProdCascProperDecayLengthMax) return kFALSE;
662 
663  Double_t lDcaXiDaughters = casc->DcaXiDaughters();
664  Double_t lDcaV0Daughters = casc->DcaV0Daughters();
665  if(lDcaXiDaughters > fProdDcaXiDaughtersMax) return kFALSE;
666  if(lDcaV0Daughters > fProdDcaV0DaughtersMax) return kFALSE;
667 
668  Double_t lDcaBachToPrimVertex = casc->DcaBachToPrimVertex();
669  Double_t lDcaV0ToPrimVertex = casc->DcaV0ToPrimVertex();
670  Double_t lDcaPosToPrimVertex = casc->DcaPosToPrimVertex();
671  Double_t lDcaNegToPrimVertex = casc->DcaNegToPrimVertex();
672  if(lDcaBachToPrimVertex < fProdDcaBachToPrimVertexMin) return kFALSE;
673  if(lDcaV0ToPrimVertex < fProdDcaV0ToPrimVertexMin) return kFALSE;
674  if(isparticle){
675  if(lDcaPosToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
676  if(lDcaNegToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
677  }else{
678  if(lDcaPosToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
679  if(lDcaNegToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
680  }
681 
682  Double_t lXiCosineOfPointingAngle = casc->CosPointingAngleXi(primvert[0],primvert[1],primvert[2]);
683  Double_t lV0CosineOfPointingAngleXi = casc->CosPointingAngle(lPosXi);
684 
685  if(lXiCosineOfPointingAngle < fProdXiCosineOfPoiningAngleMin) return kFALSE;
686  if(lV0CosineOfPointingAngleXi < fProdV0CosineOfPoiningAngleXiMin) return kFALSE;
687 
688  if(fUseCascadePID)
689  {
690  if(fPidObjCascPi->GetPidResponse()==0x0){
691  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
692  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
693  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
694  fPidObjCascPi->SetPidResponse(pidResp);
695  }
696  if(fPidObjCascPr->GetPidResponse()==0x0){
697  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
698  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
699  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
700  fPidObjCascPr->SetPidResponse(pidResp);
701  }
702  if(isparticle){
703  Int_t isProton = -9999;
704  Int_t isPion1 = -9999;
705  Int_t isPion2 = -9999;
706  Double_t nsigmatpc_proton = fPidObjCascPr->GetSigma(0);
707  Double_t nsigmatpc_pion = fPidObjCascPi->GetSigma(0);
708  Double_t nSigmaTPCpr = fPidObjCascPr->GetPidResponse()->NumberOfSigmasTPC(ptrack,AliPID::kProton);
709  Double_t nSigmaTPCpi1 = fPidObjCascPi->GetPidResponse()->NumberOfSigmasTPC(ntrack,AliPID::kPion);
710  Double_t nSigmaTPCpi2 = fPidObjCascPi->GetPidResponse()->NumberOfSigmasTPC(btrack,AliPID::kPion);
711  if(fabs(nSigmaTPCpr)<nsigmatpc_proton) isProton = 1;
712  if(fabs(nSigmaTPCpi1)<nsigmatpc_pion) isPion1 = 1;
713  if(fabs(nSigmaTPCpi2)<nsigmatpc_pion) isPion2 = 1;
714  if(isProton<1) return kFALSE;
715  if(isPion1<1) return kFALSE;
716  if(isPion2<1) return kFALSE;
717  }else{
718  Int_t isProton = -9999;
719  Int_t isPion1 = -9999;
720  Int_t isPion2 = -9999;
721  Double_t nsigmatpc_proton = fPidObjCascPr->GetSigma(0);
722  Double_t nsigmatpc_pion = fPidObjCascPi->GetSigma(0);
723  Double_t nSigmaTPCpr = fPidObjCascPr->GetPidResponse()->NumberOfSigmasTPC(ntrack,AliPID::kProton);
724  Double_t nSigmaTPCpi1 = fPidObjCascPi->GetPidResponse()->NumberOfSigmasTPC(ptrack,AliPID::kPion);
725  Double_t nSigmaTPCpi2 = fPidObjCascPi->GetPidResponse()->NumberOfSigmasTPC(btrack,AliPID::kPion);
726  if(fabs(nSigmaTPCpr)<nsigmatpc_proton) isProton = 1;
727  if(fabs(nSigmaTPCpi1)<nsigmatpc_pion) isPion1 = 1;
728  if(fabs(nSigmaTPCpi2)<nsigmatpc_pion) isPion2 = 1;
729  if(isProton<1) return kFALSE;
730  if(isPion1<1) return kFALSE;
731  if(isPion2<1) return kFALSE;
732  }
733  }
734 
735  Double_t RapXi = casc->RapXi();
736  if(RapXi<fProdCascRapMin || RapXi>fProdCascRapMax) return kFALSE;
737 
738  Double_t EtaXi = 0.5*TMath::Log((ptotxi+casc->MomXiZ())/(ptotxi-casc->MomXiZ()));
739  if(EtaXi<fProdCascEtaMin || EtaXi>fProdCascEtaMax) return kFALSE;
740 
741  return kTRUE;
742 }
743 
744 //________________________________________________________________________
745 Bool_t AliRDHFCutsXictoeleXifromAODtracks::SelectWithRoughCuts(AliAODcascade *casc, AliAODTrack *part)
746 {
747  //
748  // Mass and pT Cut to be applied before object creation
749  // Not used now
750  //
751  if(!casc) return kFALSE;
752  if(!part) return kFALSE;
753 
754  return kTRUE;
755 }
756 
757 //________________________________________________________________________
759 {
760  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
761  Double_t massXi = casc->MassXi();
762  if(TMath::Abs(massXi-mxiPDG)<fProdMassTolXi)
763  return kTRUE;
764  return kFALSE;
765 }
766 
767 //________________________________________________________________________
769 {
770  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
771  Double_t massXi = casc->M();
772  if(TMath::Abs(massXi-mxiPDG)<fProdMassTolXi)
773  return kTRUE;
774  return kFALSE;
775 }
776 
777 //________________________________________________________________________
779 {
780  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
781  Double_t massXi = casc->MassXi();
782  Bool_t issideband = kFALSE;
783  if((massXi-mxiPDG)>fProdMassTolXiRough-fProdMassTolXi) issideband = kTRUE;
784  if((massXi-mxiPDG)<-fProdMassTolXiRough+fProdMassTolXi) issideband = kTRUE;
785  return issideband;
786 }
787 
788 //________________________________________________________________________
790 {
791  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
792  Double_t massXi = casc->M();
793  Bool_t issideband = kFALSE;
794  if((massXi-mxiPDG)>fProdMassTolXiRough-fProdMassTolXi) issideband = kTRUE;
795  if((massXi-mxiPDG)<-fProdMassTolXiRough+fProdMassTolXi) issideband = kTRUE;
796  return issideband;
797 }
798 
Double_t fSigmaElectronTPCMax
nSigma electron lower limit (par2)
AliRDHFCutsXictoeleXifromAODtracks(const char *name="CutsXictoeleXi")
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Bool_t fExcludePionTPC
pT cut for Lc used before object creation
Double_t fProdRfidMaxV0
Minimum Decay vertex of V0.
Bool_t SingleCascadeCuts(AliAODcascade *casc, Double_t *vert)
AliRDHFCutsXictoeleXifromAODtracks & operator=(const AliRDHFCutsXictoeleXifromAODtracks &source)
Double_t fProdDcaV0PrToPrimVertexMin
Min Dca between v0 and PV.
Bool_t fExcludeKaonTPC
Flag wheter to exlude proton band.
Double_t fProdV0CosineOfPoiningAngleXiMin
Min Xi cos pointing angle to PV.
Double_t fExcludenSigmaPionTPC
Flag wheter to exlude proton band.
Double_t GetSigma(Int_t idet) const
Definition: AliAODPidHF.h:134
virtual void GetCutVarsForOpt(AliAODRecoDecayHF *d, Float_t *vars, Int_t nvars, Int_t *pdgdaughters)
Double_t fProdCascEtaMin
Minimum number of TPC clusters.
Double_t fProdMassTolXi
Tolerance of Xi mass from PDG value (including sideband)
Double_t fProdDcaBachToPrimVertexMin
Max Dca between V0 daughters.
Double_t fProdMassRejOmega
Tolerance of Xi mass from PDG value.
Double_t fProdTrackTPCNclsRatioMin
Min. Number of TPC PID cluster.
Double_t fProdDcaV0DaughtersMax
Max Dca between Xi daughters.
virtual Int_t IsSelectedPID(AliAODRecoDecayHF *obj)
Double_t fExcludenSigmaKaonTPC
nSigma to exclude for proton band
Double_t fProdRfidMaxXi
Minimum Decay vertex of Xi.
Double_t fSigmaElectronTPCMin
nSigma to exclude for Kaon band
Double_t fProdDcaV0ToPrimVertexMin
Min Dca between Bachelor and PV.
Bool_t fExcludeProtonTPC
Flag wheter to exlude pion band.
void SetNVars(Int_t nVars)
Definition: AliRDHFCuts.h:362
AliAODPidHF * fPidObjCascPr
PID object for cascade-pion.
AliRDHFCuts & operator=(const AliRDHFCuts &source)
Bool_t fUsePID
Definition: AliRDHFCuts.h:389
Bool_t fUseCascadePID
Threshold used in IsSelectedCombinedPID.
Double_t fSigmaElectronTOFMin
nSigma to exclude for Kaon band
Double_t fProdDcaV0PiToPrimVertexMin
Min Dca between v0-proton and PV.
Double_t fProdMassTolLambda
Flag for AOD filter Bit used before object creation.
Bool_t SingleTrkCuts(AliAODTrack *trk, AliAODVertex *primvert)
Int_t fnVarsForOpt
Definition: AliRDHFCuts.h:384
Bool_t SelectWithRoughCuts(AliAODcascade *casc, AliAODTrack *trk1)
Double_t fSigmaElectronTPCPtDepPar1
nSigma electron lower limit (par0)
Double_t fSigmaElectronTPCPtDepPar0
nSigma to exclude for Kaon band
Double_t fMaxPtCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:411
AliESDtrackCuts * fTrackCuts
quality cuts on the daughter tracks
Definition: AliRDHFCuts.h:377
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
Double_t fSigmaElectronTPCPtDepPar2
nSigma electron lower limit (par1)
Bool_t IsDaughterSelected(AliAODTrack *track, const AliESDVertex *primary, AliESDtrackCuts *cuts) const
AliAODTrack * GetBachelor() const
Double_t fSigmaElectronTOFMax
nSigma to exclude for Kaon band
Int_t fProdTrackTPCNclsPIDMin
PID object for cascade-proton.
Int_t MakeRawPid(AliAODTrack *track, Int_t specie)
AliPIDResponse * GetPidResponse() const
Definition: AliAODPidHF.h:160
Float_t * fCutsRD
fnVars*fnPtBins
Definition: AliRDHFCuts.h:387
Double_t fProdMassTolXiRough
Tolerance of Lambda mass from PDG value.
Double_t fProdXiCosineOfPoiningAngleMin
Min Dca between v0-pion and PV.
Double_t fProdCascProperDecayLengthMax
Max Decay vertex of Xi.
void SetVarsForOpt(Int_t nVars, Bool_t *forOpt)
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:385
Double_t fProdCascNTPCClustersMin
Min V0 cos pointing angle to Xi vertex.
Double_t fProdCascRapMax
Minimum rapidity of cascade.
Bool_t fProdUseAODFilterBit
Min. Number of TPC PID cluster.
AliAODPidHF * fPidObjCascPi
Use PID for cascade or not.
Double_t fProdRfidMinV0
Rejection range of Omega mass from PDG value.
void SetPtBins(Int_t nPtBinLimits, Float_t *ptBinLimits)
Double_t fExcludenSigmaProtonTPC
nSigma to exclude for pion band
Double_t fProdCascPtMin
Maximum rapidity of cascade.
Bool_t SingleTrkCutsNoPID(AliAODTrack *trk, AliAODVertex *primvert)
Double_t fProdRoughPtMin
Mass cut for Lc used before object creation.
AliAODPidHF * fPidHF
enable AOD049 centrality cleanup
Definition: AliRDHFCuts.h:391
Int_t PtBin(Double_t pt) const
Int_t GetGlobalIndex(Int_t iVar, Int_t iPtBin) const
Double_t fMinPtCand
outcome of PID selection
Definition: AliRDHFCuts.h:410
void SetPidResponse(AliPIDResponse *pidResp)
Definition: AliAODPidHF.h:111