AliPhysics  f2694b8 (f2694b8)
 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  fBzkG(0),
61  fProdTrackTPCNclsPIDMin(0),
62  fProdTrackTPCNclsRatioMin(0.0),
63  fProdUseAODFilterBit(kTRUE),
64  fProdAODFilterBit(4),
65  fProdRejectTrackWithShared(kFALSE),
66  fProdMassTolLambda(0.010),
67  fProdMassTolXiRough(0.020),
68  fProdMassTolXi(0.008),
69  fProdMassRejOmega(0.008),
70  fProdRfidMinV0(0.6),
71  fProdRfidMaxV0(100.0),
72  fProdRfidMinXi(0.6),
73  fProdRfidMaxXi(100.0),
74  fProdCascProperDecayLengthMax(100.0),
75  fProdDcaXiDaughtersMax(100.),
76  fProdDcaV0DaughtersMax(100.),
77  fProdDcaBachToPrimVertexMin(0.),
78  fProdDcaV0ToPrimVertexMin(0.),
79  fProdDcaV0PrToPrimVertexMin(0.),
80  fProdDcaV0PiToPrimVertexMin(0.),
81  fProdXiCosineOfPoiningAngleMin(-1.),
82  fProdV0CosineOfPoiningAngleXiMin(-1.),
83  fProdCascNTPCClustersMin(0.0),
84  fProdCascEtaMin(-9999.),
85  fProdCascEtaMax(9999.),
86  fProdCascRapMin(-9999.),
87  fProdCascRapMax(9999.),
88  fProdCascPtMin(0.),
89  fProdCascPtMax(9999.),
90  fProdRoughMassTol(0.25),
91  fProdRoughPtMin(0.0),
92  fExcludePionTPC(kFALSE),
93  fExcludeProtonTPC(kFALSE),
94  fExcludeKaonTPC(kFALSE),
95  fExcludenSigmaPionTPC(3.),
96  fExcludenSigmaProtonTPC(3.),
97  fExcludenSigmaKaonTPC(3.),
98  fSigmaElectronTPCMin(-9999.),
99  fSigmaElectronTPCPtDepPar0(-9999.),
100  fSigmaElectronTPCPtDepPar1(-9999.),
101  fSigmaElectronTPCPtDepPar2(0.),
102  fSigmaElectronTPCMax(9999.),
103  fSigmaElectronTOFMin(-9999.),
104  fSigmaElectronTOFMax(9999.),
105  fConversionMassMax(-1.)
106 {
107  //
108  // Default Constructor
109  //
110  for(Int_t i=0;i<3;i++){
111  fPrimVert[i] = 0.;
112  }
113 
114  const Int_t nvars=4;
115  SetNVars(nvars);
116  TString varNames[nvars]={
117  "InvMass [GeV/c2]", //0
118  "cos(Opening angle) [cos(rad)]", //1
119  "dPhiS", //2
120  "dEtaS" //3
121  };
122 
123  Bool_t isUpperCut[nvars]={
124  kTRUE, //0
125  kFALSE, //1
126  kFALSE, //2
127  kFALSE //3
128  };
129  SetVarNames(nvars,varNames,isUpperCut);
130  Bool_t forOpt[nvars]={
131  kTRUE, //0
132  kTRUE, //1
133  kTRUE, //2
134  kTRUE //3
135  };
136  SetVarsForOpt(nvars,forOpt);
137 
138  Float_t limits[2]={0,999999999.};
139  SetPtBins(2,limits);
140 }
141 //--------------------------------------------------------------------------
143  AliRDHFCuts(source),
144  fPIDStrategy(source.fPIDStrategy),
145  fCombinedPIDThreshold(source.fCombinedPIDThreshold),
146  fUseCascadePID(source.fUseCascadePID),
147  fPidObjCascPi(source.fPidObjCascPi),
148  fPidObjCascPr(source.fPidObjCascPr),
149  fBzkG(source.fBzkG),
150  fProdTrackTPCNclsPIDMin(source.fProdTrackTPCNclsPIDMin),
151  fProdTrackTPCNclsRatioMin(source.fProdTrackTPCNclsRatioMin),
152  fProdUseAODFilterBit(source.fProdUseAODFilterBit),
153  fProdAODFilterBit(source.fProdAODFilterBit),
154  fProdRejectTrackWithShared(source.fProdRejectTrackWithShared),
155  fProdMassTolLambda(source.fProdMassTolLambda),
156  fProdMassTolXiRough(source.fProdMassTolXiRough),
157  fProdMassTolXi(source.fProdMassTolXi),
158  fProdMassRejOmega(source.fProdMassRejOmega),
159  fProdRfidMinV0(source.fProdRfidMinV0),
160  fProdRfidMaxV0(source.fProdRfidMaxV0),
161  fProdRfidMinXi(source.fProdRfidMinXi),
162  fProdRfidMaxXi(source.fProdRfidMaxXi),
163  fProdCascProperDecayLengthMax(source.fProdCascProperDecayLengthMax),
164  fProdDcaXiDaughtersMax(source.fProdDcaXiDaughtersMax),
165  fProdDcaV0DaughtersMax(source.fProdDcaV0DaughtersMax),
166  fProdDcaBachToPrimVertexMin(source.fProdDcaBachToPrimVertexMin),
167  fProdDcaV0ToPrimVertexMin(source.fProdDcaV0ToPrimVertexMin),
168  fProdDcaV0PrToPrimVertexMin(source.fProdDcaV0PrToPrimVertexMin),
169  fProdDcaV0PiToPrimVertexMin(source.fProdDcaV0PiToPrimVertexMin),
170  fProdXiCosineOfPoiningAngleMin(source.fProdXiCosineOfPoiningAngleMin),
171  fProdV0CosineOfPoiningAngleXiMin(source.fProdV0CosineOfPoiningAngleXiMin),
172  fProdCascNTPCClustersMin(source.fProdCascNTPCClustersMin),
173  fProdCascEtaMin(source.fProdCascEtaMin),
174  fProdCascEtaMax(source.fProdCascEtaMax),
175  fProdCascRapMin(source.fProdCascRapMin),
176  fProdCascRapMax(source.fProdCascRapMax),
177  fProdCascPtMin(source.fProdCascPtMin),
178  fProdCascPtMax(source.fProdCascPtMax),
179  fProdRoughMassTol(source.fProdRoughMassTol),
180  fProdRoughPtMin(source.fProdRoughPtMin),
181  fExcludePionTPC(source.fExcludePionTPC),
182  fExcludeProtonTPC(source.fExcludeProtonTPC),
183  fExcludeKaonTPC(source.fExcludeKaonTPC),
184  fExcludenSigmaPionTPC(source.fExcludenSigmaPionTPC),
185  fExcludenSigmaProtonTPC(source.fExcludenSigmaProtonTPC),
186  fExcludenSigmaKaonTPC(source.fExcludenSigmaKaonTPC),
187  fSigmaElectronTPCMin(source.fSigmaElectronTPCMin),
188  fSigmaElectronTPCPtDepPar0(source.fSigmaElectronTPCPtDepPar0),
189  fSigmaElectronTPCPtDepPar1(source.fSigmaElectronTPCPtDepPar1),
190  fSigmaElectronTPCPtDepPar2(source.fSigmaElectronTPCPtDepPar2),
191  fSigmaElectronTPCMax(source.fSigmaElectronTPCMax),
192  fSigmaElectronTOFMin(source.fSigmaElectronTOFMin),
193  fSigmaElectronTOFMax(source.fSigmaElectronTOFMax),
194  fConversionMassMax(source.fConversionMassMax)
195 {
196  //
197  // Copy constructor
198  //
199  for(Int_t i=0;i<3;i++){
200  fPrimVert[i] = source.fPrimVert[i];
201  }
202 }
203 //--------------------------------------------------------------------------
205 {
206  //
207  // assignment operator
208  //
209 
210  if (this != &source) {
211  AliRDHFCuts::operator=(source);
212  }
213 
214  fPIDStrategy = source.fPIDStrategy;
217  fPidObjCascPi = source.fPidObjCascPi;
218  fPidObjCascPr = source.fPidObjCascPr;
219  fBzkG = source.fBzkG;
265 
266  for(Int_t i=0;i<3;i++){
267  fPrimVert[i] = source.fPrimVert[i];
268  }
269 
270  return *this;
271 }
272 
273 //---------------------------------------------------------------------------
275  //
276  // Default Destructor
277  //
278 
279 }
280 
281 //---------------------------------------------------------------------------
282 void AliRDHFCutsXictoeleXifromAODtracks::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) {
283  //
284  // Fills in vars the values of the variables
285  //
286 
287  if (pdgdaughters[0]==-9999) return; // dummy
288 
290  if(!dd){
291  AliError("No AliAODRecoCascadeHF object found\n");
292  return;
293  }
294 
295  if (nvars!=fnVarsForOpt) {
296  AliError("Cut object seems to have the wrong number of variables\n");
297  return;
298  }
299 
300  //Double_t ptD=d->Pt();
301  //Int_t ptbin=PtBin(ptD);
302  Int_t iter=-1;
303 
304  if(fVarsForOpt[0]){
305  iter++;
306  UInt_t pdgdg[2]={11,3312};
307  vars[iter]= dd->InvMass(2,pdgdg);
308  }
309  if(fVarsForOpt[1]){
310  iter++;
311  Double_t xipx = dd->PxProng(1);
312  Double_t xipy = dd->PyProng(1);
313  Double_t xipz = dd->PzProng(1);
314  Double_t epx = dd->PxProng(0);
315  Double_t epy = dd->PyProng(0);
316  Double_t epz = dd->PzProng(0);
317  vars[iter]= (xipx*epx+xipy*epy+xipz*epz)/sqrt(xipx*xipx+xipy*xipy+xipz*xipz)/sqrt(epx*epx+epy*epy+epz*epz);
318  }
319 
320  return;
321 }
322 
323 //---------------------------------------------------------------------------
324 Int_t AliRDHFCutsXictoeleXifromAODtracks::IsSelected(TObject* obj, Int_t selectionLevel) {
325  //
326  // Apply selection
327  //
328 
329  if (!fCutsRD) {
330  AliFatal("Cut matrix not inizialized. Exit...");
331  return 0;
332  }
333 
335  if(!d){
336  AliDebug(2,"AliAODRecoCascadeHF null");
337  return 0;
338  }
339 
340  Double_t ptD=d->Pt();
341  if(ptD<fMinPtCand) return 0;
342  if(ptD>fMaxPtCand) return 0;
343 
344  if (selectionLevel==AliRDHFCuts::kAll ||
345  selectionLevel==AliRDHFCuts::kTracks) {
346  //Performed in production stage
347  }
348 
349  Int_t returnvalueCuts=1;
350  // selection on candidate
351  if (selectionLevel==AliRDHFCuts::kAll ||
352  selectionLevel==AliRDHFCuts::kCandidate) {
353 
354  Double_t pt=d->Pt();
355  Int_t ptbin=PtBin(pt);
356  if (ptbin==-1) {
357  return 0;
358  }
359  Bool_t okcand=kTRUE;
360 
361  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
362  UInt_t pdgdg[2]={11,3312};
363  Double_t InvMassEleXi = d->InvMass(2,pdgdg);
364  Double_t xipx = d->PxProng(1);
365  Double_t xipy = d->PyProng(1);
366  Double_t xipz = d->PzProng(1);
367  Double_t epx = d->PxProng(0);
368  Double_t epy = d->PyProng(0);
369  Double_t epz = d->PzProng(0);
370  Double_t cosoa = (xipx*epx+xipy*epy+xipz*epz)/sqrt(xipx*xipx+xipy*xipy+xipz*xipz)/sqrt(epx*epx+epy*epy+epz*epz);
371 
372  Double_t dphis_e_pr, detas_e_pr, dphis_e_pi, detas_e_pi, dphis_e_bach, detas_e_bach;
373  dphis_e_pr = 9999.;
374  detas_e_pr = 9999.;
375  dphis_e_pi = 9999.;
376  detas_e_pi = 9999.;
377  dphis_e_bach = 9999.;
378  detas_e_bach = 9999.;
379  if(fCutsRD[GetGlobalIndex(2,ptbin)]>0 || fCutsRD[GetGlobalIndex(3,ptbin)]>0){
380  AliAODTrack *trke = (AliAODTrack*)d->GetDaughter(0);
381  AliAODcascade *casc = (AliAODcascade*)d->GetDaughter(1);
382  if(trke && casc){
383  AliAODTrack *cprtrk = 0;
384  AliAODTrack *cpitrk = 0;
385  AliAODTrack *cbtrk = 0;
386  if(casc->ChargeXi()<0){
387  cprtrk = (AliAODTrack*)casc->GetDaughter(0);
388  cpitrk = (AliAODTrack*)casc->GetDaughter(1);
389  cbtrk = (AliAODTrack*)casc->GetDecayVertexXi()->GetDaughter(0);
390  }else{
391  cprtrk = (AliAODTrack*)casc->GetDaughter(1);
392  cpitrk = (AliAODTrack*)casc->GetDaughter(0);
393  cbtrk = (AliAODTrack*)casc->GetDecayVertexXi()->GetDaughter(0);
394  }
395  if(cprtrk && cpitrk && cbtrk)
396  GetdPhiSdEtaSR125(trke,cprtrk,cpitrk,cbtrk,fBzkG,fPrimVert, dphis_e_pr,detas_e_pr,dphis_e_pi,detas_e_pi,dphis_e_bach,detas_e_bach);
397  }
398  }
399 
400  if(InvMassEleXi > fCutsRD[GetGlobalIndex(0,ptbin)])
401  {
402  okcand = kFALSE;
403  }
404  if(cosoa < fCutsRD[GetGlobalIndex(1,ptbin)])
405  {
406  okcand = kFALSE;
407  }
408  if(fabs(dphis_e_pr) < fCutsRD[GetGlobalIndex(2,ptbin)] && fabs(detas_e_pr) < fCutsRD[GetGlobalIndex(3,ptbin)])
409  {
410  okcand = kFALSE;
411  }
412  if(fabs(dphis_e_pi) < fCutsRD[GetGlobalIndex(2,ptbin)] && fabs(detas_e_pi) < fCutsRD[GetGlobalIndex(3,ptbin)])
413  {
414  okcand = kFALSE;
415  }
416  if(fabs(dphis_e_bach) < fCutsRD[GetGlobalIndex(2,ptbin)] && fabs(detas_e_bach) < fCutsRD[GetGlobalIndex(3,ptbin)])
417  {
418  okcand = kFALSE;
419  }
420 
421  if(!okcand) return 0;
422  returnvalueCuts = 1;
423  }
424 
425  Int_t returnvaluePID=1;
426  if(selectionLevel==AliRDHFCuts::kAll ||
427  selectionLevel==AliRDHFCuts::kCandidate||
428  selectionLevel==AliRDHFCuts::kPID) {
429  //not used. applied at single level
430  }
431 
432  Int_t returnvalue = 0;
433  if(returnvalueCuts==1 && returnvaluePID==1) returnvalue=1;
434 
435  return returnvalue;
436 }
437 
438 //---------------------------------------------------------------------------
440 {
441  //
442  // IsSelectedPID
443  //
444 
445  if(!fUsePID || !obj) return 1;
446 
448  AliAODTrack *part = dd->GetBachelor();
449 
450  Int_t returnvalue=1;
451 
452  if(fPidHF->GetPidResponse()==0x0){
453  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
454  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
455  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
456  fPidHF->SetPidResponse(pidResp);
457  }
458 
459  Int_t isElectron=fPidHF->MakeRawPid(part,0);
460  if(isElectron<1) returnvalue = 0;
461 
462  return returnvalue;
463 }
464 
465 //---------------------------------------------------------------------------
467  //
468  // IsSelectedCombinedPID
469  //
470 
471  if(!fUsePID || !obj) {return 1;}
472 
474  AliAODTrack *part = dd->GetBachelor();
475  if(!part) return 0;
476 
477  Int_t returnvalue=1;
478 
479  return returnvalue;
480 }
481 
482 //________________________________________________________________________
483 Bool_t AliRDHFCutsXictoeleXifromAODtracks::SingleTrkCuts(AliAODTrack *trk, AliAODTrack *trkpid, AliAODVertex *primVert)
484 {
485  //
486  // Single Track Cut to be applied before object creation
487  //
488 
489  //if(trk->GetStatus()&AliESDtrack::kITSpureSA) return kFALSE;
490  //if(!(trk->GetStatus()&AliESDtrack::kITSin)) return kFALSE;
491  //if(fProdUseAODFilterBit && !trk->TestFilterMask(BIT(4))) return kFALSE;
492 
493  if(fTrackCuts){
494  if(fProdAODFilterBit==7){
495  Float_t ptmin, ptmax, etamin, etamax;
496  fTrackCuts->GetPtRange(ptmin,ptmax);
497  fTrackCuts->GetEtaRange(etamin,etamax);
498  if(trk->Pt()<ptmin || trk->Pt()>ptmax) return kFALSE;
499  if(trk->Eta()<etamin || trk->Eta()>etamax) return kFALSE;
500  }else{
501  Double_t pos[3]; primVert->GetXYZ(pos);
502  Double_t cov[6]; primVert->GetCovarianceMatrix(cov);
503  const AliESDVertex vESD(pos,cov,100.,100);
504  if(!IsDaughterSelected(trk,&vESD,fTrackCuts)) return kFALSE;
505  }
506  }
507 
508  if(trkpid->GetTPCsignalN()<fProdTrackTPCNclsPIDMin) return kFALSE;
509  if(trk->GetTPCNclsF()>0){
510  Float_t tpcratio = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
511  if(tpcratio<fProdTrackTPCNclsRatioMin) return kFALSE;
512  }
513 
515  const TBits sharedMap = trk->GetTPCSharedMap();
516  if((sharedMap.CountBits()) >= 1){
517  return kFALSE;
518  }
519  }
520 
521  if(fUsePID)
522  {
523  if(fPidHF->GetPidResponse()==0x0){
524  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
525  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
526  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
527  fPidHF->SetPidResponse(pidResp);
528  }
529 
530  switch(fPIDStrategy){
531  case kNSigmaCuts:
532  return IsSelectedeID(trkpid);
533  break;
535  return IsSelectedCustomizedeID(trkpid);
536  break;
538  return IsSelectedCustomizedPtDepeID(trk,trkpid);
539  break;
540  case kCombinedCuts:
541  return IsSelectedCombinedeID(trkpid);
542  break;
543  }
544  }
545 
546  return kTRUE;
547 }
548 //________________________________________________________________________
549 Bool_t AliRDHFCutsXictoeleXifromAODtracks::SingleTrkCutsNoPID(AliAODTrack *trk, AliAODTrack *trkpid, AliAODVertex *primVert)
550 {
551  //
552  // Single Track Cut to be applied before object creation
553  //
554 
555  //if(trk->GetStatus()&AliESDtrack::kITSpureSA) return kFALSE;
556  //if(!(trk->GetStatus()&AliESDtrack::kITSin)) return kFALSE;
557  //if(fProdUseAODFilterBit && !trk->TestFilterMask(BIT(4))) return kFALSE;
558  if(fTrackCuts){
559  if(fProdAODFilterBit==7){
560  Float_t ptmin, ptmax, etamin, etamax;
561  fTrackCuts->GetPtRange(ptmin,ptmax);
562  fTrackCuts->GetEtaRange(etamin,etamax);
563  if(trk->Pt()<ptmin || trk->Pt()>ptmax) return kFALSE;
564  if(trk->Eta()<etamin || trk->Eta()>etamax) return kFALSE;
565  }else{
566  Double_t pos[3]; primVert->GetXYZ(pos);
567  Double_t cov[6]; primVert->GetCovarianceMatrix(cov);
568  const AliESDVertex vESD(pos,cov,100.,100);
569  if(!IsDaughterSelected(trk,&vESD,fTrackCuts)) return kFALSE;
570  }
571  }
572 
573  if(trkpid->GetTPCsignalN()<fProdTrackTPCNclsPIDMin) return kFALSE;
574  if(trk->GetTPCNclsF()>0){
575  Float_t tpcratio = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
576  if(tpcratio<fProdTrackTPCNclsRatioMin) return kFALSE;
577  }
578 
580  const TBits sharedMap = trk->GetTPCSharedMap();
581  if((sharedMap.CountBits()) >= 1){
582  return kFALSE;
583  }
584  }
585 
586 
587  return kTRUE;
588 }
589 //________________________________________________________________________
591 {
592  //
593  // electron ID first shot
594  //
595 
596  Double_t nSigmaPion = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
597  if(fExcludePionTPC){
598  if(TMath::Abs(nSigmaPion)<fExcludenSigmaPionTPC){
599  return kFALSE;
600  }
601  }
602 
603  Double_t nSigmaProton = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
604  if(fExcludeProtonTPC){
605  if(TMath::Abs(nSigmaProton)<fExcludenSigmaProtonTPC){
606  return kFALSE;
607  }
608  }
609 
610  Double_t nSigmaKaon = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
611  if(fExcludeKaonTPC){
612  if(TMath::Abs(nSigmaKaon)<fExcludenSigmaKaonTPC){
613  return kFALSE;
614  }
615  }
616 
617  Int_t isElectron=fPidHF->MakeRawPid(trk,0);
618  if(isElectron<1) return kFALSE;
619 
620  return kTRUE;
621 }
622 //________________________________________________________________________
624 {
625  //
626  // electron ID first shot
627  //
628 
629  Double_t nSigmaPion = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
630  if(fExcludePionTPC){
631  if(TMath::Abs(nSigmaPion)<fExcludenSigmaPionTPC){
632  return kFALSE;
633  }
634  }
635 
636  Double_t nSigmaProton = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
637  if(fExcludeProtonTPC){
638  if(TMath::Abs(nSigmaProton)<fExcludenSigmaProtonTPC){
639  return kFALSE;
640  }
641  }
642 
643  Double_t nSigmaKaon = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
644  if(fExcludeKaonTPC){
645  if(TMath::Abs(nSigmaKaon)<fExcludenSigmaKaonTPC){
646  return kFALSE;
647  }
648  }
649 
650  Double_t nSigmaTPCele = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
651  Double_t nSigmaTOFele = fPidHF->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
652 
653  if(nSigmaTPCele<fSigmaElectronTPCMin) return kFALSE;
654  if(nSigmaTPCele>fSigmaElectronTPCMax) return kFALSE;
655  if(fabs(fSigmaElectronTOFMin)<10.&&fabs(fSigmaElectronTOFMax)<10.){
656  if(nSigmaTOFele<fSigmaElectronTOFMin) return kFALSE;
657  if(nSigmaTOFele>fSigmaElectronTOFMax) return kFALSE;
658  }
659 
660  return kTRUE;
661 }
662 //________________________________________________________________________
663 Bool_t AliRDHFCutsXictoeleXifromAODtracks::IsSelectedCustomizedPtDepeID(AliAODTrack *trk, AliAODTrack *trkpid)
664 {
665  //
666  // electron ID pt dependent
667  //
668 
669  Double_t nSigmaTPCele = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trkpid,AliPID::kElectron);
670  Double_t nSigmaTOFele = fPidHF->GetPidResponse()->NumberOfSigmasTOF(trkpid,AliPID::kElectron);
671 
672  if(nSigmaTOFele<fSigmaElectronTOFMin) return kFALSE;
673  if(nSigmaTOFele>fSigmaElectronTOFMax) return kFALSE;
674 
675  Double_t pte = trk->Pt();
678  if(nSigmaTPCele<nsigmamin) return kFALSE;
679  if(nSigmaTPCele>fSigmaElectronTPCMax) return kFALSE;
680 
681  return kTRUE;
682 }
683 //________________________________________________________________________
685 {
686  //
687  // electron ID Basyian not implemented
688  //
689 
690  return kTRUE;
691 }
692 //________________________________________________________________________
693 Bool_t AliRDHFCutsXictoeleXifromAODtracks::SingleCascadeCuts(AliAODcascade *casc,Double_t *primvert)
694 {
695  //
696  // Single Cascade Cut
697  //
698 
699  if(!casc) return kFALSE;
700  if(!(casc->GetSecondaryVtx())) return kFALSE;
701  if(!(casc->GetDecayVertexXi())) return kFALSE;
702 
703  AliAODTrack *ptrack = (AliAODTrack*) (casc->GetDaughter(0));
704  AliAODTrack *ntrack = (AliAODTrack*) (casc->GetDaughter(1));
705  AliAODTrack *btrack = (AliAODTrack*) (casc->GetDecayVertexXi()->GetDaughter(0));
706 
707  if(!ptrack||!ntrack||!btrack) return kFALSE;
708 
709  if(ptrack->Charge()<0 && ntrack->Charge()>0){
710  ptrack = (AliAODTrack*) (casc->GetDaughter(1));
711  ntrack = (AliAODTrack*) (casc->GetDaughter(0));
712  }
713 
714  if(ptrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
715  if(ntrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
716  if(btrack->GetTPCClusterInfo(2,1)<fProdCascNTPCClustersMin) return kFALSE;
717 
718  Double_t pxxi = casc->MomXiX();
719  Double_t pyxi = casc->MomXiY();
720  Double_t ptxi = sqrt(pxxi*pxxi+pyxi*pyxi);
721  if(ptxi<fProdCascPtMin || ptxi>fProdCascPtMax) return kFALSE;
722 
723  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
724  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
725  Double_t momegaPDG = TDatabasePDG::Instance()->GetParticle(3334)->Mass();
726 
727  Double_t massLambda = casc->MassLambda();
728  Double_t massAntiLambda = casc->MassAntiLambda();
729  if(TMath::Abs(massLambda-mLPDG)>fProdMassTolLambda && TMath::Abs(massAntiLambda-mLPDG)>fProdMassTolLambda)
730  return kFALSE;
731 
732  Bool_t isparticle = kTRUE;
733  //if(TMath::Abs(massAntiLambda-mLPDG)<fProdMassTolLambda) isparticle = kFALSE;
734  if(casc->ChargeXi()>0) isparticle = kFALSE;
735 
736  Double_t massXi = casc->MassXi();
737  if(TMath::Abs(massXi-mxiPDG)>fProdMassTolXiRough)
738  return kFALSE;
739 
740  Double_t massOmega = casc->MassOmega();
741  if(TMath::Abs(massOmega-momegaPDG)<fProdMassRejOmega)
742  return kFALSE;
743 
744 
745  Double_t lPosXi[3];
746  lPosXi[0] = casc->DecayVertexXiX();
747  lPosXi[1] = casc->DecayVertexXiY();
748  lPosXi[2] = casc->DecayVertexXiZ();
749  Double_t decayvertXi = TMath::Sqrt(lPosXi[0]*lPosXi[0]+lPosXi[1]*lPosXi[1]);
750  Double_t lPosV0[3];
751  lPosV0[0] = casc->DecayVertexV0X();
752  lPosV0[1] = casc->DecayVertexV0Y();
753  lPosV0[2] = casc->DecayVertexV0Z();
754  Double_t decayvertV0 = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
755 
756  if(decayvertV0<fProdRfidMinV0 || decayvertV0>fProdRfidMaxV0) return kFALSE;
757  if(decayvertXi<fProdRfidMinXi || decayvertXi>fProdRfidMaxXi) return kFALSE;
758 
759  Double_t ptotxi = TMath::Sqrt(pow(casc->MomXiX(),2)+pow(casc->MomXiY(),2)+pow(casc->MomXiZ(),2));
760  Double_t properdl = casc->DecayLengthXi(primvert[0],primvert[1],primvert[2])*mxiPDG/ptotxi;
761  if(properdl>fProdCascProperDecayLengthMax) return kFALSE;
762 
763  Double_t lDcaXiDaughters = casc->DcaXiDaughters();
764  Double_t lDcaV0Daughters = casc->DcaV0Daughters();
765  if(lDcaXiDaughters > fProdDcaXiDaughtersMax) return kFALSE;
766  if(lDcaV0Daughters > fProdDcaV0DaughtersMax) return kFALSE;
767 
768  Double_t lDcaBachToPrimVertex = casc->DcaBachToPrimVertex();
769  Double_t lDcaV0ToPrimVertex = casc->DcaV0ToPrimVertex();
770  Double_t lDcaPosToPrimVertex = casc->DcaPosToPrimVertex();
771  Double_t lDcaNegToPrimVertex = casc->DcaNegToPrimVertex();
772  if(lDcaBachToPrimVertex < fProdDcaBachToPrimVertexMin) return kFALSE;
773  if(lDcaV0ToPrimVertex < fProdDcaV0ToPrimVertexMin) return kFALSE;
774  if(isparticle){
775  if(lDcaPosToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
776  if(lDcaNegToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
777  }else{
778  if(lDcaPosToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
779  if(lDcaNegToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
780  }
781 
782  Double_t lXiCosineOfPointingAngle = casc->CosPointingAngleXi(primvert[0],primvert[1],primvert[2]);
783  Double_t lV0CosineOfPointingAngleXi = casc->CosPointingAngle(lPosXi);
784 
785  if(lXiCosineOfPointingAngle < fProdXiCosineOfPoiningAngleMin) return kFALSE;
786  if(lV0CosineOfPointingAngleXi < fProdV0CosineOfPoiningAngleXiMin) return kFALSE;
787 
788  if(fUseCascadePID)
789  {
790  if(fPidObjCascPi->GetPidResponse()==0x0){
791  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
792  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
793  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
794  fPidObjCascPi->SetPidResponse(pidResp);
795  }
796  if(fPidObjCascPr->GetPidResponse()==0x0){
797  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
798  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
799  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
800  fPidObjCascPr->SetPidResponse(pidResp);
801  }
802  if(isparticle){
803  Int_t isProton = -9999;
804  Int_t isPion1 = -9999;
805  Int_t isPion2 = -9999;
806  Double_t nsigmatpc_proton = fPidObjCascPr->GetSigma(0);
807  Double_t nsigmatpc_pion = fPidObjCascPi->GetSigma(0);
808  Double_t nSigmaTPCpr = fPidObjCascPr->GetPidResponse()->NumberOfSigmasTPC(ptrack,AliPID::kProton);
809  Double_t nSigmaTPCpi1 = fPidObjCascPi->GetPidResponse()->NumberOfSigmasTPC(ntrack,AliPID::kPion);
810  Double_t nSigmaTPCpi2 = fPidObjCascPi->GetPidResponse()->NumberOfSigmasTPC(btrack,AliPID::kPion);
811  if(fabs(nSigmaTPCpr)<nsigmatpc_proton) isProton = 1;
812  if(fabs(nSigmaTPCpi1)<nsigmatpc_pion) isPion1 = 1;
813  if(fabs(nSigmaTPCpi2)<nsigmatpc_pion) isPion2 = 1;
814  if(isProton<1) return kFALSE;
815  if(isPion1<1) return kFALSE;
816  if(isPion2<1) return kFALSE;
817  }else{
818  Int_t isProton = -9999;
819  Int_t isPion1 = -9999;
820  Int_t isPion2 = -9999;
821  Double_t nsigmatpc_proton = fPidObjCascPr->GetSigma(0);
822  Double_t nsigmatpc_pion = fPidObjCascPi->GetSigma(0);
823  Double_t nSigmaTPCpr = fPidObjCascPr->GetPidResponse()->NumberOfSigmasTPC(ntrack,AliPID::kProton);
824  Double_t nSigmaTPCpi1 = fPidObjCascPi->GetPidResponse()->NumberOfSigmasTPC(ptrack,AliPID::kPion);
825  Double_t nSigmaTPCpi2 = fPidObjCascPi->GetPidResponse()->NumberOfSigmasTPC(btrack,AliPID::kPion);
826  if(fabs(nSigmaTPCpr)<nsigmatpc_proton) isProton = 1;
827  if(fabs(nSigmaTPCpi1)<nsigmatpc_pion) isPion1 = 1;
828  if(fabs(nSigmaTPCpi2)<nsigmatpc_pion) isPion2 = 1;
829  if(isProton<1) return kFALSE;
830  if(isPion1<1) return kFALSE;
831  if(isPion2<1) return kFALSE;
832  }
833  }
834 
835  Double_t RapXi = casc->RapXi();
836  if(RapXi<fProdCascRapMin || RapXi>fProdCascRapMax) return kFALSE;
837 
838  Double_t EtaXi = 0.5*TMath::Log((ptotxi+casc->MomXiZ())/(ptotxi-casc->MomXiZ()));
839  if(EtaXi<fProdCascEtaMin || EtaXi>fProdCascEtaMax) return kFALSE;
840 
842  const TBits sharedMap1 = ptrack->GetTPCSharedMap();
843  const TBits sharedMap2 = ntrack->GetTPCSharedMap();
844  const TBits sharedMap3 = btrack->GetTPCSharedMap();
845  if((sharedMap1.CountBits() >= 1) || (sharedMap2.CountBits() >= 1) ||
846  (sharedMap3.CountBits() >= 1))
847  {
848  return kFALSE;
849  }
850  }
851 
852 
853  return kTRUE;
854 }
855 
856 //________________________________________________________________________
857 Bool_t AliRDHFCutsXictoeleXifromAODtracks::SelectWithRoughCuts(AliAODcascade *casc, AliAODTrack *part)
858 {
859  //
860  // Mass and pT Cut to be applied before object creation
861  // Not used now
862  //
863  if(!casc) return kFALSE;
864  if(!part) return kFALSE;
865 
866  return kTRUE;
867 }
868 
869 //________________________________________________________________________
871 {
872  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
873  Double_t massXi = casc->MassXi();
874  if(TMath::Abs(massXi-mxiPDG)<fProdMassTolXi)
875  return kTRUE;
876  return kFALSE;
877 }
878 
879 //________________________________________________________________________
881 {
882  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
883  Double_t massXi = casc->M();
884  if(TMath::Abs(massXi-mxiPDG)<fProdMassTolXi)
885  return kTRUE;
886  return kFALSE;
887 }
888 
889 //________________________________________________________________________
891 {
892  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
893  Double_t massXi = casc->MassXi();
894  Bool_t issideband = kFALSE;
895  if((massXi-mxiPDG)>fProdMassTolXiRough-fProdMassTolXi) issideband = kTRUE;
896  if((massXi-mxiPDG)<-fProdMassTolXiRough+fProdMassTolXi) issideband = kTRUE;
897  return issideband;
898 }
899 
900 //________________________________________________________________________
902 {
903  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
904  Double_t massXi = casc->M();
905  Bool_t issideband = kFALSE;
906  if((massXi-mxiPDG)>fProdMassTolXiRough-fProdMassTolXi) issideband = kTRUE;
907  if((massXi-mxiPDG)<-fProdMassTolXiRough+fProdMassTolXi) issideband = kTRUE;
908  return issideband;
909 }
910 
911 //________________________________________________________________________
912 Bool_t AliRDHFCutsXictoeleXifromAODtracks::TagConversions(AliAODTrack *etrk, Int_t *id2index, AliAODEvent *evt, Int_t ntrk, Double_t &minmass)
913 {
914  //
915  // Tag conversion electron tracks
916  //
917  if(fConversionMassMax<0.) return kFALSE;
918 
919  Bool_t isconv = kFALSE;
920  minmass = 9999.;
921 
922  Int_t trkid = etrk->GetID();
923  Double_t px1 = etrk->Px();
924  Double_t py1 = etrk->Py();
925  Double_t pz1 = etrk->Pz();
926  Double_t E1 = sqrt(px1*px1+py1*py1+pz1*pz1+0.000511*0.000511);
927 
928  for(Int_t it=0;it<ntrk;it++){
929  AliAODTrack *trk2 = (AliAODTrack*) evt->GetTrack(it);
930  if(!trk2) continue;
931  Int_t trkid2 = trk2->GetID();
932  if(abs(trkid)==abs(trkid2)) continue;
933  if(etrk->Charge()*trk2->Charge()>0) continue;
934 
935  if(fProdAODFilterBit==7){
936  if(!trk2->TestFilterBit(BIT(fProdAODFilterBit))) continue;
937  }else{
938  if(!trk2->TestFilterMask(BIT(fProdAODFilterBit))) continue;
939  }
940 
941  Double_t nSigmaTPCele = 9999.;
942  if(fProdAODFilterBit==7){
943  if(-trkid2-1>=19000) continue;
944  if(-trkid2-1<0) continue;
945  Int_t index = id2index[-trkid2-1];
946  AliAODTrack *partpid = (AliAODTrack*)evt->GetTrack(index);
947  nSigmaTPCele = fPidHF->GetPidResponse()->NumberOfSigmasTPC(partpid,AliPID::kElectron);
948  }else{
949  nSigmaTPCele = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk2,AliPID::kElectron);
950  }
951  if(fabs(nSigmaTPCele)>5.) continue;
952 
953  Double_t px2 = trk2->Px();
954  Double_t py2 = trk2->Py();
955  Double_t pz2 = trk2->Pz();
956  Double_t E2 = sqrt(px2*px2+py2*py2+pz2*pz2+0.000511*0.000511);
957 
958  Double_t mass = sqrt(pow(E1+E2,2)-pow(px1+px2,2)-pow(py1+py2,2)-pow(pz1+pz2,2));
959  if(mass<minmass) minmass = mass;
960  }
961 
962  if(minmass<fConversionMassMax) isconv = kTRUE;
963 
964  return isconv;
965 }
966 //________________________________________________________________________
967 Bool_t AliRDHFCutsXictoeleXifromAODtracks::TagConversionsSameSign(AliAODTrack *etrk, Int_t *id2index, AliAODEvent *evt, Int_t ntrk, Double_t &minmass)
968 {
969  //
970  // Tag conversion electron tracks
971  //
972  if(fConversionMassMax<0.) return kFALSE;
973 
974  Bool_t isconv = kFALSE;
975  minmass = 9999.;
976 
977  Int_t trkid = etrk->GetID();
978  Double_t px1 = etrk->Px();
979  Double_t py1 = etrk->Py();
980  Double_t pz1 = etrk->Pz();
981  Double_t E1 = sqrt(px1*px1+py1*py1+pz1*pz1+0.000511*0.000511);
982 
983  for(Int_t it=0;it<ntrk;it++){
984  AliAODTrack *trk2 = (AliAODTrack*) evt->GetTrack(it);
985  if(!trk2) continue;
986  Int_t trkid2 = trk2->GetID();
987  if(abs(trkid)==abs(trkid2)) continue;
988  if(etrk->Charge()*trk2->Charge()<0) continue;
989 
990  if(fProdAODFilterBit==7){
991  if(!trk2->TestFilterBit(BIT(fProdAODFilterBit))) continue;
992  }else{
993  if(!trk2->TestFilterMask(BIT(fProdAODFilterBit))) continue;
994  }
995 
996  Double_t nSigmaTPCele = 9999.;
997  if(fProdAODFilterBit==7){
998  if(-trkid2-1>=19000) continue;
999  if(-trkid2-1<0) continue;
1000  Int_t index = id2index[-trkid2-1];
1001  AliAODTrack *partpid = (AliAODTrack*)evt->GetTrack(index);
1002  nSigmaTPCele = fPidHF->GetPidResponse()->NumberOfSigmasTPC(partpid,AliPID::kElectron);
1003  }else{
1004  nSigmaTPCele = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk2,AliPID::kElectron);
1005  }
1006  if(fabs(nSigmaTPCele)>5.) continue;
1007 
1008  Double_t px2 = trk2->Px();
1009  Double_t py2 = trk2->Py();
1010  Double_t pz2 = trk2->Pz();
1011  Double_t E2 = sqrt(px2*px2+py2*py2+pz2*pz2+0.000511*0.000511);
1012 
1013  Double_t mass = sqrt(pow(E1+E2,2)-pow(px1+px2,2)-pow(py1+py2,2)-pow(pz1+pz2,2));
1014  if(mass<minmass) minmass = mass;
1015  }
1016 
1017  if(minmass<fConversionMassMax) isconv = kTRUE;
1018 
1019  return isconv;
1020 }
1021 
1022 //________________________________________________________________________
1023 void AliRDHFCutsXictoeleXifromAODtracks::SetSftPosR125(AliAODTrack *track,Double_t bfield,Double_t priVtx[3],Double_t *XSftR125)
1024 {
1025  //
1026  // Sets the spatial position of the track at the radius R=1.25m in the shifted coordinate system
1027  //
1028 
1029  // Initialize the array to something indicating there was no propagation
1030  XSftR125[0]=-9999.;
1031  XSftR125[1]=-9999.;
1032  XSftR125[2]=-9999.;
1033  // Make a copy of the track to not change parameters of the track
1034  AliExternalTrackParam etp;
1035  etp.CopyFromVTrack(track);
1036 
1037  // The global position of the the track
1038  Double_t xyz[3]={-9999.,-9999.,-9999.};
1039 
1040  // The radius we want to propagate to, squared
1041  const Float_t RSquaredWanted(125.*125.);
1042 
1043 
1044  // Propagation is done in local x of the track
1045  for (Float_t x = 58.;x<247.;x+=1.){
1046  // Starts at 83 / Sqrt(2) and goes outwards. 85/Sqrt(2) is the smallest local x
1047  // for global radius 85 cm. x = 245 is the outer radial limit of the TPC when
1048  // the track is straight, i.e. has inifinite pt and doesn't get bent.
1049  // If the track's momentum is smaller than infinite, it will develop a y-component,
1050  // which adds to the global radius
1051  // We don't change the propagation steps to not mess up things!
1052 
1053  // Stop if the propagation was not succesful. This can happen for low pt tracks
1054  // that don't reach outer radii
1055  if(!etp.PropagateTo(x,(Float_t)bfield))break;
1056  etp.GetXYZ(xyz); // GetXYZ returns global coordinates
1057 
1058  // Calculate the shifted radius we are at, squared.
1059  // Compare squared radii for faster code
1060  Float_t shiftedRadiusSquared = (xyz[0]-priVtx[0])*(xyz[0]-priVtx[0])
1061  + (xyz[1]-priVtx[1])*(xyz[1]-priVtx[1]);
1062 
1063  // Roughly reached the radius we want
1064  if(shiftedRadiusSquared > RSquaredWanted){
1065 
1066  // Bigger loop has bad precision, we're nearly one centimeter too far,
1067  // go back in small steps.
1068  while (shiftedRadiusSquared>RSquaredWanted){
1069  // Propagate a mm inwards
1070  x-=.1;
1071  if(!etp.PropagateTo(x,bfield)){
1072  // Propagation failed but we're already with a
1073  // cm precision at R=1.25m so we only break the
1074  // inner loop
1075  break;
1076  }
1077  // Get the global position
1078  etp.GetXYZ(xyz);
1079  // Calculate shifted radius, squared
1080  shiftedRadiusSquared = (xyz[0]-priVtx[0])*(xyz[0]-priVtx[0])
1081  + (xyz[1]-priVtx[1])*(xyz[1]-priVtx[1]);
1082  }
1083  // We reached R=1.25m with a precission of a cm to a mm,
1084  // set the spatial position
1085  XSftR125[0]=xyz[0]-priVtx[0];
1086  XSftR125[1]=xyz[1]-priVtx[1];
1087  XSftR125[2]=xyz[2]-priVtx[2];
1088  // Done
1089  return;
1090  } // End of if roughly reached radius
1091  } // End of coarse propagation loop
1092 }
1093 
1094 //________________________________________________________________________
1095 Double_t AliRDHFCutsXictoeleXifromAODtracks::dEtaSR125(Double_t *postrack1,Double_t *postrack2)
1096 {
1097  //
1098  // Returns the pseudorapidity star difference
1099  //
1100 
1101  // It is important to keep the calculations easy and separated.
1102  // The calculation of EtaS is straight forward, one just has to
1103  // do it step by step to not get confused.
1104  Double_t ThetaS1 = TMath::Pi()/2. - TMath::ATan(postrack1[2]/125.);
1105  Double_t ThetaS2 = TMath::Pi()/2. - TMath::ATan(postrack2[2]/125.);
1106  Double_t EtaS1 = -TMath::Log( TMath::Tan(ThetaS1/2.) );
1107  Double_t EtaS2 = -TMath::Log( TMath::Tan(ThetaS2/2.) );
1108 
1109  return EtaS1-EtaS2;
1110 }
1111 
1112 //________________________________________________________________________
1113 Double_t AliRDHFCutsXictoeleXifromAODtracks::dPhiSR125(Double_t *postrack1,Double_t *postrack2)
1114 {
1115  //
1116  // returns delta phi star at R=1.25m
1117  // position5 at R=1.2m is stored as second radius
1118  //
1119  //
1120  Double_t distSft= TMath::Sqrt(TMath::Power(postrack1[0] - postrack2[0],2)
1121  +TMath::Power(postrack1[1] - postrack2[1],2));
1122  return 2.0 * TMath::ATan(distSft/2./(125.));
1123 }
1124 
1125 //________________________________________________________________________
1126 Double_t AliRDHFCutsXictoeleXifromAODtracks::GetdPhiSdEtaSR125(AliAODTrack *tracke, AliAODTrack *trackp,AliAODTrack *trackb,
1127  AliAODTrack *trackn, Double_t bfield, Double_t priVtx[3], Double_t &dPhiS_ep, Double_t &dEtaS_ep,
1128  Double_t &dPhiS_en, Double_t &dEtaS_en, Double_t &dPhiS_eb, Double_t &dEtaS_eb)
1129 {
1130  //
1131  // Returns dPhi and dEta at R 125
1132  //
1133  Double_t XSftR125_e[3];
1134  SetSftPosR125(tracke,bfield,priVtx, XSftR125_e);
1135  Double_t XSftR125_p[3];
1136  SetSftPosR125(trackp,bfield,priVtx, XSftR125_p);
1137  Double_t XSftR125_n[3];
1138  SetSftPosR125(trackn,bfield,priVtx, XSftR125_n);
1139  Double_t XSftR125_b[3];
1140  SetSftPosR125(trackb,bfield,priVtx, XSftR125_b);
1141  dPhiS_ep = dPhiSR125(XSftR125_e,XSftR125_p);
1142  dEtaS_ep = dEtaSR125(XSftR125_e,XSftR125_p);
1143  dPhiS_en = dPhiSR125(XSftR125_e,XSftR125_n);
1144  dEtaS_en = dEtaSR125(XSftR125_e,XSftR125_n);
1145  dPhiS_eb = dPhiSR125(XSftR125_e,XSftR125_b);
1146  dEtaS_eb = dEtaSR125(XSftR125_e,XSftR125_b);
1147 }
1148 
1149 //---------------------------------------------------------------------------
1150 Int_t AliRDHFCutsXictoeleXifromAODtracks::IsSelected(TLorentzVector* vtrk, TLorentzVector *vcasc, Double_t *cutvars, Int_t selectionLevel)
1151 {
1152  //
1153  // Apply selection on mixed event tracks
1154  //
1155 
1156  if (!fCutsRD) {
1157  AliFatal("Cut matrix not inizialized. Exit...");
1158  return 0;
1159  }
1160 
1161  Double_t ptD=sqrt(pow(vtrk->Px()+vcasc->Px(),2)+pow(vtrk->Px()+vcasc->Py(),2));
1162  if(ptD<fMinPtCand) return 0;
1163  if(ptD>fMaxPtCand) return 0;
1164 
1165  Double_t pt=ptD;
1166  Int_t ptbin=PtBin(pt);
1167  if (ptbin==-1) {
1168  return 0;
1169  }
1170 
1171  if (selectionLevel==AliRDHFCuts::kAll ||
1172  selectionLevel==AliRDHFCuts::kTracks) {
1173  //Performed in production stage
1174  }
1175 
1176  Int_t returnvalueCuts=1;
1177  // selection on candidate
1178  if (selectionLevel==AliRDHFCuts::kAll ||
1179  selectionLevel==AliRDHFCuts::kCandidate) {
1180 
1181  Bool_t okcand=kTRUE;
1182 
1183  Double_t mlcPDG = TDatabasePDG::Instance()->GetParticle(4132)->Mass();
1184  Double_t melePDG = TDatabasePDG::Instance()->GetParticle(11)->Mass();
1185  Double_t mxiPDG = TDatabasePDG::Instance()->GetParticle(3312)->Mass();
1186  Double_t v0px = vcasc->Px();
1187  Double_t v0py = vcasc->Py();
1188  Double_t v0pz = vcasc->Pz();
1189  Double_t epx = vtrk->Px();
1190  Double_t epy = vtrk->Py();
1191  Double_t epz = vtrk->Pz();
1192  Double_t cosoa = (v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz);
1193 
1194  TLorentzVector vele, vxi,vlc;
1195  vele.SetXYZM(epx,epy,epz,melePDG);
1196  vxi.SetXYZM(v0px,v0py,v0pz,mxiPDG);
1197  vlc = vele + vxi;
1198 
1199  Double_t dphis_e_pr = 9999.;
1200  Double_t detas_e_pr = 9999.;
1201  Double_t dphis_e_pi = 9999.;
1202  Double_t detas_e_pi = 9999.;
1203  Double_t dphis_e_bach = 9999.;
1204  Double_t detas_e_bach = 9999.;
1205  if(fCutsRD[GetGlobalIndex(2,ptbin)]>0 || fCutsRD[GetGlobalIndex(3,ptbin)]>0){
1206  Double_t xyzR125_e[3], xyzR125_pr[3], xyzR125_pi[3], xyzR125_bach[3];
1207  xyzR125_e[0] = cutvars[0];
1208  xyzR125_e[1] = cutvars[1];
1209  xyzR125_e[2] = cutvars[2];
1210  xyzR125_pr[0] = cutvars[3];
1211  xyzR125_pr[1] = cutvars[4];
1212  xyzR125_pr[2] = cutvars[5];
1213  xyzR125_pi[0] = cutvars[6];
1214  xyzR125_pi[1] = cutvars[7];
1215  xyzR125_pi[2] = cutvars[8];
1216  xyzR125_bach[0] = cutvars[9];
1217  xyzR125_bach[1] = cutvars[10];
1218  xyzR125_bach[2] = cutvars[11];
1219  dphis_e_pr = dPhiSR125(xyzR125_e,xyzR125_pr);
1220  detas_e_pr = dPhiSR125(xyzR125_e,xyzR125_pr);
1221  dphis_e_pi = dPhiSR125(xyzR125_e,xyzR125_pi);
1222  detas_e_pi = dPhiSR125(xyzR125_e,xyzR125_pi);
1223  dphis_e_bach = dPhiSR125(xyzR125_e,xyzR125_bach);
1224  detas_e_bach = dPhiSR125(xyzR125_e,xyzR125_bach);
1225  }
1226 
1227  if(vlc.M() > fCutsRD[GetGlobalIndex(0,ptbin)])
1228  {
1229  okcand = kFALSE;
1230  }
1231  if(cosoa < fCutsRD[GetGlobalIndex(1,ptbin)])
1232  {
1233  okcand = kFALSE;
1234  }
1235  if(fabs(dphis_e_pr) < fCutsRD[GetGlobalIndex(2,ptbin)] && fabs(detas_e_pr) < fCutsRD[GetGlobalIndex(3,ptbin)])
1236  {
1237  okcand = kFALSE;
1238  }
1239  if(fabs(dphis_e_pi) < fCutsRD[GetGlobalIndex(2,ptbin)] && fabs(detas_e_pi) < fCutsRD[GetGlobalIndex(3,ptbin)])
1240  {
1241  okcand = kFALSE;
1242  }
1243  if(fabs(dphis_e_bach) < fCutsRD[GetGlobalIndex(2,ptbin)] && fabs(detas_e_bach) < fCutsRD[GetGlobalIndex(3,ptbin)])
1244  {
1245  okcand = kFALSE;
1246  }
1247 
1248  if(!okcand) return 0;
1249  returnvalueCuts = 1;
1250  }
1251 
1252  Int_t returnvaluePID=1;
1253  if(selectionLevel==AliRDHFCuts::kAll ||
1254  selectionLevel==AliRDHFCuts::kCandidate||
1255  selectionLevel==AliRDHFCuts::kPID) {
1256  }
1257 
1258  Int_t returnvalue = 0;
1259  if(returnvalueCuts==1 && returnvaluePID==1) returnvalue=1;
1260 
1261  return returnvalue;
1262 }
Bool_t IsSelectedCustomizedPtDepeID(AliAODTrack *trk, AliAODTrack *trkpid)
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)
Double_t dEtaSR125(Double_t *postrack1, Double_t *postrack2)
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
Bool_t TagConversionsSameSign(AliAODTrack *etrk, Int_t *id2index, AliAODEvent *evt, Int_t ntrk, Double_t &minmass)
AliAODPidHF * fPidObjCascPr
PID object for cascade-pion.
AliRDHFCuts & operator=(const AliRDHFCuts &source)
Bool_t fUsePID
Definition: AliRDHFCuts.h:389
Bool_t TagConversions(AliAODTrack *etrk, Int_t *id2index, AliAODEvent *evt, Int_t ntrk, Double_t &minmass)
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.
Bool_t fProdRejectTrackWithShared
AOD filter Bit used before object creation.
Double_t fProdMassTolLambda
Flag to Reject tracks with shared clusters.
const Double_t etamin
Int_t fnVarsForOpt
Definition: AliRDHFCuts.h:384
Bool_t SelectWithRoughCuts(AliAODcascade *casc, AliAODTrack *trk1)
Double_t fSigmaElectronTPCPtDepPar1
nSigma electron lower limit (par0)
Double_t fBzkG
PID object for cascade-proton.
Double_t fSigmaElectronTPCPtDepPar0
nSigma to exclude for Kaon band
const Double_t ptmax
Double_t fMaxPtCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:411
AliESDtrackCuts * fTrackCuts
quality cuts on the daughter tracks
Definition: AliRDHFCuts.h:377
void SetSftPosR125(AliAODTrack *track, Double_t bfield, Double_t priVtx[3], Double_t *XSftR125)
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
const Double_t ptmin
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)
const Double_t etamax
Double_t fExcludenSigmaProtonTPC
nSigma to exclude for pion band
Double_t fProdCascPtMin
Maximum rapidity of cascade.
Bool_t SingleTrkCutsNoPID(AliAODTrack *trk, AliAODTrack *trkpid, AliAODVertex *primvert)
Int_t fProdAODFilterBit
Flag for AOD filter Bit used before object creation.
Double_t fProdRoughPtMin
Mass cut for Lc used before object creation.
Bool_t SingleTrkCuts(AliAODTrack *trk, AliAODTrack *trkpid, AliAODVertex *primvert)
Double_t GetdPhiSdEtaSR125(AliAODTrack *tracke, AliAODTrack *trackp, AliAODTrack *trackn, AliAODTrack *trackb, Double_t bfield, Double_t priVtx[3], Double_t &dPhiS_ep, Double_t &dEtaS_ep, Double_t &dPhiS_en, Double_t &dEtaS_en, Double_t &dPhiS_eb, Double_t &dEtaS_eb)
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
Double_t dPhiSR125(Double_t *postrack1, Double_t *postrack2)
void SetPidResponse(AliPIDResponse *pidResp)
Definition: AliAODPidHF.h:111