AliPhysics  a0db429 (a0db429)
 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  fConversionMassMax(-1.)
103 {
104  //
105  // Default Constructor
106  //
107 
108  const Int_t nvars=2;
109  SetNVars(nvars);
110  TString varNames[nvars]={
111  "InvMass [GeV/c2]", //0
112  "cos(Opening angle) [cos(rad)]" //1
113  };
114 
115  Bool_t isUpperCut[nvars]={
116  kTRUE, //0
117  kFALSE //1
118  };
119  SetVarNames(nvars,varNames,isUpperCut);
120  Bool_t forOpt[nvars]={
121  kTRUE, //0
122  kTRUE, //1
123  };
124  SetVarsForOpt(nvars,forOpt);
125 
126  Float_t limits[2]={0,999999999.};
127  SetPtBins(2,limits);
128 }
129 //--------------------------------------------------------------------------
131  AliRDHFCuts(source),
132  fPIDStrategy(source.fPIDStrategy),
133  fCombinedPIDThreshold(source.fCombinedPIDThreshold),
134  fUseCascadePID(source.fUseCascadePID),
135  fPidObjCascPi(source.fPidObjCascPi),
136  fPidObjCascPr(source.fPidObjCascPr),
137  fProdTrackTPCNclsPIDMin(source.fProdTrackTPCNclsPIDMin),
138  fProdTrackTPCNclsRatioMin(source.fProdTrackTPCNclsRatioMin),
139  fProdUseAODFilterBit(source.fProdUseAODFilterBit),
140  fProdMassTolLambda(source.fProdMassTolLambda),
141  fProdMassTolXiRough(source.fProdMassTolXiRough),
142  fProdMassTolXi(source.fProdMassTolXi),
143  fProdMassRejOmega(source.fProdMassRejOmega),
144  fProdRfidMinV0(source.fProdRfidMinV0),
145  fProdRfidMaxV0(source.fProdRfidMaxV0),
146  fProdRfidMinXi(source.fProdRfidMinXi),
147  fProdRfidMaxXi(source.fProdRfidMaxXi),
148  fProdCascProperDecayLengthMax(source.fProdCascProperDecayLengthMax),
149  fProdDcaXiDaughtersMax(source.fProdDcaXiDaughtersMax),
150  fProdDcaV0DaughtersMax(source.fProdDcaV0DaughtersMax),
151  fProdDcaBachToPrimVertexMin(source.fProdDcaBachToPrimVertexMin),
152  fProdDcaV0ToPrimVertexMin(source.fProdDcaV0ToPrimVertexMin),
153  fProdDcaV0PrToPrimVertexMin(source.fProdDcaV0PrToPrimVertexMin),
154  fProdDcaV0PiToPrimVertexMin(source.fProdDcaV0PiToPrimVertexMin),
155  fProdXiCosineOfPoiningAngleMin(source.fProdXiCosineOfPoiningAngleMin),
156  fProdV0CosineOfPoiningAngleXiMin(source.fProdV0CosineOfPoiningAngleXiMin),
157  fProdCascNTPCClustersMin(source.fProdCascNTPCClustersMin),
158  fProdCascEtaMin(source.fProdCascEtaMin),
159  fProdCascEtaMax(source.fProdCascEtaMax),
160  fProdCascRapMin(source.fProdCascRapMin),
161  fProdCascRapMax(source.fProdCascRapMax),
162  fProdCascPtMin(source.fProdCascPtMin),
163  fProdCascPtMax(source.fProdCascPtMax),
164  fProdRoughMassTol(source.fProdRoughMassTol),
165  fProdRoughPtMin(source.fProdRoughPtMin),
166  fExcludePionTPC(source.fExcludePionTPC),
167  fExcludeProtonTPC(source.fExcludeProtonTPC),
168  fExcludeKaonTPC(source.fExcludeKaonTPC),
169  fExcludenSigmaPionTPC(source.fExcludenSigmaPionTPC),
170  fExcludenSigmaProtonTPC(source.fExcludenSigmaProtonTPC),
171  fExcludenSigmaKaonTPC(source.fExcludenSigmaKaonTPC),
172  fSigmaElectronTPCMin(source.fSigmaElectronTPCMin),
173  fSigmaElectronTPCPtDepPar0(source.fSigmaElectronTPCPtDepPar0),
174  fSigmaElectronTPCPtDepPar1(source.fSigmaElectronTPCPtDepPar1),
175  fSigmaElectronTPCPtDepPar2(source.fSigmaElectronTPCPtDepPar2),
176  fSigmaElectronTPCMax(source.fSigmaElectronTPCMax),
177  fSigmaElectronTOFMin(source.fSigmaElectronTOFMin),
178  fSigmaElectronTOFMax(source.fSigmaElectronTOFMax),
179  fConversionMassMax(source.fConversionMassMax)
180 {
181  //
182  // Copy constructor
183  //
184 }
185 //--------------------------------------------------------------------------
187 {
188  //
189  // assignment operator
190  //
191 
192  if (this != &source) {
193  AliRDHFCuts::operator=(source);
194  }
195 
196  fPIDStrategy = source.fPIDStrategy;
199  fPidObjCascPi = source.fPidObjCascPi;
200  fPidObjCascPr = source.fPidObjCascPr;
244 
245 
246  return *this;
247 }
248 
249 //---------------------------------------------------------------------------
251  //
252  // Default Destructor
253  //
254 
255 }
256 
257 //---------------------------------------------------------------------------
258 void AliRDHFCutsXictoeleXifromAODtracks::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) {
259  //
260  // Fills in vars the values of the variables
261  //
262 
263  if (pdgdaughters[0]==-9999) return; // dummy
264 
266  if(!dd){
267  AliError("No AliAODRecoCascadeHF object found\n");
268  return;
269  }
270 
271  if (nvars!=fnVarsForOpt) {
272  AliError("Cut object seems to have the wrong number of variables\n");
273  return;
274  }
275 
276  //Double_t ptD=d->Pt();
277  //Int_t ptbin=PtBin(ptD);
278  Int_t iter=-1;
279 
280  if(fVarsForOpt[0]){
281  iter++;
282  UInt_t pdgdg[2]={11,3312};
283  vars[iter]= dd->InvMass(2,pdgdg);
284  }
285  if(fVarsForOpt[1]){
286  iter++;
287  Double_t xipx = dd->PxProng(1);
288  Double_t xipy = dd->PyProng(1);
289  Double_t xipz = dd->PzProng(1);
290  Double_t epx = dd->PxProng(0);
291  Double_t epy = dd->PyProng(0);
292  Double_t epz = dd->PzProng(0);
293  vars[iter]= (xipx*epx+xipy*epy+xipz*epz)/sqrt(xipx*xipx+xipy*xipy+xipz*xipz)/sqrt(epx*epx+epy*epy+epz*epz);
294  }
295 
296  return;
297 }
298 
299 //---------------------------------------------------------------------------
300 Int_t AliRDHFCutsXictoeleXifromAODtracks::IsSelected(TObject* obj, Int_t selectionLevel) {
301  //
302  // Apply selection
303  //
304 
305  if (!fCutsRD) {
306  AliFatal("Cut matrix not inizialized. Exit...");
307  return 0;
308  }
309 
311  if(!d){
312  AliDebug(2,"AliAODRecoCascadeHF null");
313  return 0;
314  }
315 
316  Double_t ptD=d->Pt();
317  if(ptD<fMinPtCand) return 0;
318  if(ptD>fMaxPtCand) return 0;
319 
320  if (selectionLevel==AliRDHFCuts::kAll ||
321  selectionLevel==AliRDHFCuts::kTracks) {
322  //Performed in production stage
323  }
324 
325  Int_t returnvalueCuts=1;
326  // selection on candidate
327  if (selectionLevel==AliRDHFCuts::kAll ||
328  selectionLevel==AliRDHFCuts::kCandidate) {
329 
330  Double_t pt=d->Pt();
331  Int_t ptbin=PtBin(pt);
332  if (ptbin==-1) {
333  return 0;
334  }
335  Bool_t okcand=kTRUE;
336 
337  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
338  UInt_t pdgdg[2]={11,3312};
339  Double_t InvMassEleXi = d->InvMass(2,pdgdg);
340  Double_t xipx = d->PxProng(1);
341  Double_t xipy = d->PyProng(1);
342  Double_t xipz = d->PzProng(1);
343  Double_t epx = d->PxProng(0);
344  Double_t epy = d->PyProng(0);
345  Double_t epz = d->PzProng(0);
346  Double_t cosoa = (xipx*epx+xipy*epy+xipz*epz)/sqrt(xipx*xipx+xipy*xipy+xipz*xipz)/sqrt(epx*epx+epy*epy+epz*epz);
347 
348  if(InvMassEleXi > fCutsRD[GetGlobalIndex(0,ptbin)])
349  {
350  okcand = kFALSE;
351  }
352  if(cosoa < fCutsRD[GetGlobalIndex(1,ptbin)])
353  {
354  okcand = kFALSE;
355  }
356 
357  if(!okcand) return 0;
358  returnvalueCuts = 1;
359  }
360 
361  Int_t returnvaluePID=1;
362  if(selectionLevel==AliRDHFCuts::kAll ||
363  selectionLevel==AliRDHFCuts::kCandidate||
364  selectionLevel==AliRDHFCuts::kPID) {
365  //not used. applied at single level
366  }
367 
368  Int_t returnvalue = 0;
369  if(returnvalueCuts==1 && returnvaluePID==1) returnvalue=1;
370 
371  return returnvalue;
372 }
373 
374 //---------------------------------------------------------------------------
376 {
377  //
378  // IsSelectedPID
379  //
380 
381  if(!fUsePID || !obj) return 1;
382 
384  AliAODTrack *part = dd->GetBachelor();
385 
386  Int_t returnvalue=1;
387 
388  if(fPidHF->GetPidResponse()==0x0){
389  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
390  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
391  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
392  fPidHF->SetPidResponse(pidResp);
393  }
394 
395  Int_t isElectron=fPidHF->MakeRawPid(part,0);
396  if(isElectron<1) returnvalue = 0;
397 
398  return returnvalue;
399 }
400 
401 //---------------------------------------------------------------------------
403  //
404  // IsSelectedCombinedPID
405  //
406 
407  if(!fUsePID || !obj) {return 1;}
408 
410  AliAODTrack *part = dd->GetBachelor();
411  if(!part) return 0;
412 
413  Int_t returnvalue=1;
414 
415  return returnvalue;
416 }
417 
418 //________________________________________________________________________
419 Bool_t AliRDHFCutsXictoeleXifromAODtracks::SingleTrkCuts(AliAODTrack *trk, AliAODVertex *primVert)
420 {
421  //
422  // Single Track Cut to be applied before object creation
423  //
424 
425  if(trk->GetStatus()&AliESDtrack::kITSpureSA) return kFALSE;
426  if(!(trk->GetStatus()&AliESDtrack::kITSin)) return kFALSE;
427  if(fProdUseAODFilterBit && !trk->TestFilterMask(BIT(4))) return kFALSE;
428 
429  Double_t pos[3]; primVert->GetXYZ(pos);
430  Double_t cov[6]; primVert->GetCovarianceMatrix(cov);
431  const AliESDVertex vESD(pos,cov,100.,100);
432  if(fTrackCuts&&!IsDaughterSelected(trk,&vESD,fTrackCuts)) return kFALSE;
433 
434  if(trk->GetTPCsignalN()<fProdTrackTPCNclsPIDMin) return kFALSE;
435  if(trk->GetTPCNclsF()>0){
436  Float_t tpcratio = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
437  if(tpcratio<fProdTrackTPCNclsRatioMin) return kFALSE;
438  }
439 
440  if(fUsePID)
441  {
442  if(fPidHF->GetPidResponse()==0x0){
443  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
444  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
445  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
446  fPidHF->SetPidResponse(pidResp);
447  }
448 
449  switch(fPIDStrategy){
450  case kNSigmaCuts:
451  return IsSelectedeID(trk);
452  break;
454  return IsSelectedCustomizedeID(trk);
455  break;
457  return IsSelectedCustomizedPtDepeID(trk);
458  break;
459  case kCombinedCuts:
460  return IsSelectedCombinedeID(trk);
461  break;
462  }
463 
464  }
465 
466  return kTRUE;
467 }
468 //________________________________________________________________________
469 Bool_t AliRDHFCutsXictoeleXifromAODtracks::SingleTrkCutsNoPID(AliAODTrack *trk, AliAODVertex *primVert)
470 {
471  //
472  // Single Track Cut to be applied before object creation
473  //
474 
475  if(trk->GetStatus()&AliESDtrack::kITSpureSA) return kFALSE;
476  if(!(trk->GetStatus()&AliESDtrack::kITSin)) return kFALSE;
477  if(fProdUseAODFilterBit && !trk->TestFilterMask(BIT(4))) return kFALSE;
478 
479  Double_t pos[3]; primVert->GetXYZ(pos);
480  Double_t cov[6]; primVert->GetCovarianceMatrix(cov);
481  const AliESDVertex vESD(pos,cov,100.,100);
482  if(fTrackCuts&&!IsDaughterSelected(trk,&vESD,fTrackCuts)) return kFALSE;
483 
484  if(trk->GetTPCsignalN()<fProdTrackTPCNclsPIDMin) return kFALSE;
485  if(trk->GetTPCNclsF()>0){
486  Float_t tpcratio = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
487  if(tpcratio<fProdTrackTPCNclsRatioMin) return kFALSE;
488  }
489 
490  return kTRUE;
491 }
492 //________________________________________________________________________
494 {
495  //
496  // electron ID first shot
497  //
498 
499  Double_t nSigmaPion = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
500  if(fExcludePionTPC){
501  if(TMath::Abs(nSigmaPion)<fExcludenSigmaPionTPC){
502  return kFALSE;
503  }
504  }
505 
506  Double_t nSigmaProton = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
507  if(fExcludeProtonTPC){
508  if(TMath::Abs(nSigmaProton)<fExcludenSigmaProtonTPC){
509  return kFALSE;
510  }
511  }
512 
513  Double_t nSigmaKaon = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
514  if(fExcludeKaonTPC){
515  if(TMath::Abs(nSigmaKaon)<fExcludenSigmaKaonTPC){
516  return kFALSE;
517  }
518  }
519 
520  Int_t isElectron=fPidHF->MakeRawPid(trk,0);
521  if(isElectron<1) return kFALSE;
522 
523  return kTRUE;
524 }
525 //________________________________________________________________________
527 {
528  //
529  // electron ID first shot
530  //
531 
532  Double_t nSigmaPion = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
533  if(fExcludePionTPC){
534  if(TMath::Abs(nSigmaPion)<fExcludenSigmaPionTPC){
535  return kFALSE;
536  }
537  }
538 
539  Double_t nSigmaProton = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
540  if(fExcludeProtonTPC){
541  if(TMath::Abs(nSigmaProton)<fExcludenSigmaProtonTPC){
542  return kFALSE;
543  }
544  }
545 
546  Double_t nSigmaKaon = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
547  if(fExcludeKaonTPC){
548  if(TMath::Abs(nSigmaKaon)<fExcludenSigmaKaonTPC){
549  return kFALSE;
550  }
551  }
552 
553  Double_t nSigmaTPCele = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
554  Double_t nSigmaTOFele = fPidHF->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
555 
556  if(nSigmaTPCele<fSigmaElectronTPCMin) return kFALSE;
557  if(nSigmaTPCele>fSigmaElectronTPCMax) return kFALSE;
558  if(fabs(fSigmaElectronTOFMin)<10.&&fabs(fSigmaElectronTOFMax)<10.){
559  if(nSigmaTOFele<fSigmaElectronTOFMin) return kFALSE;
560  if(nSigmaTOFele>fSigmaElectronTOFMax) return kFALSE;
561  }
562 
563  return kTRUE;
564 }
565 //________________________________________________________________________
567 {
568  //
569  // electron ID pt dependent
570  //
571 
572  Double_t nSigmaTPCele = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
573  Double_t nSigmaTOFele = fPidHF->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
574 
575  if(nSigmaTOFele<fSigmaElectronTOFMin) return kFALSE;
576  if(nSigmaTOFele>fSigmaElectronTOFMax) return kFALSE;
577 
578  Double_t pte = trk->Pt();
581  if(nSigmaTPCele<nsigmamin) return kFALSE;
582  if(nSigmaTPCele>fSigmaElectronTPCMax) return kFALSE;
583 
584  return kTRUE;
585 }
586 //________________________________________________________________________
588 {
589  //
590  // electron ID Basyian not implemented
591  //
592 
593  return kTRUE;
594 }
595 //________________________________________________________________________
596 Bool_t AliRDHFCutsXictoeleXifromAODtracks::SingleCascadeCuts(AliAODcascade *casc,Double_t *primvert)
597 {
598  //
599  // Single Cascade Cut
600  //
601 
602  if(!casc) return kFALSE;
603  if(!(casc->GetSecondaryVtx())) return kFALSE;
604  if(!(casc->GetDecayVertexXi())) return kFALSE;
605 
606  AliAODTrack *ptrack = (AliAODTrack*) (casc->GetDaughter(0));
607  AliAODTrack *ntrack = (AliAODTrack*) (casc->GetDaughter(1));
608  AliAODTrack *btrack = (AliAODTrack*) (casc->GetDecayVertexXi()->GetDaughter(0));
609 
610  if(!ptrack||!ntrack||!btrack) return kFALSE;
611 
612  if(ptrack->Charge()<0 && ntrack->Charge()>0){
613  ptrack = (AliAODTrack*) (casc->GetDaughter(1));
614  ntrack = (AliAODTrack*) (casc->GetDaughter(0));
615  }
616 
617  if(ptrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
618  if(ntrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
619  if(btrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
620 
621  Double_t pxxi = casc->MomXiX();
622  Double_t pyxi = casc->MomXiY();
623  Double_t ptxi = sqrt(pxxi*pxxi+pyxi*pyxi);
624  if(ptxi<fProdCascPtMin || ptxi>fProdCascPtMax) return kFALSE;
625 
626  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
627  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
628  Double_t momegaPDG = TDatabasePDG::Instance()->GetParticle(3334)->Mass();
629 
630  Double_t massLambda = casc->MassLambda();
631  Double_t massAntiLambda = casc->MassAntiLambda();
632  if(TMath::Abs(massLambda-mLPDG)>fProdMassTolLambda && TMath::Abs(massAntiLambda-mLPDG)>fProdMassTolLambda)
633  return kFALSE;
634 
635  Bool_t isparticle = kTRUE;
636  //if(TMath::Abs(massAntiLambda-mLPDG)<fProdMassTolLambda) isparticle = kFALSE;
637  if(casc->ChargeXi()>0) isparticle = kFALSE;
638 
639  Double_t massXi = casc->MassXi();
640  if(TMath::Abs(massXi-mxiPDG)>fProdMassTolXiRough)
641  return kFALSE;
642 
643  Double_t massOmega = casc->MassOmega();
644  if(TMath::Abs(massOmega-momegaPDG)<fProdMassRejOmega)
645  return kFALSE;
646 
647 
648  Double_t lPosXi[3];
649  lPosXi[0] = casc->DecayVertexXiX();
650  lPosXi[1] = casc->DecayVertexXiY();
651  lPosXi[2] = casc->DecayVertexXiZ();
652  Double_t decayvertXi = TMath::Sqrt(lPosXi[0]*lPosXi[0]+lPosXi[1]*lPosXi[1]);
653  Double_t lPosV0[3];
654  lPosV0[0] = casc->DecayVertexV0X();
655  lPosV0[1] = casc->DecayVertexV0Y();
656  lPosV0[2] = casc->DecayVertexV0Z();
657  Double_t decayvertV0 = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
658 
659  if(decayvertV0<fProdRfidMinV0 || decayvertV0>fProdRfidMaxV0) return kFALSE;
660  if(decayvertXi<fProdRfidMinXi || decayvertXi>fProdRfidMaxXi) return kFALSE;
661 
662  Double_t ptotxi = TMath::Sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)+pow(casc->MomXiZ(),2));
663  Double_t properdl = casc->DecayLengthXi(primvert[0],primvert[1],primvert[2])*mxiPDG/ptotxi;
664  if(properdl>fProdCascProperDecayLengthMax) return kFALSE;
665 
666  Double_t lDcaXiDaughters = casc->DcaXiDaughters();
667  Double_t lDcaV0Daughters = casc->DcaV0Daughters();
668  if(lDcaXiDaughters > fProdDcaXiDaughtersMax) return kFALSE;
669  if(lDcaV0Daughters > fProdDcaV0DaughtersMax) return kFALSE;
670 
671  Double_t lDcaBachToPrimVertex = casc->DcaBachToPrimVertex();
672  Double_t lDcaV0ToPrimVertex = casc->DcaV0ToPrimVertex();
673  Double_t lDcaPosToPrimVertex = casc->DcaPosToPrimVertex();
674  Double_t lDcaNegToPrimVertex = casc->DcaNegToPrimVertex();
675  if(lDcaBachToPrimVertex < fProdDcaBachToPrimVertexMin) return kFALSE;
676  if(lDcaV0ToPrimVertex < fProdDcaV0ToPrimVertexMin) return kFALSE;
677  if(isparticle){
678  if(lDcaPosToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
679  if(lDcaNegToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
680  }else{
681  if(lDcaPosToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
682  if(lDcaNegToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
683  }
684 
685  Double_t lXiCosineOfPointingAngle = casc->CosPointingAngleXi(primvert[0],primvert[1],primvert[2]);
686  Double_t lV0CosineOfPointingAngleXi = casc->CosPointingAngle(lPosXi);
687 
688  if(lXiCosineOfPointingAngle < fProdXiCosineOfPoiningAngleMin) return kFALSE;
689  if(lV0CosineOfPointingAngleXi < fProdV0CosineOfPoiningAngleXiMin) return kFALSE;
690 
691  if(fUseCascadePID)
692  {
693  if(fPidObjCascPi->GetPidResponse()==0x0){
694  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
695  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
696  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
697  fPidObjCascPi->SetPidResponse(pidResp);
698  }
699  if(fPidObjCascPr->GetPidResponse()==0x0){
700  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
701  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
702  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
703  fPidObjCascPr->SetPidResponse(pidResp);
704  }
705  if(isparticle){
706  Int_t isProton = -9999;
707  Int_t isPion1 = -9999;
708  Int_t isPion2 = -9999;
709  Double_t nsigmatpc_proton = fPidObjCascPr->GetSigma(0);
710  Double_t nsigmatpc_pion = fPidObjCascPi->GetSigma(0);
711  Double_t nSigmaTPCpr = fPidObjCascPr->GetPidResponse()->NumberOfSigmasTPC(ptrack,AliPID::kProton);
712  Double_t nSigmaTPCpi1 = fPidObjCascPi->GetPidResponse()->NumberOfSigmasTPC(ntrack,AliPID::kPion);
713  Double_t nSigmaTPCpi2 = fPidObjCascPi->GetPidResponse()->NumberOfSigmasTPC(btrack,AliPID::kPion);
714  if(fabs(nSigmaTPCpr)<nsigmatpc_proton) isProton = 1;
715  if(fabs(nSigmaTPCpi1)<nsigmatpc_pion) isPion1 = 1;
716  if(fabs(nSigmaTPCpi2)<nsigmatpc_pion) isPion2 = 1;
717  if(isProton<1) return kFALSE;
718  if(isPion1<1) return kFALSE;
719  if(isPion2<1) return kFALSE;
720  }else{
721  Int_t isProton = -9999;
722  Int_t isPion1 = -9999;
723  Int_t isPion2 = -9999;
724  Double_t nsigmatpc_proton = fPidObjCascPr->GetSigma(0);
725  Double_t nsigmatpc_pion = fPidObjCascPi->GetSigma(0);
726  Double_t nSigmaTPCpr = fPidObjCascPr->GetPidResponse()->NumberOfSigmasTPC(ntrack,AliPID::kProton);
727  Double_t nSigmaTPCpi1 = fPidObjCascPi->GetPidResponse()->NumberOfSigmasTPC(ptrack,AliPID::kPion);
728  Double_t nSigmaTPCpi2 = fPidObjCascPi->GetPidResponse()->NumberOfSigmasTPC(btrack,AliPID::kPion);
729  if(fabs(nSigmaTPCpr)<nsigmatpc_proton) isProton = 1;
730  if(fabs(nSigmaTPCpi1)<nsigmatpc_pion) isPion1 = 1;
731  if(fabs(nSigmaTPCpi2)<nsigmatpc_pion) isPion2 = 1;
732  if(isProton<1) return kFALSE;
733  if(isPion1<1) return kFALSE;
734  if(isPion2<1) return kFALSE;
735  }
736  }
737 
738  Double_t RapXi = casc->RapXi();
739  if(RapXi<fProdCascRapMin || RapXi>fProdCascRapMax) return kFALSE;
740 
741  Double_t EtaXi = 0.5*TMath::Log((ptotxi+casc->MomXiZ())/(ptotxi-casc->MomXiZ()));
742  if(EtaXi<fProdCascEtaMin || EtaXi>fProdCascEtaMax) return kFALSE;
743 
744  return kTRUE;
745 }
746 
747 //________________________________________________________________________
748 Bool_t AliRDHFCutsXictoeleXifromAODtracks::SelectWithRoughCuts(AliAODcascade *casc, AliAODTrack *part)
749 {
750  //
751  // Mass and pT Cut to be applied before object creation
752  // Not used now
753  //
754  if(!casc) return kFALSE;
755  if(!part) return kFALSE;
756 
757  return kTRUE;
758 }
759 
760 //________________________________________________________________________
762 {
763  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
764  Double_t massXi = casc->MassXi();
765  if(TMath::Abs(massXi-mxiPDG)<fProdMassTolXi)
766  return kTRUE;
767  return kFALSE;
768 }
769 
770 //________________________________________________________________________
772 {
773  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
774  Double_t massXi = casc->M();
775  if(TMath::Abs(massXi-mxiPDG)<fProdMassTolXi)
776  return kTRUE;
777  return kFALSE;
778 }
779 
780 //________________________________________________________________________
782 {
783  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
784  Double_t massXi = casc->MassXi();
785  Bool_t issideband = kFALSE;
786  if((massXi-mxiPDG)>fProdMassTolXiRough-fProdMassTolXi) issideband = kTRUE;
787  if((massXi-mxiPDG)<-fProdMassTolXiRough+fProdMassTolXi) issideband = kTRUE;
788  return issideband;
789 }
790 
791 //________________________________________________________________________
793 {
794  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
795  Double_t massXi = casc->M();
796  Bool_t issideband = kFALSE;
797  if((massXi-mxiPDG)>fProdMassTolXiRough-fProdMassTolXi) issideband = kTRUE;
798  if((massXi-mxiPDG)<-fProdMassTolXiRough+fProdMassTolXi) issideband = kTRUE;
799  return issideband;
800 }
801 
802 //________________________________________________________________________
803 Bool_t AliRDHFCutsXictoeleXifromAODtracks::TagConversions(AliAODTrack *etrk, AliAODEvent *evt, Int_t ntrk, Double_t &minmass)
804 {
805  //
806  // Tag conversion electron tracks
807  //
808  if(fConversionMassMax<0.) return kFALSE;
809 
810  Bool_t isconv = kFALSE;
811  minmass = 9999.;
812 
813  Int_t trkid = etrk->GetID();
814  Double_t px1 = etrk->Px();
815  Double_t py1 = etrk->Py();
816  Double_t pz1 = etrk->Pz();
817  Double_t E1 = sqrt(px1*px1+py1*py1+pz1*pz1+0.000511*0.000511);
818 
819  for(Int_t it=0;it<ntrk;it++){
820  AliAODTrack *trk2 = (AliAODTrack*) evt->GetTrack(it);
821  if(!trk2) continue;
822  Int_t trkid2 = trk2->GetID();
823  if(trkid==trkid2) continue;
824  if(etrk->Charge()*trk2->Charge()>0) continue;
825  if(!etrk->TestFilterMask(BIT(4))) continue;
826 
827  Double_t px2 = trk2->Px();
828  Double_t py2 = trk2->Py();
829  Double_t pz2 = trk2->Pz();
830  Double_t E2 = sqrt(px2*px2+py2*py2+pz2*pz2+0.000511*0.000511);
831 
832  Double_t mass = sqrt(pow(E1+E2,2)-pow(px1+px2,2)-pow(py1+py2,2)-pow(pz1+pz2,2));
833  if(mass<minmass) minmass = mass;
834  }
835 
836  if(minmass<fConversionMassMax) isconv = kTRUE;
837 
838  return isconv;
839 }
840 //________________________________________________________________________
841 Bool_t AliRDHFCutsXictoeleXifromAODtracks::TagConversionsSameSign(AliAODTrack *etrk, AliAODEvent *evt, Int_t ntrk, Double_t &minmass)
842 {
843  //
844  // Tag conversion electron tracks
845  //
846  if(fConversionMassMax<0.) return kFALSE;
847 
848  Bool_t isconv = kFALSE;
849  minmass = 9999.;
850 
851  Int_t trkid = etrk->GetID();
852  Double_t px1 = etrk->Px();
853  Double_t py1 = etrk->Py();
854  Double_t pz1 = etrk->Pz();
855  Double_t E1 = sqrt(px1*px1+py1*py1+pz1*pz1+0.000511*0.000511);
856 
857  for(Int_t it=0;it<ntrk;it++){
858  AliAODTrack *trk2 = (AliAODTrack*) evt->GetTrack(it);
859  if(!trk2) continue;
860  Int_t trkid2 = trk2->GetID();
861  if(trkid==trkid2) continue;
862  if(etrk->Charge()*trk2->Charge()<0) continue;
863  if(!etrk->TestFilterMask(BIT(4))) continue;
864 
865  Double_t px2 = trk2->Px();
866  Double_t py2 = trk2->Py();
867  Double_t pz2 = trk2->Pz();
868  Double_t E2 = sqrt(px2*px2+py2*py2+pz2*pz2+0.000511*0.000511);
869 
870  Double_t mass = sqrt(pow(E1+E2,2)-pow(px1+px2,2)-pow(py1+py2,2)-pow(pz1+pz2,2));
871  if(mass<minmass) minmass = mass;
872  }
873 
874  if(minmass<fConversionMassMax) isconv = kTRUE;
875 
876  return isconv;
877 }
Double_t fConversionMassMax
nSigma to exclude for Kaon band
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 mass
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)
Bool_t TagConversions(AliAODTrack *etrk, AliAODEvent *evt, Int_t ntrk, Double_t &minmass)
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
Bool_t TagConversionsSameSign(AliAODTrack *etrk, AliAODEvent *evt, Int_t ntrk, Double_t &minmass)
void SetPidResponse(AliPIDResponse *pidResp)
Definition: AliAODPidHF.h:111