AliPhysics  v5-06-40-01 (42bb456)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliRDHFCutsLctoeleLambdafromAODtracks.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2010, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 /* $Id$ */
17 
19 //
20 // Class for cuts on AOD reconstructed LC->e+Lambda
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 //--------------------------------------------------------------------------
53 AliRDHFCuts(name),
54  fPIDStrategy(kNSigmaCuts),
55  fCombinedPIDThreshold(0.),
56  fUseLambdaPID(kFALSE),
57  fPidObjProton(0),
58  fPidObjPion(0),
59  fUseOnTheFlyV0(kFALSE),
60  fProdTrackTPCNclsPIDMin(0),
61  fProdTrackTPCNclsRatioMin(0.0),
62  fProdUseAODFilterBit(kTRUE),
63  fProdV0MassTolLambda(0.01),
64  fProdV0PtMin(0.5),
65  fProdV0CosPointingAngleToPrimVtxMin(0.99),
66  fProdV0DcaDaughtersMax(1.5),
67  fProdV0DaughterEtaRange(0.8),
68  fProdV0DaughterPtMin(0.0),
69  fProdV0DaughterTPCClusterMin(70),
70  fProdV0DaughterTPCCrossRatioMin(0.0),
71  fProdRfidMinV0(0.6),
72  fProdRfidMaxV0(100.0),
73  fProdDcaV0ToPrimVertexMin(0.),
74  fProdDcaV0PrToPrimVertexMin(0.),
75  fProdDcaV0PiToPrimVertexMin(0.),
76  fProdV0ProperDecayLengthMax(99999.),
77  fProdMassRejK0s(0.),
78  fProdV0EtaMin(-9999.),
79  fProdV0EtaMax(9999.),
80  fProdV0RapMin(-9999.),
81  fProdV0RapMax(9999.),
82  fProdRoughMassTol(0.25),
83  fProdRoughPtMin(0.0),
84  fExcludePionTPC(kFALSE),
85  fExcludeProtonTPC(kFALSE),
86  fExcludeKaonTPC(kFALSE),
87  fExcludenSigmaPionTPC(3.),
88  fExcludenSigmaProtonTPC(3.),
89  fExcludenSigmaKaonTPC(3.),
90  fSigmaElectronTPCMin(-9999.),
91  fSigmaElectronTPCPtDepPar0(-9999.),
92  fSigmaElectronTPCPtDepPar1(-9999.),
93  fSigmaElectronTPCMax(9999.),
94  fSigmaElectronTOFMin(-9999.),
95  fSigmaElectronTOFMax(9999.)
96 {
97  //
98  // Default Constructor
99  //
100 
101  const Int_t nvars=2;
102  SetNVars(nvars);
103  TString varNames[nvars]={
104  "InvMass [GeV/c2]", //0
105  "cos(Opening angle) [cos(rad)]" //1
106  };
107 
108  Bool_t isUpperCut[nvars]={
109  kTRUE, //0
110  kFALSE //1
111  };
112  SetVarNames(nvars,varNames,isUpperCut);
113  Bool_t forOpt[nvars]={
114  kTRUE, //0
115  kTRUE //1
116  };
117  SetVarsForOpt(nvars,forOpt);
118 
119  Float_t limits[2]={0,999999999.};
120  SetPtBins(2,limits);
121 }
122 //--------------------------------------------------------------------------
124  AliRDHFCuts(source),
125  fPIDStrategy(source.fPIDStrategy),
126  fCombinedPIDThreshold(source.fCombinedPIDThreshold),
127  fUseLambdaPID(source.fUseLambdaPID),
128  fPidObjProton(source.fPidObjProton),
129  fPidObjPion(source.fPidObjPion),
130  fUseOnTheFlyV0(source.fUseOnTheFlyV0),
131  fProdTrackTPCNclsPIDMin(source.fProdTrackTPCNclsPIDMin),
132  fProdTrackTPCNclsRatioMin(source.fProdTrackTPCNclsRatioMin),
133  fProdUseAODFilterBit(source.fProdUseAODFilterBit),
134  fProdV0MassTolLambda(source.fProdV0MassTolLambda),
135  fProdV0PtMin(source.fProdV0PtMin),
136  fProdV0CosPointingAngleToPrimVtxMin(source.fProdV0CosPointingAngleToPrimVtxMin),
137  fProdV0DcaDaughtersMax(source.fProdV0DcaDaughtersMax),
138  fProdV0DaughterEtaRange(source.fProdV0DaughterEtaRange),
139  fProdV0DaughterPtMin(source.fProdV0DaughterPtMin),
140  fProdV0DaughterTPCClusterMin(source.fProdV0DaughterTPCClusterMin),
141  fProdV0DaughterTPCCrossRatioMin(source.fProdV0DaughterTPCCrossRatioMin),
142  fProdRfidMinV0(source.fProdRfidMinV0),
143  fProdRfidMaxV0(source.fProdRfidMaxV0),
144  fProdDcaV0ToPrimVertexMin(source.fProdDcaV0ToPrimVertexMin),
145  fProdDcaV0PrToPrimVertexMin(source.fProdDcaV0PrToPrimVertexMin),
146  fProdDcaV0PiToPrimVertexMin(source.fProdDcaV0PiToPrimVertexMin),
147  fProdV0ProperDecayLengthMax(source.fProdV0ProperDecayLengthMax),
148  fProdMassRejK0s(source.fProdMassRejK0s),
149  fProdV0EtaMin(source.fProdV0EtaMin),
150  fProdV0EtaMax(source.fProdV0EtaMax),
151  fProdV0RapMin(source.fProdV0RapMin),
152  fProdV0RapMax(source.fProdV0RapMax),
153  fProdRoughMassTol(source.fProdRoughMassTol),
154  fProdRoughPtMin(source.fProdRoughPtMin),
155  fExcludePionTPC(source.fExcludePionTPC),
156  fExcludeProtonTPC(source.fExcludeProtonTPC),
157  fExcludeKaonTPC(source.fExcludeKaonTPC),
158  fExcludenSigmaPionTPC(source.fExcludenSigmaPionTPC),
159  fExcludenSigmaProtonTPC(source.fExcludenSigmaProtonTPC),
160  fExcludenSigmaKaonTPC(source.fExcludenSigmaKaonTPC),
161  fSigmaElectronTPCMin(source.fSigmaElectronTPCMin),
162  fSigmaElectronTPCPtDepPar0(source.fSigmaElectronTPCPtDepPar0),
163  fSigmaElectronTPCPtDepPar1(source.fSigmaElectronTPCPtDepPar1),
164  fSigmaElectronTPCMax(source.fSigmaElectronTPCMax),
165  fSigmaElectronTOFMin(source.fSigmaElectronTOFMin),
166  fSigmaElectronTOFMax(source.fSigmaElectronTOFMax)
167 {
168  //
169  // Copy constructor
170  //
171 }
172 //--------------------------------------------------------------------------
174 {
175  //
176  // assignment operator
177  //
178 
179  if (this != &source) {
180  AliRDHFCuts::operator=(source);
181  }
182 
183  fPIDStrategy = source.fPIDStrategy;
185  fUseLambdaPID = source.fUseLambdaPID;
186  fPidObjProton = source.fPidObjProton;
187  fPidObjPion = source.fPidObjPion;
193  fProdV0PtMin = source.fProdV0PtMin;
207  fProdV0EtaMin = source.fProdV0EtaMin;
208  fProdV0EtaMax = source.fProdV0EtaMax;
209  fProdV0RapMin = source.fProdV0RapMin;
210  fProdV0RapMax = source.fProdV0RapMax;
225 
226 
227  return *this;
228 }
229 
230 //---------------------------------------------------------------------------
232  //
233  // Default Destructor
234  //
235 
236 }
237 
238 //---------------------------------------------------------------------------
239 void AliRDHFCutsLctoeleLambdafromAODtracks::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) {
240  //
241  // Fills in vars the values of the variables
242  //
243 
244  if (pdgdaughters[0]==-9999) return; // dummy
245 
247  if(!dd){
248  AliError("No AliAODRecoCascadeHF object found\n");
249  return;
250  }
251 
252  if (nvars!=fnVarsForOpt) {
253  AliError("Cut object seems to have the wrong number of variables\n");
254  return;
255  }
256 
257  //Double_t ptD=d->Pt();
258  //Int_t ptbin=PtBin(ptD);
259  Int_t iter=-1;
260 
261 
262  if(fVarsForOpt[0]){
263  iter++;
264  UInt_t pdgdg[2]={11,3122};
265  vars[iter]= dd->InvMass(2,pdgdg);
266  }
267  if(fVarsForOpt[1]){
268  iter++;
269  Double_t v0px = dd->PxProng(1);
270  Double_t v0py = dd->PyProng(1);
271  Double_t v0pz = dd->PzProng(1);
272  Double_t epx = dd->PxProng(0);
273  Double_t epy = dd->PyProng(0);
274  Double_t epz = dd->PzProng(0);
275  vars[iter]= (v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz);
276  }
277 
278  return;
279 }
280 
281 //---------------------------------------------------------------------------
282 Int_t AliRDHFCutsLctoeleLambdafromAODtracks::IsSelected(TObject* obj, Int_t selectionLevel) {
283  //
284  // Apply selection
285  //
286 
287  if (!fCutsRD) {
288  AliFatal("Cut matrix not inizialized. Exit...");
289  return 0;
290  }
291 
293  if(!d){
294  AliDebug(2,"AliAODRecoCascadeHF null");
295  return 0;
296  }
297 
298  Double_t ptD=d->Pt();
299  if(ptD<fMinPtCand) return 0;
300  if(ptD>fMaxPtCand) return 0;
301 
302  if (selectionLevel==AliRDHFCuts::kAll ||
303  selectionLevel==AliRDHFCuts::kTracks) {
304  //Performed in production stage
305  }
306 
307  Int_t returnvalueCuts=1;
308  // selection on candidate
309  if (selectionLevel==AliRDHFCuts::kAll ||
310  selectionLevel==AliRDHFCuts::kCandidate) {
311 
312  Double_t pt=d->Pt();
313  Int_t ptbin=PtBin(pt);
314  if (ptbin==-1) {
315  return 0;
316  }
317  Bool_t okcand=kTRUE;
318 
319  Double_t mlamPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
320  UInt_t pdgdg[2]={11,3122};
321  Double_t InvMassEleLambda = d->InvMass(2,pdgdg);
322 
323  Double_t v0px = d->PxProng(1);
324  Double_t v0py = d->PyProng(1);
325  Double_t v0pz = d->PzProng(1);
326  Double_t epx = d->PxProng(0);
327  Double_t epy = d->PyProng(0);
328  Double_t epz = d->PzProng(0);
329  Double_t cosoa = (v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz);
330 
331  if(InvMassEleLambda > fCutsRD[GetGlobalIndex(0,ptbin)])
332  {
333  okcand = kFALSE;
334  }
335  if(cosoa < fCutsRD[GetGlobalIndex(1,ptbin)])
336  {
337  okcand = kFALSE;
338  }
339 
340  if(!okcand) return 0;
341  returnvalueCuts = 1;
342  }
343 
344  Int_t returnvaluePID=1;
345  if(selectionLevel==AliRDHFCuts::kAll ||
346  selectionLevel==AliRDHFCuts::kCandidate||
347  selectionLevel==AliRDHFCuts::kPID) {
348  //Not used
349  }
350 
351  Int_t returnvalue = 0;
352  if(returnvalueCuts==1 && returnvaluePID==1) returnvalue=1;
353 
354  return returnvalue;
355 }
356 
357 //---------------------------------------------------------------------------
359 {
360  //
361  // IsSelectedPID (not used)
362  //
363 
364  if(!fUsePID || !obj) return 1;
365 
367  AliAODTrack *part = dd->GetBachelor();
368 
369  Int_t returnvalue=1;
370 
371  if(fPidHF->GetPidResponse()==0x0){
372  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
373  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
374  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
375  fPidHF->SetPidResponse(pidResp);
376  }
377 
378  Int_t isElectron=fPidHF->MakeRawPid(part,0);
379  if(isElectron<1) returnvalue = 0;
380 
381  return returnvalue;
382 }
383 
384 //---------------------------------------------------------------------------
386  //
387  // IsSelectedCombinedPID (not used)
388  //
389 
390  if(!fUsePID || !obj) {return 1;}
391 
393  AliAODTrack *part = dd->GetBachelor();
394  if(!part) return 0;
395 
396  Int_t returnvalue=1;
397 
398  return returnvalue;
399 }
400 
401 //________________________________________________________________________
402 Bool_t AliRDHFCutsLctoeleLambdafromAODtracks::SingleTrkCuts(AliAODTrack *trk, AliAODVertex *primVert)
403 {
404  //
405  // Single Track Cut to be applied before object creation
406  //
407 
408  if(trk->GetStatus()&AliESDtrack::kITSpureSA) return kFALSE;
409  if(!(trk->GetStatus()&AliESDtrack::kITSin)) return kFALSE;
410  if(fProdUseAODFilterBit && !trk->TestFilterMask(BIT(4))) return kFALSE;
411  Double_t pos[3]; primVert->GetXYZ(pos);
412  Double_t cov[6]; primVert->GetCovarianceMatrix(cov);
413  const AliESDVertex vESD(pos,cov,100.,100);
414  if(fTrackCuts&&!IsDaughterSelected(trk,&vESD,fTrackCuts)) return kFALSE;
415 
416  if(trk->GetTPCsignalN()<fProdTrackTPCNclsPIDMin) return kFALSE;
417  if(trk->GetTPCNclsF()>0){
418  Float_t tpcratio = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
419  if(tpcratio<fProdTrackTPCNclsRatioMin) return kFALSE;
420  }
421 
422 
423  if(fUsePID)
424  {
425  if(fPidHF->GetPidResponse()==0x0){
426  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
427  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
428  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
429  fPidHF->SetPidResponse(pidResp);
430  }
431 
432  switch(fPIDStrategy){
433  case kNSigmaCuts:
434  return IsSelectedeID(trk);
435  break;
437  return IsSelectedCustomizedeID(trk);
438  break;
440  return IsSelectedCustomizedPtDepeID(trk);
441  break;
442  case kCombinedCuts:
443  return IsSelectedCombinedeID(trk);
444  break;
445  }
446 
447  }
448 
449  return kTRUE;
450 }
451 //________________________________________________________________________
452 Bool_t AliRDHFCutsLctoeleLambdafromAODtracks::SingleTrkCutsNoPID(AliAODTrack *trk, AliAODVertex *primVert)
453 {
454  //
455  // Single Track Cut to be applied before object creation
456  //
457 
458  if(trk->GetStatus()&AliESDtrack::kITSpureSA) return kFALSE;
459  if(!(trk->GetStatus()&AliESDtrack::kITSin)) return kFALSE;
460  if(fProdUseAODFilterBit && !trk->TestFilterMask(BIT(4))) return kFALSE;
461  Double_t pos[3]; primVert->GetXYZ(pos);
462  Double_t cov[6]; primVert->GetCovarianceMatrix(cov);
463  const AliESDVertex vESD(pos,cov,100.,100);
464  if(fTrackCuts&&!IsDaughterSelected(trk,&vESD,fTrackCuts)) return kFALSE;
465 
466  if(trk->GetTPCsignalN()<fProdTrackTPCNclsPIDMin) return kFALSE;
467  if(trk->GetTPCNclsF()>0){
468  Float_t tpcratio = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
469  if(tpcratio<fProdTrackTPCNclsRatioMin) return kFALSE;
470  }
471 
472  return kTRUE;
473 }
474 //________________________________________________________________________
476 {
477  //
478  // electron ID first shot
479  //
480 
481  Double_t nSigmaPion = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
482  if(fExcludePionTPC){
483  if(TMath::Abs(nSigmaPion)<fExcludenSigmaPionTPC){
484  return kFALSE;
485  }
486  }
487 
488  Double_t nSigmaProton = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
489  if(fExcludeProtonTPC){
490  if(TMath::Abs(nSigmaProton)<fExcludenSigmaProtonTPC){
491  return kFALSE;
492  }
493  }
494 
495  Double_t nSigmaKaon = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
496  if(fExcludeKaonTPC){
497  if(TMath::Abs(nSigmaKaon)<fExcludenSigmaKaonTPC){
498  return kFALSE;
499  }
500  }
501 
502  Int_t isElectron=fPidHF->MakeRawPid(trk,0);
503  if(isElectron<1) return kFALSE;
504 
505  return kTRUE;
506 }
507 //________________________________________________________________________
509 {
510  //
511  // electron ID first shot
512  //
513 
514  Double_t nSigmaPion = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
515  if(fExcludePionTPC){
516  if(TMath::Abs(nSigmaPion)<fExcludenSigmaPionTPC){
517  return kFALSE;
518  }
519  }
520 
521  Double_t nSigmaProton = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
522  if(fExcludeProtonTPC){
523  if(TMath::Abs(nSigmaProton)<fExcludenSigmaProtonTPC){
524  return kFALSE;
525  }
526  }
527 
528  Double_t nSigmaKaon = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
529  if(fExcludeKaonTPC){
530  if(TMath::Abs(nSigmaKaon)<fExcludenSigmaKaonTPC){
531  return kFALSE;
532  }
533  }
534 
535  Double_t nSigmaTPCele = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
536  Double_t nSigmaTOFele = fPidHF->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
537 
538  if(nSigmaTPCele<fSigmaElectronTPCMin) return kFALSE;
539  if(nSigmaTPCele>fSigmaElectronTPCMax) return kFALSE;
540  if(nSigmaTOFele<fSigmaElectronTOFMin) return kFALSE;
541  if(nSigmaTOFele>fSigmaElectronTOFMax) return kFALSE;
542 
543  return kTRUE;
544 }
545 //________________________________________________________________________
547 {
548  //
549  // electron ID first shot
550  //
551 
552  Double_t nSigmaTPCele = fPidHF->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
553  Double_t nSigmaTOFele = fPidHF->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
554 
555  if(nSigmaTOFele<fSigmaElectronTOFMin) return kFALSE;
556  if(nSigmaTOFele>fSigmaElectronTOFMax) return kFALSE;
557 
558  if(nSigmaTPCele<fSigmaElectronTPCPtDepPar0+fSigmaElectronTPCPtDepPar1*trk->Pt()) return kFALSE;
559  if(nSigmaTPCele>fSigmaElectronTPCMax) return kFALSE;
560 
561  return kTRUE;
562 }
563 //________________________________________________________________________
565 {
566  //
567  // electron ID Basyian not implemented
568  //
569 
570  return kTRUE;
571 }
572 
573 //________________________________________________________________________
574 Bool_t AliRDHFCutsLctoeleLambdafromAODtracks::SingleV0Cuts(AliAODv0 *v0, AliAODVertex *primVert)
575 {
576  //
577  // Single V0 Cut to be applied before object creation
578  //
579 
580  Bool_t onFlyV0 = v0->GetOnFlyStatus(); // on-the-flight V0s
581  if ( onFlyV0 && !fUseOnTheFlyV0 ) return kFALSE;
582  if(!v0) return kFALSE;
583  if(!(v0->GetSecondaryVtx())) return kFALSE;
584 
585  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
586  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
587  if(!cptrack || !cntrack) return kFALSE;
588  if(cptrack->Charge()<0 && cntrack->Charge()>0){
589  //In case sign is wrong
590  cptrack = (AliAODTrack*)(v0->GetDaughter(1));
591  cntrack = (AliAODTrack*)(v0->GetDaughter(0));
592  }
593 
594  if ( cptrack->Charge() == cntrack->Charge() ) return kFALSE;
595  if(!(cptrack->GetStatus() & AliESDtrack::kTPCrefit) ||
596  !(cntrack->GetStatus() & AliESDtrack::kTPCrefit)) return kFALSE;
597  AliAODVertex *maybeKinkPos = (AliAODVertex*)cptrack->GetProdVertex();
598  AliAODVertex *maybeKinkNeg = (AliAODVertex*)cntrack->GetProdVertex();
599  if (maybeKinkPos->GetType()==AliAODVertex::kKink || maybeKinkNeg->GetType()==AliAODVertex::kKink)
600  return kFALSE;
601 
602  if ( ( ( cptrack->GetTPCClusterInfo(2,1) ) < (Float_t)fProdV0DaughterTPCClusterMin ) ||
603  ( ( cntrack->GetTPCClusterInfo(2,1) ) < (Float_t)fProdV0DaughterTPCClusterMin) ) return kFALSE;
604 
605 
606  if((cptrack->GetTPCNclsF()>0)&&(cptrack->GetTPCClusterInfo(2,1)/cptrack->GetTPCNclsF()<fProdV0DaughterTPCCrossRatioMin)) return kFALSE;
607  if((cntrack->GetTPCNclsF()>0)&&(cntrack->GetTPCClusterInfo(2,1)/cntrack->GetTPCNclsF()<fProdV0DaughterTPCCrossRatioMin)) return kFALSE;
608 
609  Double_t massLambda = v0->MassLambda();
610  Double_t massAntiLambda = v0->MassAntiLambda();
611  Double_t mlamPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
612  Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
613  if(!(fabs(massAntiLambda-mlamPDG)<fProdV0MassTolLambda) && !(fabs(massLambda-mlamPDG)<fProdV0MassTolLambda)) return kFALSE;
614 
615  Double_t massK0s = v0->MassK0Short();
616  if(TMath::Abs(massK0s-mk0sPDG)<fProdMassRejK0s)
617  return kFALSE;
618 
619  Bool_t isparticle = kTRUE;
620  if(TMath::Abs(massAntiLambda-mlamPDG)<fProdV0MassTolLambda) isparticle = kFALSE;
621 
622 
623  if(TMath::Abs(v0->DcaV0Daughters())>fProdV0DcaDaughtersMax) return kFALSE;
624  Double_t posVtx[3] = {0.,0.,0.};
625  primVert->GetXYZ(posVtx);
626  Double_t cospav0 = v0->CosPointingAngle(posVtx);
627  if(cospav0<fProdV0CosPointingAngleToPrimVtxMin) return kFALSE;
628  if(v0->Pt()<fProdV0PtMin) return kFALSE;
629  if(fabs(cptrack->Eta())>fProdV0DaughterEtaRange) return kFALSE;
630  if(fabs(cntrack->Eta())>fProdV0DaughterEtaRange) return kFALSE;
631  if(cptrack->Pt()<fProdV0DaughterPtMin) return kFALSE;
632  if(cntrack->Pt()<fProdV0DaughterPtMin) return kFALSE;
633 
634  Double_t lDcaV0ToPrimVertex = v0->DcaV0ToPrimVertex();
635  Double_t lDcaPosToPrimVertex = v0->DcaPosToPrimVertex();
636  Double_t lDcaNegToPrimVertex = v0->DcaNegToPrimVertex();
637  if(lDcaV0ToPrimVertex < fProdDcaV0ToPrimVertexMin) return kFALSE;
638  if(isparticle){
639  if(lDcaPosToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
640  if(lDcaNegToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
641  }else{
642  if(lDcaPosToPrimVertex < fProdDcaV0PiToPrimVertexMin) return kFALSE;
643  if(lDcaNegToPrimVertex < fProdDcaV0PrToPrimVertexMin) return kFALSE;
644  }
645  Double_t lPosV0[3];
646  lPosV0[0] = v0->DecayVertexV0X();
647  lPosV0[1] = v0->DecayVertexV0Y();
648  lPosV0[2] = v0->DecayVertexV0Z();
649  Double_t decayvertV0 = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
650 
651  if(decayvertV0<fProdRfidMinV0 || decayvertV0>fProdRfidMaxV0) return kFALSE;
652 
653  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
654  Double_t properdl = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
655  if(properdl>fProdV0ProperDecayLengthMax) return kFALSE;
656 
657 
658  if(fUseLambdaPID)
659  {
660  if(fPidObjProton->GetPidResponse()==0x0){
661  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
662  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
663  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
664  fPidObjProton->SetPidResponse(pidResp);
665  }
666  if(fPidObjPion->GetPidResponse()==0x0){
667  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
668  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
669  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
670  fPidObjPion->SetPidResponse(pidResp);
671  }
672 
673  Int_t isProton= -9999;
674  Int_t isPion= -9999;
675  if(fabs(massLambda-mlamPDG)<0.02){
676  isProton=fPidObjProton->MakeRawPid(cptrack,4);
677  isPion=fPidObjPion->MakeRawPid(cntrack,2);
678  }else{
679  isProton=fPidObjProton->MakeRawPid(cntrack,4);
680  isPion=fPidObjPion->MakeRawPid(cptrack,2);
681  }
682  if(isProton<1) return kFALSE;
683  if(isPion<1) return kFALSE;
684  }
685 
686  Double_t RapLambda = v0->RapLambda();
687  if(RapLambda<fProdV0RapMin || RapLambda>fProdV0RapMax) return kFALSE;
688 
689  Double_t EtaLambda = v0->PseudoRapV0();
690  if(EtaLambda<fProdV0EtaMin || EtaLambda>fProdV0EtaMax) return kFALSE;
691 
692  return kTRUE;
693 }
694 
695 //________________________________________________________________________
696 Bool_t AliRDHFCutsLctoeleLambdafromAODtracks::SelectWithRoughCuts(AliAODv0 *v0, AliAODTrack *part)
697 {
698  //
699  // Mass and pT Cut to be applied before object creation
700  // Not used now
701  //
702  if(!v0) return kFALSE;
703  if(!part) return kFALSE;
704 
705  return kTRUE;
706 
707 }
Bool_t SingleV0Cuts(AliAODv0 *v0, AliAODVertex *vert)
Double_t fProdV0DaughterTPCCrossRatioMin
V0 daughter Minimum TPC cluster pT used before object creation.
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Double_t fProdV0ProperDecayLengthMax
Min Dca between v0-pion and PV.
Double_t fSigmaElectronTPCMin
nSigma to exclude for Kaon band
AliAODPidHF * fPidObjProton
Use PID for proton from Lc.
Double_t fProdRoughMassTol
Maximum rapidity of cascade.
AliRDHFCutsLctoeleLambdafromAODtracks & operator=(const AliRDHFCutsLctoeleLambdafromAODtracks &source)
Double_t fProdV0CosPointingAngleToPrimVtxMin
Minimum Lambda pT used before object creation.
Double_t fProdV0PtMin
Lambda mass selection used before object creation.
Double_t fExcludenSigmaKaonTPC
nSigma to exclude for proton band
void SetNVars(Int_t nVars)
Definition: AliRDHFCuts.h:361
AliRDHFCuts & operator=(const AliRDHFCuts &source)
Bool_t fExcludePionTPC
pT cut for Lc used before object creation
Double_t fProdTrackTPCNclsRatioMin
Min. Number of TPC PID cluster.
Bool_t fUsePID
Definition: AliRDHFCuts.h:388
Double_t fSigmaElectronTPCPtDepPar1
nSigma electron lower limit (par0)
Double_t fSigmaElectronTPCPtDepPar0
nSigma to exclude for Kaon band
Double_t fExcludenSigmaProtonTPC
nSigma to exclude for pion band
Double_t fProdDcaV0PrToPrimVertexMin
Min Dca between v0 and PV.
virtual void GetCutVarsForOpt(AliAODRecoDecayHF *d, Float_t *vars, Int_t nvars, Int_t *pdgdaughters)
Double_t fProdV0DaughterEtaRange
Max DCA between V0 daughters used before object creation.
Int_t fnVarsForOpt
Definition: AliRDHFCuts.h:383
Bool_t fUseLambdaPID
Threshold used in IsSelectedCombinedPID.
Double_t fMaxPtCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:410
Double_t fSigmaElectronTOFMin
nSigma to exclude for Kaon band
AliESDtrackCuts * fTrackCuts
quality cuts on the daughter tracks
Definition: AliRDHFCuts.h:376
Bool_t fExcludeKaonTPC
Flag wheter to exlude proton band.
Double_t fProdRoughPtMin
Mass cut for Lc used before object creation.
Double_t fProdDcaV0PiToPrimVertexMin
Min Dca between v0-proton and PV.
Bool_t IsDaughterSelected(AliAODTrack *track, const AliESDVertex *primary, AliESDtrackCuts *cuts) const
Double_t fSigmaElectronTOFMax
nSigma to exclude for Kaon band
Int_t fProdTrackTPCNclsPIDMin
Flag to check if we use on-the-fly v0.
AliAODTrack * GetBachelor() const
Bool_t fUseOnTheFlyV0
PID object for proton from Lc.
Bool_t SelectWithRoughCuts(AliAODv0 *v0, AliAODTrack *trk1)
Int_t MakeRawPid(AliAODTrack *track, Int_t specie)
AliPIDResponse * GetPidResponse() const
Definition: AliAODPidHF.h:160
Double_t fProdV0MassTolLambda
Flag for AOD filter Bit used before object creation.
Float_t * fCutsRD
fnVars*fnPtBins
Definition: AliRDHFCuts.h:386
Double_t fProdV0EtaMin
Rejection range of Omega mass from PDG value.
void SetVarsForOpt(Int_t nVars, Bool_t *forOpt)
Double_t fProdV0DaughterTPCClusterMin
V0 Daughter pT min used before object creation.
Double_t fExcludenSigmaPionTPC
Flag wheter to exlude proton band.
void SetVarNames(Int_t nVars, TString *varNames, Bool_t *isUpperCut)
Bool_t fExcludeProtonTPC
Flag wheter to exlude pion band.
Bool_t * fVarsForOpt
number of cut vars to be optimized for candidates
Definition: AliRDHFCuts.h:384
Bool_t fProdUseAODFilterBit
Min. Number of TPC PID cluster.
void SetPtBins(Int_t nPtBinLimits, Float_t *ptBinLimits)
Bool_t SingleTrkCutsNoPID(AliAODTrack *trk, AliAODVertex *vert)
Double_t fSigmaElectronTPCMax
nSigma electron lower limit (par1)
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
Double_t fProdRfidMinV0
V0 daughter Minimum TPC cluster pT used before object creation.
Double_t fProdV0DcaDaughtersMax
V0 pointing angle used before object creation.
AliRDHFCutsLctoeleLambdafromAODtracks(const char *name="CutsLctoeleLambda")
AliAODPidHF * fPidHF
enable AOD049 centrality cleanup
Definition: AliRDHFCuts.h:390
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:409
AliAODPidHF * fPidObjPion
PID object for proton from Lc.
Double_t fProdV0DaughterPtMin
V0Daughter eta range used before object creation.
void SetPidResponse(AliPIDResponse *pidResp)
Definition: AliAODPidHF.h:111
Bool_t SingleTrkCuts(AliAODTrack *trk, AliAODVertex *vert)