AliPhysics  449db5a (449db5a)
 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 
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 {
62  //
63  // Default Constructor
64  //
65 
66  const Int_t nvars=21;
67  SetNVars(nvars);
68  TString varNames[nvars]={"Lc inv. mass if K0S [GeV/c2]", // 0
69  "Lc inv. mass if Lambda [GeV/c2]", // 1
70  "K0S inv. mass [GeV/c2]", // 2
71  "Lambda/LambdaBar inv. mass[GeV/c2]", // 3
72  "pT min bachelor track [GeV/c]", // 4
73  "pT min V0-positive track [GeV/c]", // 5
74  "pT min V0-negative track [GeV/c]", // 6
75  "dca cascade (prong-to-prong) cut [cm]", // 7
76  "dca V0 (prong-to-prong) cut [number of sigmas]", // 8
77  "V0 cosPA min wrt PV", // 9
78  "d0 max bachelor wrt PV [cm]", // 10
79  "d0 max V0 wrt PV [cm]", // 11
80  "mass K0S veto [GeV/c2]", // 12
81  "mass Lambda/LambdaBar veto [GeV/c2]", // 13
82  "mass Gamma veto [GeV/c2]", // 14
83  "pT min V0 track [GeV/c]", // 15
84  "Max Proton emission angle in Lc CMS", // 16
85  "Min Proton emission angle in Lc CMS", // 17
86  "Resigned d0", // 18
87  "V0 qT/|alpha|", // 19
88  "V0 type" // 20
89  };
90 
91  Bool_t isUpperCut[nvars]={kTRUE, // 0
92  kTRUE, // 1
93  kTRUE, // 2
94  kTRUE, // 3
95  kFALSE, // 4
96  kFALSE, // 5
97  kFALSE, // 6
98  kTRUE, // 7
99  kTRUE, // 8
100  kFALSE, // 9
101  kTRUE, // 10
102  kTRUE, // 11
103  kFALSE, // 12
104  kFALSE, // 13
105  kFALSE, // 14
106  kFALSE, // 15
107  kTRUE, // 16
108  kFALSE, // 17
109  kFALSE, // 18
110  kFALSE, // 19
111  kFALSE // 20
112  };
113  SetVarNames(nvars,varNames,isUpperCut);
114  Bool_t forOpt[nvars]={kFALSE, // 0
115  kFALSE, // 1
116  kTRUE, // 2
117  kTRUE, // 3
118  kTRUE, // 4
119  kTRUE, // 5
120  kTRUE, // 6
121  kTRUE, // 7
122  kTRUE, // 8
123  kTRUE, // 9
124  kTRUE, // 10
125  kTRUE, // 11
126  kTRUE, // 12
127  kTRUE, // 13
128  kTRUE, // 14
129  kTRUE, // 15
130  kTRUE, // 16
131  kTRUE, // 17
132  kTRUE, // 18
133  kTRUE, // 19
134  kFALSE // 20
135  };
136  SetVarsForOpt(nvars,forOpt);
137 
138  Float_t limits[2]={0,999999999.};
139  SetPtBins(2,limits);
140 
141  /*
142  switch (v0channel) {
143  case 0:
144  fV0channel = 0x0001;
145  break;
146  case 1:
147  fV0channel = 0x0002;
148  break;
149  case 2:
150  fV0channel = 0x0004;
151  break;
152  }
153  */
154 
155 }
156 //--------------------------------------------------------------------------
158  AliRDHFCuts(source),
159  fPidSelectionFlag(source.fPidSelectionFlag),
160  fV0daughtersCuts(0),
161  fV0Type(source.fV0Type),
162  fHighPtCut(source.fHighPtCut),
163  fLowPtCut(source.fLowPtCut),
164  fExcludedCut(source.fExcludedCut),
165  fMinCombinedProbability(0)
166 {
167  //
168  // Copy constructor
169  //
170 
172  else fV0daughtersCuts = new AliESDtrackCuts();
173 
175 
176 }
177 //--------------------------------------------------------------------------
179 {
180  //
181  // assignment operator
182  //
183 
184  if (this != &source) {
185 
186  AliRDHFCuts::operator=(source);
188 
189  delete fV0daughtersCuts;
190  fV0daughtersCuts = new AliESDtrackCuts(*(source.fV0daughtersCuts));
191 
192  fV0Type = source.fV0Type;
193 
194  fHighPtCut = source.fHighPtCut;
195  fLowPtCut = source.fLowPtCut;
196 
198 
199  }
200 
201  return *this;
202 }
203 
204 
205 //---------------------------------------------------------------------------
207  //
208  // Default Destructor
209  //
210 
211  if (fV0daughtersCuts) {
212  delete fV0daughtersCuts;
214  }
215 
217  delete [] fMinCombinedProbability;
219  }
220 
221 }
222 
223 //---------------------------------------------------------------------------
225  //
226  // Fills in vars the values of the variables
227  //
228 
229  if (pdgdaughters[0]==-9999) return; // dummy
230 
231  if (nvars!=fnVarsForOpt) {
232  printf("AliRDHFCutsLctoV0::GetCutVarsForOpt: wrong number of variables\n");
233  return;
234  }
235 
236  Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
237  Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
238  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
239 
241 
242  // Get the v0 and all daughter tracks
243  AliAODTrack *bachelorTrack = (AliAODTrack*)dd->GetBachelor();
244  AliAODv0 *v0 = (AliAODv0*)dd->Getv0();
245  AliAODTrack *v0positiveTrack = (AliAODTrack*)dd->Getv0PositiveTrack();
246  AliAODTrack *v0negativeTrack = (AliAODTrack*)dd->Getv0NegativeTrack();
247 
248  Int_t iter=-1;
249  // cut on cascade mass, if K0S + p
250  if (fVarsForOpt[0]) {
251  iter++;
252  vars[iter]=TMath::Abs(dd->InvMassLctoK0sP()-mLcPDG);
253  }
254  // cut on cascade mass, if Lambda/LambdaBar + pi
255  if (fVarsForOpt[1]) {
256  iter++;
257  vars[iter]=TMath::Abs(dd->InvMassLctoLambdaPi()-mLcPDG);
258  }
259 
260  // cut on V0 mass if K0S
261  if (fVarsForOpt[2]) {
262  iter++;
263  vars[iter]=TMath::Abs(v0->MassK0Short()-mk0sPDG);
264  }
265 
266  // cut on V0 mass if Lambda/LambdaBar
267  if (fVarsForOpt[3]) {
268 
269  if (bachelorTrack->Charge()==1) {
270  iter++;
271  vars[iter]=TMath::Abs(v0->MassLambda()-mLPDG);
272  } else if (bachelorTrack->Charge()==-1) {
273  iter++;
274  vars[iter]=TMath::Abs(v0->MassAntiLambda()-mLPDG);
275  }
276 
277  }
278 
279  // cut bachelor min pt
280  if (fVarsForOpt[4]) {
281  iter++;
282  vars[iter]=bachelorTrack->Pt();
283  }
284 
285  // cut on V0-positive min pt
286  if (fVarsForOpt[5]) {
287  iter++;
288  vars[iter]=v0positiveTrack->Pt();
289  }
290 
291  // cut on V0-negative min pt
292  if (fVarsForOpt[6]) {
293  iter++;
294  vars[iter]=v0negativeTrack->Pt();
295  }
296 
297  // cut on cascade dca (prong-to-prong)
298  if (fVarsForOpt[7]) {
299  iter++;
300  vars[iter]=dd->GetDCA(); // prong-to-prong cascade DCA
301  }
302 
303  // cut on V0 dca (prong-to-prong)
304  if (fVarsForOpt[8]) {
305  iter++;
306  vars[iter]=v0->GetDCA(); // prong-to-prong V0 DCA
307  }
308 
309  // cut on V0 cosPA wrt PV
310  if (fVarsForOpt[9]) {
311  iter++;
312  vars[iter]=dd->CosV0PointingAngle(); // cosine of V0 pointing angle wrt primary vertex
313  }
314 
315  // cut on bachelor transverse impact parameter wrt PV
316  if (fVarsForOpt[10]) {
317  iter++;
318  vars[iter]=dd->Getd0Prong(0); // bachelor transverse impact parameter wrt primary vertex
319  }
320 
321  // cut on V0 transverse impact parameter wrt PV
322  if (fVarsForOpt[11]) {
323  iter++;
324  vars[iter]=dd->Getd0Prong(1); // V0 transverse impact parameter wrt primary vertex
325  }
326 
327  // cut on K0S invariant mass veto
328  if (fVarsForOpt[12]) {
329  iter++;
330  vars[iter]=TMath::Abs(v0->MassK0Short()-mk0sPDG); // K0S invariant mass veto
331  }
332 
333  // cut on Lambda/LambdaBar invariant mass veto
334  if (fVarsForOpt[13]) {
335 
336  if (bachelorTrack->Charge()==1) {
337  iter++;
338  vars[iter]=TMath::Abs(v0->MassLambda()-mLPDG);
339  } else if (bachelorTrack->Charge()==-1) {
340  iter++;
341  vars[iter]=TMath::Abs(v0->MassAntiLambda()-mLPDG);
342  }
343 
344  }
345 
346  // cut on gamma invariant mass veto
347  if (fVarsForOpt[14]) {
348  iter++;
349  vars[iter]= v0->InvMass2Prongs(0,1,11,11); // gamma invariant mass veto
350  }
351 
352 
353  // cut on V0 pT min
354  if (fVarsForOpt[15]) {
355  iter++;
356  vars[iter]= v0->Pt(); // V0 pT min
357  }
358 
359  // cut on proton emission angle
360  if (fVarsForOpt[16]) {
361  iter++;
362  vars[iter]= GetProtonEmissionAngleCMS(d); //CosPrThetaCMS
363  }
364 
365  // cut on proton emission angle
366  if (fVarsForOpt[17]) {
367  iter++;
368  vars[iter]= GetProtonEmissionAngleCMS(d); //CosPrThetaCMS
369  }
370 
371  // cut on re-signed d0
372  if (fVarsForOpt[18]) {
373  iter++;
374  vars[iter]= -9999;
375  }
376 
377  // cut on Armenteros qT/|alpha|
378  if (fVarsForOpt[19]) {
379  iter++;
380  vars[iter]= v0->PtArmV0()/TMath::Abs(v0->AlphaV0());
381  }
382 
383 
384  return;
385 }
386 //---------------------------------------------------------------------------
388  //
389  // Apply selection
390  //
391 
392  if (!fCutsRD) {
393  AliFatal("Cut matrice not inizialized. Exit...");
394  return 0;
395  }
396 
398  if (!d) {
399  AliDebug(2,"AliAODRecoCascadeHF null");
400  return 0;
401  }
402 
403  Double_t pt=d->Pt();
404  if(pt<fMinPtCand) return 0;
405  if(pt>fMaxPtCand) return 0;
406 
407  if (!d->GetSecondaryVtx()) {
408  AliDebug(2,"No secondary vertex for cascade");
409  return 0;
410  }
411 
412  if (d->GetNDaughters()!=2) {
413  AliDebug(2,Form("No 2 daughters for current cascade (nDaughters=%d)",d->GetNDaughters()));
414  return 0;
415  }
416 
417  AliAODv0 * v0 = dynamic_cast<AliAODv0*>(d->Getv0());
418 
419  if ( v0 && ((v0->GetOnFlyStatus() == kTRUE && GetV0Type() == AliRDHFCuts::kOnlyOfflineV0s) ||
420  (v0->GetOnFlyStatus() == kFALSE && GetV0Type() == AliRDHFCuts::kOnlyOnTheFlyV0s)) ) return 0;
421 
422  AliAODTrack * bachelorTrack = dynamic_cast<AliAODTrack*>(d->GetBachelor());
423  if (!v0 || !bachelorTrack) {
424  AliDebug(2,"No V0 or no bachelor for current cascade");
425  return 0;
426  }
427 
428  if (bachelorTrack->GetID()<0) {
429  AliDebug(2,Form("Bachelor has negative ID %d",bachelorTrack->GetID()));
430  return 0;
431  }
432 
433  if (!v0->GetSecondaryVtx()) {
434  AliDebug(2,"No secondary vertex for V0 by cascade");
435  return 0;
436  }
437 
438  if (v0->GetNDaughters()!=2) {
439  AliDebug(2,Form("No 2 daughters for V0 of current cascade (onTheFly=%d, nDaughters=%d)",v0->GetOnFlyStatus(),v0->GetNDaughters()));
440  return 0;
441  }
442 
443 
444  // Get the V0 daughter tracks
445  AliAODTrack *v0positiveTrack = dynamic_cast<AliAODTrack*>(d->Getv0PositiveTrack());
446  AliAODTrack *v0negativeTrack = dynamic_cast<AliAODTrack*>(d->Getv0NegativeTrack());
447  if (!v0positiveTrack || !v0negativeTrack ) {
448  AliDebug(2,"No V0 daughters' objects");
449  return 0;
450  }
451 
452  if (v0positiveTrack->GetID()<0 || v0negativeTrack->GetID()<0) {
453  AliDebug(2,Form("At least one of V0 daughters has negative ID %d %d",v0positiveTrack->GetID(),v0negativeTrack->GetID()));
454  return 0;
455  }
456 
457  //if(fUseTrackSelectionWithFilterBits && d->HasBadDaughters()) return 0;
458  if ( fUseTrackSelectionWithFilterBits && !(bachelorTrack->TestFilterMask(BIT(4))) ) {
459  AliDebug(2,"Check on the bachelor FilterBit: no BIT(4). Candidate rejected.");
460  return 0;
461  }
462 
463  Int_t returnvalueTrack = 7;
464 
465  // selection on daughter tracks
466  if (selectionLevel==AliRDHFCuts::kAll ||
467  selectionLevel==AliRDHFCuts::kTracks) {
468 
469  if (!AreLctoV0DaughtersSelected(d,aod)) return 0;
470 
471  }
472 
473  Bool_t okLck0sp=kTRUE, okLcLpi=kTRUE, okLcLBarpi=kTRUE;
474 
475  // selection on candidate
476  if (selectionLevel==AliRDHFCuts::kAll ||
477  selectionLevel==AliRDHFCuts::kCandidate) {
478 
479  Double_t pt = d->Pt();
480  Int_t ptbin = PtBin(pt);
481 
482  Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
483  Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
484  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
485 
486  // K0S + p
487  Double_t mk0s = v0->MassK0Short();
488  Double_t mLck0sp = d->InvMassLctoK0sP();
489 
490  // Lambda + pi
491  Double_t mlambda = v0->MassLambda();
492  Double_t malambda = v0->MassAntiLambda();
493  Double_t mLcLpi = d->InvMassLctoLambdaPi();
494 
495  Bool_t okK0spipi=kTRUE, okLppi=kTRUE, okLBarpip=kTRUE;
496  Bool_t isNotK0S = kTRUE, isNotLambda = kTRUE, isNotLambdaBar = kTRUE, isNotGamma = kTRUE;
497 
498  // cut on Lc mass with K0S+p hypothesis
499  if (TMath::Abs(mLck0sp-mLcPDG) > fCutsRD[GetGlobalIndex(0,ptbin)] && fExcludedCut!=0) {
500  okLck0sp = kFALSE;
501  AliDebug(4,Form(" cascade mass is %2.2e and does not correspond to Lambda_c into K0S+p cut",mLck0sp));
502  }
503 
504  // cuts on the V0 mass: K0S case
505  if (TMath::Abs(mk0s-mk0sPDG) > fCutsRD[GetGlobalIndex(2,ptbin)] && fExcludedCut!=2) {
506  okK0spipi = kFALSE;
507  AliDebug(4,Form(" V0 mass is %2.2e and does not correspond to K0S cut",mk0s));
508  }
509 
510  // cut on Lc mass with Lambda+pi hypothesis
511  if (TMath::Abs(mLcLpi-mLcPDG) > fCutsRD[GetGlobalIndex(1,ptbin)] && fExcludedCut!=1) {
512  okLcLpi = kFALSE;
513  okLcLBarpi = kFALSE;
514  AliDebug(4,Form(" cascade mass is %2.2e and does not correspond to Lambda_c into Lambda+pi cut",mLcLpi));
515  }
516 
517  // cuts on the V0 mass: Lambda/LambdaBar case
518  //if ( !(bachelorTrack->Charge()==+1 && TMath::Abs(mlambda-mLPDG) <= fCutsRD[GetGlobalIndex(3,ptbin)] ) ) {
519  if ( TMath::Abs(mlambda-mLPDG) > fCutsRD[GetGlobalIndex(3,ptbin)] && fExcludedCut!=3) {
520  okLppi = kFALSE;
521  AliDebug(4,Form(" V0 mass is %2.2e and does not correspond to LambdaBar cut",mlambda));
522  }
523 
524  //if ( !(bachelorTrack->Charge()==-1 && TMath::Abs(malambda-mLPDG) <= fCutsRD[GetGlobalIndex(3,ptbin)] ) ) {
525  if ( TMath::Abs(malambda-mLPDG) > fCutsRD[GetGlobalIndex(3,ptbin)] && fExcludedCut!=3) {
526  okLBarpip = kFALSE;
527  AliDebug(4,Form(" V0 mass is %2.2e and does not correspond to LambdaBar cut",malambda));
528  }
529 
530  // cut on K0S invariant mass veto
531  if (TMath::Abs(v0->MassK0Short()-mk0sPDG) < fCutsRD[GetGlobalIndex(12,ptbin)] && fExcludedCut!=12) { // K0S invariant mass veto
532  AliDebug(4,Form(" veto on K0S invariant mass doesn't pass the cut"));
533  //return 0;
534  isNotK0S=kFALSE;
535  }
536 
537  // cut on Lambda/LambdaBar invariant mass veto
538  if (TMath::Abs(v0->MassLambda()-mLPDG) < fCutsRD[GetGlobalIndex(13,ptbin)] && fExcludedCut!=13) { // Lambda invariant mass veto
539  AliDebug(4,Form(" veto on Lambda invariant mass doesn't pass the cut"));
540  isNotLambda=kFALSE;
541  //return 0;
542  }
543  if (TMath::Abs(v0->MassAntiLambda()-mLPDG) < fCutsRD[GetGlobalIndex(13,ptbin)] && fExcludedCut!=13) { // LambdaBar invariant mass veto
544  AliDebug(4,Form(" veto on LambdaBar invariant mass doesn't pass the cut"));
545  isNotLambdaBar=kFALSE;
546  //return 0;
547  }
548 
549  // cut on gamma invariant mass veto
550  if (v0->InvMass2Prongs(0,1,11,11) < fCutsRD[GetGlobalIndex(14,ptbin)] && fExcludedCut!=14) { // K0S invariant mass veto
551  AliDebug(4,Form(" veto on gamma invariant mass doesn't pass the cut"));
552  isNotGamma=kFALSE;
553  //return 0;
554  }
555 
556  okLck0sp = okLck0sp && okK0spipi && isNotLambda && isNotLambdaBar && isNotGamma;
557  okLcLpi = okLcLpi && okLppi && isNotK0S && isNotLambdaBar && isNotGamma;
558  okLcLBarpi = okLcLBarpi && okLBarpip && isNotK0S && isNotLambda && isNotGamma;
559 
560  if (!okLck0sp && !okLcLpi && !okLcLBarpi) return 0;
561 
562  // cuts on the minimum pt of the tracks
563  if (TMath::Abs(bachelorTrack->Pt()) < fCutsRD[GetGlobalIndex(4,ptbin)] && fExcludedCut!=4) {
564  AliDebug(4,Form(" bachelor track Pt=%2.2e > %2.2e",bachelorTrack->Pt(),fCutsRD[GetGlobalIndex(4,ptbin)]));
565  return 0;
566  }
567  if (TMath::Abs(v0positiveTrack->Pt()) < fCutsRD[GetGlobalIndex(5,ptbin)] && fExcludedCut!=5) {
568  AliDebug(4,Form(" V0-positive track Pt=%2.2e > %2.2e",v0positiveTrack->Pt(),fCutsRD[GetGlobalIndex(5,ptbin)]));
569  return 0;
570  }
571  if (TMath::Abs(v0negativeTrack->Pt()) < fCutsRD[GetGlobalIndex(6,ptbin)] && fExcludedCut!=6) {
572  AliDebug(4,Form(" V0-negative track Pt=%2.2e > %2.2e",v0negativeTrack->Pt(),fCutsRD[GetGlobalIndex(6,ptbin)]));
573  return 0;
574  }
575 
576  // cut on cascade dca (prong-to-prong)
577  if ( TMath::Abs(d->GetDCA()) > fCutsRD[GetGlobalIndex(7,ptbin)] && fExcludedCut!=7) { // prong-to-prong cascade DCA
578  AliDebug(4,Form(" cascade tracks DCA don't pass the cut"));
579  return 0;
580  }
581 
582  // cut on V0 dca (prong-to-prong)
583  if ( TMath::Abs(v0->GetDCA()) > fCutsRD[GetGlobalIndex(8,ptbin)] && fExcludedCut!=8) { // prong-to-prong V0 DCA
584  AliDebug(4,Form(" V0 DCA don't pass the cut"));
585  return 0;
586  }
587 
588  // cut on V0 cosine of pointing angle wrt PV
589  if (d->CosV0PointingAngle() < fCutsRD[GetGlobalIndex(9,ptbin)] && fExcludedCut!=9) { // cosine of V0 pointing angle wrt primary vertex
590  AliDebug(4,Form(" V0 cosine of pointing angle doesn't pass the cut"));
591  return 0;
592  }
593 
594  // cut on bachelor transverse impact parameter wrt PV
595  if (TMath::Abs(d->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(10,ptbin)] && fExcludedCut!=10) { // bachelor transverse impact parameter wrt PV
596  AliDebug(4,Form(" bachelor transverse impact parameter doesn't pass the cut"));
597  return 0;
598  }
599 
600  // cut on V0 transverse impact parameter wrt PV
601  if (TMath::Abs(d->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(11,ptbin)] && fExcludedCut!=11) { // V0 transverse impact parameter wrt PV
602  AliDebug(4,Form(" V0 transverse impact parameter doesn't pass the cut"));
603  return 0;
604  }
605 
606  // cut on V0 pT min
607  if (v0->Pt() < fCutsRD[GetGlobalIndex(15,ptbin)] && fExcludedCut!=15) { // V0 pT min
608  AliDebug(4,Form(" V0 track Pt=%2.2e > %2.2e",v0->Pt(),fCutsRD[GetGlobalIndex(15,ptbin)]));
609  return 0;
610  }
611 
612  // cut on Proton emission angle
613  if(TMath::Abs(fCutsRD[GetGlobalIndex(16,ptbin)])<1.1 || TMath::Abs(fCutsRD[GetGlobalIndex(17,ptbin)])<1.1){
615  if (cutvar > fCutsRD[GetGlobalIndex(16,ptbin)] && fExcludedCut!=16 && fExcludedCut!=17) { // Proton emission angle
616  AliDebug(4,Form(" Cos proton emission=%2.2e < %2.2e",cutvar,fCutsRD[GetGlobalIndex(16,ptbin)]));
617  return 0;
618  }
619  if (cutvar < fCutsRD[GetGlobalIndex(17,ptbin)] && fExcludedCut!=16 && fExcludedCut!=17) { // Proton emission angle
620  AliDebug(4,Form(" Cos proton emission=%2.2e > %2.2e",cutvar,fCutsRD[GetGlobalIndex(17,ptbin)]));
621  return 0;
622  }
623  }
624 
625  // cut on proton re-signed d0
626  if(TMath::Abs(fCutsRD[GetGlobalIndex(18,ptbin)])<0.2){
627  Double_t cutvar = GetReSignedd0(d) ;
628  if (cutvar< fCutsRD[GetGlobalIndex(18,ptbin)] && fExcludedCut!=18) { // proton d0
629  AliDebug(4,Form(" Proton d0 (re-signed)=%2.2e > %2.2e",cutvar,fCutsRD[GetGlobalIndex(18,ptbin)]));
630  return 0;
631  }
632  }
633 
634  // cut on Armenteros qT/|alpha|
635  if(TMath::Abs(fCutsRD[GetGlobalIndex(19,ptbin)])<0.3){
636  Double_t cutvar = v0->PtArmV0()/TMath::Abs(v0->AlphaV0());
637  if (cutvar < fCutsRD[GetGlobalIndex(19,ptbin)] && fExcludedCut!=19) { // v0 armenteros variable
638  AliDebug(4,Form(" qT/|alpha|=%2.2e > %2.2e",cutvar,fCutsRD[GetGlobalIndex(19,ptbin)]));
639  return 0;
640  }
641  }
642 
643  }
644 
645  Int_t returnvalue = okLck0sp+2*okLcLBarpi+4*okLcLpi;
646  /*
647  retvalue case
648  1 Lc->K0S + p
649  2 Lc->LambdaBar + pi
650  3 Lc->K0S + p AND Lc->LambdaBar + pi
651  4 Lc->Lambda + pi
652  5 Lc->K0S + p AND Lc->Lambda + pi
653  6 Lc->LambdaBar + pi AND Lc->Lambda + pi
654  7 Lc->K0S + p AND Lc->LambdaBar + pi AND Lc->Lambda + pi
655  */
656 
657  Int_t returnvaluePID = 7;
658 
659  // selection on candidate
660  if (selectionLevel==AliRDHFCuts::kAll ||
661  selectionLevel==AliRDHFCuts::kCandidate ||
662  selectionLevel==AliRDHFCuts::kPID )
663  returnvaluePID = IsSelectedPID(d);
664 
665  //if (fUsePID && returnvaluePID==0) return 0;
666 
667  Int_t returnvalueTot = 0;
668  if ( fUsePID )
669  returnvalueTot = CombineCuts(returnvalueTrack,returnvalue,returnvaluePID);
670  else
671  returnvalueTot = CombineCuts(returnvalueTrack,returnvalue,7);
672 
673  return returnvalueTot;
674 
675 }
676 //---------------------------------------------------------------------------
677 Bool_t AliRDHFCutsLctoV0::PreSelect(TObject* obj, AliAODv0 *v0, AliVTrack *bachelorTrack){
678  //
679  // Apply pre-selections, used in the AOD filtering
680  //
681 
682  if (!fCutsRD) {
683  AliFatal("Cut matrix not inizialized. Exit...");
684  return 0;
685  }
686 
688  if (!d) {
689  AliDebug(2,"AliAODRecoCascadeHF null");
690  return 0;
691  }
692 
693  Double_t pt = d->Pt();
694  Int_t ptbin = PtBin(pt);
695 
696  if ( v0 && ((v0->GetOnFlyStatus() == kTRUE && GetV0Type() == AliRDHFCuts::kOnlyOfflineV0s) ||
697  (v0->GetOnFlyStatus() == kFALSE && GetV0Type() == AliRDHFCuts::kOnlyOnTheFlyV0s)) ) return 0;
698 
699  // cut on V0 pT min
700  if (v0->Pt() < fCutsRD[GetGlobalIndex(15,ptbin)]) return 0;
701 
702  // cuts on the minimum pt of the bachelor
703  if (TMath::Abs(bachelorTrack->Pt()) < fCutsRD[GetGlobalIndex(4,ptbin)]) return 0;
704 
705  Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
706  Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
707  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
708 
709  // K0S + p
710  Double_t mk0s = v0->MassK0Short();
711  Double_t mLck0sp = d->InvMassLctoK0sP();
712 
713  // Lambda + pi
714  Double_t mlambda = v0->MassLambda();
715  Double_t malambda = v0->MassAntiLambda();
716  Double_t mLcLpi = d->InvMassLctoLambdaPi();
717 
718  Bool_t okLck0sp=kTRUE, okLcLpi=kTRUE, okLcLBarpi=kTRUE;
719  Bool_t okK0spipi=kTRUE, okLppi=kTRUE, okLBarpip=kTRUE;
720  Bool_t isNotK0S = kTRUE, isNotLambda = kTRUE, isNotLambdaBar = kTRUE, isNotGamma = kTRUE;
721 
722  // cut on Lc mass with K0S+p hypothesis
723  if (TMath::Abs(mLck0sp-mLcPDG) > fCutsRD[GetGlobalIndex(0,ptbin)]) okLck0sp = kFALSE;
724  // cuts on the V0 mass: K0S case
725  if (TMath::Abs(mk0s-mk0sPDG) > fCutsRD[GetGlobalIndex(2,ptbin)]) okK0spipi = kFALSE;
726  // cut on Lc mass with Lambda+pi hypothesis
727  if (TMath::Abs(mLcLpi-mLcPDG) > fCutsRD[GetGlobalIndex(1,ptbin)]) {
728  okLcLpi = kFALSE;
729  okLcLBarpi = kFALSE;
730  }
731 
732  // cuts on the V0 mass: Lambda/LambdaBar case
733  if ( TMath::Abs(mlambda-mLPDG) > fCutsRD[GetGlobalIndex(3,ptbin)]) okLppi = kFALSE;
734  if ( TMath::Abs(malambda-mLPDG) > fCutsRD[GetGlobalIndex(3,ptbin)]) okLBarpip = kFALSE;
735 
736  // cut on K0S invariant mass veto
737  if (TMath::Abs(v0->MassK0Short()-mk0sPDG) < fCutsRD[GetGlobalIndex(12,ptbin)]) isNotK0S=kFALSE;
738  // cut on Lambda/LambdaBar invariant mass veto
739  if (TMath::Abs(v0->MassLambda()-mLPDG) < fCutsRD[GetGlobalIndex(13,ptbin)]) isNotLambda=kFALSE;
740  if (TMath::Abs(v0->MassAntiLambda()-mLPDG) < fCutsRD[GetGlobalIndex(13,ptbin)]) isNotLambdaBar=kFALSE;
741 
742  // cut on gamma invariant mass veto
743  if (v0->InvMass2Prongs(0,1,11,11) < fCutsRD[GetGlobalIndex(14,ptbin)]) isNotGamma=kFALSE;
744 
745  okLck0sp = okLck0sp && okK0spipi && isNotLambda && isNotLambdaBar && isNotGamma;
746  okLcLpi = okLcLpi && okLppi && isNotK0S && isNotLambdaBar && isNotGamma;
747  okLcLBarpi = okLcLBarpi && okLBarpip && isNotK0S && isNotLambda && isNotGamma;
748 
749  if (!okLck0sp && !okLcLpi && !okLcLBarpi) return 0;
750 
751 
752  // cut on V0 dca (prong-to-prong)
753  if ( TMath::Abs(v0->GetDCA()) > fCutsRD[GetGlobalIndex(8,ptbin)]) return 0;
754 
755 
756  return kTRUE;
757 
758 }
759 //---------------------------------------------------------------------------
761 
762  // fPidHF -> PID object for bachelor
763 
764  if (!fUsePID || !obj) {
765  AliDebug(2,"PID selection inactive. Candidate accepted.");
766  return 7; // all hypothesis are valid
767  }
768 
770 
771  AliAODv0 * v0 = dynamic_cast<AliAODv0*>(objD->Getv0());
772  if ( v0 && ((v0->GetOnFlyStatus() == kTRUE && GetV0Type() == AliRDHFCuts::kOnlyOfflineV0s) ||
773  (v0->GetOnFlyStatus() == kFALSE && GetV0Type() == AliRDHFCuts::kOnlyOnTheFlyV0s)) ) return 0;
774 
775  AliAODTrack *bachelor = (AliAODTrack*)objD->GetBachelor();
776  AliAODTrack *v0Pos = (AliAODTrack*)objD->Getv0PositiveTrack();
777  AliAODTrack *v0Neg = (AliAODTrack*)objD->Getv0NegativeTrack();
778 
779  if (!bachelor || !v0Pos || !v0Neg) return 0;
780 
781  Bool_t okLcK0Sp = kTRUE; // K0S case
782  Bool_t okLcLambdaBarPi = kTRUE; // LambdaBar case
783  Bool_t okLcLambdaPi = kTRUE; // Lambda case
784 
785  Double_t ptCand = objD->Pt();
786  Int_t candPtBin = PtBin(ptCand);
787  CheckPID(candPtBin,bachelor,v0Neg,v0Pos,okLcK0Sp,okLcLambdaBarPi,okLcLambdaPi);
788 
789  Int_t returnvalue = okLcK0Sp+2*okLcLambdaBarPi+4*okLcLambdaPi;
790 
791  return returnvalue;
792 }
793 //-----------------------
794 void AliRDHFCutsLctoV0::CheckPID(Int_t candPtBin, AliAODTrack *bachelor,
795  AliAODTrack * /*v0Neg*/, AliAODTrack * /*v0Pos*/,
796  Bool_t &isBachelorID1, Bool_t &isBachelorID2, Bool_t &isBachelorID4) {
797  // identification strategy
798 
799  Int_t idxIDbyTOF = -1;
800  Int_t idxIDbyTPC = -1;
801 
802  Int_t tpcID = -1;
803  Int_t tofID = -1;
804  Double_t nTPCsigmas = -999;
805  Double_t nTOFsigmas = -999;
806 
807  Bool_t trackIDByTOF = -1;
808  Bool_t trackIDByTPC = -1;
809 
810  Bool_t dummy = kFALSE;
811 
812  switch (fPidSelectionFlag) {
813 
814  case 0:
815 
816  // identify bachelor
817  idxIDbyTOF = fPidHF->ApplyPidTOFRaw(bachelor,4);
818  idxIDbyTPC = fPidHF->ApplyPidTPCRaw(bachelor,4);
819  isBachelorID1 = (idxIDbyTOF==4) && (idxIDbyTPC==4); // K0S case
820 
821  idxIDbyTOF = fPidHF->ApplyPidTOFRaw(bachelor,2);
822  idxIDbyTPC = fPidHF->ApplyPidTPCRaw(bachelor,2);
823  isBachelorID2 = (idxIDbyTOF==2) && (idxIDbyTPC==2); // LambdaBar case
824 
825  isBachelorID4 = isBachelorID2; // Lambda case
826 
827  break;
828 
829  case 1:
830 
831  // identify bachelor
832  idxIDbyTOF = fPidHF->ApplyPidTOFRaw(bachelor,4);
833  idxIDbyTPC = fPidHF->ApplyPidTPCRaw(bachelor,4);
834  dummy = ( !(fPidHF->CheckTOFPIDStatus(bachelor)) && (idxIDbyTPC==4) &&
835  fPidHF->IsExcluded(bachelor,2,2.,"TPC") && fPidHF->IsExcluded(bachelor,3,2.,"TPC") ); // K0S case
836  isBachelorID1 = ( (idxIDbyTOF==4) || dummy );
837 
838  idxIDbyTOF = fPidHF->ApplyPidTOFRaw(bachelor,2);
839  idxIDbyTPC = fPidHF->ApplyPidTPCRaw(bachelor,2);
840  dummy = ( !(fPidHF->CheckTOFPIDStatus(bachelor)) && (idxIDbyTPC==2) &&
841  fPidHF->IsExcluded(bachelor,3,2.,"TPC") && fPidHF->IsExcluded(bachelor,4,2.,"TPC") ); // LambdaBar case
842  isBachelorID2 = ( (idxIDbyTOF==2) || dummy );
843 
844  isBachelorID4 = isBachelorID2; // Lambda case
845 
846  break;
847 
848  case 2:
849 
850  // identify bachelor
851  nTOFsigmas = -999;
852  tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
853  nTPCsigmas = -999;
854  tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
855  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
856  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
857  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) ||
858  (bachelor->P()>=fLowPtCut && TMath::Abs(nTPCsigmas)<3) ) );
859  isBachelorID1 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && trackIDByTPC && trackIDByTOF); // K0S case
860 
861  nTOFsigmas = -999;
862  tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
863  nTPCsigmas = -999;
864  tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
865  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
866  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
867  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) ||
868  (bachelor->P()>=fLowPtCut && TMath::Abs(nTPCsigmas)<3) ) );
869  isBachelorID2 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && trackIDByTPC && trackIDByTOF); // LambdaBar case
870 
871  isBachelorID4 = isBachelorID2; // Lambda case
872 
873  break;
874 
875  case 3:
876 
877  // identify bachelor
878  nTOFsigmas = -999;
879  tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
880  nTPCsigmas = -999;
881  tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
882  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
883  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
884  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) ||
885  (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTPCsigmas)<3) ||
886  (bachelor->P()>=fHighPtCut && nTPCsigmas>-3 && nTPCsigmas<2) ) );
887  isBachelorID1 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && trackIDByTPC && trackIDByTOF); // K0S case
888 
889  nTOFsigmas = -999;
890  tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
891  nTPCsigmas = -999;
892  tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
893  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
894  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
895  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) ||
896  (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTPCsigmas)<3) ||
897  (bachelor->P()>=fHighPtCut && nTPCsigmas>-3 && nTPCsigmas<2) ) );
898  isBachelorID2 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && trackIDByTPC && trackIDByTOF); // LambdaBar case
899 
900  isBachelorID4 = isBachelorID2; // Lambda case
901 
902  break;
903 
904  case 4:
905 
906  // identify bachelor
907  nTOFsigmas = -999;
908  tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
909  nTPCsigmas = -999;
910  tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
911  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
912  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
913  trackIDByTPC = ( (tpcID==1) && (TMath::Abs(nTPCsigmas)<2) );
914  isBachelorID1 = ( (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && trackIDByTOF) ); // K0S case
915 
916  nTOFsigmas = -999;
917  tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
918  nTPCsigmas = -999;
919  tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
920  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
921  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
922  trackIDByTPC = ( (tpcID==1) && (TMath::Abs(nTPCsigmas)<2) );
923  isBachelorID2 = ( (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && trackIDByTOF) ); // LambdaBar case
924 
925  isBachelorID4 = isBachelorID2; // Lambda case
926 
927  break;
928 
929  case 5:
930 
931  // identify bachelor
932  nTOFsigmas = -999;
933  tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
934  nTPCsigmas = -999;
935  tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
936  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
937  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
938  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) || (bachelor->P()>=fHighPtCut && tofID!=1 && TMath::Abs(nTPCsigmas)<3) ) );
939  isBachelorID1 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && trackIDByTOF) || (bachelor->P()>=fHighPtCut && (trackIDByTOF || trackIDByTPC) ); // K0S case
940 
941  nTOFsigmas = -999;
942  tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
943  nTPCsigmas = -999;
944  tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
945  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
946  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
947  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) || (bachelor->P()>=fHighPtCut && tofID!=1 && TMath::Abs(nTPCsigmas)<3) ) );
948  isBachelorID2 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && trackIDByTOF) || (bachelor->P()>=fHighPtCut && (trackIDByTOF || trackIDByTPC) ); // LambdaBar case
949 
950  isBachelorID4 = isBachelorID2; // Lambda case
951 
952  break;
953 
954  case 6:
955 
956  // identify bachelor
957  nTOFsigmas = -999;
958  tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
959  nTPCsigmas = -999;
960  tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
961  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
962  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
963  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) || (bachelor->P()>=fHighPtCut && tofID!=1 && nTPCsigmas>-3 && nTPCsigmas<2) ) );
964  isBachelorID1 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && trackIDByTOF) || (bachelor->P()>=fHighPtCut && (trackIDByTOF || trackIDByTPC) ); // K0S case
965 
966  nTOFsigmas = -999;
967  tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
968  nTPCsigmas = -999;
969  tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
970  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
971  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
972  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) || (bachelor->P()>=fHighPtCut && tofID!=1 && nTPCsigmas>-3 && nTPCsigmas<2) ) );
973  isBachelorID2 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && trackIDByTOF) || (bachelor->P()>=fHighPtCut && (trackIDByTOF || trackIDByTPC) ); // LambdaBar case
974 
975  isBachelorID4 = isBachelorID2; // Lambda case
976 
977  break;
978 
979  case 7:
980 
981  // identify bachelor
982  nTOFsigmas = -999;
983  tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
984  nTPCsigmas = -999;
985  tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
986  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
987  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
988  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) || (bachelor->P()>=fLowPtCut && tofID!=1 && TMath::Abs(nTPCsigmas)<3) ) );
989  isBachelorID1 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && (trackIDByTOF || trackIDByTPC) ); // K0S case
990 
991  nTOFsigmas = -999;
992  tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
993  nTPCsigmas = -999;
994  tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
995  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
996  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
997  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) || (bachelor->P()>=fHighPtCut && tofID!=1 && TMath::Abs(nTPCsigmas)<3) ) );
998  isBachelorID2 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && (trackIDByTOF || trackIDByTPC) ); // LambdaBar case
999 
1000  isBachelorID4 = isBachelorID2; // Lambda case
1001 
1002  break;
1003 
1004  case 8:
1005 
1006  // identify bachelor
1007  nTOFsigmas = -999;
1008  tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
1009  nTPCsigmas = -999;
1010  tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
1011  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
1012  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
1013  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) || (bachelor->P()>=fLowPtCut && tofID!=1 && nTPCsigmas>-3 && nTPCsigmas<2) ) );
1014  isBachelorID1 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && (trackIDByTOF || trackIDByTPC) ); // K0S case
1015 
1016  nTOFsigmas = -999;
1017  tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
1018  nTPCsigmas = -999;
1019  tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
1020  trackIDByTOF = ( (tofID==1) && ( (bachelor->P()>=fLowPtCut && bachelor->P()<fHighPtCut && TMath::Abs(nTOFsigmas)<3) ||
1021  (bachelor->P()>=fHighPtCut && nTOFsigmas>-2 && nTOFsigmas<3) ) );
1022  trackIDByTPC = ( (tpcID==1) && ( (bachelor->P()<fLowPtCut && TMath::Abs(nTPCsigmas)<2) || (bachelor->P()>=fHighPtCut && tofID!=1 && nTPCsigmas>-3 && nTPCsigmas<2) ) );
1023  isBachelorID2 = (bachelor->P()<fLowPtCut && trackIDByTPC) || (bachelor->P()>=fLowPtCut && (trackIDByTOF || trackIDByTPC) ); // LambdaBar case
1024 
1025  isBachelorID4 = isBachelorID2; // Lambda case
1026 
1027  break;
1028 
1029  case 9:
1030  {
1031  // identify bachelor
1032  fPidHF->GetPidCombined()->SetDefaultTPCPriors();
1033  fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC+AliPIDResponse::kDetTOF);
1034  Double_t probTPCTOF[AliPID::kSPECIES]={-1.};
1035  UInt_t detUsed = fPidHF->GetPidCombined()->ComputeProbabilities(bachelor, fPidHF->GetPidResponse(), probTPCTOF);
1036  Double_t probProton = -1.;
1037  Double_t probPion = -1.;
1038  if (detUsed == (UInt_t)fPidHF->GetPidCombined()->GetDetectorMask() ) {
1039  probProton = probTPCTOF[AliPID::kProton];
1040  probPion = probTPCTOF[AliPID::kPion];
1041  }
1042  else { // if you don't have both TOF and TPC, try only TPC
1043  fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC);
1044  detUsed = fPidHF->GetPidCombined()->ComputeProbabilities(bachelor, fPidHF->GetPidResponse(), probTPCTOF);
1045  if (detUsed == (UInt_t)fPidHF->GetPidCombined()->GetDetectorMask()) {
1046  probProton = probTPCTOF[AliPID::kProton];
1047  probPion = probTPCTOF[AliPID::kPion];
1048  }
1049  fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC+AliPIDResponse::kDetTOF);
1050  }
1051 
1052  isBachelorID1=(probProton>fMinCombinedProbability[candPtBin]); // K0S case
1053 
1054  isBachelorID2=(probPion>fMinCombinedProbability[candPtBin]); // LambdaBar case
1055 
1056  isBachelorID4 = isBachelorID2; // Lambda case
1057  }
1058  break;
1059 
1060  case 10:
1061 
1062  // identify bachelor
1063  nTOFsigmas = -999;
1064  tofID = fPidHF->GetnSigmaTOF(bachelor,4,nTOFsigmas);
1065  nTPCsigmas = -999;
1066  tpcID = fPidHF->GetnSigmaTPC(bachelor,4,nTPCsigmas);
1067 
1068  isBachelorID1 = kFALSE;
1069  if(TMath::Abs(nTPCsigmas)<3. && TMath::Abs(nTOFsigmas)<3.){
1070  isBachelorID1 = !(bachelor->Pt()>fLowPtCut&& nTOFsigmas<-2.) && !(bachelor->Pt()>fLowPtCut&& nTPCsigmas>2.);
1071  }
1072 
1073  nTOFsigmas = -999;
1074  tofID = fPidHF->GetnSigmaTOF(bachelor,2,nTOFsigmas);
1075  nTPCsigmas = -999;
1076  tpcID = fPidHF->GetnSigmaTPC(bachelor,2,nTPCsigmas);
1077 
1078  isBachelorID2 = TMath::Abs(nTPCsigmas)<3. && TMath::Abs(nTOFsigmas)<3.;
1079  isBachelorID4 = isBachelorID2;
1080 
1081  break;
1082 
1083  }
1084 
1085 }
1086 //----------------
1087 Int_t AliRDHFCutsLctoV0::CombineCuts(Int_t returnvalueTrack, Int_t returnvalue, Int_t returnvaluePID) const {
1088  //
1089  // combine track selection, topological cuts and PID
1090  //
1091 
1092  Int_t returnvalueTot=returnvalueTrack&returnvalue;
1093  returnvalueTot=returnvalueTot&returnvaluePID;
1094 
1095  return returnvalueTot;
1096 }
1097 
1098 //----------------------------------
1100  //
1101  // Apply selection on single cut
1102  //
1103 
1104  if (!fCutsRD) {
1105  AliDebug(2,"Cut matrice not inizialized. Exit...");
1106  return 0;
1107  }
1108 
1110  if (!d) {
1111  AliDebug(2,"AliAODRecoCascadeHF null");
1112  return 0;
1113  }
1114 
1115  if (!d->GetSecondaryVtx()) {
1116  AliDebug(2,"No secondary vertex for cascade");
1117  return 0;
1118  }
1119 
1120  if (d->GetNDaughters()!=2) {
1121  AliDebug(2,Form("No 2 daughters for current cascade (nDaughters=%d)",d->GetNDaughters()));
1122  return 0;
1123  }
1124 
1125  AliAODv0 * v0 = dynamic_cast<AliAODv0*>(d->Getv0());
1126  if ( v0 && ((v0->GetOnFlyStatus() == kTRUE && GetV0Type() == AliRDHFCuts::kOnlyOfflineV0s) ||
1127  (v0->GetOnFlyStatus() == kFALSE && GetV0Type() == AliRDHFCuts::kOnlyOnTheFlyV0s)) ) return 0;
1128 
1129  AliAODTrack * bachelorTrack = dynamic_cast<AliAODTrack*>(d->GetBachelor());
1130  if (!v0 || !bachelorTrack) {
1131  AliDebug(2,"No V0 or no bachelor for current cascade");
1132  return 0;
1133  }
1134 
1135  if (bachelorTrack->GetID()<0) {
1136  AliDebug(2,Form("Bachelor has negative ID %d",bachelorTrack->GetID()));
1137  return 0;
1138  }
1139 
1140  if (!v0->GetSecondaryVtx()) {
1141  AliDebug(2,"No secondary vertex for V0 by cascade");
1142  return 0;
1143  }
1144 
1145  if (v0->GetNDaughters()!=2) {
1146  AliDebug(2,Form("No 2 daughters for V0 of current cascade (onTheFly=%d, nDaughters=%d)",v0->GetOnFlyStatus(),v0->GetNDaughters()));
1147  return 0;
1148  }
1149 
1150 
1151  // Get the V0 daughter tracks
1152  AliAODTrack *v0positiveTrack = dynamic_cast<AliAODTrack*>(d->Getv0PositiveTrack());
1153  AliAODTrack *v0negativeTrack = dynamic_cast<AliAODTrack*>(d->Getv0NegativeTrack());
1154  if (!v0positiveTrack || !v0negativeTrack ) {
1155  AliDebug(2,"No V0 daughters' objects");
1156  return 0;
1157  }
1158 
1159  if (v0positiveTrack->GetID()<0 || v0negativeTrack->GetID()<0) {
1160  AliDebug(2,Form("At least one of V0 daughters has negative ID %d %d",v0positiveTrack->GetID(),v0negativeTrack->GetID()));
1161  return 0;
1162  }
1163 
1164  //if(fUseTrackSelectionWithFilterBits && d->HasBadDaughters()) return 0;
1165  if ( fUseTrackSelectionWithFilterBits && !(bachelorTrack->TestFilterMask(BIT(4))) ) {
1166  AliDebug(2,"Check on the bachelor FilterBit: no BIT(4). Candidate rejected.");
1167  return 0;
1168  }
1169 
1170 
1171  // selection on daughter tracks
1172  if (selectionLevel==AliRDHFCuts::kAll ||
1173  selectionLevel==AliRDHFCuts::kTracks) {
1174 
1175  if (!AreLctoV0DaughtersSelected(d,aod)) return 0;
1176 
1177  }
1178 
1179  Bool_t okLck0sp=kFALSE, okLcLpi=kFALSE, okLcLBarpi=kFALSE;
1180 
1181  // selection on candidate
1182  if (selectionLevel==AliRDHFCuts::kAll ||
1183  selectionLevel==AliRDHFCuts::kCandidate) {
1184 
1185  Double_t pt = d->Pt();
1186  Int_t ptbin = PtBin(pt);
1187 
1188  Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
1189  Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
1190  Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
1191 
1192  // K0S + p
1193  Double_t mk0s = v0->MassK0Short();
1194  Double_t mLck0sp = d->InvMassLctoK0sP();
1195 
1196  // Lambda + pi
1197  Double_t mlambda = v0->MassLambda();
1198  Double_t malambda = v0->MassAntiLambda();
1199  Double_t mLcLpi = d->InvMassLctoLambdaPi();
1200 
1201  switch (cutIndex) {
1202  case 0:
1203  // cut on Lc mass with K0S+p hypothesis
1204  okLck0sp = TMath::Abs(mLck0sp-mLcPDG)<=fCutsRD[GetGlobalIndex(0,ptbin)];
1205  okLcLpi = kFALSE;
1206  okLcLBarpi = kFALSE;
1207  break;
1208  case 1:
1209  // cut on Lc mass with Lambda+pi hypothesis
1210  okLck0sp = kFALSE;
1211  okLcLpi = TMath::Abs(mLcLpi-mLcPDG)<=fCutsRD[GetGlobalIndex(1,ptbin)];
1212  okLcLBarpi = okLcLpi;
1213  break;
1214  case 2:
1215  // cuts on the V0 mass: K0S case
1216  okLck0sp = TMath::Abs(mk0s-mk0sPDG)<=fCutsRD[GetGlobalIndex(2,ptbin)];
1217  okLcLpi = kFALSE;
1218  okLcLBarpi = kFALSE;
1219  break;
1220  case 3:
1221  // cuts on the V0 mass: Lambda/LambdaBar case
1222  okLck0sp = kFALSE;
1223  okLcLpi = TMath::Abs(mlambda-mLPDG)<=fCutsRD[GetGlobalIndex(3,ptbin)];
1224  //okLcLpi = okLcLpi && (bachelorTrack->Charge()==+1);
1225  okLcLBarpi = TMath::Abs(malambda-mLPDG)<=fCutsRD[GetGlobalIndex(3,ptbin)];
1226  //okLcLBarpi = okLcLBarpi && (bachelorTrack->Charge()==-1);
1227  break;
1228  case 4:
1229  // cuts on the minimum pt of bachelor
1230  okLck0sp = TMath::Abs(bachelorTrack->Pt())>=fCutsRD[GetGlobalIndex(4,ptbin)];
1231  okLcLpi = okLck0sp;
1232  okLcLBarpi = okLck0sp;
1233  break;
1234  case 5:
1235  // cuts on the minimum pt of positive V0daughter
1236  okLck0sp = TMath::Abs(v0positiveTrack->Pt())>=fCutsRD[GetGlobalIndex(5,ptbin)];
1237  okLcLpi = okLck0sp;
1238  okLcLBarpi = okLck0sp;
1239  break;
1240  case 6:
1241  // cuts on the minimum pt of negative V0daughter
1242  okLck0sp = TMath::Abs(v0negativeTrack->Pt())>=fCutsRD[GetGlobalIndex(6,ptbin)];
1243  okLcLpi = okLck0sp;
1244  okLcLBarpi = okLck0sp;
1245  break;
1246  case 7:
1247  // cut on cascade dca
1248  okLck0sp = TMath::Abs(d->GetDCA())<=fCutsRD[GetGlobalIndex(7,ptbin)];
1249  okLcLpi = okLck0sp;
1250  okLcLBarpi = okLck0sp;
1251  break;
1252  case 8:
1253  // cut on V0 dca
1254  okLck0sp = TMath::Abs(v0->GetDCA())<=fCutsRD[GetGlobalIndex(8,ptbin)];
1255  okLcLpi = okLck0sp;
1256  okLcLBarpi = okLck0sp;
1257  break;
1258  case 9:
1259  // cut on V0 cosine of pointing angle wrt PV
1260  okLck0sp = d->CosV0PointingAngle()>=fCutsRD[GetGlobalIndex(9,ptbin)];
1261  okLcLpi = okLck0sp;
1262  okLcLBarpi = okLck0sp;
1263  break;
1264  case 10:
1265  // cut on bachelor transverse impact parameter wrt PV
1266  okLck0sp = TMath::Abs(d->Getd0Prong(0))<=fCutsRD[GetGlobalIndex(10,ptbin)];
1267  okLcLpi = okLck0sp;
1268  okLcLBarpi = okLck0sp;
1269  break;
1270  case 11:
1271  // cut on V0 transverse impact parameter wrt PV
1272  okLck0sp = TMath::Abs(d->Getd0Prong(1))<=fCutsRD[GetGlobalIndex(11,ptbin)];
1273  okLcLpi = okLck0sp;
1274  okLcLBarpi = okLck0sp;
1275  break;
1276  case 12:
1277  // cut on K0S invariant mass veto
1278  okLcLpi = TMath::Abs(mk0s-mk0sPDG)>=fCutsRD[GetGlobalIndex(12,ptbin)];
1279  okLcLBarpi = TMath::Abs(mk0s-mk0sPDG)>=fCutsRD[GetGlobalIndex(12,ptbin)];
1280  break;
1281  case 13:
1282  // cut on Lambda/LambdaBar invariant mass veto
1283  okLck0sp = (TMath::Abs(mlambda-mLPDG)>=fCutsRD[GetGlobalIndex(13,ptbin)] &&
1284  TMath::Abs(malambda-mLPDG)>=fCutsRD[GetGlobalIndex(13,ptbin)]);
1285  break;
1286  case 14:
1287  // cut on gamma invariant mass veto
1288  okLck0sp = v0->InvMass2Prongs(0,1,11,11)>=fCutsRD[GetGlobalIndex(14,ptbin)];
1289  okLcLpi = okLck0sp;
1290  okLcLBarpi = okLck0sp;
1291  break;
1292  case 15:
1293  // cut on V0 pT min
1294  okLck0sp = v0->Pt()>=fCutsRD[GetGlobalIndex(15,ptbin)];
1295  okLcLpi = okLck0sp;
1296  okLcLBarpi = okLck0sp;
1297  break;
1298  case 16:
1299  okLck0sp = (TMath::Abs(fCutsRD[GetGlobalIndex(16,ptbin)])<1.1)&&(GetProtonEmissionAngleCMS(d)<= fCutsRD[GetGlobalIndex(16,ptbin)]);
1300  okLcLpi = okLck0sp;
1301  okLcLBarpi = okLck0sp;
1302  break;
1303  case 17:
1304  okLck0sp = (TMath::Abs(fCutsRD[GetGlobalIndex(17,ptbin)])<1.1)&&(GetProtonEmissionAngleCMS(d)>= fCutsRD[GetGlobalIndex(17,ptbin)]);
1305  okLcLpi = okLck0sp;
1306  okLcLBarpi = okLck0sp;
1307  break;
1308  case 18:
1309  okLck0sp = (TMath::Abs(fCutsRD[GetGlobalIndex(18,ptbin)])<0.2)&&(GetReSignedd0(d)>= fCutsRD[GetGlobalIndex(18,ptbin)]);
1310  okLcLpi = okLck0sp;
1311  okLcLBarpi = okLck0sp;
1312  break;
1313  case 19:
1314  okLck0sp = (TMath::Abs(fCutsRD[GetGlobalIndex(19,ptbin)])<0.3)&&(v0->PtArmV0()/TMath::Abs(v0->AlphaV0()) >= fCutsRD[GetGlobalIndex(19,ptbin)]);
1315  okLcLpi = okLck0sp;
1316  okLcLBarpi = okLck0sp;
1317  break;
1318  }
1319  }
1320 
1321  Int_t returnvalue = okLck0sp+2*okLcLBarpi+4*okLcLpi;
1322  /*
1323  retvalue case
1324  1 Lc->K0S + p
1325  2 Lc->LambdaBar + pi
1326  3 Lc->K0S + p AND Lc->LambdaBar + pi
1327  4 Lc->Lambda + pi
1328  5 Lc->K0S + p AND Lc->Lambda + pi
1329  6 Lc->LambdaBar + pi AND Lc->Lambda + pi
1330  7 Lc->K0S + p AND Lc->LambdaBar + pi AND Lc->Lambda + pi
1331  */
1332 
1333 
1334  /*
1335  Int_t returnvaluePID = 7;
1336 
1337  // selection on PID
1338  if (selectionLevel==AliRDHFCuts::kAll ||
1339  selectionLevel==AliRDHFCuts::kCandidate ||
1340  selectionLevel==AliRDHFCuts::kPID )
1341  returnvaluePID = IsSelectedPID(d);
1342  */
1343 
1344  Int_t returnvalueTot = 0;
1345  //if ( fUsePID )
1346  //returnvalueTot = CombineCuts(returnvalue,returnvaluePID);
1347  //else
1348  returnvalueTot = returnvalue;
1349 
1350  return returnvalueTot;
1351 
1352 }
1353 //----------------------------------
1355 
1356  SetName("LctoV0ProductionCuts");
1357  SetTitle("Production cuts for Lc->V0+bachelor analysis");
1358 
1359  AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts();
1360  esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
1361  //default
1362  esdTrackCuts->SetRequireTPCRefit(kTRUE);
1363  esdTrackCuts->SetRequireITSRefit(kTRUE);
1364  esdTrackCuts->SetMinNClustersITS(0);//(4); // default is 5
1365  esdTrackCuts->SetMinNClustersTPC(70);
1366  //esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
1367  // AliESDtrackCuts::kAny);
1368  // default is kBoth, otherwise kAny
1369  esdTrackCuts->SetMinDCAToVertexXY(0.);
1370  esdTrackCuts->SetPtRange(0.3,1.e10);
1371  //esdTrackCuts->SetEtaRange(-0.8,+0.8);
1372  esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
1373  AddTrackCuts(esdTrackCuts);
1374  delete esdTrackCuts;
1375  esdTrackCuts=NULL;
1376 
1377 
1378  AliESDtrackCuts* esdTrackCutsV0daughters=new AliESDtrackCuts();
1379  esdTrackCutsV0daughters->SetRequireSigmaToVertex(kFALSE);
1380  //default
1381  esdTrackCutsV0daughters->SetRequireTPCRefit(kTRUE);
1382  esdTrackCutsV0daughters->SetRequireITSRefit(kFALSE);//(kTRUE);
1383  esdTrackCutsV0daughters->SetMinNClustersITS(0);//(4); // default is 5
1384  esdTrackCutsV0daughters->SetMinNClustersTPC(70);
1385  //esdTrackCutsV0daughters->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
1386  // AliESDtrackCuts::kAny);
1387  // default is kBoth, otherwise kAny
1388  esdTrackCutsV0daughters->SetMinDCAToVertexXY(0.);
1389  esdTrackCutsV0daughters->SetPtRange(0.,1.e10);
1390  esdTrackCutsV0daughters->SetAcceptKinkDaughters(kFALSE);
1391  AddTrackCutsV0daughters(esdTrackCutsV0daughters);
1392  delete esdTrackCutsV0daughters;
1393  esdTrackCutsV0daughters=NULL;
1394 
1395  const Int_t nptbins=1;
1396  Float_t* ptbins;
1397  ptbins=new Float_t[nptbins+1];
1398  ptbins[0]=0.;
1399  ptbins[1]=99999999.;
1400 
1401  SetPtBins(nptbins+1,ptbins);
1402  SetPtBins(nptbins+1,ptbins);
1403 
1404  const Int_t nvars=21;
1405 
1406  Float_t** prodcutsval;
1407  prodcutsval=new Float_t*[nvars];
1408  for(Int_t ic=0;ic<nvars;ic++){prodcutsval[ic]=new Float_t[nptbins];}
1409  for(Int_t ipt2=0;ipt2<nptbins;ipt2++){
1410  prodcutsval[0][ipt2]=1.; // inv. mass if K0S [GeV/c2]
1411  prodcutsval[1][ipt2]=1.; // inv. mass if Lambda [GeV/c2]
1412  prodcutsval[2][ipt2]=0.05; // inv. mass V0 if K0S [GeV/c2]
1413  prodcutsval[3][ipt2]=0.05; // inv. mass V0 if Lambda [GeV/c2]
1414  prodcutsval[4][ipt2]=0.3; // pT min bachelor track [GeV/c] // AOD by construction
1415  prodcutsval[5][ipt2]=0.; // pT min V0-positive track [GeV/c]
1416  prodcutsval[6][ipt2]=0.; // pT min V0-negative track [GeV/c]
1417  prodcutsval[7][ipt2]=1000.; // dca cascade cut [cm]
1418  prodcutsval[8][ipt2]=1.5; // dca V0 cut [nSigma] // it's 1.5 x offline V0s
1419  prodcutsval[9][ipt2]=-1.; // cosPA V0 cut // it's 0.90 x offline V0s at reconstruction level, 0.99 at filtering level
1420  prodcutsval[10][ipt2]=3.; // d0 max bachelor wrt PV [cm]
1421  prodcutsval[11][ipt2]=1000.;// d0 max V0 wrt PV [cm]
1422  prodcutsval[12][ipt2]=0.; // mass K0S veto [GeV/c2]
1423  prodcutsval[13][ipt2]=0.; // mass Lambda/LambdaBar veto [GeV/c2]
1424  prodcutsval[14][ipt2]=0.; // mass Gamma veto [GeV/c2]
1425  prodcutsval[15][ipt2]=0.; // pT min V0 track [GeV/c]
1426  prodcutsval[16][ipt2]=9999.;// max cos (Proton emission angle) cut
1427  prodcutsval[17][ipt2]=-9999.;// min cos (Proton emission angle) cut
1428  prodcutsval[18][ipt2]=-9999.;// Re-signed d0 [cm]
1429  prodcutsval[19][ipt2]=-9999.;// V0 armenteros qT/|alpha|
1430  prodcutsval[20][ipt2]=0.; // V0 type cut
1431  }
1432  SetCuts(nvars,nptbins,prodcutsval);
1433 
1434  SetGlobalIndex(nvars,nptbins);
1435  SetPtBins(nptbins+1,ptbins);
1436 
1437 
1438  //pid settings
1439  //1. bachelor: default one
1440  AliAODPidHF* pidObjBachelor = new AliAODPidHF();
1441  Double_t sigmasBac[5]={3.,1.,1.,3.,3.}; // 0, 1(A), 2(A) -> TPC; 3 -> TOF; 4 -> ITS
1442  pidObjBachelor->SetSigma(sigmasBac);
1443  pidObjBachelor->SetAsym(kFALSE);
1444  pidObjBachelor->SetMatch(1);
1445  pidObjBachelor->SetTPC(kTRUE);
1446  pidObjBachelor->SetTOF(kTRUE);
1447  pidObjBachelor->SetTOFdecide(kFALSE);
1448  SetPidHF(pidObjBachelor);
1449 
1450  SetUsePID(kFALSE);//(kTRUE);
1451 
1452  //PrintAll();
1453 
1454  for(Int_t iiv=0;iiv<nvars;iiv++){
1455  delete [] prodcutsval[iiv];
1456  }
1457  delete [] prodcutsval;
1458  prodcutsval=NULL;
1459  delete [] ptbins;
1460  ptbins=NULL;
1461 
1462 
1463  delete pidObjBachelor;
1464  pidObjBachelor=NULL;
1465 
1466  return;
1467 }
1468 //------------------
1470 
1471  SetName("LctoV0ProductionCuts");
1472  SetTitle("Production cuts for Lc->V0+bachelor analysis");
1473 
1475 
1476  return;
1477 }
1478 //------------------
1480 
1481  // Default 2010 PbPb cut object
1483 
1484  //
1485  // Enable all 2011 PbPb run triggers
1486  //
1487  SetTriggerClass("");
1491 
1492 }
1493 //-----------------------
1495 
1496  const Int_t nvars = this->GetNVars() ;
1497  //Float_t *vArray =GetCuts();
1498  //fV0Type = vArray[nvars-1];
1499  fV0Type = (this->GetCuts())[nvars-1];
1500  //this->GetCuts(vArray);
1501  TString *sVarNames=GetVarNames();
1502 
1503  if(sVarNames[nvars-1].Contains("V0 type")) return (Int_t)fV0Type;
1504  else {AliInfo("AliRDHFCutsLctoV0 Last variable is not the V0 type!!!"); return -999;}
1505 }
1506 
1507 //---------------------------------------------------------------------------
1509  //
1510  // print all cuts values
1511  //
1512 
1513  printf("Minimum vtx type %d\n",fMinVtxType);
1514  printf("Minimum vtx contr %d\n",fMinVtxContr);
1515  printf("Max vtx red chi2 %f\n",fMaxVtxRedChi2);
1516  printf("Min SPD mult %d\n",fMinSPDMultiplicity);
1517  printf("Use PID %d (PID selection flag = %d) OldPid=%d\n",(Int_t)fUsePID,(Int_t)fPidSelectionFlag,fPidHF ? fPidHF->GetOldPid() : -1);
1518  printf("High value for pT %f\n",fHighPtCut);
1519  printf("Low and high values for pT cuts: %f %f\n",fLowPtCut,fHighPtCut);
1520  printf("Remove daughters from vtx %d\n",(Int_t)fRemoveDaughtersFromPrimary);
1521  printf("Physics selection: %s\n",fUsePhysicsSelection ? "Yes" : "No");
1522  printf("Pileup rejection: %s\n",(fOptPileup > 0) ? "Yes" : "No");
1523  printf("UseTrackSelectionWithFilterBits: %s\n",fUseTrackSelectionWithFilterBits ? "Yes" : "No");
1524  printf("Reject kink: %s\n",fKinkReject ? "Yes" : "No");
1525  if(fOptPileup==1) printf(" -- Reject pileup event");
1526  if(fOptPileup==2) printf(" -- Reject tracks from pileup vtx");
1527  if(fUseCentrality>0) {
1528  TString estimator="";
1529  if(fUseCentrality==1) estimator = "V0";
1530  if(fUseCentrality==2) estimator = "Tracks";
1531  if(fUseCentrality==3) estimator = "Tracklets";
1532  if(fUseCentrality==4) estimator = "SPD clusters outer";
1533  printf("Centrality class considered: %.1f-%.1f, estimated with %s",fMinCentrality,fMaxCentrality,estimator.Data());
1534  }
1535  if(fIsCandTrackSPDFirst) printf("Check for candidates with pt < %2.2f, that daughters fullfill kFirst criteria\n",fMaxPtCandTrackSPDFirst);
1536 
1537  if(fVarNames){
1538  cout<<"Array of variables"<<endl;
1539  for(Int_t iv=0;iv<fnVars;iv++){
1540  cout<<fVarNames[iv]<<"\t";
1541  }
1542  cout<<endl;
1543  }
1544  if(fVarsForOpt){
1545  cout<<"Array of optimization"<<endl;
1546  for(Int_t iv=0;iv<fnVars;iv++){
1547  cout<<fVarsForOpt[iv]<<"\t";
1548  }
1549  cout<<endl;
1550  }
1551  if(fIsUpperCut){
1552  cout<<"Array of upper/lower cut"<<endl;
1553  for(Int_t iv=0;iv<fnVars;iv++){
1554  cout<<fIsUpperCut[iv]<<"\t";
1555  }
1556  cout<<endl;
1557  }
1558  if(fPtBinLimits){
1559  cout<<"Array of ptbin limits"<<endl;
1560  for(Int_t ib=0;ib<fnPtBinLimits;ib++){
1561  cout<<fPtBinLimits[ib]<<"\t";
1562  }
1563  cout<<endl;
1564  }
1565  if(fCutsRD){
1566  cout<<"Matrix of cuts"<<endl;
1567  for(Int_t iv=0;iv<fnVars;iv++){
1568  for(Int_t ib=0;ib<fnPtBins;ib++){
1569  cout<<"fCutsRD["<<iv<<"]["<<ib<<"] = "<<fCutsRD[GetGlobalIndex(iv,ib)]<<"\t";
1570  }
1571  cout<<endl;
1572  }
1573  cout<<endl;
1574  }
1575 
1576  if (fPidSelectionFlag==9) {
1577  for(Int_t ib=0;ib<fnPtBins;ib++){
1578  cout<<"fMinCombinedProbability["<<ib<<"] = "<<fMinCombinedProbability[ib]<<"\t";
1579  }
1580  cout<<endl;
1581  cout << " GetCombDetectors() = " << GetPidHF()->GetCombDetectors() << endl;
1582  }
1583 
1584  if (fTrackCuts) {
1585  Float_t eta1=0, eta2=0; fTrackCuts->GetEtaRange(eta1,eta2);
1586  cout << " etaRange for Bachelor: [" << eta1 << "," << eta2 << "]\n";
1587  }
1588  if (fV0daughtersCuts) {
1589  Float_t eta3=0, eta4=0; fV0daughtersCuts->GetEtaRange(eta3,eta4);
1590  cout << " etaRange for V0daughters: [" << eta3 << "," << eta4 << "]\n";
1591  }
1592  return;
1593 
1594 }
1595 
1596 //-------------------------
1598 {
1599  //
1600  //
1601  // Checking if Lc is in fiducial acceptance region
1602  //
1603  //
1604 
1605  if(fMaxRapidityCand>-998.){
1606  if(TMath::Abs(y) > fMaxRapidityCand) return kFALSE;
1607  else return kTRUE;
1608  }
1609 
1610  if(pt > 5.) {
1611  // applying cut for pt > 5 GeV
1612  AliDebug(2,Form("pt of Lambda_c = %f (> 5), cutting at |y| < 0.8",pt));
1613  if (TMath::Abs(y) > 0.8) return kFALSE;
1614 
1615  } else {
1616  // appliying smooth cut for pt < 5 GeV
1617  Double_t maxFiducialY = -0.2/15*pt*pt+1.9/15*pt+0.5;
1618  Double_t minFiducialY = 0.2/15*pt*pt-1.9/15*pt-0.5;
1619  AliDebug(2,Form("pt of Lambda_c = %f (< 5), cutting according to the fiducial zone [%f, %f]\n",pt,minFiducialY,maxFiducialY));
1620  if (y < minFiducialY || y > maxFiducialY) return kFALSE;
1621  }
1622  //
1623  return kTRUE;
1624 }
1625 //---------------------------------------------------------------------------
1627  //
1628  // Daughter tracks selection
1629  //
1630 
1632  if (!d) {
1633  AliDebug(2,"AliAODRecoCascadeHF null");
1634  return kFALSE;
1635  }
1636 
1637  if (!fTrackCuts) {
1638  AliFatal("Cut object is not defined for bachelor. Candidate accepted.");
1639  return kFALSE;
1640  }
1641 
1642  AliAODTrack * bachelorTrack = dynamic_cast<AliAODTrack*>(d->GetBachelor());
1643  if (!bachelorTrack) return kFALSE;
1644 
1646  if(!bachelorTrack->HasPointOnITSLayer(0)) return kFALSE;
1647  }
1648 
1649  if (fKinkReject != (!(fTrackCuts->GetAcceptKinkDaughters())) ) {
1650  AliError(Form("Not compatible setting: fKinkReject=%1d - fTrackCuts->GetAcceptKinkDaughters()=%1d",fKinkReject, fTrackCuts->GetAcceptKinkDaughters()));
1651  return kFALSE;
1652  }
1653 
1654  AliAODVertex *vAOD = d->GetPrimaryVtx();
1655  Double_t pos[3]; vAOD->GetXYZ(pos);
1656  Double_t cov[6]; vAOD->GetCovarianceMatrix(cov);
1657  const AliESDVertex vESD(pos,cov,100.,100);
1658 
1659  if (!IsDaughterSelected(bachelorTrack,&vESD,fTrackCuts,aod)) return kFALSE;
1660 
1661  if (!fV0daughtersCuts) {
1662  AliFatal("Cut object is not defined for V0daughters. Candidate accepted.");
1663  return kFALSE;
1664  }
1665 
1666  AliAODv0 * v0 = dynamic_cast<AliAODv0*>(d->Getv0());
1667  if (!v0) return kFALSE;
1668  AliAODTrack *v0positiveTrack = dynamic_cast<AliAODTrack*>(d->Getv0PositiveTrack());
1669  if (!v0positiveTrack) return kFALSE;
1670  AliAODTrack *v0negativeTrack = dynamic_cast<AliAODTrack*>(d->Getv0NegativeTrack());
1671  if (!v0negativeTrack) return kFALSE;
1672 
1673 
1674  Float_t etaMin=0, etaMax=0; fV0daughtersCuts->GetEtaRange(etaMin,etaMax);
1675  if ( (v0positiveTrack->Eta()<=etaMin || v0positiveTrack->Eta()>=etaMax) ||
1676  (v0negativeTrack->Eta()<=etaMin || v0negativeTrack->Eta()>=etaMax) ) return kFALSE;
1677  Float_t ptMin=0, ptMax=0; fV0daughtersCuts->GetPtRange(ptMin,ptMax);
1678  if ( (v0positiveTrack->Pt()<=ptMin || v0positiveTrack->Pt()>=ptMax) ||
1679  (v0negativeTrack->Pt()<=ptMin || v0negativeTrack->Pt()>=ptMax) ) return kFALSE;
1680 
1681  // Condition on nTPCclusters
1682  if (fV0daughtersCuts->GetMinNClusterTPC()>0) {
1683  if ( ( ( v0positiveTrack->GetTPCClusterInfo(2,1) ) < fV0daughtersCuts->GetMinNClusterTPC() ) ||
1684  ( ( v0negativeTrack->GetTPCClusterInfo(2,1) ) < fV0daughtersCuts->GetMinNClusterTPC() ) ) return kFALSE;
1685  }
1686 
1687  if (fV0daughtersCuts->GetMinRatioCrossedRowsOverFindableClustersTPC()>0.5) {
1688  Float_t ratioCrossedRowsOverFindableClustersTPCPos = 1.0;
1689  Float_t ratioCrossedRowsOverFindableClustersTPCNeg = 1.0;
1690  if (v0positiveTrack->GetTPCNclsF()>0) {
1691  ratioCrossedRowsOverFindableClustersTPCPos = v0positiveTrack->GetTPCClusterInfo(2,1) / v0positiveTrack->GetTPCNclsF();
1692  }
1693  if (v0negativeTrack->GetTPCNclsF()>0) {
1694  ratioCrossedRowsOverFindableClustersTPCNeg = v0negativeTrack->GetTPCClusterInfo(2,1) / v0negativeTrack->GetTPCNclsF();
1695  }
1696  if ( ( ( ratioCrossedRowsOverFindableClustersTPCPos ) < fV0daughtersCuts->GetMinRatioCrossedRowsOverFindableClustersTPC() ) ||
1697  ( ( ratioCrossedRowsOverFindableClustersTPCNeg ) < fV0daughtersCuts->GetMinRatioCrossedRowsOverFindableClustersTPC() ) ) return kFALSE;
1698  }
1699 
1700  // kTPCrefit status
1701  if (v0->GetOnFlyStatus()==kFALSE) { // only for offline V0s
1702  if (fV0daughtersCuts->GetRequireTPCRefit()) {
1703  if( !(v0positiveTrack->GetStatus() & AliESDtrack::kTPCrefit)) return kFALSE;
1704  if( !(v0negativeTrack->GetStatus() & AliESDtrack::kTPCrefit)) return kFALSE;
1705  }
1706  }
1707  // kink condition
1708  if (!fV0daughtersCuts->GetAcceptKinkDaughters()) {
1709  AliAODVertex *maybeKinkPos = (AliAODVertex*)v0positiveTrack->GetProdVertex();
1710  AliAODVertex *maybeKinkNeg = (AliAODVertex*)v0negativeTrack->GetProdVertex();
1711  if (maybeKinkPos->GetType()==AliAODVertex::kKink ||
1712  maybeKinkNeg->GetType()==AliAODVertex::kKink) return kFALSE;
1713  }
1714  // Findable clusters > 0 condition - from V0 analysis
1715  //if( v0positiveTrack->GetTPCNclsF()<=0 || v0negativeTrack->GetTPCNclsF()<=0 ) return kFALSE;
1716  /*
1717  Float_t lPosTrackCrossedRows = v0positiveTrack->GetTPCClusterInfo(2,1);
1718  Float_t lNegTrackCrossedRows = v0positiveTrack->GetTPCClusterInfo(2,1);
1719  fTreeVariableLeastNbrCrossedRows = (Int_t) lPosTrackCrossedRows;
1720  if( lNegTrackCrossedRows < fTreeVariableLeastNbrCrossedRows )
1721  fTreeVariableLeastNbrCrossedRows = (Int_t) lNegTrackCrossedRows;
1722  //Compute ratio Crossed Rows / Findable clusters
1723  //Note: above test avoids division by zero!
1724  Float_t lPosTrackCrossedRowsOverFindable = lPosTrackCrossedRows / ((double)(pTrack->GetTPCNclsF()));
1725  Float_t lNegTrackCrossedRowsOverFindable = lNegTrackCrossedRows / ((double)(nTrack->GetTPCNclsF()));
1726  fTreeVariableLeastRatioCrossedRowsOverFindable = lPosTrackCrossedRowsOverFindable;
1727  if( lNegTrackCrossedRowsOverFindable < fTreeVariableLeastRatioCrossedRowsOverFindable )
1728  fTreeVariableLeastRatioCrossedRowsOverFindable = lNegTrackCrossedRowsOverFindable;
1729  //Lowest Cut Level for Ratio Crossed Rows / Findable = 0.8, set here
1730  if ( fTreeVariableLeastRatioCrossedRowsOverFindable < 0.8 ) return kFALSE;
1731  */
1732 
1733  return kTRUE;
1734 
1735 }
1736 
1737 //---------------------------------------------------------------------------
1739  //
1740  // store the combined probability cuts
1741  //
1742  if(nPtBins!=fnPtBins) {
1743  printf("Wrong number of pt bins: it has to be %d\n",fnPtBins);
1744  AliFatal("exiting");
1745  }
1746 
1748 
1749  for(Int_t ib=0; ib<fnPtBins; ib++) {
1750  fMinCombinedProbability[ib] = minProb[ib];
1751  }
1752  return;
1753 }
1754 
1755 //---------------------------------------------------------------------------
1757  //
1758  // Proton emission angle in p+K0s pair rest frame
1759  // This function is different from CosThetaStar function in AliAODRecoDecay,
1760  // which assumes the mass of Lc even for the pairs with the invariant mass
1761  // far from Lc mass
1762  //
1764  if (!d) {
1765  AliDebug(2,"AliAODRecoCascadeHF null");
1766  return -9999;
1767  }
1768  Double_t mprPDG = TDatabasePDG::Instance()->GetParticle(2212)->Mass();
1769  Double_t mlcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
1770  Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
1771 
1772  TLorentzVector vpr, vk0s,vlc;
1773  vpr.SetXYZM(d->PxProng(0),d->PyProng(0),d->PzProng(0),mprPDG);
1774  vk0s.SetXYZM(d->PxProng(1),d->PyProng(1),d->PzProng(1),mk0sPDG);
1775  vlc = vpr + vk0s;
1776  TVector3 vboost = vlc.BoostVector();
1777  vpr.Boost(-vboost);
1778  Double_t bachcosthe = cos(vpr.Angle(vlc.Vect()));
1779 
1780  return bachcosthe;
1781 }
1782 
1783 //---------------------------------------------------------------------------
1785  //
1786  // Sign of d0 different from regular d0.
1787  // Sign defined using the position of crossing point with Lc vector
1788  // with respect to the primary vertex
1789  //
1791  if (!d) {
1792  AliDebug(2,"AliAODRecoCascadeHF null");
1793  return -9999;
1794  }
1795 
1796  AliAODTrack * bachelorTrack = dynamic_cast<AliAODTrack*>(d->GetBachelor());
1797  AliAODVertex *primvert = dynamic_cast<AliAODVertex*>(d->GetPrimaryVtx());
1798 
1799  Double_t d0z0bach[2],covd0z0bach[3];
1800  bachelorTrack->PropagateToDCA(primvert,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
1801  Double_t tx[3];
1802  bachelorTrack->GetXYZ(tx);
1803  tx[0] -= primvert->GetX();
1804  tx[1] -= primvert->GetY();
1805  tx[2] -= primvert->GetZ();
1806  Double_t innerpro = tx[0]*d->Px()+tx[1]*d->Py();
1807  Double_t signd0 = 1.;
1808  if(innerpro<0.) signd0 = -1.;
1809 
1810  return signd0*TMath::Abs(d0z0bach[0]);
1811 }
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
float Float_t
Definition: External.C:68
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)
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)
ClassImp(AliAnalysisTaskDeltaPt) AliAnalysisTaskDeltaPt
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
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