AliPhysics  58f3d52 (58f3d52)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliRDHFCutsLctoV0.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->V0+X
21 //
22 // Modified by A.De Caro - decaro@sa.infn.it
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"
34 #include "AliRDHFCutsLctoV0.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 "AliESDv0.h"
42 
43 using std::cout;
44 using std::endl;
45 
47 ClassImp(AliRDHFCutsLctoV0);
49 
50 
51 //--------------------------------------------------------------------------
52 AliRDHFCutsLctoV0::AliRDHFCutsLctoV0(const char* name, Short_t /*v0channel*/) :
53 AliRDHFCuts(name),
54 fPidSelectionFlag(0),
55 fV0daughtersCuts(0),
56 fV0Type(0),
57 fHighPtCut(2.5),
58 fLowPtCut(1.0),
59 fExcludedCut(-1),
60 fMinCombinedProbability(0),
61 fBzkG(0)
62 {
63  //
64  // Default Constructor
65  //
66 
67  const Int_t nvars=21;
68  SetNVars(nvars);
69  TString varNames[nvars]={"Lc inv. mass if K0S [GeV/c2]", // 0
70  "Lc inv. mass if Lambda [GeV/c2]", // 1
71  "K0S inv. mass [GeV/c2]", // 2
72  "Lambda/LambdaBar inv. mass[GeV/c2]", // 3
73  "pT min bachelor track [GeV/c]", // 4
74  "pT min V0-positive track [GeV/c]", // 5
75  "pT min V0-negative track [GeV/c]", // 6
76  "dca cascade (prong-to-prong) cut [cm]", // 7
77  "dca V0 (prong-to-prong) cut [number of sigmas]", // 8
78  "V0 cosPA min wrt PV", // 9
79  "d0 max bachelor wrt PV [cm]", // 10
80  "d0 max V0 wrt PV [cm]", // 11
81  "mass K0S veto [GeV/c2]", // 12
82  "mass Lambda/LambdaBar veto [GeV/c2]", // 13
83  "mass Gamma veto [GeV/c2]", // 14
84  "pT min V0 track [GeV/c]", // 15
85  "Max Proton emission angle in Lc CMS", // 16
86  "Min Proton emission angle in Lc CMS", // 17
87  "Resigned d0", // 18
88  "V0 qT/|alpha|", // 19
89  "V0 type" // 20
90  };
91 
92  Bool_t isUpperCut[nvars]={kTRUE, // 0
93  kTRUE, // 1
94  kTRUE, // 2
95  kTRUE, // 3
96  kFALSE, // 4
97  kFALSE, // 5
98  kFALSE, // 6
99  kTRUE, // 7
100  kTRUE, // 8
101  kFALSE, // 9
102  kTRUE, // 10
103  kTRUE, // 11
104  kFALSE, // 12
105  kFALSE, // 13
106  kFALSE, // 14
107  kFALSE, // 15
108  kTRUE, // 16
109  kFALSE, // 17
110  kFALSE, // 18
111  kFALSE, // 19
112  kFALSE // 20
113  };
114  SetVarNames(nvars,varNames,isUpperCut);
115  Bool_t forOpt[nvars]={kFALSE, // 0
116  kFALSE, // 1
117  kTRUE, // 2
118  kTRUE, // 3
119  kTRUE, // 4
120  kTRUE, // 5
121  kTRUE, // 6
122  kTRUE, // 7
123  kTRUE, // 8
124  kTRUE, // 9
125  kTRUE, // 10
126  kTRUE, // 11
127  kTRUE, // 12
128  kTRUE, // 13
129  kTRUE, // 14
130  kTRUE, // 15
131  kTRUE, // 16
132  kTRUE, // 17
133  kTRUE, // 18
134  kTRUE, // 19
135  kFALSE // 20
136  };
137  SetVarsForOpt(nvars,forOpt);
138 
139  Float_t limits[2]={0,999999999.};
140  SetPtBins(2,limits);
141 
142  /*
143  switch (v0channel) {
144  case 0:
145  fV0channel = 0x0001;
146  break;
147  case 1:
148  fV0channel = 0x0002;
149  break;
150  case 2:
151  fV0channel = 0x0004;
152  break;
153  }
154  */
155 
156 }
157 //--------------------------------------------------------------------------
159  AliRDHFCuts(source),
160  fPidSelectionFlag(source.fPidSelectionFlag),
161  fV0daughtersCuts(0),
162  fV0Type(source.fV0Type),
163  fHighPtCut(source.fHighPtCut),
164  fLowPtCut(source.fLowPtCut),
165  fExcludedCut(source.fExcludedCut),
166  fMinCombinedProbability(0),
167  fBzkG(source.fBzkG)
168 {
169  //
170  // Copy constructor
171  //
172 
174  else fV0daughtersCuts = new AliESDtrackCuts();
175 
177 
178 }
179 //--------------------------------------------------------------------------
181 {
182  //
183  // assignment operator
184  //
185 
186  if (this != &source) {
187 
188  AliRDHFCuts::operator=(source);
190 
191  delete fV0daughtersCuts;
192  fV0daughtersCuts = new AliESDtrackCuts(*(source.fV0daughtersCuts));
193 
194  fV0Type = source.fV0Type;
195 
196  fHighPtCut = source.fHighPtCut;
197  fLowPtCut = source.fLowPtCut;
198 
200  fBzkG = source.fBzkG;
201  }
202 
203  return *this;
204 }
205 
206 
207 //---------------------------------------------------------------------------
209  //
210  // Default Destructor
211  //
212 
213  if (fV0daughtersCuts) {
214  delete fV0daughtersCuts;
216  }
217 
219  delete [] fMinCombinedProbability;
221  }
222 
223 }
224 
225 //---------------------------------------------------------------------------
227  //
228  // Fills in vars the values of the variables
229  //
230 
231  if (pdgdaughters[0]==-9999) return; // dummy
232 
233  if (nvars!=fnVarsForOpt) {
234  printf("AliRDHFCutsLctoV0::GetCutVarsForOpt: wrong number of variables\n");
235  return;
236  }
237 
238  Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
239  Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
240  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
241 
243 
244  // Get the v0 and all daughter tracks
245  AliAODTrack *bachelorTrack = (AliAODTrack*)dd->GetBachelor();
246  AliAODv0 *v0 = (AliAODv0*)dd->Getv0();
247  AliAODTrack *v0positiveTrack = (AliAODTrack*)dd->Getv0PositiveTrack();
248  AliAODTrack *v0negativeTrack = (AliAODTrack*)dd->Getv0NegativeTrack();
249 
250  Int_t iter=-1;
251  // cut on cascade mass, if K0S + p
252  if (fVarsForOpt[0]) {
253  iter++;
254  vars[iter]=TMath::Abs(dd->InvMassLctoK0sP()-mLcPDG);
255  }
256  // cut on cascade mass, if Lambda/LambdaBar + pi
257  if (fVarsForOpt[1]) {
258  iter++;
259  vars[iter]=TMath::Abs(dd->InvMassLctoLambdaPi()-mLcPDG);
260  }
261 
262  // cut on V0 mass if K0S
263  if (fVarsForOpt[2]) {
264  iter++;
265  vars[iter]=TMath::Abs(v0->MassK0Short()-mk0sPDG);
266  }
267 
268  // cut on V0 mass if Lambda/LambdaBar
269  if (fVarsForOpt[3]) {
270 
271  if (bachelorTrack->Charge()==1) {
272  iter++;
273  vars[iter]=TMath::Abs(v0->MassLambda()-mLPDG);
274  } else if (bachelorTrack->Charge()==-1) {
275  iter++;
276  vars[iter]=TMath::Abs(v0->MassAntiLambda()-mLPDG);
277  }
278 
279  }
280 
281  // cut bachelor min pt
282  if (fVarsForOpt[4]) {
283  iter++;
284  vars[iter]=bachelorTrack->Pt();
285  }
286 
287  // cut on V0-positive min pt
288  if (fVarsForOpt[5]) {
289  iter++;
290  vars[iter]=v0positiveTrack->Pt();
291  }
292 
293  // cut on V0-negative min pt
294  if (fVarsForOpt[6]) {
295  iter++;
296  vars[iter]=v0negativeTrack->Pt();
297  }
298 
299  // cut on cascade dca (prong-to-prong)
300  if (fVarsForOpt[7]) {
301  iter++;
302  vars[iter]=dd->GetDCA(); // prong-to-prong cascade DCA
303  }
304 
305  // cut on V0 dca (prong-to-prong)
306  if (fVarsForOpt[8]) {
307  iter++;
308  vars[iter]=v0->GetDCA(); // prong-to-prong V0 DCA
309  }
310 
311  // cut on V0 cosPA wrt PV
312  if (fVarsForOpt[9]) {
313  iter++;
314  vars[iter]=dd->CosV0PointingAngle(); // cosine of V0 pointing angle wrt primary vertex
315  }
316 
317  // cut on bachelor transverse impact parameter wrt PV
318  if (fVarsForOpt[10]) {
319  iter++;
320  vars[iter]=dd->Getd0Prong(0); // bachelor transverse impact parameter wrt primary vertex
321  }
322 
323  // cut on V0 transverse impact parameter wrt PV
324  if (fVarsForOpt[11]) {
325  iter++;
326  vars[iter]=dd->Getd0Prong(1); // V0 transverse impact parameter wrt primary vertex
327  }
328 
329  // cut on K0S invariant mass veto
330  if (fVarsForOpt[12]) {
331  iter++;
332  vars[iter]=TMath::Abs(v0->MassK0Short()-mk0sPDG); // K0S invariant mass veto
333  }
334 
335  // cut on Lambda/LambdaBar invariant mass veto
336  if (fVarsForOpt[13]) {
337 
338  if (bachelorTrack->Charge()==1) {
339  iter++;
340  vars[iter]=TMath::Abs(v0->MassLambda()-mLPDG);
341  } else if (bachelorTrack->Charge()==-1) {
342  iter++;
343  vars[iter]=TMath::Abs(v0->MassAntiLambda()-mLPDG);
344  }
345 
346  }
347 
348  // cut on gamma invariant mass veto
349  if (fVarsForOpt[14]) {
350  iter++;
351  vars[iter]= v0->InvMass2Prongs(0,1,11,11); // gamma invariant mass veto
352  }
353 
354 
355  // cut on V0 pT min
356  if (fVarsForOpt[15]) {
357  iter++;
358  vars[iter]= v0->Pt(); // V0 pT min
359  }
360 
361  // cut on proton emission angle
362  if (fVarsForOpt[16]) {
363  iter++;
364  vars[iter]= GetProtonEmissionAngleCMS(d); //CosPrThetaCMS
365  }
366 
367  // cut on proton emission angle
368  if (fVarsForOpt[17]) {
369  iter++;
370  vars[iter]= GetProtonEmissionAngleCMS(d); //CosPrThetaCMS
371  }
372 
373  // cut on re-signed d0
374  if (fVarsForOpt[18]) {
375  iter++;
376  vars[iter]= -9999;
377  }
378 
379  // cut on Armenteros qT/|alpha|
380  if (fVarsForOpt[19]) {
381  iter++;
382  vars[iter]= v0->PtArmV0()/TMath::Abs(v0->AlphaV0());
383  }
384 
385 
386  return;
387 }
388 //---------------------------------------------------------------------------
390  //
391  // Apply selection
392  //
393 
394  if (!fCutsRD) {
395  AliFatal("Cut matrice not inizialized. Exit...");
396  return 0;
397  }
398 
400  if (!d) {
401  AliDebug(2,"AliAODRecoCascadeHF null");
402  return 0;
403  }
404 
405  Double_t pt=d->Pt();
406  if(pt<fMinPtCand) return 0;
407  if(pt>fMaxPtCand) return 0;
408 
409  if (!d->GetSecondaryVtx()) {
410  AliDebug(2,"No secondary vertex for cascade");
411  return 0;
412  }
413 
414  if (d->GetNDaughters()!=2) {
415  AliDebug(2,Form("No 2 daughters for current cascade (nDaughters=%d)",d->GetNDaughters()));
416  return 0;
417  }
418 
419  AliAODv0 * v0 = dynamic_cast<AliAODv0*>(d->Getv0());
420 
421  if ( v0 && ((v0->GetOnFlyStatus() == kTRUE && GetV0Type() == AliRDHFCuts::kOnlyOfflineV0s) ||
422  (v0->GetOnFlyStatus() == kFALSE && GetV0Type() == AliRDHFCuts::kOnlyOnTheFlyV0s)) ) return 0;
423 
424  AliAODTrack * bachelorTrack = dynamic_cast<AliAODTrack*>(d->GetBachelor());
425  if (!v0 || !bachelorTrack) {
426  AliDebug(2,"No V0 or no bachelor for current cascade");
427  return 0;
428  }
429 
430  if (bachelorTrack->GetID()<0) {
431  AliDebug(2,Form("Bachelor has negative ID %d",bachelorTrack->GetID()));
432  return 0;
433  }
434 
435  if (!v0->GetSecondaryVtx()) {
436  AliDebug(2,"No secondary vertex for V0 by cascade");
437  return 0;
438  }
439 
440  if (v0->GetNDaughters()!=2) {
441  AliDebug(2,Form("No 2 daughters for V0 of current cascade (onTheFly=%d, nDaughters=%d)",v0->GetOnFlyStatus(),v0->GetNDaughters()));
442  return 0;
443  }
444 
445 
446  // Get the V0 daughter tracks
447  AliAODTrack *v0positiveTrack = dynamic_cast<AliAODTrack*>(d->Getv0PositiveTrack());
448  AliAODTrack *v0negativeTrack = dynamic_cast<AliAODTrack*>(d->Getv0NegativeTrack());
449  if (!v0positiveTrack || !v0negativeTrack ) {
450  AliDebug(2,"No V0 daughters' objects");
451  return 0;
452  }
453 
454  if (v0positiveTrack->GetID()<0 || v0negativeTrack->GetID()<0) {
455  AliDebug(2,Form("At least one of V0 daughters has negative ID %d %d",v0positiveTrack->GetID(),v0negativeTrack->GetID()));
456  return 0;
457  }
458 
459  //if(fUseTrackSelectionWithFilterBits && d->HasBadDaughters()) return 0;
460  if ( fUseTrackSelectionWithFilterBits && !(bachelorTrack->TestFilterMask(BIT(4))) ) {
461  AliDebug(2,"Check on the bachelor FilterBit: no BIT(4). Candidate rejected.");
462  return 0;
463  }
464 
465  Int_t returnvalueTrack = 7;
466 
467  // selection on daughter tracks
468  if (selectionLevel==AliRDHFCuts::kAll ||
469  selectionLevel==AliRDHFCuts::kTracks) {
470 
471  if (!AreLctoV0DaughtersSelected(d,aod)) return 0;
472 
473  }
474 
475  Bool_t okLck0sp=kTRUE, okLcLpi=kTRUE, okLcLBarpi=kTRUE;
476 
477  // selection on candidate
478  if (selectionLevel==AliRDHFCuts::kAll ||
479  selectionLevel==AliRDHFCuts::kCandidate) {
480 
481  Double_t pt = d->Pt();
482  Int_t ptbin = PtBin(pt);
483 
484  Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
485  Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
486  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
487 
488  // K0S + p
489  Double_t mk0s = v0->MassK0Short();
490  Double_t mLck0sp = d->InvMassLctoK0sP();
491 
492  // Lambda + pi
493  Double_t mlambda = v0->MassLambda();
494  Double_t malambda = v0->MassAntiLambda();
495  Double_t mLcLpi = d->InvMassLctoLambdaPi();
496 
497  Bool_t okK0spipi=kTRUE, okLppi=kTRUE, okLBarpip=kTRUE;
498  Bool_t isNotK0S = kTRUE, isNotLambda = kTRUE, isNotLambdaBar = kTRUE, isNotGamma = kTRUE;
499 
500  // cut on Lc mass with K0S+p hypothesis
501  if (TMath::Abs(mLck0sp-mLcPDG) > fCutsRD[GetGlobalIndex(0,ptbin)] && fExcludedCut!=0) {
502  okLck0sp = kFALSE;
503  AliDebug(4,Form(" cascade mass is %2.2e and does not correspond to Lambda_c into K0S+p cut",mLck0sp));
504  }
505 
506  // cuts on the V0 mass: K0S case
507  if (TMath::Abs(mk0s-mk0sPDG) > fCutsRD[GetGlobalIndex(2,ptbin)] && fExcludedCut!=2) {
508  okK0spipi = kFALSE;
509  AliDebug(4,Form(" V0 mass is %2.2e and does not correspond to K0S cut",mk0s));
510  }
511 
512  // cut on Lc mass with Lambda+pi hypothesis
513  if (TMath::Abs(mLcLpi-mLcPDG) > fCutsRD[GetGlobalIndex(1,ptbin)] && fExcludedCut!=1) {
514  okLcLpi = kFALSE;
515  okLcLBarpi = kFALSE;
516  AliDebug(4,Form(" cascade mass is %2.2e and does not correspond to Lambda_c into Lambda+pi cut",mLcLpi));
517  }
518 
519  // cuts on the V0 mass: Lambda/LambdaBar case
520  //if ( !(bachelorTrack->Charge()==+1 && TMath::Abs(mlambda-mLPDG) <= fCutsRD[GetGlobalIndex(3,ptbin)] ) ) {
521  if ( TMath::Abs(mlambda-mLPDG) > fCutsRD[GetGlobalIndex(3,ptbin)] && fExcludedCut!=3) {
522  okLppi = kFALSE;
523  AliDebug(4,Form(" V0 mass is %2.2e and does not correspond to LambdaBar cut",mlambda));
524  }
525 
526  //if ( !(bachelorTrack->Charge()==-1 && TMath::Abs(malambda-mLPDG) <= fCutsRD[GetGlobalIndex(3,ptbin)] ) ) {
527  if ( TMath::Abs(malambda-mLPDG) > fCutsRD[GetGlobalIndex(3,ptbin)] && fExcludedCut!=3) {
528  okLBarpip = kFALSE;
529  AliDebug(4,Form(" V0 mass is %2.2e and does not correspond to LambdaBar cut",malambda));
530  }
531 
532  // cut on K0S invariant mass veto
533  if (TMath::Abs(v0->MassK0Short()-mk0sPDG) < fCutsRD[GetGlobalIndex(12,ptbin)] && fExcludedCut!=12) { // K0S invariant mass veto
534  AliDebug(4,Form(" veto on K0S invariant mass doesn't pass the cut"));
535  //return 0;
536  isNotK0S=kFALSE;
537  }
538 
539  // cut on Lambda/LambdaBar invariant mass veto
540  if (TMath::Abs(v0->MassLambda()-mLPDG) < fCutsRD[GetGlobalIndex(13,ptbin)] && fExcludedCut!=13) { // Lambda invariant mass veto
541  AliDebug(4,Form(" veto on Lambda invariant mass doesn't pass the cut"));
542  isNotLambda=kFALSE;
543  //return 0;
544  }
545  if (TMath::Abs(v0->MassAntiLambda()-mLPDG) < fCutsRD[GetGlobalIndex(13,ptbin)] && fExcludedCut!=13) { // LambdaBar invariant mass veto
546  AliDebug(4,Form(" veto on LambdaBar invariant mass doesn't pass the cut"));
547  isNotLambdaBar=kFALSE;
548  //return 0;
549  }
550 
551  // cut on gamma invariant mass veto
552  if (v0->InvMass2Prongs(0,1,11,11) < fCutsRD[GetGlobalIndex(14,ptbin)] && fExcludedCut!=14) { // K0S invariant mass veto
553  AliDebug(4,Form(" veto on gamma invariant mass doesn't pass the cut"));
554  isNotGamma=kFALSE;
555  //return 0;
556  }
557 
558  okLck0sp = okLck0sp && okK0spipi && isNotLambda && isNotLambdaBar && isNotGamma;
559  okLcLpi = okLcLpi && okLppi && isNotK0S && isNotLambdaBar && isNotGamma;
560  okLcLBarpi = okLcLBarpi && okLBarpip && isNotK0S && isNotLambda && isNotGamma;
561 
562  if (!okLck0sp && !okLcLpi && !okLcLBarpi) return 0;
563 
564  // cuts on the minimum pt of the tracks
565  if (TMath::Abs(bachelorTrack->Pt()) < fCutsRD[GetGlobalIndex(4,ptbin)] && fExcludedCut!=4) {
566  AliDebug(4,Form(" bachelor track Pt=%2.2e > %2.2e",bachelorTrack->Pt(),fCutsRD[GetGlobalIndex(4,ptbin)]));
567  return 0;
568  }
569  if (TMath::Abs(v0positiveTrack->Pt()) < fCutsRD[GetGlobalIndex(5,ptbin)] && fExcludedCut!=5) {
570  AliDebug(4,Form(" V0-positive track Pt=%2.2e > %2.2e",v0positiveTrack->Pt(),fCutsRD[GetGlobalIndex(5,ptbin)]));
571  return 0;
572  }
573  if (TMath::Abs(v0negativeTrack->Pt()) < fCutsRD[GetGlobalIndex(6,ptbin)] && fExcludedCut!=6) {
574  AliDebug(4,Form(" V0-negative track Pt=%2.2e > %2.2e",v0negativeTrack->Pt(),fCutsRD[GetGlobalIndex(6,ptbin)]));
575  return 0;
576  }
577 
578  // cut on cascade dca (prong-to-prong)
579  if ( TMath::Abs(d->GetDCA()) > fCutsRD[GetGlobalIndex(7,ptbin)] && fExcludedCut!=7) { // prong-to-prong cascade DCA
580  AliDebug(4,Form(" cascade tracks DCA don't pass the cut"));
581  return 0;
582  }
583 
584  // cut on V0 dca (prong-to-prong)
585  if ( TMath::Abs(v0->GetDCA()) > fCutsRD[GetGlobalIndex(8,ptbin)] && fExcludedCut!=8) { // prong-to-prong V0 DCA
586  AliDebug(4,Form(" V0 DCA don't pass the cut"));
587  return 0;
588  }
589 
590  // cut on V0 cosine of pointing angle wrt PV
591  if (d->CosV0PointingAngle() < fCutsRD[GetGlobalIndex(9,ptbin)] && fExcludedCut!=9) { // cosine of V0 pointing angle wrt primary vertex
592  AliDebug(4,Form(" V0 cosine of pointing angle doesn't pass the cut"));
593  return 0;
594  }
595 
596  // cut on bachelor transverse impact parameter wrt PV
597  if (TMath::Abs(d->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(10,ptbin)] && fExcludedCut!=10) { // bachelor transverse impact parameter wrt PV
598  AliDebug(4,Form(" bachelor transverse impact parameter doesn't pass the cut"));
599  return 0;
600  }
601 
602  // cut on V0 transverse impact parameter wrt PV
603  if (TMath::Abs(d->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(11,ptbin)] && fExcludedCut!=11) { // V0 transverse impact parameter wrt PV
604  AliDebug(4,Form(" V0 transverse impact parameter doesn't pass the cut"));
605  return 0;
606  }
607 
608  // cut on V0 pT min
609  if (v0->Pt() < fCutsRD[GetGlobalIndex(15,ptbin)] && fExcludedCut!=15) { // V0 pT min
610  AliDebug(4,Form(" V0 track Pt=%2.2e > %2.2e",v0->Pt(),fCutsRD[GetGlobalIndex(15,ptbin)]));
611  return 0;
612  }
613 
614  // cut on Proton emission angle
615  if(TMath::Abs(fCutsRD[GetGlobalIndex(16,ptbin)])<1.1 || TMath::Abs(fCutsRD[GetGlobalIndex(17,ptbin)])<1.1){
617  if (cutvar > fCutsRD[GetGlobalIndex(16,ptbin)] && fExcludedCut!=16 && fExcludedCut!=17) { // Proton emission angle
618  AliDebug(4,Form(" Cos proton emission=%2.2e < %2.2e",cutvar,fCutsRD[GetGlobalIndex(16,ptbin)]));
619  return 0;
620  }
621  if (cutvar < fCutsRD[GetGlobalIndex(17,ptbin)] && fExcludedCut!=16 && fExcludedCut!=17) { // Proton emission angle
622  AliDebug(4,Form(" Cos proton emission=%2.2e > %2.2e",cutvar,fCutsRD[GetGlobalIndex(17,ptbin)]));
623  return 0;
624  }
625  }
626 
627  // cut on proton re-signed d0
628  if(TMath::Abs(fCutsRD[GetGlobalIndex(18,ptbin)])<0.2){
629  Double_t cutvar = GetReSignedd0(d) ;
630  if (cutvar< fCutsRD[GetGlobalIndex(18,ptbin)] && fExcludedCut!=18) { // proton d0
631  AliDebug(4,Form(" Proton d0 (re-signed)=%2.2e > %2.2e",cutvar,fCutsRD[GetGlobalIndex(18,ptbin)]));
632  return 0;
633  }
634  }
635 
636  // cut on Armenteros qT/|alpha|
637  if(TMath::Abs(fCutsRD[GetGlobalIndex(19,ptbin)])<0.3){
638  Double_t cutvar = v0->PtArmV0()/TMath::Abs(v0->AlphaV0());
639  if (cutvar < fCutsRD[GetGlobalIndex(19,ptbin)] && fExcludedCut!=19) { // v0 armenteros variable
640  AliDebug(4,Form(" qT/|alpha|=%2.2e > %2.2e",cutvar,fCutsRD[GetGlobalIndex(19,ptbin)]));
641  return 0;
642  }
643  }
644 
645  }
646 
647  Int_t returnvalue = okLck0sp+2*okLcLBarpi+4*okLcLpi;
648  /*
649  retvalue case
650  1 Lc->K0S + p
651  2 Lc->LambdaBar + pi
652  3 Lc->K0S + p AND Lc->LambdaBar + pi
653  4 Lc->Lambda + pi
654  5 Lc->K0S + p AND Lc->Lambda + pi
655  6 Lc->LambdaBar + pi AND Lc->Lambda + pi
656  7 Lc->K0S + p AND Lc->LambdaBar + pi AND Lc->Lambda + pi
657  */
658 
659  Int_t returnvaluePID = 7;
660 
661  // selection on candidate
662  if (selectionLevel==AliRDHFCuts::kAll ||
663  selectionLevel==AliRDHFCuts::kCandidate ||
664  selectionLevel==AliRDHFCuts::kPID )
665  returnvaluePID = IsSelectedPID(d);
666 
667  //if (fUsePID && returnvaluePID==0) return 0;
668 
669  Int_t returnvalueTot = 0;
670  if ( fUsePID )
671  returnvalueTot = CombineCuts(returnvalueTrack,returnvalue,returnvaluePID);
672  else
673  returnvalueTot = CombineCuts(returnvalueTrack,returnvalue,7);
674 
675  return returnvalueTot;
676 
677 }
678 //---------------------------------------------------------------------------
679 Bool_t AliRDHFCutsLctoV0::PreSelect(TObject* obj, AliAODv0 *v0, AliVTrack *bachelorTrack){
680  //
681  // Apply pre-selections, used in the AOD filtering
682  //
683 
684  if (!fCutsRD) {
685  AliFatal("Cut matrix not inizialized. Exit...");
686  return 0;
687  }
688 
690  if (!d) {
691  AliDebug(2,"AliAODRecoCascadeHF null");
692  return 0;
693  }
694 
695  Double_t pt = d->Pt();
696  Int_t ptbin = PtBin(pt);
697 
698  if ( v0 && ((v0->GetOnFlyStatus() == kTRUE && GetV0Type() == AliRDHFCuts::kOnlyOfflineV0s) ||
699  (v0->GetOnFlyStatus() == kFALSE && GetV0Type() == AliRDHFCuts::kOnlyOnTheFlyV0s)) ) return 0;
700 
701  // cut on V0 pT min
702  if (v0->Pt() < fCutsRD[GetGlobalIndex(15,ptbin)]) return 0;
703 
704  // cuts on the minimum pt of the bachelor
705  if (TMath::Abs(bachelorTrack->Pt()) < fCutsRD[GetGlobalIndex(4,ptbin)]) return 0;
706 
707  Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
708  Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
709  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
710 
711  // K0S + p
712  Double_t mk0s = v0->MassK0Short();
713  Double_t mLck0sp = d->InvMassLctoK0sP();
714 
715  // Lambda + pi
716  Double_t mlambda = v0->MassLambda();
717  Double_t malambda = v0->MassAntiLambda();
718  Double_t mLcLpi = d->InvMassLctoLambdaPi();
719 
720  Bool_t okLck0sp=kTRUE, okLcLpi=kTRUE, okLcLBarpi=kTRUE;
721  Bool_t okK0spipi=kTRUE, okLppi=kTRUE, okLBarpip=kTRUE;
722  Bool_t isNotK0S = kTRUE, isNotLambda = kTRUE, isNotLambdaBar = kTRUE, isNotGamma = kTRUE;
723 
724  // cut on Lc mass with K0S+p hypothesis
725  if (TMath::Abs(mLck0sp-mLcPDG) > fCutsRD[GetGlobalIndex(0,ptbin)]) okLck0sp = kFALSE;
726  // cuts on the V0 mass: K0S case
727  if (TMath::Abs(mk0s-mk0sPDG) > fCutsRD[GetGlobalIndex(2,ptbin)]) okK0spipi = kFALSE;
728  // cut on Lc mass with Lambda+pi hypothesis
729  if (TMath::Abs(mLcLpi-mLcPDG) > fCutsRD[GetGlobalIndex(1,ptbin)]) {
730  okLcLpi = kFALSE;
731  okLcLBarpi = kFALSE;
732  }
733 
734  // cuts on the V0 mass: Lambda/LambdaBar case
735  if ( TMath::Abs(mlambda-mLPDG) > fCutsRD[GetGlobalIndex(3,ptbin)]) okLppi = kFALSE;
736  if ( TMath::Abs(malambda-mLPDG) > fCutsRD[GetGlobalIndex(3,ptbin)]) okLBarpip = kFALSE;
737 
738  // cut on K0S invariant mass veto
739  if (TMath::Abs(v0->MassK0Short()-mk0sPDG) < fCutsRD[GetGlobalIndex(12,ptbin)]) isNotK0S=kFALSE;
740  // cut on Lambda/LambdaBar invariant mass veto
741  if (TMath::Abs(v0->MassLambda()-mLPDG) < fCutsRD[GetGlobalIndex(13,ptbin)]) isNotLambda=kFALSE;
742  if (TMath::Abs(v0->MassAntiLambda()-mLPDG) < fCutsRD[GetGlobalIndex(13,ptbin)]) isNotLambdaBar=kFALSE;
743 
744  // cut on gamma invariant mass veto
745  if (v0->InvMass2Prongs(0,1,11,11) < fCutsRD[GetGlobalIndex(14,ptbin)]) isNotGamma=kFALSE;
746 
747  okLck0sp = okLck0sp && okK0spipi && isNotLambda && isNotLambdaBar && isNotGamma;
748  okLcLpi = okLcLpi && okLppi && isNotK0S && isNotLambdaBar && isNotGamma;
749  okLcLBarpi = okLcLBarpi && okLBarpip && isNotK0S && isNotLambda && isNotGamma;
750 
751  if (!okLck0sp && !okLcLpi && !okLcLBarpi) return 0;
752 
753 
754  // cut on V0 dca (prong-to-prong)
755  if ( TMath::Abs(v0->GetDCA()) > fCutsRD[GetGlobalIndex(8,ptbin)]) return 0;
756 
757 
758  return kTRUE;
759 
760 }
761 //---------------------------------------------------------------------------
763 
764  // fPidHF -> PID object for bachelor
765 
766  if (!fUsePID || !obj) {
767  AliDebug(2,"PID selection inactive. Candidate accepted.");
768  return 7; // all hypothesis are valid
769  }
770 
772 
773  AliAODv0 * v0 = dynamic_cast<AliAODv0*>(objD->Getv0());
774  if ( v0 && ((v0->GetOnFlyStatus() == kTRUE && GetV0Type() == AliRDHFCuts::kOnlyOfflineV0s) ||
775  (v0->GetOnFlyStatus() == kFALSE && GetV0Type() == AliRDHFCuts::kOnlyOnTheFlyV0s)) ) return 0;
776 
777  AliAODTrack *bachelor = (AliAODTrack*)objD->GetBachelor();
778  AliAODTrack *v0Pos = (AliAODTrack*)objD->Getv0PositiveTrack();
779  AliAODTrack *v0Neg = (AliAODTrack*)objD->Getv0NegativeTrack();
780 
781  if (!bachelor || !v0Pos || !v0Neg) return 0;
782 
783  Bool_t okLcK0Sp = kTRUE; // K0S case
784  Bool_t okLcLambdaBarPi = kTRUE; // LambdaBar case
785  Bool_t okLcLambdaPi = kTRUE; // Lambda case
786 
787  Double_t ptCand = objD->Pt();
788  Int_t candPtBin = PtBin(ptCand);
789  CheckPID(candPtBin,bachelor,v0Neg,v0Pos,okLcK0Sp,okLcLambdaBarPi,okLcLambdaPi);
790 
791  Int_t returnvalue = okLcK0Sp+2*okLcLambdaBarPi+4*okLcLambdaPi;
792 
793  return returnvalue;
794 }
795 //-----------------------
796 void AliRDHFCutsLctoV0::CheckPID(Int_t candPtBin, AliAODTrack *bachelor,
797  AliAODTrack * /*v0Neg*/, AliAODTrack * /*v0Pos*/,
798  Bool_t &isBachelorID1, Bool_t &isBachelorID2, Bool_t &isBachelorID4) {
799  // identification strategy
800 
801  Int_t idxIDbyTOF = -1;
802  Int_t idxIDbyTPC = -1;
803 
804  Int_t tpcID = -1;
805  Int_t tofID = -1;
806  Double_t nTPCsigmas = -999;
807  Double_t nTOFsigmas = -999;
808 
809  Bool_t trackIDByTOF = -1;
810  Bool_t trackIDByTPC = -1;
811 
812  Bool_t dummy = kFALSE;
813 
814  switch (fPidSelectionFlag) {
815 
816  case 0:
817 
818  // identify bachelor
819  idxIDbyTOF = fPidHF->ApplyPidTOFRaw(bachelor,4);
820  idxIDbyTPC = fPidHF->ApplyPidTPCRaw(bachelor,4);
821  isBachelorID1 = (idxIDbyTOF==4) && (idxIDbyTPC==4); // K0S case
822 
823  idxIDbyTOF = fPidHF->ApplyPidTOFRaw(bachelor,2);
824  idxIDbyTPC = fPidHF->ApplyPidTPCRaw(bachelor,2);
825  isBachelorID2 = (idxIDbyTOF==2) && (idxIDbyTPC==2); // LambdaBar case
826 
827  isBachelorID4 = isBachelorID2; // Lambda case
828 
829  break;
830 
831  case 1:
832 
833  // identify bachelor
834  idxIDbyTOF = fPidHF->ApplyPidTOFRaw(bachelor,4);
835  idxIDbyTPC = fPidHF->ApplyPidTPCRaw(bachelor,4);
836  dummy = ( !(fPidHF->CheckTOFPIDStatus(bachelor)) && (idxIDbyTPC==4) &&
837  fPidHF->IsExcluded(bachelor,2,2.,"TPC") && fPidHF->IsExcluded(bachelor,3,2.,"TPC") ); // K0S case
838  isBachelorID1 = ( (idxIDbyTOF==4) || dummy );
839 
840  idxIDbyTOF = fPidHF->ApplyPidTOFRaw(bachelor,2);
841  idxIDbyTPC = fPidHF->ApplyPidTPCRaw(bachelor,2);
842  dummy = ( !(fPidHF->CheckTOFPIDStatus(bachelor)) && (idxIDbyTPC==2) &&
843  fPidHF->IsExcluded(bachelor,3,2.,"TPC") && fPidHF->IsExcluded(bachelor,4,2.,"TPC") ); // LambdaBar case
844  isBachelorID2 = ( (idxIDbyTOF==2) || dummy );
845 
846  isBachelorID4 = isBachelorID2; // Lambda case
847 
848  break;
849 
850  case 2:
851 
852  // identify bachelor
853  nTOFsigmas = -999;
854  tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
855  nTPCsigmas = -999;
856  tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
857  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
858  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
859  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) ||
860  (bachelor->P()>=fLowPtCut && TMath::Abs(nTPCsigmas)<3) ) );
861  isBachelorID1 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && trackIDByTPC && trackIDByTOF); // K0S case
862 
863  nTOFsigmas = -999;
864  tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
865  nTPCsigmas = -999;
866  tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
867  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
868  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
869  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) ||
870  (bachelor->P()>=fLowPtCut && TMath::Abs(nTPCsigmas)<3) ) );
871  isBachelorID2 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && trackIDByTPC && trackIDByTOF); // LambdaBar case
872 
873  isBachelorID4 = isBachelorID2; // Lambda case
874 
875  break;
876 
877  case 3:
878 
879  // identify bachelor
880  nTOFsigmas = -999;
881  tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
882  nTPCsigmas = -999;
883  tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
884  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
885  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
886  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) ||
887  (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTPCsigmas)<3) ||
888  (bachelor->P()>=fHighPtCut && nTPCsigmas>-3 && nTPCsigmas<2) ) );
889  isBachelorID1 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && trackIDByTPC && trackIDByTOF); // K0S case
890 
891  nTOFsigmas = -999;
892  tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
893  nTPCsigmas = -999;
894  tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
895  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
896  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
897  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) ||
898  (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTPCsigmas)<3) ||
899  (bachelor->P()>=fHighPtCut && nTPCsigmas>-3 && nTPCsigmas<2) ) );
900  isBachelorID2 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && trackIDByTPC && trackIDByTOF); // LambdaBar case
901 
902  isBachelorID4 = isBachelorID2; // Lambda case
903 
904  break;
905 
906  case 4:
907 
908  // identify bachelor
909  nTOFsigmas = -999;
910  tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
911  nTPCsigmas = -999;
912  tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
913  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
914  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
915  trackIDByTPC = ( (tpcID==1) && (TMath::Abs(nTPCsigmas)<2) );
916  isBachelorID1 = ( (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && trackIDByTOF) ); // K0S case
917 
918  nTOFsigmas = -999;
919  tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
920  nTPCsigmas = -999;
921  tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
922  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
923  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
924  trackIDByTPC = ( (tpcID==1) && (TMath::Abs(nTPCsigmas)<2) );
925  isBachelorID2 = ( (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && trackIDByTOF) ); // LambdaBar case
926 
927  isBachelorID4 = isBachelorID2; // Lambda case
928 
929  break;
930 
931  case 5:
932 
933  // identify bachelor
934  nTOFsigmas = -999;
935  tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
936  nTPCsigmas = -999;
937  tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
938  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
939  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
940  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) || (bachelor->P()>=fHighPtCut && tofID!=1 && TMath::Abs(nTPCsigmas)<3) ) );
941  isBachelorID1 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && trackIDByTOF) || (bachelor->P()>=fHighPtCut && (trackIDByTOF || trackIDByTPC) ); // K0S case
942 
943  nTOFsigmas = -999;
944  tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
945  nTPCsigmas = -999;
946  tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
947  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
948  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
949  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) || (bachelor->P()>=fHighPtCut && tofID!=1 && TMath::Abs(nTPCsigmas)<3) ) );
950  isBachelorID2 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && trackIDByTOF) || (bachelor->P()>=fHighPtCut && (trackIDByTOF || trackIDByTPC) ); // LambdaBar case
951 
952  isBachelorID4 = isBachelorID2; // Lambda case
953 
954  break;
955 
956  case 6:
957 
958  // identify bachelor
959  nTOFsigmas = -999;
960  tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
961  nTPCsigmas = -999;
962  tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
963  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
964  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
965  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) || (bachelor->P()>=fHighPtCut && tofID!=1 && nTPCsigmas>-3 && nTPCsigmas<2) ) );
966  isBachelorID1 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && trackIDByTOF) || (bachelor->P()>=fHighPtCut && (trackIDByTOF || trackIDByTPC) ); // K0S case
967 
968  nTOFsigmas = -999;
969  tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
970  nTPCsigmas = -999;
971  tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
972  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
973  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
974  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) || (bachelor->P()>=fHighPtCut && tofID!=1 && nTPCsigmas>-3 && nTPCsigmas<2) ) );
975  isBachelorID2 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && trackIDByTOF) || (bachelor->P()>=fHighPtCut && (trackIDByTOF || trackIDByTPC) ); // LambdaBar case
976 
977  isBachelorID4 = isBachelorID2; // Lambda case
978 
979  break;
980 
981  case 7:
982 
983  // identify bachelor
984  nTOFsigmas = -999;
985  tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
986  nTPCsigmas = -999;
987  tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
988  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
989  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
990  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) || (bachelor->P()>=fLowPtCut && tofID!=1 && TMath::Abs(nTPCsigmas)<3) ) );
991  isBachelorID1 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && (trackIDByTOF || trackIDByTPC) ); // K0S case
992 
993  nTOFsigmas = -999;
994  tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
995  nTPCsigmas = -999;
996  tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
997  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
998  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
999  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) || (bachelor->P()>=fHighPtCut && tofID!=1 && TMath::Abs(nTPCsigmas)<3) ) );
1000  isBachelorID2 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && (trackIDByTOF || trackIDByTPC) ); // LambdaBar case
1001 
1002  isBachelorID4 = isBachelorID2; // Lambda case
1003 
1004  break;
1005 
1006  case 8:
1007 
1008  // identify bachelor
1009  nTOFsigmas = -999;
1010  tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
1011  nTPCsigmas = -999;
1012  tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
1013  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
1014  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
1015  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) || (bachelor->P()>=fLowPtCut && tofID!=1 && nTPCsigmas>-3 && nTPCsigmas<2) ) );
1016  isBachelorID1 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && (trackIDByTOF || trackIDByTPC) ); // K0S case
1017 
1018  nTOFsigmas = -999;
1019  tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
1020  nTPCsigmas = -999;
1021  tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
1022  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
1023  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
1024  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) || (bachelor->P()>=fHighPtCut && tofID!=1 && nTPCsigmas>-3 && nTPCsigmas<2) ) );
1025  isBachelorID2 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && (trackIDByTOF || trackIDByTPC) ); // LambdaBar case
1026 
1027  isBachelorID4 = isBachelorID2; // Lambda case
1028 
1029  break;
1030 
1031  case 9:
1032  {
1033  // identify bachelor
1034  fPidHF->GetPidCombined()->SetDefaultTPCPriors();
1035  fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC+AliPIDResponse::kDetTOF);
1036  Double_t probTPCTOF[AliPID::kSPECIES]={-1.};
1037  UInt_t detUsed = fPidHF->GetPidCombined()->ComputeProbabilities(bachelor, fPidHF->GetPidResponse(), probTPCTOF);
1038  Double_t probProton = -1.;
1039  Double_t probPion = -1.;
1040  if (detUsed == (UInt_t)fPidHF->GetPidCombined()->GetDetectorMask() ) {
1041  probProton = probTPCTOF[AliPID::kProton];
1042  probPion = probTPCTOF[AliPID::kPion];
1043  }
1044  else { // if you don't have both TOF and TPC, try only TPC
1045  fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC);
1046  detUsed = fPidHF->GetPidCombined()->ComputeProbabilities(bachelor, fPidHF->GetPidResponse(), probTPCTOF);
1047  if (detUsed == (UInt_t)fPidHF->GetPidCombined()->GetDetectorMask()) {
1048  probProton = probTPCTOF[AliPID::kProton];
1049  probPion = probTPCTOF[AliPID::kPion];
1050  }
1051  fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC+AliPIDResponse::kDetTOF);
1052  }
1053 
1054  isBachelorID1=(probProton>fMinCombinedProbability[candPtBin]); // K0S case
1055 
1056  isBachelorID2=(probPion>fMinCombinedProbability[candPtBin]); // LambdaBar case
1057 
1058  isBachelorID4 = isBachelorID2; // Lambda case
1059  }
1060  break;
1061 
1062  case 10:
1063 
1064  // identify bachelor
1065  nTOFsigmas = -999;
1066  tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
1067  nTPCsigmas = -999;
1068  tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
1069 
1070  isBachelorID1 = kFALSE;
1071  if((tpcID==1)&&(tofID==1)&&(TMath::Abs(nTPCsigmas)<3.)&&(TMath::Abs(nTOFsigmas)<3.)){
1072  isBachelorID1 = !(bachelor->Pt()>fLowPtCut&& nTOFsigmas<-2.) && !(bachelor->Pt()>fLowPtCut&& nTPCsigmas>2.);
1073  }
1074 
1075  nTOFsigmas = -999;
1076  tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
1077  nTPCsigmas = -999;
1078  tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
1079 
1080  isBachelorID2 = TMath::Abs(nTPCsigmas)<3. && TMath::Abs(nTOFsigmas)<3. && (tpcID==1)&&(tofID==1);
1081  isBachelorID4 = isBachelorID2;
1082 
1083  break;
1084 
1085  }
1086 
1087 }
1088 //----------------
1089 Int_t AliRDHFCutsLctoV0::CombineCuts(Int_t returnvalueTrack, Int_t returnvalue, Int_t returnvaluePID) const {
1090  //
1091  // combine track selection, topological cuts and PID
1092  //
1093 
1094  Int_t returnvalueTot=returnvalueTrack&returnvalue;
1095  returnvalueTot=returnvalueTot&returnvaluePID;
1096 
1097  return returnvalueTot;
1098 }
1099 
1100 //----------------------------------
1102  //
1103  // Apply selection on single cut
1104  //
1105 
1106  if (!fCutsRD) {
1107  AliDebug(2,"Cut matrice not inizialized. Exit...");
1108  return 0;
1109  }
1110 
1112  if (!d) {
1113  AliDebug(2,"AliAODRecoCascadeHF null");
1114  return 0;
1115  }
1116 
1117  if (!d->GetSecondaryVtx()) {
1118  AliDebug(2,"No secondary vertex for cascade");
1119  return 0;
1120  }
1121 
1122  if (d->GetNDaughters()!=2) {
1123  AliDebug(2,Form("No 2 daughters for current cascade (nDaughters=%d)",d->GetNDaughters()));
1124  return 0;
1125  }
1126 
1127  AliAODv0 * v0 = dynamic_cast<AliAODv0*>(d->Getv0());
1128  if ( v0 && ((v0->GetOnFlyStatus() == kTRUE && GetV0Type() == AliRDHFCuts::kOnlyOfflineV0s) ||
1129  (v0->GetOnFlyStatus() == kFALSE && GetV0Type() == AliRDHFCuts::kOnlyOnTheFlyV0s)) ) return 0;
1130 
1131  AliAODTrack * bachelorTrack = dynamic_cast<AliAODTrack*>(d->GetBachelor());
1132  if (!v0 || !bachelorTrack) {
1133  AliDebug(2,"No V0 or no bachelor for current cascade");
1134  return 0;
1135  }
1136 
1137  if (bachelorTrack->GetID()<0) {
1138  AliDebug(2,Form("Bachelor has negative ID %d",bachelorTrack->GetID()));
1139  return 0;
1140  }
1141 
1142  if (!v0->GetSecondaryVtx()) {
1143  AliDebug(2,"No secondary vertex for V0 by cascade");
1144  return 0;
1145  }
1146 
1147  if (v0->GetNDaughters()!=2) {
1148  AliDebug(2,Form("No 2 daughters for V0 of current cascade (onTheFly=%d, nDaughters=%d)",v0->GetOnFlyStatus(),v0->GetNDaughters()));
1149  return 0;
1150  }
1151 
1152 
1153  // Get the V0 daughter tracks
1154  AliAODTrack *v0positiveTrack = dynamic_cast<AliAODTrack*>(d->Getv0PositiveTrack());
1155  AliAODTrack *v0negativeTrack = dynamic_cast<AliAODTrack*>(d->Getv0NegativeTrack());
1156  if (!v0positiveTrack || !v0negativeTrack ) {
1157  AliDebug(2,"No V0 daughters' objects");
1158  return 0;
1159  }
1160 
1161  if (v0positiveTrack->GetID()<0 || v0negativeTrack->GetID()<0) {
1162  AliDebug(2,Form("At least one of V0 daughters has negative ID %d %d",v0positiveTrack->GetID(),v0negativeTrack->GetID()));
1163  return 0;
1164  }
1165 
1166  //if(fUseTrackSelectionWithFilterBits && d->HasBadDaughters()) return 0;
1167  if ( fUseTrackSelectionWithFilterBits && !(bachelorTrack->TestFilterMask(BIT(4))) ) {
1168  AliDebug(2,"Check on the bachelor FilterBit: no BIT(4). Candidate rejected.");
1169  return 0;
1170  }
1171 
1172 
1173  // selection on daughter tracks
1174  if (selectionLevel==AliRDHFCuts::kAll ||
1175  selectionLevel==AliRDHFCuts::kTracks) {
1176 
1177  if (!AreLctoV0DaughtersSelected(d,aod)) return 0;
1178 
1179  }
1180 
1181  Bool_t okLck0sp=kFALSE, okLcLpi=kFALSE, okLcLBarpi=kFALSE;
1182 
1183  // selection on candidate
1184  if (selectionLevel==AliRDHFCuts::kAll ||
1185  selectionLevel==AliRDHFCuts::kCandidate) {
1186 
1187  Double_t pt = d->Pt();
1188  Int_t ptbin = PtBin(pt);
1189 
1190  Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
1191  Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
1192  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
1193 
1194  // K0S + p
1195  Double_t mk0s = v0->MassK0Short();
1196  Double_t mLck0sp = d->InvMassLctoK0sP();
1197 
1198  // Lambda + pi
1199  Double_t mlambda = v0->MassLambda();
1200  Double_t malambda = v0->MassAntiLambda();
1201  Double_t mLcLpi = d->InvMassLctoLambdaPi();
1202 
1203  switch (cutIndex) {
1204  case 0:
1205  // cut on Lc mass with K0S+p hypothesis
1206  okLck0sp = TMath::Abs(mLck0sp-mLcPDG)<=fCutsRD[GetGlobalIndex(0,ptbin)];
1207  okLcLpi = kFALSE;
1208  okLcLBarpi = kFALSE;
1209  break;
1210  case 1:
1211  // cut on Lc mass with Lambda+pi hypothesis
1212  okLck0sp = kFALSE;
1213  okLcLpi = TMath::Abs(mLcLpi-mLcPDG)<=fCutsRD[GetGlobalIndex(1,ptbin)];
1214  okLcLBarpi = okLcLpi;
1215  break;
1216  case 2:
1217  // cuts on the V0 mass: K0S case
1218  okLck0sp = TMath::Abs(mk0s-mk0sPDG)<=fCutsRD[GetGlobalIndex(2,ptbin)];
1219  okLcLpi = kFALSE;
1220  okLcLBarpi = kFALSE;
1221  break;
1222  case 3:
1223  // cuts on the V0 mass: Lambda/LambdaBar case
1224  okLck0sp = kFALSE;
1225  okLcLpi = TMath::Abs(mlambda-mLPDG)<=fCutsRD[GetGlobalIndex(3,ptbin)];
1226  //okLcLpi = okLcLpi && (bachelorTrack->Charge()==+1);
1227  okLcLBarpi = TMath::Abs(malambda-mLPDG)<=fCutsRD[GetGlobalIndex(3,ptbin)];
1228  //okLcLBarpi = okLcLBarpi && (bachelorTrack->Charge()==-1);
1229  break;
1230  case 4:
1231  // cuts on the minimum pt of bachelor
1232  okLck0sp = TMath::Abs(bachelorTrack->Pt())>=fCutsRD[GetGlobalIndex(4,ptbin)];
1233  okLcLpi = okLck0sp;
1234  okLcLBarpi = okLck0sp;
1235  break;
1236  case 5:
1237  // cuts on the minimum pt of positive V0daughter
1238  okLck0sp = TMath::Abs(v0positiveTrack->Pt())>=fCutsRD[GetGlobalIndex(5,ptbin)];
1239  okLcLpi = okLck0sp;
1240  okLcLBarpi = okLck0sp;
1241  break;
1242  case 6:
1243  // cuts on the minimum pt of negative V0daughter
1244  okLck0sp = TMath::Abs(v0negativeTrack->Pt())>=fCutsRD[GetGlobalIndex(6,ptbin)];
1245  okLcLpi = okLck0sp;
1246  okLcLBarpi = okLck0sp;
1247  break;
1248  case 7:
1249  // cut on cascade dca
1250  okLck0sp = TMath::Abs(d->GetDCA())<=fCutsRD[GetGlobalIndex(7,ptbin)];
1251  okLcLpi = okLck0sp;
1252  okLcLBarpi = okLck0sp;
1253  break;
1254  case 8:
1255  // cut on V0 dca
1256  okLck0sp = TMath::Abs(v0->GetDCA())<=fCutsRD[GetGlobalIndex(8,ptbin)];
1257  okLcLpi = okLck0sp;
1258  okLcLBarpi = okLck0sp;
1259  break;
1260  case 9:
1261  // cut on V0 cosine of pointing angle wrt PV
1262  okLck0sp = d->CosV0PointingAngle()>=fCutsRD[GetGlobalIndex(9,ptbin)];
1263  okLcLpi = okLck0sp;
1264  okLcLBarpi = okLck0sp;
1265  break;
1266  case 10:
1267  // cut on bachelor transverse impact parameter wrt PV
1268  okLck0sp = TMath::Abs(d->Getd0Prong(0))<=fCutsRD[GetGlobalIndex(10,ptbin)];
1269  okLcLpi = okLck0sp;
1270  okLcLBarpi = okLck0sp;
1271  break;
1272  case 11:
1273  // cut on V0 transverse impact parameter wrt PV
1274  okLck0sp = TMath::Abs(d->Getd0Prong(1))<=fCutsRD[GetGlobalIndex(11,ptbin)];
1275  okLcLpi = okLck0sp;
1276  okLcLBarpi = okLck0sp;
1277  break;
1278  case 12:
1279  // cut on K0S invariant mass veto
1280  okLcLpi = TMath::Abs(mk0s-mk0sPDG)>=fCutsRD[GetGlobalIndex(12,ptbin)];
1281  okLcLBarpi = TMath::Abs(mk0s-mk0sPDG)>=fCutsRD[GetGlobalIndex(12,ptbin)];
1282  break;
1283  case 13:
1284  // cut on Lambda/LambdaBar invariant mass veto
1285  okLck0sp = (TMath::Abs(mlambda-mLPDG)>=fCutsRD[GetGlobalIndex(13,ptbin)] &&
1286  TMath::Abs(malambda-mLPDG)>=fCutsRD[GetGlobalIndex(13,ptbin)]);
1287  break;
1288  case 14:
1289  // cut on gamma invariant mass veto
1290  okLck0sp = v0->InvMass2Prongs(0,1,11,11)>=fCutsRD[GetGlobalIndex(14,ptbin)];
1291  okLcLpi = okLck0sp;
1292  okLcLBarpi = okLck0sp;
1293  break;
1294  case 15:
1295  // cut on V0 pT min
1296  okLck0sp = v0->Pt()>=fCutsRD[GetGlobalIndex(15,ptbin)];
1297  okLcLpi = okLck0sp;
1298  okLcLBarpi = okLck0sp;
1299  break;
1300  case 16:
1301  okLck0sp = (TMath::Abs(fCutsRD[GetGlobalIndex(16,ptbin)])<1.1)&&(GetProtonEmissionAngleCMS(d)<= fCutsRD[GetGlobalIndex(16,ptbin)]);
1302  okLcLpi = okLck0sp;
1303  okLcLBarpi = okLck0sp;
1304  break;
1305  case 17:
1306  okLck0sp = (TMath::Abs(fCutsRD[GetGlobalIndex(17,ptbin)])<1.1)&&(GetProtonEmissionAngleCMS(d)>= fCutsRD[GetGlobalIndex(17,ptbin)]);
1307  okLcLpi = okLck0sp;
1308  okLcLBarpi = okLck0sp;
1309  break;
1310  case 18:
1311  okLck0sp = (TMath::Abs(fCutsRD[GetGlobalIndex(18,ptbin)])<0.2)&&(GetReSignedd0(d)>= fCutsRD[GetGlobalIndex(18,ptbin)]);
1312  okLcLpi = okLck0sp;
1313  okLcLBarpi = okLck0sp;
1314  break;
1315  case 19:
1316  okLck0sp = (TMath::Abs(fCutsRD[GetGlobalIndex(19,ptbin)])<0.3)&&(v0->PtArmV0()/TMath::Abs(v0->AlphaV0()) >= fCutsRD[GetGlobalIndex(19,ptbin)]);
1317  okLcLpi = okLck0sp;
1318  okLcLBarpi = okLck0sp;
1319  break;
1320  }
1321  }
1322 
1323  Int_t returnvalue = okLck0sp+2*okLcLBarpi+4*okLcLpi;
1324  /*
1325  retvalue case
1326  1 Lc->K0S + p
1327  2 Lc->LambdaBar + pi
1328  3 Lc->K0S + p AND Lc->LambdaBar + pi
1329  4 Lc->Lambda + pi
1330  5 Lc->K0S + p AND Lc->Lambda + pi
1331  6 Lc->LambdaBar + pi AND Lc->Lambda + pi
1332  7 Lc->K0S + p AND Lc->LambdaBar + pi AND Lc->Lambda + pi
1333  */
1334 
1335 
1336  /*
1337  Int_t returnvaluePID = 7;
1338 
1339  // selection on PID
1340  if (selectionLevel==AliRDHFCuts::kAll ||
1341  selectionLevel==AliRDHFCuts::kCandidate ||
1342  selectionLevel==AliRDHFCuts::kPID )
1343  returnvaluePID = IsSelectedPID(d);
1344  */
1345 
1346  Int_t returnvalueTot = 0;
1347  //if ( fUsePID )
1348  //returnvalueTot = CombineCuts(returnvalue,returnvaluePID);
1349  //else
1350  returnvalueTot = returnvalue;
1351 
1352  return returnvalueTot;
1353 
1354 }
1355 //----------------------------------
1357 
1358  SetName("LctoV0ProductionCuts");
1359  SetTitle("Production cuts for Lc->V0+bachelor analysis");
1360 
1361  AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts();
1362  esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
1363  //default
1364  esdTrackCuts->SetRequireTPCRefit(kTRUE);
1365  esdTrackCuts->SetRequireITSRefit(kTRUE);
1366  esdTrackCuts->SetMinNClustersITS(0);//(4); // default is 5
1367  esdTrackCuts->SetMinNClustersTPC(70);
1368  //esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
1369  // AliESDtrackCuts::kAny);
1370  // default is kBoth, otherwise kAny
1371  esdTrackCuts->SetMinDCAToVertexXY(0.);
1372  esdTrackCuts->SetPtRange(0.3,1.e10);
1373  //esdTrackCuts->SetEtaRange(-0.8,+0.8);
1374  esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
1375  AddTrackCuts(esdTrackCuts);
1376  delete esdTrackCuts;
1377  esdTrackCuts=NULL;
1378 
1379 
1380  AliESDtrackCuts* esdTrackCutsV0daughters=new AliESDtrackCuts();
1381  esdTrackCutsV0daughters->SetRequireSigmaToVertex(kFALSE);
1382  //default
1383  esdTrackCutsV0daughters->SetRequireTPCRefit(kTRUE);
1384  esdTrackCutsV0daughters->SetRequireITSRefit(kFALSE);//(kTRUE);
1385  esdTrackCutsV0daughters->SetMinNClustersITS(0);//(4); // default is 5
1386  esdTrackCutsV0daughters->SetMinNClustersTPC(70);
1387  //esdTrackCutsV0daughters->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
1388  // AliESDtrackCuts::kAny);
1389  // default is kBoth, otherwise kAny
1390  esdTrackCutsV0daughters->SetMinDCAToVertexXY(0.);
1391  esdTrackCutsV0daughters->SetPtRange(0.,1.e10);
1392  esdTrackCutsV0daughters->SetAcceptKinkDaughters(kFALSE);
1393  AddTrackCutsV0daughters(esdTrackCutsV0daughters);
1394  delete esdTrackCutsV0daughters;
1395  esdTrackCutsV0daughters=NULL;
1396 
1397  const Int_t nptbins=1;
1398  Float_t* ptbins;
1399  ptbins=new Float_t[nptbins+1];
1400  ptbins[0]=0.;
1401  ptbins[1]=99999999.;
1402 
1403  SetPtBins(nptbins+1,ptbins);
1404  SetPtBins(nptbins+1,ptbins);
1405 
1406  const Int_t nvars=21;
1407 
1408  Float_t** prodcutsval;
1409  prodcutsval=new Float_t*[nvars];
1410  for(Int_t ic=0;ic<nvars;ic++){prodcutsval[ic]=new Float_t[nptbins];}
1411  for(Int_t ipt2=0;ipt2<nptbins;ipt2++){
1412  prodcutsval[0][ipt2]=1.; // inv. mass if K0S [GeV/c2]
1413  prodcutsval[1][ipt2]=1.; // inv. mass if Lambda [GeV/c2]
1414  prodcutsval[2][ipt2]=0.05; // inv. mass V0 if K0S [GeV/c2]
1415  prodcutsval[3][ipt2]=0.05; // inv. mass V0 if Lambda [GeV/c2]
1416  prodcutsval[4][ipt2]=0.3; // pT min bachelor track [GeV/c] // AOD by construction
1417  prodcutsval[5][ipt2]=0.; // pT min V0-positive track [GeV/c]
1418  prodcutsval[6][ipt2]=0.; // pT min V0-negative track [GeV/c]
1419  prodcutsval[7][ipt2]=1000.; // dca cascade cut [cm]
1420  prodcutsval[8][ipt2]=1.5; // dca V0 cut [nSigma] // it's 1.5 x offline V0s
1421  prodcutsval[9][ipt2]=-1.; // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
1422  prodcutsval[10][ipt2]=3.; // d0 max bachelor wrt PV [cm]
1423  prodcutsval[11][ipt2]=1000.;// d0 max V0 wrt PV [cm]
1424  prodcutsval[12][ipt2]=0.; // mass K0S veto [GeV/c2]
1425  prodcutsval[13][ipt2]=0.; // mass Lambda/LambdaBar veto [GeV/c2]
1426  prodcutsval[14][ipt2]=0.; // mass Gamma veto [GeV/c2]
1427  prodcutsval[15][ipt2]=0.; // pT min V0 track [GeV/c]
1428  prodcutsval[16][ipt2]=9999.;// max cos (Proton emission angle) cut
1429  prodcutsval[17][ipt2]=-9999.;// min cos (Proton emission angle) cut
1430  prodcutsval[18][ipt2]=-9999.;// Re-signed d0 [cm]
1431  prodcutsval[19][ipt2]=-9999.;// V0 armenteros qT/|alpha|
1432  prodcutsval[20][ipt2]=0.; // V0 type cut
1433  }
1434  SetCuts(nvars,nptbins,prodcutsval);
1435 
1436  SetGlobalIndex(nvars,nptbins);
1437  SetPtBins(nptbins+1,ptbins);
1438 
1439 
1440  //pid settings
1441  //1. bachelor: default one
1442  AliAODPidHF* pidObjBachelor = new AliAODPidHF();
1443  Double_t sigmasBac[5]={3.,1.,1.,3.,3.}; // 0, 1(A), 2(A) -> TPC; 3 -> TOF; 4 -> ITS
1444  pidObjBachelor->SetSigma(sigmasBac);
1445  pidObjBachelor->SetAsym(kFALSE);
1446  pidObjBachelor->SetMatch(1);
1447  pidObjBachelor->SetTPC(kTRUE);
1448  pidObjBachelor->SetTOF(kTRUE);
1449  pidObjBachelor->SetTOFdecide(kFALSE);
1450  SetPidHF(pidObjBachelor);
1451 
1452  SetUsePID(kFALSE);//(kTRUE);
1453 
1454  //PrintAll();
1455 
1456  for(Int_t iiv=0;iiv<nvars;iiv++){
1457  delete [] prodcutsval[iiv];
1458  }
1459  delete [] prodcutsval;
1460  prodcutsval=NULL;
1461  delete [] ptbins;
1462  ptbins=NULL;
1463 
1464 
1465  delete pidObjBachelor;
1466  pidObjBachelor=NULL;
1467 
1468  return;
1469 }
1470 //------------------
1472 
1473  SetName("LctoV0ProductionCuts");
1474  SetTitle("Production cuts for Lc->V0+bachelor analysis");
1475 
1477 
1478  return;
1479 }
1480 //------------------
1482 
1483  // Default 2010 PbPb cut object
1485 
1486  //
1487  // Enable all 2011 PbPb run triggers
1488  //
1489  SetTriggerClass("");
1493 
1494 }
1495 //-----------------------
1497 
1498  const Int_t nvars = this->GetNVars() ;
1499  //Float_t *vArray =GetCuts();
1500  //fV0Type = vArray[nvars-1];
1501  fV0Type = (this->GetCuts())[nvars-1];
1502  //this->GetCuts(vArray);
1503  TString *sVarNames=GetVarNames();
1504 
1505  if(sVarNames[nvars-1].Contains("V0 type")) return (Int_t)fV0Type;
1506  else {AliInfo("AliRDHFCutsLctoV0 Last variable is not the V0 type!!!"); return -999;}
1507 }
1508 
1509 //---------------------------------------------------------------------------
1511  //
1512  // print all cuts values
1513  //
1514 
1515  printf("Minimum vtx type %d\n",fMinVtxType);
1516  printf("Minimum vtx contr %d\n",fMinVtxContr);
1517  printf("Max vtx red chi2 %f\n",fMaxVtxRedChi2);
1518  printf("Min SPD mult %d\n",fMinSPDMultiplicity);
1519  printf("Use PID %d (PID selection flag = %d) OldPid=%d\n",(Int_t)fUsePID,(Int_t)fPidSelectionFlag,fPidHF ? fPidHF->GetOldPid() : -1);
1520  printf("High value for pT %f\n",fHighPtCut);
1521  printf("Low and high values for pT cuts: %f %f\n",fLowPtCut,fHighPtCut);
1522  printf("Remove daughters from vtx %d\n",(Int_t)fRemoveDaughtersFromPrimary);
1523  printf("Physics selection: %s\n",fUsePhysicsSelection ? "Yes" : "No");
1524  printf("Pileup rejection: %s\n",(fOptPileup > 0) ? "Yes" : "No");
1525  printf("UseTrackSelectionWithFilterBits: %s\n",fUseTrackSelectionWithFilterBits ? "Yes" : "No");
1526  printf("Reject kink: %s\n",fKinkReject ? "Yes" : "No");
1527  if(fOptPileup==1) printf(" -- Reject pileup event");
1528  if(fOptPileup==2) printf(" -- Reject tracks from pileup vtx");
1529  if(fUseCentrality>0) {
1530  TString estimator="";
1531  if(fUseCentrality==1) estimator = "V0";
1532  if(fUseCentrality==2) estimator = "Tracks";
1533  if(fUseCentrality==3) estimator = "Tracklets";
1534  if(fUseCentrality==4) estimator = "SPD clusters outer";
1535  printf("Centrality class considered: %.1f-%.1f, estimated with %s",fMinCentrality,fMaxCentrality,estimator.Data());
1536  }
1537  if(fIsCandTrackSPDFirst) printf("Check for candidates with pt < %2.2f, that daughters fullfill kFirst criteria\n",fMaxPtCandTrackSPDFirst);
1538 
1539  if(fVarNames){
1540  cout<<"Array of variables"<<endl;
1541  for(Int_t iv=0;iv<fnVars;iv++){
1542  cout<<fVarNames[iv]<<"\t";
1543  }
1544  cout<<endl;
1545  }
1546  if(fVarsForOpt){
1547  cout<<"Array of optimization"<<endl;
1548  for(Int_t iv=0;iv<fnVars;iv++){
1549  cout<<fVarsForOpt[iv]<<"\t";
1550  }
1551  cout<<endl;
1552  }
1553  if(fIsUpperCut){
1554  cout<<"Array of upper/lower cut"<<endl;
1555  for(Int_t iv=0;iv<fnVars;iv++){
1556  cout<<fIsUpperCut[iv]<<"\t";
1557  }
1558  cout<<endl;
1559  }
1560  if(fPtBinLimits){
1561  cout<<"Array of ptbin limits"<<endl;
1562  for(Int_t ib=0;ib<fnPtBinLimits;ib++){
1563  cout<<fPtBinLimits[ib]<<"\t";
1564  }
1565  cout<<endl;
1566  }
1567  if(fCutsRD){
1568  cout<<"Matrix of cuts"<<endl;
1569  for(Int_t iv=0;iv<fnVars;iv++){
1570  for(Int_t ib=0;ib<fnPtBins;ib++){
1571  cout<<"fCutsRD["<<iv<<"]["<<ib<<"] = "<<fCutsRD[GetGlobalIndex(iv,ib)]<<"\t";
1572  }
1573  cout<<endl;
1574  }
1575  cout<<endl;
1576  }
1577 
1578  if (fPidSelectionFlag==9) {
1579  for(Int_t ib=0;ib<fnPtBins;ib++){
1580  cout<<"fMinCombinedProbability["<<ib<<"] = "<<fMinCombinedProbability[ib]<<"\t";
1581  }
1582  cout<<endl;
1583  cout << " GetCombDetectors() = " << GetPidHF()->GetCombDetectors() << endl;
1584  }
1585 
1586  if (fTrackCuts) {
1587  Float_t eta1=0, eta2=0; fTrackCuts->GetEtaRange(eta1,eta2);
1588  cout << " etaRange for Bachelor: [" << eta1 << "," << eta2 << "]\n";
1589  }
1590  if (fV0daughtersCuts) {
1591  Float_t eta3=0, eta4=0; fV0daughtersCuts->GetEtaRange(eta3,eta4);
1592  cout << " etaRange for V0daughters: [" << eta3 << "," << eta4 << "]\n";
1593  }
1594  return;
1595 
1596 }
1597 
1598 //-------------------------
1600 {
1601  //
1602  //
1603  // Checking if Lc is in fiducial acceptance region
1604  //
1605  //
1606 
1607  if(fMaxRapidityCand>-998.){
1608  if(TMath::Abs(y) > fMaxRapidityCand) return kFALSE;
1609  else return kTRUE;
1610  }
1611 
1612  if(pt > 5.) {
1613  // applying cut for pt > 5 GeV
1614  AliDebug(2,Form("pt of Lambda_c = %f (> 5), cutting at |y| < 0.8",pt));
1615  if (TMath::Abs(y) > 0.8) return kFALSE;
1616 
1617  } else {
1618  // appliying smooth cut for pt < 5 GeV
1619  Double_t maxFiducialY = -0.2/15*pt*pt+1.9/15*pt+0.5;
1620  Double_t minFiducialY = 0.2/15*pt*pt-1.9/15*pt-0.5;
1621  AliDebug(2,Form("pt of Lambda_c = %f (< 5), cutting according to the fiducial zone [%f, %f]\n",pt,minFiducialY,maxFiducialY));
1622  if (y < minFiducialY || y > maxFiducialY) return kFALSE;
1623  }
1624  //
1625  return kTRUE;
1626 }
1627 //---------------------------------------------------------------------------
1629  //
1630  // Daughter tracks selection
1631  //
1632 
1634  if (!d) {
1635  AliDebug(2,"AliAODRecoCascadeHF null");
1636  return kFALSE;
1637  }
1638 
1639  if (!fTrackCuts) {
1640  AliFatal("Cut object is not defined for bachelor. Candidate accepted.");
1641  return kFALSE;
1642  }
1643 
1644  AliAODTrack * bachelorTrack = dynamic_cast<AliAODTrack*>(d->GetBachelor());
1645  if (!bachelorTrack) return kFALSE;
1646 
1648  if(!bachelorTrack->HasPointOnITSLayer(0)) return kFALSE;
1649  }
1650 
1651  if (fKinkReject != (!(fTrackCuts->GetAcceptKinkDaughters())) ) {
1652  AliError(Form("Not compatible setting: fKinkReject=%1d - fTrackCuts->GetAcceptKinkDaughters()=%1d",fKinkReject, fTrackCuts->GetAcceptKinkDaughters()));
1653  return kFALSE;
1654  }
1655 
1656  AliAODVertex *vAOD = d->GetPrimaryVtx();
1657  Double_t pos[3]; vAOD->GetXYZ(pos);
1658  Double_t cov[6]; vAOD->GetCovarianceMatrix(cov);
1659  const AliESDVertex vESD(pos,cov,100.,100);
1660 
1661  if (!IsDaughterSelected(bachelorTrack,&vESD,fTrackCuts,aod)) return kFALSE;
1662 
1663  if (!fV0daughtersCuts) {
1664  AliFatal("Cut object is not defined for V0daughters. Candidate accepted.");
1665  return kFALSE;
1666  }
1667 
1668  AliAODv0 * v0 = dynamic_cast<AliAODv0*>(d->Getv0());
1669  if (!v0) return kFALSE;
1670  AliAODTrack *v0positiveTrack = dynamic_cast<AliAODTrack*>(d->Getv0PositiveTrack());
1671  if (!v0positiveTrack) return kFALSE;
1672  AliAODTrack *v0negativeTrack = dynamic_cast<AliAODTrack*>(d->Getv0NegativeTrack());
1673  if (!v0negativeTrack) return kFALSE;
1674 
1675 
1676  Float_t etaMin=0, etaMax=0; fV0daughtersCuts->GetEtaRange(etaMin,etaMax);
1677  if ( (v0positiveTrack->Eta()<=etaMin || v0positiveTrack->Eta()>=etaMax) ||
1678  (v0negativeTrack->Eta()<=etaMin || v0negativeTrack->Eta()>=etaMax) ) return kFALSE;
1679  Float_t ptMin=0, ptMax=0; fV0daughtersCuts->GetPtRange(ptMin,ptMax);
1680  if ( (v0positiveTrack->Pt()<=ptMin || v0positiveTrack->Pt()>=ptMax) ||
1681  (v0negativeTrack->Pt()<=ptMin || v0negativeTrack->Pt()>=ptMax) ) return kFALSE;
1682 
1683  // Condition on nTPCclusters
1684  if (fV0daughtersCuts->GetMinNClusterTPC()>0) {
1685  if ( ( ( v0positiveTrack->GetTPCClusterInfo(2,1) ) < fV0daughtersCuts->GetMinNClusterTPC() ) ||
1686  ( ( v0negativeTrack->GetTPCClusterInfo(2,1) ) < fV0daughtersCuts->GetMinNClusterTPC() ) ) return kFALSE;
1687  }
1688 
1689  if (fV0daughtersCuts->GetMinRatioCrossedRowsOverFindableClustersTPC()>0.5) {
1690  Float_t ratioCrossedRowsOverFindableClustersTPCPos = 1.0;
1691  Float_t ratioCrossedRowsOverFindableClustersTPCNeg = 1.0;
1692  if (v0positiveTrack->GetTPCNclsF()>0) {
1693  ratioCrossedRowsOverFindableClustersTPCPos = v0positiveTrack->GetTPCClusterInfo(2,1) / v0positiveTrack->GetTPCNclsF();
1694  }
1695  if (v0negativeTrack->GetTPCNclsF()>0) {
1696  ratioCrossedRowsOverFindableClustersTPCNeg = v0negativeTrack->GetTPCClusterInfo(2,1) / v0negativeTrack->GetTPCNclsF();
1697  }
1698  if ( ( ( ratioCrossedRowsOverFindableClustersTPCPos ) < fV0daughtersCuts->GetMinRatioCrossedRowsOverFindableClustersTPC() ) ||
1699  ( ( ratioCrossedRowsOverFindableClustersTPCNeg ) < fV0daughtersCuts->GetMinRatioCrossedRowsOverFindableClustersTPC() ) ) return kFALSE;
1700  }
1701 
1702  // kTPCrefit status
1703  if (v0->GetOnFlyStatus()==kFALSE) { // only for offline V0s
1704  if (fV0daughtersCuts->GetRequireTPCRefit()) {
1705  if( !(v0positiveTrack->GetStatus() & AliESDtrack::kTPCrefit)) return kFALSE;
1706  if( !(v0negativeTrack->GetStatus() & AliESDtrack::kTPCrefit)) return kFALSE;
1707  }
1708  }
1709  // kink condition
1710  if (!fV0daughtersCuts->GetAcceptKinkDaughters()) {
1711  AliAODVertex *maybeKinkPos = (AliAODVertex*)v0positiveTrack->GetProdVertex();
1712  AliAODVertex *maybeKinkNeg = (AliAODVertex*)v0negativeTrack->GetProdVertex();
1713  if (maybeKinkPos->GetType()==AliAODVertex::kKink ||
1714  maybeKinkNeg->GetType()==AliAODVertex::kKink) return kFALSE;
1715  }
1716  // Findable clusters > 0 condition - from V0 analysis
1717  //if( v0positiveTrack->GetTPCNclsF()<=0 || v0negativeTrack->GetTPCNclsF()<=0 ) return kFALSE;
1718  /*
1719  Float_t lPosTrackCrossedRows = v0positiveTrack->GetTPCClusterInfo(2,1);
1720  Float_t lNegTrackCrossedRows = v0positiveTrack->GetTPCClusterInfo(2,1);
1721  fTreeVariableLeastNbrCrossedRows = (Int_t) lPosTrackCrossedRows;
1722  if( lNegTrackCrossedRows < fTreeVariableLeastNbrCrossedRows )
1723  fTreeVariableLeastNbrCrossedRows = (Int_t) lNegTrackCrossedRows;
1724  //Compute ratio Crossed Rows / Findable clusters
1725  //Note: above test avoids division by zero!
1726  Float_t lPosTrackCrossedRowsOverFindable = lPosTrackCrossedRows / ((double)(pTrack->GetTPCNclsF()));
1727  Float_t lNegTrackCrossedRowsOverFindable = lNegTrackCrossedRows / ((double)(nTrack->GetTPCNclsF()));
1728  fTreeVariableLeastRatioCrossedRowsOverFindable = lPosTrackCrossedRowsOverFindable;
1729  if( lNegTrackCrossedRowsOverFindable < fTreeVariableLeastRatioCrossedRowsOverFindable )
1730  fTreeVariableLeastRatioCrossedRowsOverFindable = lNegTrackCrossedRowsOverFindable;
1731  //Lowest Cut Level for Ratio Crossed Rows / Findable = 0.8, set here
1732  if ( fTreeVariableLeastRatioCrossedRowsOverFindable < 0.8 ) return kFALSE;
1733  */
1734 
1735  return kTRUE;
1736 
1737 }
1738 
1739 //---------------------------------------------------------------------------
1741  //
1742  // store the combined probability cuts
1743  //
1744  if(nPtBins!=fnPtBins) {
1745  printf("Wrong number of pt bins: it has to be %d\n",fnPtBins);
1746  AliFatal("exiting");
1747  }
1748 
1750 
1751  for(Int_t ib=0; ib<fnPtBins; ib++) {
1752  fMinCombinedProbability[ib] = minProb[ib];
1753  }
1754  return;
1755 }
1756 
1757 //---------------------------------------------------------------------------
1759  //
1760  // Proton emission angle in p+K0s pair rest frame
1761  // This function is different from CosThetaStar function in AliAODRecoDecay,
1762  // which assumes the mass of Lc even for the pairs with the invariant mass
1763  // far from Lc mass
1764  //
1766  if (!d) {
1767  AliDebug(2,"AliAODRecoCascadeHF null");
1768  return -9999;
1769  }
1770  Double_t mprPDG = TDatabasePDG::Instance()->GetParticle(2212)->Mass();
1771  Double_t mlcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
1772  Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
1773 
1774  TLorentzVector vpr, vk0s,vlc;
1775  vpr.SetXYZM(d->PxProng(0),d->PyProng(0),d->PzProng(0),mprPDG);
1776  vk0s.SetXYZM(d->PxProng(1),d->PyProng(1),d->PzProng(1),mk0sPDG);
1777  vlc = vpr + vk0s;
1778  TVector3 vboost = vlc.BoostVector();
1779  vpr.Boost(-vboost);
1780  Double_t bachcosthe = cos(vpr.Angle(vlc.Vect()));
1781 
1782  return bachcosthe;
1783 }
1784 
1785 //---------------------------------------------------------------------------
1787  //
1788  // Sign of d0 different from regular d0.
1789  // Sign defined using the position of crossing point with Lc vector
1790  // with respect to the primary vertex
1791  //
1793  if (!d) {
1794  AliDebug(2,"AliAODRecoCascadeHF null");
1795  return -9999;
1796  }
1797 
1798  AliAODTrack * bachelorTrack = dynamic_cast<AliAODTrack*>(d->GetBachelor());
1799  AliAODVertex *primvert = dynamic_cast<AliAODVertex*>(d->GetPrimaryVtx());
1800 
1801  Double_t d0z0bach[2],covd0z0bach[3];
1802  bachelorTrack->PropagateToDCA(primvert,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
1803  Double_t tx[3];
1804  bachelorTrack->GetXYZ(tx);
1805  tx[0] -= primvert->GetX();
1806  tx[1] -= primvert->GetY();
1807  tx[2] -= primvert->GetZ();
1808  Double_t innerpro = tx[0]*d->Px()+tx[1]*d->Py();
1809  Double_t signd0 = 1.;
1810  if(innerpro<0.) signd0 = -1.;
1811 
1812  return signd0*TMath::Abs(d0z0bach[0]);
1813 }
1814 
1815 //---------------------------------------------------------------------------
1817  //
1818  // V0 selection
1819  //
1820 
1821  if(!v0){
1822  AliFatal("V0 object is NULL");
1823  return kFALSE;
1824  }
1825 
1826  if (!fV0daughtersCuts) {
1827  AliFatal("Cut object is not defined for V0daughters. Candidate accepted.");
1828  return kFALSE;
1829  }
1830 
1831  if ( v0 && ((v0->GetOnFlyStatus() == kTRUE && GetV0Type() == AliRDHFCuts::kOnlyOfflineV0s) ||
1832  (v0->GetOnFlyStatus() == kFALSE && GetV0Type() == AliRDHFCuts::kOnlyOnTheFlyV0s)) ) return kFALSE;
1833 
1834  if (!v0->GetSecondaryVtx()) {
1835  AliDebug(2,"No secondary vertex for V0 by cascade");
1836  return kFALSE;
1837  }
1838  if (v0->GetNDaughters()!=2) {
1839  AliDebug(2,Form("No 2 daughters for V0 of current cascade (onTheFly=%d, nDaughters=%d)",v0->GetOnFlyStatus(),v0->GetNDaughters()));
1840  return kFALSE;
1841  }
1842 
1843  // cuts on the V0 mass: K0S case
1844  Double_t mk0s = v0->MassK0Short();
1845  Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
1846  Double_t maxcut_m = -9999;
1847  for(Int_t ip=0;ip<fnPtBins;ip++){
1848  if(fCutsRD[GetGlobalIndex(2,ip)]>maxcut_m) maxcut_m = fCutsRD[GetGlobalIndex(2,ip)];
1849  }
1850  if (TMath::Abs(mk0s-mk0sPDG) > maxcut_m) {
1851  return kFALSE;
1852  }
1853 
1854  // cut on V0 pT min
1855  Double_t mincut_p = 9999;
1856  for(Int_t ip=0;ip<fnPtBins;ip++){
1857  if(fCutsRD[GetGlobalIndex(15,ip)]<mincut_p) mincut_p = fCutsRD[GetGlobalIndex(15,ip)];
1858  }
1859  if (v0->Pt() < mincut_p) { // V0 pT min
1860  return kFALSE;
1861  }
1862 
1863  AliAODTrack *v0positiveTrack = dynamic_cast<AliAODTrack*>(v0->GetDaughter(0));
1864  if (!v0positiveTrack) return kFALSE;
1865  AliAODTrack *v0negativeTrack = dynamic_cast<AliAODTrack*>(v0->GetDaughter(1));
1866  if (!v0negativeTrack) return kFALSE;
1867 
1868 
1869  Float_t etaMin=0, etaMax=0; fV0daughtersCuts->GetEtaRange(etaMin,etaMax);
1870  if ( (v0positiveTrack->Eta()<=etaMin || v0positiveTrack->Eta()>=etaMax) ||
1871  (v0negativeTrack->Eta()<=etaMin || v0negativeTrack->Eta()>=etaMax) ) return kFALSE;
1872  Float_t ptMin=0, ptMax=0; fV0daughtersCuts->GetPtRange(ptMin,ptMax);
1873  if ( (v0positiveTrack->Pt()<=ptMin || v0positiveTrack->Pt()>=ptMax) ||
1874  (v0negativeTrack->Pt()<=ptMin || v0negativeTrack->Pt()>=ptMax) ) return kFALSE;
1875 
1876  // Condition on nTPCclusters
1877  if (fV0daughtersCuts->GetMinNClusterTPC()>0) {
1878  if ( ( ( v0positiveTrack->GetTPCClusterInfo(2,1) ) < fV0daughtersCuts->GetMinNClusterTPC() ) ||
1879  ( ( v0negativeTrack->GetTPCClusterInfo(2,1) ) < fV0daughtersCuts->GetMinNClusterTPC() ) ) return kFALSE;
1880  }
1881 
1882  if (fV0daughtersCuts->GetMinRatioCrossedRowsOverFindableClustersTPC()>0.5) {
1883  Float_t ratioCrossedRowsOverFindableClustersTPCPos = 1.0;
1884  Float_t ratioCrossedRowsOverFindableClustersTPCNeg = 1.0;
1885  if (v0positiveTrack->GetTPCNclsF()>0) {
1886  ratioCrossedRowsOverFindableClustersTPCPos = v0positiveTrack->GetTPCClusterInfo(2,1) / v0positiveTrack->GetTPCNclsF();
1887  }
1888  if (v0negativeTrack->GetTPCNclsF()>0) {
1889  ratioCrossedRowsOverFindableClustersTPCNeg = v0negativeTrack->GetTPCClusterInfo(2,1) / v0negativeTrack->GetTPCNclsF();
1890  }
1891  if ( ( ( ratioCrossedRowsOverFindableClustersTPCPos ) < fV0daughtersCuts->GetMinRatioCrossedRowsOverFindableClustersTPC() ) ||
1892  ( ( ratioCrossedRowsOverFindableClustersTPCNeg ) < fV0daughtersCuts->GetMinRatioCrossedRowsOverFindableClustersTPC() ) ) return kFALSE;
1893  }
1894 
1895  // kTPCrefit status
1896  if (v0->GetOnFlyStatus()==kFALSE) { // only for offline V0s
1897  if (fV0daughtersCuts->GetRequireTPCRefit()) {
1898  if( !(v0positiveTrack->GetStatus() & AliESDtrack::kTPCrefit)) return kFALSE;
1899  if( !(v0negativeTrack->GetStatus() & AliESDtrack::kTPCrefit)) return kFALSE;
1900  }
1901  }
1902  // kink condition
1903  if (!fV0daughtersCuts->GetAcceptKinkDaughters()) {
1904  AliAODVertex *maybeKinkPos = (AliAODVertex*)v0positiveTrack->GetProdVertex();
1905  AliAODVertex *maybeKinkNeg = (AliAODVertex*)v0negativeTrack->GetProdVertex();
1906  if (maybeKinkPos->GetType()==AliAODVertex::kKink ||
1907  maybeKinkNeg->GetType()==AliAODVertex::kKink) return kFALSE;
1908  }
1909 
1910  return kTRUE;
1911 
1912 }
1913 
1914 //---------------------------------------------------------------------------
1916  //
1917  // Daughter tracks selection
1918  //
1919 
1920  if (!fTrackCuts) {
1921  AliFatal("Cut object is not defined for bachelor. Candidate accepted.");
1922  return kFALSE;
1923  }
1924 
1925  if (!bachelorTrack) {
1926  AliFatal("Track object is NULL.");
1927  return kFALSE;
1928  }
1929 
1930  if ( fUseTrackSelectionWithFilterBits && !(bachelorTrack->TestFilterMask(BIT(4))) ) {
1931  AliDebug(2,"Check on the bachelor FilterBit: no BIT(4). Candidate rejected.");
1932  return kFALSE;
1933  }
1934 
1935  Float_t ptmin, ptmax;
1936  fTrackCuts->GetPtRange(ptmin,ptmax);
1937  if(bachelorTrack->Pt()<ptmin) return kFALSE;
1938  if(bachelorTrack->Pt()>ptmax) return kFALSE;
1939 
1940  // cut on bachelor pT min
1941  Double_t mincut_p = 9999;
1942  for(Int_t ip=0;ip<fnPtBins;ip++){
1943  if(fCutsRD[GetGlobalIndex(4,ip)]<mincut_p) mincut_p = fCutsRD[GetGlobalIndex(4,ip)];
1944  }
1945  if (bachelorTrack->Pt() < mincut_p) {
1946  return kFALSE;
1947  }
1948 
1949  if (fKinkReject != (!(fTrackCuts->GetAcceptKinkDaughters())) ) {
1950  AliError(Form("Not compatible setting: fKinkReject=%1d - fTrackCuts->GetAcceptKinkDaughters()=%1d",fKinkReject, fTrackCuts->GetAcceptKinkDaughters()));
1951  return kFALSE;
1952  }
1953 
1954 
1955  AliAODVertex *vAOD = (AliAODVertex*)aod->GetPrimaryVertex();
1956  Double_t pos[3]; vAOD->GetXYZ(pos);
1957  Double_t cov[6]; vAOD->GetCovarianceMatrix(cov);
1958  const AliESDVertex vESD(pos,cov,100.,100);
1959 
1960  if (!IsDaughterSelected(bachelorTrack,&vESD,fTrackCuts,aod)) return kFALSE;
1961 
1962  Bool_t okLcK0Sp = kTRUE; // K0S case
1963  Bool_t dummy1 = kTRUE;
1964  Bool_t dummy2 = kTRUE;
1965  CheckPID(0,bachelorTrack,0,0,okLcK0Sp,dummy1,dummy2);//use the PID for the first bin. only option 9 is the candidate pT depedent, so probably OK, need to update if needed
1966 
1967  return okLcK0Sp;
1968 }
1969 
1970 //---------------------------------------------------------------------------
1972  //
1973  // Apply selection
1974  //
1975 
1976  if (!fCutsRD) {
1977  AliFatal("Cut matrice not inizialized. Exit...");
1978  return kFALSE;
1979  }
1980 
1981 
1983  if (!d) {
1984  AliDebug(2,"AliAODRecoCascadeHF null");
1985  return kFALSE;
1986  }
1987 
1988  Double_t pt=d->Pt();
1989  if(pt<fMinPtCand) return kFALSE;
1990  if(pt>fMaxPtCand) return kFALSE;
1991  Int_t ptbin = PtBin(pt);
1992 
1993  AliVTrack *bachelorTrack = (AliVTrack*)d->GetBachelor();
1994  AliAODv0 *v0 = (AliAODv0*)d->Getv0();
1995 
1997  if(!spdfirstflag) return kFALSE;
1998  }
1999 
2000  // Get the V0 daughter tracks
2001  AliAODTrack *v0positiveTrack = (AliAODTrack*)v0->GetDaughter(0);
2002  AliAODTrack *v0negativeTrack = (AliAODTrack*)v0->GetDaughter(1);
2003  if (!v0positiveTrack || !v0negativeTrack ) {
2004  AliDebug(2,"No V0 daughters' objects");
2005  return kFALSE;
2006  }
2007 
2008  if (v0positiveTrack->GetID()<0 || v0negativeTrack->GetID()<0) {
2009  AliDebug(2,Form("At least one of V0 daughters has negative ID %d %d",v0positiveTrack->GetID(),v0negativeTrack->GetID()));
2010  return kFALSE;
2011  }
2012 
2013  AliAODVertex *vAOD = (AliAODVertex*)aod->GetPrimaryVertex();
2014  Double_t posVtx[3]; vAOD->GetXYZ(posVtx);
2015 
2016  Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
2017  Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
2018  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
2019 
2020  // K0S + p
2021  Double_t mk0s = v0->MassK0Short();
2022  Double_t mLck0sp = d->InvMassLctoK0sP();
2023 
2024  // Lambda + pi
2025  Double_t mlambda = v0->MassLambda();
2026  Double_t malambda = v0->MassAntiLambda();
2027  Double_t mLcLpi = d->InvMassLctoLambdaPi();
2028 
2029  Bool_t okK0spipi=kTRUE, okLppi=kTRUE, okLBarpip=kTRUE;
2030  Bool_t isNotK0S = kTRUE, isNotLambda = kTRUE, isNotLambdaBar = kTRUE, isNotGamma = kTRUE;
2031 
2032  Bool_t okLck0sp=kTRUE, okLcLpi=kTRUE, okLcLBarpi=kTRUE;
2033 
2034  // cut on Lc mass with K0S+p hypothesis
2035  if (TMath::Abs(mLck0sp-mLcPDG) > fCutsRD[GetGlobalIndex(0,ptbin)] && fExcludedCut!=0) {
2036  okLck0sp = kFALSE;
2037  AliDebug(4,Form(" cascade mass is %2.2e and does not correspond to Lambda_c into K0S+p cut",mLck0sp));
2038  }
2039 
2040  // cuts on the V0 mass: K0S case
2041  if (TMath::Abs(mk0s-mk0sPDG) > fCutsRD[GetGlobalIndex(2,ptbin)] && fExcludedCut!=2) {
2042  okK0spipi = kFALSE;
2043  AliDebug(4,Form(" V0 mass is %2.2e and does not correspond to K0S cut",mk0s));
2044  }
2045 
2046  // cut on Lc mass with Lambda+pi hypothesis
2047  if (TMath::Abs(mLcLpi-mLcPDG) > fCutsRD[GetGlobalIndex(1,ptbin)] && fExcludedCut!=1) {
2048  okLcLpi = kFALSE;
2049  okLcLBarpi = kFALSE;
2050  AliDebug(4,Form(" cascade mass is %2.2e and does not correspond to Lambda_c into Lambda+pi cut",mLcLpi));
2051  }
2052 
2053  // cuts on the V0 mass: Lambda/LambdaBar case
2054  if ( TMath::Abs(mlambda-mLPDG) > fCutsRD[GetGlobalIndex(3,ptbin)] && fExcludedCut!=3) {
2055  okLppi = kFALSE;
2056  AliDebug(4,Form(" V0 mass is %2.2e and does not correspond to LambdaBar cut",mlambda));
2057  }
2058 
2059  if ( TMath::Abs(malambda-mLPDG) > fCutsRD[GetGlobalIndex(3,ptbin)] && fExcludedCut!=3) {
2060  okLBarpip = kFALSE;
2061  AliDebug(4,Form(" V0 mass is %2.2e and does not correspond to LambdaBar cut",malambda));
2062  }
2063 
2064  // cut on K0S invariant mass veto
2065  if (TMath::Abs(v0->MassK0Short()-mk0sPDG) < fCutsRD[GetGlobalIndex(12,ptbin)] && fExcludedCut!=12) { // K0S invariant mass veto
2066  AliDebug(4,Form(" veto on K0S invariant mass doesn't pass the cut"));
2067  isNotK0S=kFALSE;
2068  }
2069 
2070  // cut on Lambda/LambdaBar invariant mass veto
2071  if (TMath::Abs(v0->MassLambda()-mLPDG) < fCutsRD[GetGlobalIndex(13,ptbin)] && fExcludedCut!=13) { // Lambda invariant mass veto
2072  AliDebug(4,Form(" veto on Lambda invariant mass doesn't pass the cut"));
2073  isNotLambda=kFALSE;
2074  }
2075  if (TMath::Abs(v0->MassAntiLambda()-mLPDG) < fCutsRD[GetGlobalIndex(13,ptbin)] && fExcludedCut!=13) { // LambdaBar invariant mass veto
2076  AliDebug(4,Form(" veto on LambdaBar invariant mass doesn't pass the cut"));
2077  isNotLambdaBar=kFALSE;
2078  }
2079 
2080  // cut on gamma invariant mass veto
2081  if (v0->InvMass2Prongs(0,1,11,11) < fCutsRD[GetGlobalIndex(14,ptbin)] && fExcludedCut!=14) { // K0S invariant mass veto
2082  AliDebug(4,Form(" veto on gamma invariant mass doesn't pass the cut"));
2083  isNotGamma=kFALSE;
2084  }
2085 
2086  okLck0sp = okLck0sp && okK0spipi && isNotLambda && isNotLambdaBar && isNotGamma;
2087  okLcLpi = okLcLpi && okLppi && isNotK0S && isNotLambdaBar && isNotGamma;
2088  okLcLBarpi = okLcLBarpi && okLBarpip && isNotK0S && isNotLambda && isNotGamma;
2089 
2090  if (!okLck0sp) return kFALSE;
2091 
2092  // cuts on the minimum pt of the tracks
2093  if (TMath::Abs(bachelorTrack->Pt()) < fCutsRD[GetGlobalIndex(4,ptbin)] && fExcludedCut!=4) {
2094  AliDebug(4,Form(" bachelor track Pt=%2.2e > %2.2e",bachelorTrack->Pt(),fCutsRD[GetGlobalIndex(4,ptbin)]));
2095  return kFALSE;
2096  }
2097  if (TMath::Abs(v0positiveTrack->Pt()) < fCutsRD[GetGlobalIndex(5,ptbin)] && fExcludedCut!=5) {
2098  AliDebug(4,Form(" V0-positive track Pt=%2.2e > %2.2e",v0positiveTrack->Pt(),fCutsRD[GetGlobalIndex(5,ptbin)]));
2099  return kFALSE;
2100  }
2101  if (TMath::Abs(v0negativeTrack->Pt()) < fCutsRD[GetGlobalIndex(6,ptbin)] && fExcludedCut!=6) {
2102  AliDebug(4,Form(" V0-negative track Pt=%2.2e > %2.2e",v0negativeTrack->Pt(),fCutsRD[GetGlobalIndex(6,ptbin)]));
2103  return kFALSE;
2104  }
2105  // cut on cascade dca (prong-to-prong)
2106  if ( TMath::Abs(d->GetDCA()) > fCutsRD[GetGlobalIndex(7,ptbin)] && fExcludedCut!=7) { // prong-to-prong cascade DCA
2107  AliDebug(4,Form(" cascade tracks DCA don't pass the cut"));
2108  return kFALSE;
2109  }
2110 
2111  // cut on V0 dca (prong-to-prong)
2112  if ( TMath::Abs(v0->GetDCA()) > fCutsRD[GetGlobalIndex(8,ptbin)] && fExcludedCut!=8) { // prong-to-prong V0 DCA
2113  AliDebug(4,Form(" V0 DCA don't pass the cut"));
2114  return kFALSE;
2115  }
2116 
2117  // cut on V0 cosine of pointing angle wrt PV
2118  if (v0->CosPointingAngle(posVtx) < fCutsRD[GetGlobalIndex(9,ptbin)] && fExcludedCut!=9) { // cosine of V0 pointing angle wrt primary vertex
2119  AliDebug(4,Form(" V0 cosine of pointing angle doesn't pass the cut"));
2120  return kFALSE;
2121  }
2122 
2123  // cut on bachelor transverse impact parameter wrt PV
2124  if (TMath::Abs(d->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(10,ptbin)] && fExcludedCut!=10) { // bachelor transverse impact parameter wrt PV
2125  AliDebug(4,Form(" bachelor transverse impact parameter doesn't pass the cut"));
2126  return kFALSE;
2127  }
2128 
2129  // cut on V0 transverse impact parameter wrt PV
2130  if (TMath::Abs(d->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(11,ptbin)] && fExcludedCut!=11) { // V0 transverse impact parameter wrt PV
2131  AliDebug(4,Form(" V0 transverse impact parameter doesn't pass the cut"));
2132  return kFALSE;
2133  }
2134 
2135  // cut on V0 pT min
2136  if (v0->Pt() < fCutsRD[GetGlobalIndex(15,ptbin)] && fExcludedCut!=15) { // V0 pT min
2137  AliDebug(4,Form(" V0 track Pt=%2.2e > %2.2e",v0->Pt(),fCutsRD[GetGlobalIndex(15,ptbin)]));
2138  return kFALSE;
2139  }
2140 
2141  // cut on Proton emission angle
2142  if(TMath::Abs(fCutsRD[GetGlobalIndex(16,ptbin)])<1.1 || TMath::Abs(fCutsRD[GetGlobalIndex(17,ptbin)])<1.1){
2143  Double_t cutvar = GetProtonEmissionAngleCMS(d);
2144  if (cutvar > fCutsRD[GetGlobalIndex(16,ptbin)] && fExcludedCut!=16 && fExcludedCut!=17) { // Proton emission angle
2145  AliDebug(4,Form(" Cos proton emission=%2.2e < %2.2e",cutvar,fCutsRD[GetGlobalIndex(16,ptbin)]));
2146  return kFALSE;
2147  }
2148  if (cutvar < fCutsRD[GetGlobalIndex(17,ptbin)] && fExcludedCut!=16 && fExcludedCut!=17) { // Proton emission angle
2149  AliDebug(4,Form(" Cos proton emission=%2.2e > %2.2e",cutvar,fCutsRD[GetGlobalIndex(17,ptbin)]));
2150  return kFALSE;
2151  }
2152  }
2153 
2154  // cut on proton re-signed d0
2155  if(TMath::Abs(fCutsRD[GetGlobalIndex(18,ptbin)])<0.2){
2156  Double_t cutvar = GetReSignedd0(d) ;
2157  if (cutvar< fCutsRD[GetGlobalIndex(18,ptbin)] && fExcludedCut!=18) { // proton d0
2158  AliDebug(4,Form(" Proton d0 (re-signed)=%2.2e > %2.2e",cutvar,fCutsRD[GetGlobalIndex(18,ptbin)]));
2159  return kFALSE;
2160  }
2161  }
2162 
2163  // cut on Armenteros qT/|alpha|
2164  if(TMath::Abs(fCutsRD[GetGlobalIndex(19,ptbin)])<0.3){
2165  Double_t cutvar = v0->PtArmV0()/TMath::Abs(v0->AlphaV0());
2166  if (cutvar < fCutsRD[GetGlobalIndex(19,ptbin)] && fExcludedCut!=19) { // v0 armenteros variable
2167  AliDebug(4,Form(" qT/|alpha|=%2.2e > %2.2e",cutvar,fCutsRD[GetGlobalIndex(19,ptbin)]));
2168  return kFALSE;
2169  }
2170  }
2171 
2172  return kTRUE;
2173 }
AliESDtrackCuts * fV0daughtersCuts
virtual void SetStandardCutsPbPb2010()
Double_t fMaxPtCandTrackSPDFirst
flag to select the track kFirst criteria for pt < ptlimit
Definition: AliRDHFCuts.h:438
Int_t GetNVars() const
Definition: AliRDHFCuts.h:240
void SetAsym(Bool_t asym)
Definition: AliAODPidHF.h:88
double Double_t
Definition: External.C:58
AliRDHFCutsLctoV0(const char *name="CutsLctoV0", Short_t v0channel=0)
Int_t GetnSigmaTOF(AliAODTrack *track, Int_t species, Double_t &sigma) const
Bool_t * fIsUpperCut
Definition: AliRDHFCuts.h:409
virtual void SetStandardCutsPP2010()
Bool_t fRemoveDaughtersFromPrimary
Definition: AliRDHFCuts.h:415
AliAODTrack * Getv0NegativeTrack() const
Int_t GetnSigmaTPC(AliAODTrack *track, Int_t species, Double_t &sigma) const
Bool_t CheckTOFPIDStatus(AliAODTrack *track) const
Float_t * fPtBinLimits
"number of limits", that is fnPtBins+1
Definition: AliRDHFCuts.h:402
ECombDetectors GetCombDetectors() const
Definition: AliAODPidHF.h:162
AliAODv0 * Getv0() const
virtual void SetStandardCutsPbPb2011()
Int_t fMinVtxContr
0: not cut; 1: SPDZ; 2: SPD3D; 3: Tracks
Definition: AliRDHFCuts.h:390
Double_t InvMassLctoLambdaPi() const
Bool_t AreLctoV0DaughtersSelected(AliAODRecoDecayHF *rd, AliAODEvent *aod=0x0) const
Float_t fMaxVtxRedChi2
minimum vertex contributors
Definition: AliRDHFCuts.h:391
Int_t CombineCuts(Int_t returnvalueTrack, Int_t returnvalue, Int_t returnvaluePID) const
Float_t * fMinCombinedProbability
cut to be excluded (-1=none)
const Float_t * GetCuts() const
Definition: AliRDHFCuts.h:244
Float_t fV0Type
cuts for v0 daughters (AOD converted to ESD on the flight!)
void SetNVars(Int_t nVars)
Definition: AliRDHFCuts.h:383
Int_t fMinVtxType
cuts on the event
Definition: AliRDHFCuts.h:389
Double_t fMaxRapidityCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:435
void EnableSemiCentralTrigger()
Definition: AliRDHFCuts.h:94
AliRDHFCutsLctoV0 & operator=(const AliRDHFCutsLctoV0 &source)
TString * GetVarNames() const
Definition: AliRDHFCuts.h:241
Double_t ptMin
Int_t ApplyPidTPCRaw(AliAODTrack *track, Int_t specie) const
void SetGlobalIndex()
Definition: AliRDHFCuts.h:198
AliRDHFCuts & operator=(const AliRDHFCuts &source)
Int_t fUseCentrality
flag to use a multiplicity dependent pileup selection
Definition: AliRDHFCuts.h:422
Bool_t fUsePID
Definition: AliRDHFCuts.h:410
void SetPidHF(AliAODPidHF *pidObj)
see enum below
Definition: AliRDHFCuts.h:212
Double_t InvMassLctoK0sP() const
Bool_t GetOldPid()
Definition: AliAODPidHF.h:157
AliAODPidHF * GetPidHF() const
Definition: AliRDHFCuts.h:237
void SetTOF(Bool_t tof)
Definition: AliAODPidHF.h:95
AliAODTrack * Getv0PositiveTrack() const
const Int_t nPtBins
virtual void GetCutVarsForOpt(AliAODRecoDecayHF *d, Float_t *vars, Int_t nvars, Int_t *pdgdaughters)
Double_t GetReSignedd0(AliAODRecoDecayHF *d)
int Int_t
Definition: External.C:63
Bool_t fUseTrackSelectionWithFilterBits
flag to reject kink daughters
Definition: AliRDHFCuts.h:445
void SetCuts(Int_t nVars, Int_t nPtBins, Float_t **cutsRD)
Int_t fnVarsForOpt
Definition: AliRDHFCuts.h:405
void ResetMaskAndEnableMBTrigger()
Definition: AliRDHFCuts.h:74
unsigned int UInt_t
Definition: External.C:33
AliPIDCombined * GetPidCombined() const
Definition: AliAODPidHF.h:161
Bool_t ApplySingleProtonCuts(AliAODTrack *trk, AliAODEvent *aod)
float Float_t
Definition: External.C:68
const Double_t ptmax
TString * fVarNames
number of cut vars for candidates
Definition: AliRDHFCuts.h:404
Double_t fMaxPtCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:434
AliESDtrackCuts * fTrackCuts
quality cuts on the daughter tracks
Definition: AliRDHFCuts.h:398
void AddTrackCutsV0daughters(AliESDtrackCuts *v0daug)
Float_t fLowPtCut
high pT cut separation for proton identification
AliAODTrack * GetBachelor() const
Int_t fOptPileup
use Physics selection criteria
Definition: AliRDHFCuts.h:418
Bool_t IsExcluded(AliAODTrack *track, Int_t labelTrack, Double_t nsigmaCut, TString detector)
const Double_t ptmin
virtual void PrintAll() const
Float_t fMinCentrality
Definition: AliRDHFCuts.h:427
AliPIDResponse * GetPidResponse() const
Definition: AliAODPidHF.h:160
Int_t fnPtBinLimits
number of pt bins for cuts
Definition: AliRDHFCuts.h:401
void SetSigma(Double_t *sigma)
Definition: AliAODPidHF.h:39
Float_t * fCutsRD
fnVars*fnPtBins
Definition: AliRDHFCuts.h:408
Double_t CosV0PointingAngle() const
short Short_t
Definition: External.C:23
Int_t ApplyPidTOFRaw(AliAODTrack *track, Int_t specie) const
void SetVarsForOpt(Int_t nVars, Bool_t *forOpt)
Bool_t ApplyCandidateCuts(AliAODRecoDecayHF *rd, AliAODEvent *aod, Bool_t spdfirst)
Double_t GetProtonEmissionAngleCMS(AliAODRecoDecayHF *d)
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:406
void SetMinCombinedProbability(Int_t ptBins, Float_t *ptMin)
Bool_t PreSelect(TObject *obj, AliAODv0 *v0, AliVTrack *bachelorTrack)
void EnableCentralTrigger()
Definition: AliRDHFCuts.h:82
void CheckPID(Int_t candPtBin, AliAODTrack *bachelor, AliAODTrack *, AliAODTrack *, Bool_t &isBachelorID1, Bool_t &isBachelorID2, Bool_t &isBachelorID4)
Int_t fMinSPDMultiplicity
maximum |z| of primary vertex
Definition: AliRDHFCuts.h:393
void SetUsePID(Bool_t flag=kTRUE)
Definition: AliRDHFCuts.h:206
Int_t fExcludedCut
low pT cut separation for proton identification
Bool_t fIsCandTrackSPDFirst
IsSelected returns always kTRUE for MC signal.
Definition: AliRDHFCuts.h:437
Bool_t ApplySingleK0Cuts(AliAODv0 *v0, AliAODEvent *aod)
void SetPtBins(Int_t nPtBinLimits, Float_t *ptBinLimits)
Bool_t fKinkReject
cut on zSPD vertex to remove outliers in centrality vs. tracklets (0=no cut, 1= cut at 12 cm...
Definition: AliRDHFCuts.h:444
Bool_t fUsePhysicsSelection
use MC primary vertex
Definition: AliRDHFCuts.h:417
void SetTOFdecide(Bool_t tOFdecide)
Definition: AliAODPidHF.h:107
void SetMatch(Int_t match)
Definition: AliAODPidHF.h:98
AliAODVertex * GetPrimaryVtx() const
void AddTrackCuts(const AliESDtrackCuts *cuts)
Definition: AliRDHFCuts.h:204
void SetTPC(Bool_t tpc)
Definition: AliAODPidHF.h:94
bool Bool_t
Definition: External.C:53
Int_t fnPtBins
cuts on the candidate
Definition: AliRDHFCuts.h:400
Float_t fHighPtCut
V0 type – should be defined as in AliRDHFCuts.h.
Double_t ptMax
void SetTriggerClass(TString trclass0, TString trclass1="")
Definition: AliRDHFCuts.h:194
AliAODPidHF * fPidHF
enable AOD049 centrality cleanup
Definition: AliRDHFCuts.h:412
virtual Bool_t IsInFiducialAcceptance(Double_t pt, Double_t y) const
Int_t PtBin(Double_t pt) const
Int_t GetGlobalIndex(Int_t iVar, Int_t iPtBin) const
Int_t IsSelectedSingleCut(TObject *obj, Int_t selectionLevel, Int_t cutIndex, AliAODEvent *aod=0x0)
Int_t nptbins
Double_t fMinPtCand
outcome of PID selection
Definition: AliRDHFCuts.h:433
Bool_t IsDaughterSelected(AliAODTrack *track, const AliESDVertex *primary, AliESDtrackCuts *cuts, const AliAODEvent *aod=0x0) const
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
Float_t fMaxCentrality
minimum centrality for selected events
Definition: AliRDHFCuts.h:428
virtual Int_t IsSelectedPID(AliAODRecoDecayHF *obj)
Int_t fnVars
Definition: AliRDHFCuts.h:403