AliPhysics  master (3d17d9d)
AliRDHFCutsXictopKpi.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 // \class for cuts on AOD reconstructed Xic->pKpi
20 // \First implementation by copying the AliRDHFCutsLctopKpi class
21 // \author Author: M. Faggin (mfaggin@cern.ch)
23 
24 #include <TDatabasePDG.h>
25 #include <Riostream.h>
26 #include <AliAnalysisManager.h>
27 #include <AliInputEventHandler.h>
28 #include <AliPIDResponse.h>
29 
30 #include "AliRDHFCutsXictopKpi.h"
32 #include "AliRDHFCuts.h"
33 #include "AliAODTrack.h"
34 #include "AliESDtrack.h"
35 #include "AliKFParticle.h"
36 #include "AliESDVertex.h"
37 #include "AliVertexerTracks.h"
38 
39 using std::cout;
40 using std::endl;
41 
43 ClassImp(AliRDHFCutsXictopKpi);
45 
46 //--------------------------------------------------------------------------
48 AliRDHFCuts(name),
49 fPidObjprot(0),
50 fPidObjpion(0),
51 fUseImpParProdCorrCut(kFALSE),
52 fPIDStrategy(kNSigma),
53 fCutsStrategy(kStandard),
54 fUseSpecialCut(kFALSE)
55 {
56  //
57  // Default Constructor
58  //
59  Int_t nvars=13;
60  SetNVars(nvars);
61  TString varNames[13]={"inv. mass [GeV]",
62  "pTK [GeV/c]",
63  "pTP [GeV/c]",
64  "d0K [cm] lower limit!",
65  "d0Pi [cm] lower limit!",
66  "dist12 (cm)",
67  "sigmavert (cm)",
68  "dist prim-sec (cm)",
69  "pM=Max{pT1,pT2,pT3} (GeV/c)",
70  "cosThetaPoint",
71  "Sum d0^2 (cm^2)",
72  "dca cut (cm)",
73  "cut on pTpion [GeV/c]"};
74  Bool_t isUpperCut[13]={kTRUE,
75  kFALSE,
76  kFALSE,
77  kFALSE,
78  kFALSE,
79  kFALSE,
80  kTRUE,
81  kFALSE,
82  kFALSE,
83  kFALSE,
84  kFALSE,
85  kTRUE,
86  kFALSE
87  };
88  SetVarNames(nvars,varNames,isUpperCut);
89  Bool_t forOpt[13]={kFALSE,
90  kTRUE,
91  kTRUE,
92  kFALSE,
93  kFALSE,
94  kFALSE,
95  kFALSE,
96  kTRUE,
97  kFALSE,
98  kFALSE,
99  kFALSE,
100  kFALSE,
101  kTRUE};
102  SetVarsForOpt(4,forOpt);
103  Float_t limits[2]={0,999999999.};
104  SetPtBins(2,limits);
105  for (Int_t ispecies=0;ispecies<AliPID::kSPECIES;++ispecies)
106  fPIDThreshold[ispecies]=0.;
107 }
108 //--------------------------------------------------------------------------
110  AliRDHFCuts(source),
111  fPidObjprot(0x0),
112  fPidObjpion(0x0),
114  fPIDStrategy(source.fPIDStrategy),
117 {
118  //
119  // Copy constructor
120  //
121  if (source.fPidObjprot) fPidObjprot = new AliAODPidHF(*(source.fPidObjprot));
122  else fPidObjprot = new AliAODPidHF();
123  if (source.fPidObjpion) fPidObjpion = new AliAODPidHF(*(source.fPidObjpion));
124  else fPidObjpion = new AliAODPidHF();
125  memcpy(fPIDThreshold,source.fPIDThreshold,AliPID::kSPECIES*sizeof(Double_t));
126 }
127 //--------------------------------------------------------------------------
129 {
130  //
131  // assignment operator
132  //
133  if(this != &source) {
134 
135  AliRDHFCuts::operator=(source);
136  delete fPidObjprot;
137  fPidObjprot = new AliAODPidHF(*(source.fPidObjprot));
138  delete fPidObjpion;
139  fPidObjpion = new AliAODPidHF(*(source.fPidObjpion));
140  fPIDStrategy=source.fPIDStrategy;
142  memcpy(fPIDThreshold,source.fPIDThreshold,AliPID::kSPECIES*sizeof(Double_t));
143  }
144 
145  return *this;
146 }
147 //---------------------------------------------------------------------------
149  //
150  // // Default Destructor
151  //
152  if(fPidObjpion){
153  delete fPidObjpion;
154  fPidObjpion=0;
155  }
156  if(fPidObjprot){
157  delete fPidObjprot;
158  fPidObjprot=0;
159  }
160 
161 }
162 
163 //---------------------------------------------------------------------------
165  //
166  // Fills in vars the values of the variables
167  //
168 
169  if(nvars!=fnVarsForOpt) {
170  printf("AliRDHFCutsXictopKpi::GetCutsVarsForOpt: wrong number of variables\n");
171  return;
172  }
173 
175 
176  Int_t iter=-1;
177  if(fVarsForOpt[0]){
178  iter++;
179  vars[iter]=dd->InvMassLcpKpi();
180  }
181  if(fVarsForOpt[1]){
182  iter++;
183  for(Int_t iprong=0;iprong<3;iprong++){
184  if(TMath::Abs(pdgdaughters[iprong])==321) {
185  vars[iter]=dd->PtProng(iprong);
186  }
187  }
188  }
189  if(fVarsForOpt[2]){
190  iter++;
191  for(Int_t iprong=0;iprong<3;iprong++){
192  if(TMath::Abs(pdgdaughters[iprong])==2212) {
193  vars[iter]=dd->PtProng(iprong);
194  }
195  }
196  }
197  if(fVarsForOpt[3]){
198  iter++;
199  for(Int_t iprong=0;iprong<3;iprong++){
200  if(TMath::Abs(pdgdaughters[iprong])==2212) {
201  vars[iter]=dd->Getd0Prong(iprong);
202  }
203  }
204  }
205  if(fVarsForOpt[4]){
206  iter++;
207  for(Int_t iprong=0;iprong<3;iprong++){
208  if(TMath::Abs(pdgdaughters[iprong])==211) {
209  vars[iter]=dd->Getd0Prong(iprong);
210  }
211  }
212  }
213  if(fVarsForOpt[5]){
214  iter++;
215  vars[iter]=dd->GetDist12toPrim();
216  }
217  if(fVarsForOpt[6]){
218  iter++;
219  vars[iter]=dd->GetSigmaVert(aod);
220  }
221  if(fVarsForOpt[7]){
222  iter++;
223  vars[iter] = dd->DecayLength();
224  }
225  if(fVarsForOpt[8]){
226  iter++;
227  Float_t ptmax=0;
228  for(Int_t i=0;i<3;i++){
229  if(dd->PtProng(i)>ptmax)ptmax=dd->PtProng(i);
230  }
231  vars[iter]=ptmax;
232  }
233  if(fVarsForOpt[9]){
234  iter++;
235  vars[iter]=dd->CosPointingAngle();
236  }
237  if(fVarsForOpt[10]){
238  iter++;
239  vars[iter]=dd->Getd0Prong(0)*dd->Getd0Prong(0)+dd->Getd0Prong(1)*dd->Getd0Prong(1)+dd->Getd0Prong(2)*dd->Getd0Prong(2);
240  }
241  if(fVarsForOpt[11]){
242  iter++;
243  vars[iter]=dd->GetDCA();
244  }
245  if(fVarsForOpt[12]){
246  iter++;
247  for(Int_t iprong=0;iprong<3;iprong++){
248  if(TMath::Abs(pdgdaughters[iprong])==211) {
249  vars[iter]=dd->PtProng(iprong);
250  }
251  }
252  }
253 
254  return;
255 }
256 //---------------------------------------------------------------------------
258  //
259  // Apply selection
260  //
261 
262  if(!fCutsRD){
263  AliError("Cut matrice not inizialized. Exit...\n");
264  return 0;
265  }
266  //PrintAll();
268 
269  if(!d){
270  AliError("AliAODRecoDecayHF3Prong null \n");
271  return 0;
272  }
273 
274  //
275  // NB: pdg code of Lc... shall we change it ???
276  //
277  if(fKeepSignalMC) if(IsSignalMC(d,aod,4122)) return 3;
278 
279  Int_t returnvalue=3;
280  Int_t returnvaluePID=3;
281 
282  if(d->Pt()<fMinPtCand) return 0;
283  if(d->Pt()>fMaxPtCand) return 0;
284 
286 
287 
288  // selection on daughter tracks
289  if(selectionLevel==AliRDHFCuts::kAll ||
290  selectionLevel==AliRDHFCuts::kTracks) {
291  if(!AreDaughtersSelected(d,aod)) return 0;
292  }
293 
294 
295  // PID selection
296  if(selectionLevel==AliRDHFCuts::kAll ||
297  selectionLevel==AliRDHFCuts::kCandidate||
298  selectionLevel==AliRDHFCuts::kPID) {
299  switch (fPIDStrategy) {
300  case kNSigma:
301  returnvaluePID = IsSelectedPID(d);
302  break;
303  case kNSigmaMin:
304  returnvaluePID = IsSelectedPID(d);
305  break;
306  case kNSigmaPbPb:
307  returnvaluePID = IsSelectedNSigmaPbPb(d);
308  break;
309  case kCombined:
310  returnvaluePID = IsSelectedCombinedPID(d);
311  break;
312  case kCombinedSoft:
313  returnvaluePID = IsSelectedCombinedPIDSoft(d);
314  break;
315  case kNSigmaStrong:
316  returnvaluePID = IsSelectedPIDStrong(d);
317  break;
318  case kCombinedpPb:
319  returnvaluePID = IsSelectedCombinedPIDpPb(d);
320  break;
321  case kCombinedpPb2:
322  returnvaluePID = IsSelectedCombinedPIDpPb2(d);
323  break;
324  case kCombinedProb:
325  returnvaluePID = IsSelectedCombinedPIDProb(d);
326  break;
327  }
328  fIsSelectedPID=returnvaluePID;
329  }
330  // if(fUsePID || selectionLevel==AliRDHFCuts::kPID) returnvaluePID = IsSelectedCombinedPID(d); // to test!!
331  if(returnvaluePID==0) return 0;
332 
333 
334 
335 
336  // selection on candidate
337  if(selectionLevel==AliRDHFCuts::kAll ||
338  selectionLevel==AliRDHFCuts::kCandidate) {
339 
340  Double_t pt=d->Pt();
341 
342  Int_t ptbin=PtBin(pt);
343 
344  Double_t mXicpKpi=0.,mXicpiKp=0.;
345  Int_t okXicpKpi=1,okXicpiKp=1;
346 
347  Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
348 
349  mXicpKpi=d->InvMassLcpKpi();
350  mXicpiKp=d->InvMassLcpiKp();
351 
352  // Comparison with Lc mass from PDG.
353  // From the cutobject, only the upper limit is set.
354  // The lower limit is hardocoded, in order to discard candidates with
355  // mass lower than the Lc.
356  if(mXicpKpi-mLcPDG>fCutsRD[GetGlobalIndex(0,ptbin)] || (mLcPDG-mXicpKpi)>0.18) okXicpKpi = 0;
357  if(mXicpiKp-mLcPDG>fCutsRD[GetGlobalIndex(0,ptbin)] || (mLcPDG-mXicpiKp)>0.18) okXicpiKp = 0;
358  if(!okXicpKpi && !okXicpiKp) return 0;
359 
360  switch (fCutsStrategy) {
361 
362  case kStandard:
363  if(TMath::Abs(d->PtProng(1)) < fCutsRD[GetGlobalIndex(1,ptbin)] || TMath::Abs(d->Getd0Prong(1))<fCutsRD[GetGlobalIndex(3,ptbin)]) return 0;//Kaon
364  if(d->Pt()>=3. && d->PProng(1)<0.55) return 0;
365  if(fUseSpecialCut) {
366  if(TMath::Abs(d->PtProng(0)) < TMath::Abs(d->PtProng(2)) )okXicpKpi=0;
367  if(TMath::Abs(d->PtProng(2)) < TMath::Abs(d->PtProng(0)) )okXicpiKp=0;
368  }
369  if((TMath::Abs(d->PtProng(0)) < fCutsRD[GetGlobalIndex(2,ptbin)]) || (TMath::Abs(d->PtProng(2)) < fCutsRD[GetGlobalIndex(12,ptbin)])) okXicpKpi=0;
370  if((TMath::Abs(d->PtProng(2)) < fCutsRD[GetGlobalIndex(2,ptbin)]) || (TMath::Abs(d->PtProng(0)) < fCutsRD[GetGlobalIndex(12,ptbin)]))okXicpiKp=0;
371  if(!okXicpKpi && !okXicpiKp) return 0;
372  //2track cuts
373  // postponed
374  //if(d->GetDist12toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]|| d->GetDist23toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]) return 0;
375  //if(d->GetDist12toPrim()>0.5) return 0;
376  //if(d->GetDist23toPrim()>0.5) return 0;
378  if(d->Getd0Prong(0)*d->Getd0Prong(1)<0. && d->Getd0Prong(2)*d->Getd0Prong(1)<0.) return 0;
379  }
380  //sec vert
381  if(d->DecayLength()<fCutsRD[GetGlobalIndex(7,ptbin)]) return 0;
382  if(d->DecayLength()>0.5) return 0;
383 
384  // Double_t sumd0s=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
385  // if(sumd0s<fCutsRD[GetGlobalIndex(10,ptbin)]) return 0;
386  if((d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2))<fCutsRD[GetGlobalIndex(10,ptbin)]) return 0;
387 
388  if(TMath::Abs(d->PtProng(0))<fCutsRD[GetGlobalIndex(8,ptbin)] && TMath::Abs(d->PtProng(1))<fCutsRD[GetGlobalIndex(8,ptbin)] && TMath::Abs(d->PtProng(2))<fCutsRD[GetGlobalIndex(8,ptbin)]) return 0;
389  if(d->CosPointingAngle()< fCutsRD[GetGlobalIndex(9,ptbin)]) return 0;
390  if(d->GetSigmaVert(aod)>fCutsRD[GetGlobalIndex(6,ptbin)]) return 0;
391 
392  //DCA
393  for(Int_t i=0;i<3;i++) if(d->GetDCA(i)>fCutsRD[GetGlobalIndex(11,ptbin)]) return 0;
394 
395  // dist12 and dist23
396  if(d->GetDist12toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]|| d->GetDist23toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]) return 0;
397  if(d->GetDist12toPrim()>0.5) return 0;
398  if(d->GetDist23toPrim()>0.5) return 0;
399 
400  break;
401 
402 
403  case kKF:
404  Int_t pdgs[3]={0,321,0};
405  Bool_t constraint=kFALSE;
406  if(fCutsRD[GetGlobalIndex(1,ptbin)]>0.) constraint=kTRUE;
407  Double_t field=aod->GetMagneticField();
408  if (returnvaluePID==1 || returnvaluePID==3){
409 
410  pdgs[0]=2122;pdgs[2]=211;
411  AliKFParticle *lc1=ReconstructKF(d,pdgs,field,constraint);
412  if(!lc1){
413  okXicpKpi=0;
414  }else{
415  if(lc1->GetChi2()/lc1->GetNDF()>fCutsRD[GetGlobalIndex(2,ptbin)]) okXicpKpi=0;
416  }
417  } else if(returnvaluePID>=2){
418 
419  pdgs[0]=211;pdgs[2]=2212;
420  AliKFParticle *lc2=ReconstructKF(d,pdgs,field,constraint);
421  if(!lc2){
422  okXicpiKp=0;
423  }else{
424  if(lc2->GetChi2()/lc2->GetNDF()>fCutsRD[GetGlobalIndex(2,ptbin)])okXicpiKp=0;
425  }
426  }
427  break;
428 
429  }
430 
431  if(okXicpKpi) returnvalue=1; //cuts passed as Xic->pKpi
432  if(okXicpiKp) returnvalue=2; //cuts passed as Xic->piKp
433  if(okXicpKpi && okXicpiKp) returnvalue=3; //cuts passed as both pKpi and piKp
434 
435  }
436 
437 
438  Int_t returnvalueTot=CombinePIDCuts(returnvalue,returnvaluePID);
439  return returnvalueTot;
440 }
441 //---------------------------------------------------------------------------
443 
444 
445  if(!fUsePID || !obj) return 3;
446  Int_t okXicpKpi=0,okXicpiKp=0;
447  Int_t returnvalue=0;
448  Bool_t isPeriodd=fPidHF->GetOnePad();
449  Bool_t isMC=fPidHF->GetMC();
450  Bool_t ispion0=kTRUE,ispion2=kTRUE;
451  Bool_t isproton0=kFALSE,isproton2=kFALSE;
452  Bool_t iskaon1=kFALSE;
453  if(isPeriodd) {
454  fPidObjprot->SetOnePad(kTRUE);
455  fPidObjpion->SetOnePad(kTRUE);
456  }
457  if(isMC) {
458  fPidObjprot->SetMC(kTRUE);
459  fPidObjpion->SetMC(kTRUE);
460  }
461 
462  if(fPidObjprot->GetPidResponse()==0x0){
463  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
464  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
465  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
466  fPidObjprot->SetPidResponse(pidResp);
467  }
468  if(fPidObjpion->GetPidResponse()==0x0){
469  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
470  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
471  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
472  fPidObjpion->SetPidResponse(pidResp);
473  }
474  if(fPidHF->GetPidResponse()==0x0){
475  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
476  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
477  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
478  fPidHF->SetPidResponse(pidResp);
479  }
480 
481  for(Int_t i=0;i<3;i++){
482  AliAODTrack *track=(AliAODTrack*)obj->GetDaughter(i);
483  if(!track) return 0;
484  if(i==1) {
485  // identify kaon
486  if(track->P()<0.55){
487  fPidHF->SetTOF(kFALSE);
488  fPidHF->SetTOFdecide(kFALSE);
489  }
490  //if(i==1) {
491  Int_t isKaon=0;
492  isKaon=fPIDStrategy==kNSigmaMin?fPidHF->MatchTPCTOFMin(track,3):fPidHF->MakeRawPid(track,3);
493  if(isKaon>=1) iskaon1=kTRUE;
494  if(track->P()<0.55){
495  fPidHF->SetTOF(kTRUE);
496  fPidHF->SetTOFdecide(kTRUE);
497  }
498 
499 
500  if(isKaon>=1) iskaon1=kTRUE;
501 
502  if(!iskaon1) return 0;
503 
504  }else{
505  //pion or proton
506  if(track->P()<1.){
507  fPidObjprot->SetTOF(kFALSE);
508  fPidObjprot->SetTOFdecide(kFALSE);
509  }
510 
511  Int_t isProton=0;
513  Int_t isPion=0;
515 
516  if(track->P()<1.){
517  fPidObjprot->SetTOF(kTRUE);
518  fPidObjprot->SetTOFdecide(kTRUE);
519  }
520 
521 
522  if(i==0) {
523  if(isPion<0) ispion0=kFALSE;
524  if(isProton>=1) isproton0=kTRUE;
525 
526  }
527  if(!ispion0 && !isproton0) return 0;
528  if(i==2) {
529  if(isPion<0) ispion2=kFALSE;
530  if(isProton>=1) isproton2=kTRUE;
531  }
532 
533  }
534  }
535 
536  if(ispion2 && isproton0 && iskaon1) okXicpKpi=1;
537  if(ispion0 && isproton2 && iskaon1) okXicpiKp=1;
538  if(okXicpKpi) returnvalue=1; //cuts passed as Xic->pKpi
539  if(okXicpiKp) returnvalue=2; //cuts passed as Xic->piKp
540  if(okXicpKpi && okXicpiKp) returnvalue=3; //cuts passed as both pKpi and piKp
541 
542  return returnvalue;
543 }
544 
545 //--------------------------------------------------------------------------
546 
548 
549 
550  if(!fUsePID || !obj) return 3;
551  Int_t okXicpKpi=0,okXicpiKp=0;
552  Int_t returnvalue=0;
553  Bool_t isPeriodd=fPidHF->GetOnePad();
554  Bool_t isMC=fPidHF->GetMC();
555  Bool_t ispion0=kTRUE,ispion2=kTRUE;
556  Bool_t isproton0=kFALSE,isproton2=kFALSE;
557  Bool_t iskaon1=kFALSE;
558  if(isPeriodd) {
559  fPidObjprot->SetOnePad(kTRUE);
560  fPidObjpion->SetOnePad(kTRUE);
561  }
562  if(isMC) {
563  fPidObjprot->SetMC(kTRUE);
564  fPidObjpion->SetMC(kTRUE);
565  }
566 
567  if(fPidObjprot->GetPidResponse()==0x0){
568  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
569  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
570  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
571  fPidObjprot->SetPidResponse(pidResp);
572  }
573  if(fPidObjpion->GetPidResponse()==0x0){
574  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
575  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
576  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
577  fPidObjpion->SetPidResponse(pidResp);
578  }
579  if(fPidHF->GetPidResponse()==0x0){
580  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
581  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
582  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
583  fPidHF->SetPidResponse(pidResp);
584  }
585 
586  for(Int_t i=0;i<3;i++){
587  AliAODTrack *track=(AliAODTrack*)obj->GetDaughter(i);
588  if(!track) return 0;
589 
590  if(i==1) {
591  //kaon
592  Int_t isKaon=fPidHF->MakeRawPid(track,3);
593  if(isKaon>=1) iskaon1=kTRUE;
594  if(!iskaon1) return 0;
595  }
596 
597  else {
598  //pion or proton
599  Int_t isProton=fPidObjprot->MakeRawPid(track,4);
600  Int_t isPion=fPidObjpion->MakeRawPid(track,2);
601 
602  if(i==0) {
603  if(isPion<0) ispion0=kFALSE;
604  if(isProton>=1) isproton0=kTRUE;
605  }
606  if(!ispion0 && !isproton0) return 0;
607 
608  if(i==2) {
609  if(isPion<0) ispion2=kFALSE;
610  if(isProton>=1) isproton2=kTRUE;
611  }
612  }
613  }
614 
615  if(ispion2 && isproton0 && iskaon1) okXicpKpi=1;
616  if(ispion0 && isproton2 && iskaon1) okXicpiKp=1;
617  if(okXicpKpi) returnvalue=1; //cuts passed as Xic->pKpi
618  if(okXicpiKp) returnvalue=2; //cuts passed as Xic->piKp
619  if(okXicpKpi && okXicpiKp) returnvalue=3; //cuts passed as both pKpi and piKp
620 
621  return returnvalue;
622 }
623 
624 
625 
626 
627 //---------------------------------------------------------------------------
629 
630  if(!fUsePID || !obj) {return 3;}
631  Int_t okXicpKpi=0,okXicpiKp=0;
632  Int_t returnvalue=0;
633  Bool_t isPeriodd=fPidHF->GetOnePad();
634  Bool_t isMC=fPidHF->GetMC();
635 
636  if(isPeriodd) {
637  fPidObjprot->SetOnePad(kTRUE);
638  fPidObjpion->SetOnePad(kTRUE);
639  }
640  if(isMC) {
641  fPidObjprot->SetMC(kTRUE);
642  fPidObjpion->SetMC(kTRUE);
643  }
644 
645  AliVTrack *track0=dynamic_cast<AliVTrack*>(obj->GetDaughter(0));
646  AliVTrack *track1=dynamic_cast<AliVTrack*>(obj->GetDaughter(1));
647  AliVTrack *track2=dynamic_cast<AliVTrack*>(obj->GetDaughter(2));
648  if (!track0 || !track1 || !track2) return 0;
649  Double_t prob0[AliPID::kSPECIES];
650  Double_t prob1[AliPID::kSPECIES];
651  Double_t prob2[AliPID::kSPECIES];
652  if(obj->Pt()<3. && track0->P()<1.) fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC);
653  fPidHF->GetPidCombined()->ComputeProbabilities(track0,fPidHF->GetPidResponse(),prob0);
654  if(obj->Pt()<3. && track0->P()<1.) fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC|AliPIDResponse::kDetTOF);
655 
656  if(obj->Pt()<3. && track1->P()<0.55) fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC);
657  fPidHF->GetPidCombined()->ComputeProbabilities(track1,fPidHF->GetPidResponse(),prob1);
658  if(obj->Pt()<3. && track1->P()<0.55) fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC|AliPIDResponse::kDetTOF);
659 
660  if(obj->Pt()<3. && track2->P()<1.) fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC);
661  fPidHF->GetPidCombined()->ComputeProbabilities(track2,fPidHF->GetPidResponse(),prob2);
662  if(obj->Pt()<3. && track2->P()<1.) fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC|AliPIDResponse::kDetTOF);
663 
665  okXicpiKp= (prob0[AliPID::kPion ]>fPIDThreshold[AliPID::kPion ])
668  okXicpKpi= (prob0[AliPID::kProton]>fPIDThreshold[AliPID::kProton])
669  &&(prob1[AliPID::kKaon ]>fPIDThreshold[AliPID::kKaon ])
671  }else{
672  //pion or proton
673 
674 
675  if(TMath::MaxElement(AliPID::kSPECIES,prob1) == prob1[AliPID::kKaon]){
676  if(TMath::MaxElement(AliPID::kSPECIES,prob0) == prob0[AliPID::kProton] && TMath::MaxElement(AliPID::kSPECIES,prob2) == prob2[AliPID::kPion]) okXicpKpi = 1;
677  if(TMath::MaxElement(AliPID::kSPECIES,prob2) == prob2[AliPID::kProton] && TMath::MaxElement(AliPID::kSPECIES,prob0) == prob0[AliPID::kPion]) okXicpiKp = 1;
678  }
679  }
680 
681  if(okXicpKpi) returnvalue=1; //cuts passed as Xic->pKpi
682  if(okXicpiKp) returnvalue=2; //cuts passed as Xic->piKp
683  if(okXicpKpi && okXicpiKp) returnvalue=3; //cuts passed as both pKpi and piKp
684 
685  return returnvalue;
686 }
687 //-----------------------
688 Int_t AliRDHFCutsXictopKpi::CombinePIDCuts(Int_t returnvalue, Int_t returnvaluePID) const {
689 
690  Int_t returnvalueTot=0;
691  Int_t okXicpKpi=0,okXicpiKp=0;
692  if(returnvaluePID==1){
693  if(returnvalue==1 || returnvalue==3) okXicpKpi=1;
694  }
695  if(returnvaluePID==2){
696  if(returnvalue>=2) okXicpiKp=1;
697  }
698  if(returnvaluePID==3 && returnvalue>0){
699  if(returnvalue==1 || returnvalue==3) okXicpKpi=1;
700  if(returnvalue>=2) okXicpiKp=1;
701  }
702 
703  if(okXicpKpi) returnvalueTot=1; //cuts passed as Xic->pKpi
704  if(okXicpiKp) returnvalueTot=2; //cuts passed as Xic->piKp
705  if(okXicpKpi && okXicpiKp) returnvalueTot=3; //cuts passed as both pKpi and piKp
706  return returnvalueTot;
707 }
708 //----------------------------------
710 
711  SetName("XictopKpiProdCuts");
712  SetTitle("Production cuts for Xic analysis");
713 
714  AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default");
715  esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
716  esdTrackCuts->SetRequireTPCRefit(kTRUE);
717  esdTrackCuts->SetMinNClustersTPC(70);
718  esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
719  AliESDtrackCuts::kAny);
720  esdTrackCuts->SetRequireITSRefit(kTRUE);
721  esdTrackCuts->SetMinNClustersITS(4);
722  esdTrackCuts->SetMinDCAToVertexXY(0.);
723  esdTrackCuts->SetEtaRange(-0.8,0.8);
724  esdTrackCuts->SetPtRange(0.3,1.e10);
725  AddTrackCuts(esdTrackCuts);
726  delete esdTrackCuts;
727  esdTrackCuts=NULL;
728 
729  const Int_t nptbins=8;
730  const Int_t nvars=13;
731  Float_t* ptbins;
732  ptbins=new Float_t[nptbins+1];
733 
734  ptbins[0]=1.;
735  ptbins[1]=2.;
736  ptbins[2]=3.;
737  ptbins[3]=4.;
738  ptbins[4]=5.;
739  ptbins[5]=6.;
740  ptbins[6]=8.;
741  ptbins[7]=10.;
742  ptbins[8]=20.;
743 
744  SetGlobalIndex(nvars,nptbins);
745  SetPtBins(nptbins+1,ptbins);
746 
747  Float_t** prodcutsval;
748  prodcutsval=new Float_t*[nvars];
749  for(Int_t iv=0;iv<nvars;iv++){
750  prodcutsval[iv]=new Float_t[nptbins];
751  }
752 
753  for(Int_t ipt=0;ipt<nptbins;ipt++){
754  prodcutsval[0][ipt]=0.13;
755  prodcutsval[1][ipt]=0.4;
756  prodcutsval[2][ipt]=0.4;
757  prodcutsval[3][ipt]=0.;
758  prodcutsval[4][ipt]=0.;
759  prodcutsval[5][ipt]=0.;
760  prodcutsval[6][ipt]=0.06;
761  prodcutsval[7][ipt]=0.005;
762  prodcutsval[8][ipt]=0.;
763  prodcutsval[9][ipt]=0.;
764  prodcutsval[10][ipt]=0.;
765  prodcutsval[11][ipt]=0.05;
766  prodcutsval[12][ipt]=0.4;
767  }
768  SetCuts(nvars,nptbins,prodcutsval);
769 
770  AliAODPidHF* pidObjK=new AliAODPidHF();
771  Double_t sigmasK[5]={3.,1.,1.,3.,2.};
772  pidObjK->SetSigma(sigmasK);
773  pidObjK->SetAsym(kTRUE);
774  pidObjK->SetMatch(1);
775  pidObjK->SetTPC(kTRUE);
776  pidObjK->SetTOF(kTRUE);
777  pidObjK->SetITS(kTRUE);
778  Double_t plimK[2]={0.5,0.8};
779  pidObjK->SetPLimit(plimK,2);
780  pidObjK->SetTOFdecide(kTRUE);
781 
782  SetPidHF(pidObjK);
783 
784  AliAODPidHF* pidObjpi=new AliAODPidHF();
785  pidObjpi->SetTPC(kTRUE);
786  Double_t sigmaspi[5]={3.,0.,0.,0.,0.};
787  pidObjpi->SetSigma(sigmaspi);
788  pidObjpi->SetTOFdecide(kTRUE);
789  SetPidpion(pidObjpi);
790 
791  AliAODPidHF* pidObjp=new AliAODPidHF();
792  Double_t sigmasp[5]={3.,1.,1.,3.,2.};
793  pidObjp->SetSigma(sigmasp);
794  pidObjp->SetAsym(kTRUE);
795  pidObjp->SetMatch(1);
796  pidObjp->SetTPC(kTRUE);
797  pidObjp->SetTOF(kTRUE);
798  pidObjp->SetITS(kTRUE);
799  Double_t plimp[2]={1.,2.};
800  pidObjp->SetPLimit(plimp,2);
801  pidObjp->SetTOFdecide(kTRUE);
802 
803  SetPidprot(pidObjp);
804 
805  SetUsePID(kTRUE);
806  SetOptPileup(kTRUE);
807 
808  // PrintAll();
809 
810  for(Int_t iiv=0;iiv<nvars;iiv++){
811  delete [] prodcutsval[iiv];
812  }
813  delete [] prodcutsval;
814  prodcutsval=NULL;
815  delete [] ptbins;
816  ptbins=NULL;
817 
818  delete pidObjK;
819  pidObjK=NULL;
820  delete pidObjpi;
821  pidObjpi=NULL;
822  delete pidObjp;
823  pidObjp=NULL;
824 
825  return;
826 }
827 //------------------
829 
830  SetName("XictopKpiProdCuts");
831  SetTitle("Production cuts for Xic analysis");
832 
833  AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default");
834 
835  esdTrackCuts->SetRequireTPCRefit(kTRUE);
836  esdTrackCuts->SetMinNClustersTPC(70);
837  esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
838  AliESDtrackCuts::kAny);
839  esdTrackCuts->SetRequireITSRefit(kTRUE);
840  esdTrackCuts->SetMinNClustersITS(4);
841  esdTrackCuts->SetMinDCAToVertexXYPtDep("0.0100*TMath::Max(0.,(1-TMath::Floor(TMath::Abs(pt)/2.)))");
842  esdTrackCuts->SetEtaRange(-0.8,0.8);
843  esdTrackCuts->SetMaxDCAToVertexXY(1.);
844  esdTrackCuts->SetMaxDCAToVertexZ(1.);
845  esdTrackCuts->SetPtRange(0.49,1.e10);
846  AddTrackCuts(esdTrackCuts);
847  delete esdTrackCuts;
848  esdTrackCuts=NULL;
849 
850  const Int_t nptbins=8;
851  const Int_t nvars=13;
852  Float_t* ptbins;
853  ptbins=new Float_t[nptbins+1];
854 
855  ptbins[0]=1.;
856  ptbins[1]=2.;
857  ptbins[2]=3.;
858  ptbins[3]=4.;
859  ptbins[4]=5.;
860  ptbins[5]=6.;
861  ptbins[6]=8.;
862  ptbins[7]=10.;
863  ptbins[8]=99999.;
864 
865 
866  SetGlobalIndex(nvars,nptbins);
867  SetPtBins(nptbins+1,ptbins);
868 
869  Float_t** prodcutsval;
870  prodcutsval=new Float_t*[nvars];
871  for(Int_t iv=0;iv<nvars;iv++){
872  prodcutsval[iv]=new Float_t[nptbins];
873  }
874 
875  for(Int_t ipt=0;ipt<nptbins;ipt++){
876  prodcutsval[0][ipt]=0.13;
877  prodcutsval[1][ipt]=0.5;
878  prodcutsval[2][ipt]=0.6;
879  prodcutsval[3][ipt]=0.;
880  prodcutsval[4][ipt]=0.;
881  prodcutsval[5][ipt]=0.01;
882  prodcutsval[6][ipt]=0.04;
883  prodcutsval[7][ipt]=0.006;
884  prodcutsval[8][ipt]=0.8;
885  prodcutsval[9][ipt]=0.3;
886  prodcutsval[10][ipt]=0.;
887  prodcutsval[11][ipt]=0.05;
888  prodcutsval[12][ipt]=0.4;
889  }
890  SetCuts(nvars,nptbins,prodcutsval);
891 
892  AliAODPidHF* pidObj=new AliAODPidHF();
893  pidObj->SetTPC(kTRUE);
894  pidObj->SetTOF(kTRUE);
895  SetPidHF(pidObj);
896  SetPidpion(pidObj);
897  SetPidprot(pidObj);
898 
899 
900  // bayesian pid
901  GetPidHF()->SetUseCombined(kTRUE);
902  GetPidHF()->SetUseDefaultPriors(kTRUE);
904  for (Int_t ispecies=0;ispecies<AliPID::kSPECIES;++ispecies){
905  SetPIDThreshold(static_cast<AliPID::EParticleType>(ispecies),0);
906  }
908  SetUsePID(kTRUE);
909 
910 
911  // PrintAll();
912 
913  for(Int_t iiv=0;iiv<nvars;iiv++){
914  delete [] prodcutsval[iiv];
915  }
916  delete [] prodcutsval;
917  prodcutsval=NULL;
918  delete [] ptbins;
919  ptbins=NULL;
920 
921  delete pidObj;
922  pidObj=NULL;
923 
924  return;
925 }
926 //------------------
927 AliKFParticle* AliRDHFCutsXictopKpi::ReconstructKF(AliAODRecoDecayHF3Prong *d,Int_t *pdgs,Double_t field,Bool_t constraint) const{
928  // Method to construct the KF particle from the candidate
929 
930  const Int_t nprongs=d->GetNProngs();
931  if(nprongs<=0) return 0x0;
932 
933  Int_t iprongs[nprongs];
934  for(Int_t i=0;i<nprongs;i++) iprongs[i]=i;
935 
936  Double_t mass[2]={0.,0.};
937 
938  AliKFParticle *decay=d->ApplyVertexingKF(iprongs,nprongs,pdgs,constraint,field,mass);
939  if(!decay) return 0x0;
940  AliESDVertex *vertexESD = new AliESDVertex(decay->Parameters(),
941  decay->CovarianceMatrix(),
942  decay->GetChi2(),
943  nprongs);
944  Double_t pos[3],cov[6],chi2perNDF;
945  vertexESD->GetXYZ(pos);
946  vertexESD->GetCovMatrix(cov);
947  chi2perNDF = vertexESD->GetChi2toNDF();
948  delete vertexESD; vertexESD=NULL;
949  AliAODVertex *vertexAOD = new AliAODVertex(pos,cov,chi2perNDF,0x0,-1,AliAODVertex::kUndef,nprongs);
950  d->SetSecondaryVtx(vertexAOD);
951  return decay;
952 }
953 
954 //------------------
956 
957  // Default 2010 PbPb cut object
959 
960  //
961  // Enable all 2011 PbPb run triggers
962  //
963  SetTriggerClass("");
967 }
968 //-----------------
969 
971 {
972  //
973  // // Checking if Xic is in fiducial acceptance region
974  // //
975  //
976  if(fMaxRapidityCand>-998.){
977  if(TMath::Abs(y) > fMaxRapidityCand) return kFALSE;
978  else return kTRUE;
979  }
980 
981  if(pt > 5.) {
982  // applying cut for pt > 5 GeV
983  AliDebug(2,Form("pt of Xic = %f (> 5), cutting at |y| < 0.8",pt));
984  if (TMath::Abs(y) > 0.8) return kFALSE;
985 
986  } else {
987  // appliying smooth cut for pt < 5 GeV
988  Double_t maxFiducialY = -0.2/15*pt*pt+1.9/15*pt+0.5;
989  Double_t minFiducialY = 0.2/15*pt*pt-1.9/15*pt-0.5;
990  AliDebug(2,Form("pt of Xic = %f (< 5), cutting according to the fiducial zone [%f, %f]\n",pt,minFiducialY,maxFiducialY));
991  if (y < minFiducialY || y > maxFiducialY) return kFALSE;
992  }
993  //
994  return kTRUE;
995 }
996 //--------------------------------------------------------
998  if(!fUsePID || !obj) {return 3;}
999  Int_t okXicpKpi=0,okXicpiKp=0;
1000  Int_t returnvalue=0;
1001 
1002  AliVTrack *track0=dynamic_cast<AliVTrack*>(obj->GetDaughter(0));
1003  AliVTrack *track1=dynamic_cast<AliVTrack*>(obj->GetDaughter(1));
1004  AliVTrack *track2=dynamic_cast<AliVTrack*>(obj->GetDaughter(2));
1005  if (!track0 || !track1 || !track2) return 0;
1006  Double_t prob0[AliPID::kSPECIES];
1007  Double_t prob1[AliPID::kSPECIES];
1008  Double_t prob2[AliPID::kSPECIES];
1009 
1010  Bool_t isTOF0=fPidHF->CheckTOFPIDStatus((AliAODTrack*)obj->GetDaughter(0));
1011  Bool_t isTOF1=fPidHF->CheckTOFPIDStatus((AliAODTrack*)obj->GetDaughter(1));
1012  Bool_t isTOF2=fPidHF->CheckTOFPIDStatus((AliAODTrack*)obj->GetDaughter(2));
1013 
1014 Bool_t isK1=kFALSE;
1015  if(isTOF1){ //kaon
1016  if(track1->P()<1.8) {
1017  fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC|AliPIDResponse::kDetTOF);
1018  if(obj->Pt()<3. && track1->P()<0.55) fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC);
1019  fPidHF->GetPidCombined()->ComputeProbabilities(track1,fPidHF->GetPidResponse(),prob1);
1020 
1021  }else{
1022  AliAODTrack *trackaod1=(AliAODTrack*)(obj->GetDaughter(1));
1023  if(trackaod1->P()<0.55){
1024  fPidHF->SetTOF(kFALSE);
1025  fPidHF->SetTOFdecide(kFALSE);
1026  }
1027  Int_t isKaon=fPidHF->MakeRawPid(trackaod1,3);
1028  if(isKaon>=1) isK1=kTRUE;
1029  if(trackaod1->P()<0.55){
1030  fPidHF->SetTOF(kTRUE);
1031  fPidHF->SetTOFdecide(kTRUE);
1032  }
1033  }
1034  }else{
1035  if(track1->P()<0.8){
1036  fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC);
1037  fPidHF->GetPidCombined()->ComputeProbabilities(track1,fPidHF->GetPidResponse(),prob0);
1038  }else{
1039  AliAODTrack *trackaod1=(AliAODTrack*)(obj->GetDaughter(1));
1040  if(trackaod1->P()<0.55){
1041  fPidHF->SetTOF(kFALSE);
1042  fPidHF->SetTOFdecide(kFALSE);
1043  }
1044  Int_t isKaon=fPidHF->MakeRawPid(trackaod1,3);
1045  if(isKaon>=1) isK1=kTRUE;
1046  if(trackaod1->P()<0.55){
1047  fPidHF->SetTOF(kTRUE);
1048  fPidHF->SetTOFdecide(kTRUE);
1049  }
1050  }
1051  }
1052 
1053  Bool_t ispi0=kFALSE;
1054  Bool_t isp0=kFALSE;
1055  Bool_t ispi2=kFALSE;
1056  Bool_t isp2=kFALSE;
1057 
1058  if(isTOF0){ //proton
1059  if(track0->P()<2.2) {
1060  fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC|AliPIDResponse::kDetTOF);
1061  if(obj->Pt()<3. && track0->P()<1.) fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC);
1062  fPidHF->GetPidCombined()->ComputeProbabilities(track0,fPidHF->GetPidResponse(),prob0);
1063  }else{
1064  AliAODTrack *trackaod0=(AliAODTrack*)(obj->GetDaughter(0));
1065  if(trackaod0->P()<1.){
1066  fPidObjprot->SetTOF(kFALSE);
1067  fPidObjprot->SetTOFdecide(kFALSE);
1068  }
1069  Int_t isProton=fPidObjprot->MakeRawPid(trackaod0,4);
1070  if(isProton>=1) isp0=kTRUE;
1071  if(trackaod0->P()<1.){
1072  fPidObjprot->SetTOF(kTRUE);
1073  fPidObjprot->SetTOFdecide(kTRUE);
1074  }
1075  }
1076  }else{
1077  if(track0->P()<1.2){
1078  fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC);
1079  fPidHF->GetPidCombined()->ComputeProbabilities(track0,fPidHF->GetPidResponse(),prob0);
1080  }else{
1081  AliAODTrack *trackaod0=(AliAODTrack*)(obj->GetDaughter(0));
1082  if(trackaod0->P()<1.){
1083  fPidObjprot->SetTOF(kFALSE);
1084  fPidObjprot->SetTOFdecide(kFALSE);
1085  }
1086  Int_t isProton=fPidObjprot->MakeRawPid(trackaod0,4);
1087  if(isProton>=1) isp0=kTRUE;
1088  if(trackaod0->P()<1.){
1089  fPidObjprot->SetTOF(kTRUE);
1090  fPidObjprot->SetTOFdecide(kTRUE);
1091  }
1092  }
1093  }
1094 
1095  if(isTOF2){ //proton
1096  if(track2->P()<2.2) {
1097  fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC|AliPIDResponse::kDetTOF);
1098  if(obj->Pt()<3. && track2->P()<1.) fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC);
1099  fPidHF->GetPidCombined()->ComputeProbabilities(track2,fPidHF->GetPidResponse(),prob2);
1100  }else{
1101  AliAODTrack *trackaod2=(AliAODTrack*)(obj->GetDaughter(2));
1102  if(trackaod2->P()<1.){
1103  fPidObjprot->SetTOF(kFALSE);
1104  fPidObjprot->SetTOFdecide(kFALSE);
1105  }
1106  Int_t isProton=fPidObjprot->MakeRawPid(trackaod2,4);
1107  if(isProton>=1) isp2=kTRUE;
1108  if(trackaod2->P()<1.){
1109  fPidObjprot->SetTOF(kTRUE);
1110  fPidObjprot->SetTOFdecide(kTRUE);
1111  }
1112  }
1113  }else{
1114  if(track2->P()<1.2){
1115  fPidHF->GetPidCombined()->SetDetectorMask(AliPIDResponse::kDetTPC);
1116  fPidHF->GetPidCombined()->ComputeProbabilities(track2,fPidHF->GetPidResponse(),prob2);
1117  }else{
1118  AliAODTrack *trackaod2=(AliAODTrack*)(obj->GetDaughter(2));
1119  if(trackaod2->P()<1.){
1120  fPidObjprot->SetTOF(kFALSE);
1121  fPidObjprot->SetTOFdecide(kFALSE);
1122  }
1123  Int_t isProton=fPidObjprot->MakeRawPid(trackaod2,4);
1124  if(isProton>=1) isp2=kTRUE;
1125  if(trackaod2->P()<1.){
1126  fPidObjprot->SetTOF(kTRUE);
1127  fPidObjprot->SetTOFdecide(kTRUE);
1128  }
1129  }
1130  }
1131  AliAODTrack *trackaod2=(AliAODTrack*)(obj->GetDaughter(2));
1132  if(fPidObjpion->MakeRawPid(trackaod2,2)>=1)ispi2=kTRUE;
1133  AliAODTrack *trackaod0=(AliAODTrack*)(obj->GetDaughter(2));
1134  if(fPidObjpion->MakeRawPid(trackaod0,2)>=1)ispi0=kTRUE;
1135 
1136  if(TMath::MaxElement(AliPID::kSPECIES,prob1) == prob1[AliPID::kKaon]){
1137 
1138  if(TMath::MaxElement(AliPID::kSPECIES,prob0) == prob0[AliPID::kProton] && TMath::MaxElement(AliPID::kSPECIES,prob2) == prob2[AliPID::kPion]) okXicpKpi = 1;
1139  if(TMath::MaxElement(AliPID::kSPECIES,prob2) == prob2[AliPID::kProton] && TMath::MaxElement(AliPID::kSPECIES,prob0) == prob0[AliPID::kPion]) okXicpiKp = 1;
1140  }
1141 
1142  if(!isK1 && TMath::MaxElement(AliPID::kSPECIES,prob1) == prob1[AliPID::kKaon]) isK1=kTRUE;
1143  if(!ispi0 && TMath::MaxElement(AliPID::kSPECIES,prob0) == prob0[AliPID::kPion]) ispi0=kTRUE;
1144  if(!ispi2 && TMath::MaxElement(AliPID::kSPECIES,prob2) == prob2[AliPID::kPion]) ispi2=kTRUE;
1145  if(!isp0 && TMath::MaxElement(AliPID::kSPECIES,prob0) == prob0[AliPID::kProton]) isp0=kTRUE;
1146  if(!isp2 && TMath::MaxElement(AliPID::kSPECIES,prob2) == prob2[AliPID::kProton]) isp2=kTRUE;
1147  if(isK1 && ispi0 && isp2) okXicpiKp = 1;
1148  if(isK1 && isp0 && ispi2) okXicpKpi = 1;
1149 
1150  if(okXicpKpi) returnvalue=1; //cuts passed as Xic->pKpi
1151  if(okXicpiKp) returnvalue=2; //cuts passed as Xic->piKp
1152  if(okXicpKpi && okXicpiKp) returnvalue=3; //cuts passed as both pKpi and piKp
1153 
1154  return returnvalue;
1155 
1156 
1157 }
1158 //----------------------------------------------------------
1160 
1161 
1162  if(!fUsePID || !obj) return 3;
1163  Int_t okXicpKpi=0,okXicpiKp=0;
1164  Int_t returnvalue=0;
1165  Bool_t isPeriodd=fPidHF->GetOnePad();
1166  Bool_t isMC=fPidHF->GetMC();
1167  Bool_t ispion0=kTRUE,ispion2=kTRUE;
1168  Bool_t isproton0=kFALSE,isproton2=kFALSE;
1169  Bool_t iskaon1=kFALSE;
1170  if(isPeriodd) {
1171  fPidObjprot->SetOnePad(kTRUE);
1172  fPidObjpion->SetOnePad(kTRUE);
1173  }
1174  if(isMC) {
1175  fPidObjprot->SetMC(kTRUE);
1176  fPidObjpion->SetMC(kTRUE);
1177  }
1178 
1179  for(Int_t i=0;i<3;i++){
1180  AliAODTrack *track=(AliAODTrack*)obj->GetDaughter(i);
1181  if(!track) return 0;
1182  // identify kaon
1183  if(i==1) {
1184  Int_t isKaon=fPidHF->MakeRawPid(track,3);
1185  if(isKaon>=1) {
1186  iskaon1=kTRUE;
1187  if(fPidHF->MakeRawPid(track,2)>=1) iskaon1=kFALSE;
1188  }
1189  if(!iskaon1) return 0;
1190 
1191  }else{
1192  //pion or proton
1193 
1194  Int_t isProton=fPidObjprot->MakeRawPid(track,4);
1195  if(isProton>=1){
1196  if(fPidHF->MakeRawPid(track,2)>=1) isProton=-1;
1197  if(fPidHF->MakeRawPid(track,3)>=1) isProton=-1;
1198  }
1199 
1200  Int_t isPion=fPidObjpion->MakeRawPid(track,2);
1201  if(fPidHF->MakeRawPid(track,3)>=1) isPion=-1;
1202  if(fPidObjprot->MakeRawPid(track,4)>=1) isPion=-1;
1203 
1204 
1205  if(i==0) {
1206  if(isPion<0) ispion0=kFALSE;
1207  if(isProton>=1) isproton0=kTRUE;
1208 
1209  }
1210  if(!ispion0 && !isproton0) return 0;
1211  if(i==2) {
1212  if(isPion<0) ispion2=kFALSE;
1213  if(isProton>=1) isproton2=kTRUE;
1214  }
1215 
1216  }
1217  }
1218 
1219  if(ispion2 && isproton0 && iskaon1) okXicpKpi=1;
1220  if(ispion0 && isproton2 && iskaon1) okXicpiKp=1;
1221  if(okXicpKpi) returnvalue=1; //cuts passed as Xic->pKpi
1222  if(okXicpiKp) returnvalue=2; //cuts passed as Xic->piKp
1223  if(okXicpKpi && okXicpiKp) returnvalue=3; //cuts passed as both pKpi and piKp
1224 
1225  return returnvalue;
1226 }
1227 //--------------------
1229 
1230  if(!fUsePID || !obj) {return 3;}
1231  Int_t okXicpKpi=0,okXicpiKp=0;
1232  Int_t returnvalue=0;
1233 
1234  Bool_t isMC=fPidHF->GetMC();
1235 
1236 
1237  if(isMC) {
1238  fPidObjprot->SetMC(kTRUE);
1239  fPidObjpion->SetMC(kTRUE);
1240  }
1241 
1242  AliVTrack *track0=dynamic_cast<AliVTrack*>(obj->GetDaughter(0));
1243  AliVTrack *track1=dynamic_cast<AliVTrack*>(obj->GetDaughter(1));
1244  AliVTrack *track2=dynamic_cast<AliVTrack*>(obj->GetDaughter(2));
1245  if (!track0 || !track1 || !track2) return 0;
1246  Double_t prob0[AliPID::kSPECIES];
1247  Double_t prob1[AliPID::kSPECIES];
1248  Double_t prob2[AliPID::kSPECIES];
1249 
1250  fPidHF->GetPidCombined()->ComputeProbabilities(track0,fPidHF->GetPidResponse(),prob0);
1251  fPidHF->GetPidCombined()->ComputeProbabilities(track1,fPidHF->GetPidResponse(),prob1);
1252  fPidHF->GetPidCombined()->ComputeProbabilities(track2,fPidHF->GetPidResponse(),prob2);
1253 
1254 
1256  okXicpiKp= (prob0[AliPID::kPion ]>fPIDThreshold[AliPID::kPion ])
1259  okXicpKpi= (prob0[AliPID::kProton]>fPIDThreshold[AliPID::kProton])
1260  &&(prob1[AliPID::kKaon ]>fPIDThreshold[AliPID::kKaon ])
1262  }else{
1263  //pion or proton
1264 
1265 
1266  if(TMath::MaxElement(AliPID::kSPECIES,prob1) == prob1[AliPID::kKaon]){
1267  if(TMath::MaxElement(AliPID::kSPECIES,prob0) == prob0[AliPID::kProton] && TMath::MaxElement(AliPID::kSPECIES,prob2) == prob2[AliPID::kPion]) okXicpKpi = 1;
1268  if(TMath::MaxElement(AliPID::kSPECIES,prob2) == prob2[AliPID::kProton] && TMath::MaxElement(AliPID::kSPECIES,prob0) == prob0[AliPID::kPion]) okXicpiKp = 1;
1269  }
1270  }
1271 
1272  if(okXicpKpi) returnvalue=1; //cuts passed as Xic->pKpi
1273  if(okXicpiKp) returnvalue=2; //cuts passed as Xic->piKp
1274  if(okXicpKpi && okXicpiKp) returnvalue=3; //cuts passed as both pKpi and piKp
1275 
1276  return returnvalue;
1277 }
1278 //-----------------------
1280 
1281  Int_t returnvalue =0;
1282  Double_t thresholdK =0.7;
1283  Double_t thresholdPi =0.3;
1284  Double_t thresholdPr =0.7;
1285 
1286  AliVTrack *track0=dynamic_cast<AliVTrack*>(obj->GetDaughter(0));
1287  AliVTrack *track1=dynamic_cast<AliVTrack*>(obj->GetDaughter(1));
1288  AliVTrack *track2=dynamic_cast<AliVTrack*>(obj->GetDaughter(2));
1289 
1290  if (!track0 || !track1 || !track2) return 0;
1291  Double_t prob0[AliPID::kSPECIES];
1292  Double_t prob1[AliPID::kSPECIES];
1293  Double_t prob2[AliPID::kSPECIES];
1294 
1295  fPidHF->GetPidCombined()->ComputeProbabilities(track0,fPidHF->GetPidResponse(),prob0);
1296  fPidHF->GetPidCombined()->ComputeProbabilities(track1,fPidHF->GetPidResponse(),prob1);
1297  fPidHF->GetPidCombined()->ComputeProbabilities(track2,fPidHF->GetPidResponse(),prob2);
1298 
1299  if(prob1[AliPID::kKaon]>thresholdK){
1300  if(TMath::MaxElement(AliPID::kSPECIES,prob0)>TMath::MaxElement(AliPID::kSPECIES,prob2)){
1301  if(((prob0[AliPID::kPion ]>prob0[AliPID::kProton ])&& prob0[AliPID::kPion]>thresholdPi) && prob2[AliPID::kProton]>thresholdPr) returnvalue=2;//piKp
1302  else if(((prob0[AliPID::kProton ]>prob0[AliPID::kPion ])&& prob0[AliPID::kProton]>thresholdPr) && prob2[AliPID::kPion]>thresholdPi)returnvalue =1;//pKpi
1303  }
1304 
1305  else if(TMath::MaxElement(AliPID::kSPECIES,prob0)<TMath::MaxElement(AliPID::kSPECIES,prob2)){
1306  if(((prob2[AliPID::kPion ]>prob2[AliPID::kProton ])&& prob2[AliPID::kPion]>thresholdPi) && prob0[AliPID::kProton]>thresholdPr) returnvalue=1; //pKpi
1307  else if(((prob2[AliPID::kProton ]>prob2[AliPID::kPion ])&& prob2[AliPID::kProton]>thresholdPr) && prob0[AliPID::kPion]>thresholdPi)returnvalue =2; //piKp
1308  }
1309 
1310  }
1311  return returnvalue;
1312 
1313 }
1314 //------------------------------------------------------
1316 
1317  SetName("XictopKpiProdCuts");
1318  SetTitle("Production cuts for Xic analysis");
1319 
1320  AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default");
1321  esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
1322  esdTrackCuts->SetRequireTPCRefit(kTRUE);
1323  esdTrackCuts->SetMinNClustersTPC(70);
1324  esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
1325  AliESDtrackCuts::kAny);
1326  esdTrackCuts->SetRequireITSRefit(kTRUE);
1327  esdTrackCuts->SetMinNClustersITS(4);
1328  esdTrackCuts->SetMinDCAToVertexXY(0.);
1329  esdTrackCuts->SetEtaRange(-0.8,0.8);
1330  esdTrackCuts->SetPtRange(0.3,1.e10);
1331  AddTrackCuts(esdTrackCuts);
1332  delete esdTrackCuts;
1333  esdTrackCuts=NULL;
1334 
1335  const Int_t nvars=13;
1336  const Int_t nptbins=9;
1337  Float_t* ptbins;
1338  ptbins=new Float_t[nptbins+1];
1339  ptbins[0]=0.;
1340  ptbins[1]=1.;
1341  ptbins[2]=2.;
1342  ptbins[3]=3.;
1343  ptbins[4]=4.;
1344  ptbins[5]=5.;
1345  ptbins[6]=6.;
1346  ptbins[7]=8.;
1347  ptbins[8]=10.;
1348  ptbins[9]=99999.;
1349 
1350  SetGlobalIndex(nvars,nptbins);
1351  SetPtBins(nptbins+1,ptbins);
1352 
1353  Float_t** prodcutsval;
1354  prodcutsval=new Float_t*[nvars];
1355  for(Int_t iv=0;iv<nvars;iv++){
1356  prodcutsval[iv]=new Float_t[nptbins];
1357  }
1358 
1359  for(Int_t ipt=0;ipt<nptbins;ipt++){
1360  prodcutsval[0][ipt]=0.13;
1361  prodcutsval[1][ipt]=0.4;
1362  prodcutsval[2][ipt]=0.4;
1363  prodcutsval[3][ipt]=0.;
1364  prodcutsval[4][ipt]=0.;
1365  prodcutsval[5][ipt]=0.;
1366  prodcutsval[6][ipt]=0.06;
1367  prodcutsval[7][ipt]=0.;
1368  prodcutsval[8][ipt]=0.;
1369  prodcutsval[9][ipt]=0.;
1370  prodcutsval[10][ipt]=0.;
1371  prodcutsval[11][ipt]=0.05;
1372  prodcutsval[12][ipt]=0.4;
1373  }
1374  SetCuts(nvars,nptbins,prodcutsval);
1375 
1376  AliAODPidHF* pidObjK=new AliAODPidHF();
1377  Double_t sigmasK[5]={3.,1.,1.,3.,2.};
1378  pidObjK->SetSigma(sigmasK);
1379  pidObjK->SetAsym(kTRUE);
1380  pidObjK->SetMatch(1);
1381  pidObjK->SetTPC(kTRUE);
1382  pidObjK->SetTOF(kTRUE);
1383  pidObjK->SetITS(kTRUE);
1384  Double_t plimK[2]={0.5,0.8};
1385  pidObjK->SetPLimit(plimK,2);
1386  pidObjK->SetTOFdecide(kTRUE);
1387  SetPidHF(pidObjK);
1388 
1389  AliAODPidHF* pidObjpi=new AliAODPidHF();
1390  pidObjpi->SetTPC(kTRUE);
1391  Double_t sigmaspi[5]={3.,0.,0.,0.,0.};
1392  pidObjpi->SetSigma(sigmaspi);
1393  pidObjpi->SetTOFdecide(kTRUE);
1394  SetPidpion(pidObjpi);
1395 
1396  AliAODPidHF* pidObjp=new AliAODPidHF();
1397  Double_t sigmasp[5]={3.,1.,1.,3.,2.};
1398  pidObjp->SetSigma(sigmasp);
1399  pidObjp->SetAsym(kTRUE);
1400  pidObjp->SetMatch(1);
1401  pidObjp->SetTPC(kTRUE);
1402  pidObjp->SetTOF(kTRUE);
1403  pidObjp->SetITS(kTRUE);
1404  Double_t plimp[2]={1.,2.};
1405  pidObjp->SetPLimit(plimp,2);
1406  pidObjp->SetTOFdecide(kTRUE);
1407 
1408  SetUsePID(kTRUE);
1409 
1410  // PrintAll();
1411 
1412  for(Int_t iiv=0;iiv<nvars;iiv++){
1413  delete [] prodcutsval[iiv];
1414  }
1415  delete [] prodcutsval;
1416  prodcutsval=NULL;
1417  delete [] ptbins;
1418  ptbins=NULL;
1419 
1420  delete pidObjK;
1421  pidObjK=NULL;
1422  delete pidObjpi;
1423  pidObjpi=NULL;
1424  delete pidObjp;
1425  pidObjp=NULL;
1426 
1427  return;
1428 }
1429 //-----------------------
1431 
1432  Int_t returnvalue =0;
1433  Double_t thresholdPr=fPIDThreshold[AliPID::kProton ];
1434  Double_t thresholdK=fPIDThreshold[AliPID::kKaon ];
1435  Double_t thresholdPi=fPIDThreshold[AliPID::kPion ];
1436 
1437 
1438  AliVTrack *track0=dynamic_cast<AliVTrack*>(obj->GetDaughter(0));
1439  AliVTrack *track1=dynamic_cast<AliVTrack*>(obj->GetDaughter(1));
1440  AliVTrack *track2=dynamic_cast<AliVTrack*>(obj->GetDaughter(2));
1441 
1442  if (!track0 || !track1 || !track2) return 0;
1443  Double_t prob0[AliPID::kSPECIES];
1444  Double_t prob1[AliPID::kSPECIES];
1445  Double_t prob2[AliPID::kSPECIES];
1446 
1447  fPidHF->GetPidCombined()->ComputeProbabilities(track0,fPidHF->GetPidResponse(),prob0);
1448  fPidHF->GetPidCombined()->ComputeProbabilities(track1,fPidHF->GetPidResponse(),prob1);
1449  fPidHF->GetPidCombined()->ComputeProbabilities(track2,fPidHF->GetPidResponse(),prob2);
1450 
1451  if(prob1[AliPID::kKaon]<thresholdK) return 0;
1452  if(prob0[AliPID::kPion]<thresholdPi&&prob2[AliPID::kPion]<thresholdPi) return 0;
1453  if(prob0[AliPID::kProton]<thresholdPr&&prob2[AliPID::kProton]<thresholdPr) return 0;
1454  if((prob0[AliPID::kPion]>prob0[AliPID::kProton]&&prob2[AliPID::kPion]>prob2[AliPID::kProton])||(prob0[AliPID::kPion]<prob0[AliPID::kProton]&&prob2[AliPID::kPion]<prob2[AliPID::kProton])) return 0; //pKp or piKpi candidate
1455 
1456  if(prob0[AliPID::kPion]>prob0[AliPID::kProton]&&prob2[AliPID::kPion]<prob2[AliPID::kProton]) returnvalue=2; //piKp
1457  else if(prob0[AliPID::kPion]==prob0[AliPID::kProton]||prob2[AliPID::kPion]==prob2[AliPID::kProton]) returnvalue=3; //pKpi or piKp
1458  else returnvalue=1; //pKpi
1459 
1460  return returnvalue;
1461 
1462 }
1463 //-----------------------
1464 void AliRDHFCutsXictopKpi::ExplorePID(AliPIDResponse* pid_resp, AliAODRecoDecayHF3Prong* cand, UInt_t PIDcase, Bool_t &is_pKpi_passed, Bool_t &is_piKp_passed)
1465 {
1466  //
1467  // Testing some PID cuts, tuned on TH2 PID plots from pp @ 5 TeV
1468  //
1469 
1470  // store the PID variables (nSigma)
1471  Float_t nSigma_TPC_prot_0=99, nSigma_TOF_prot_0=99, nSigma_TPC_pion_0=99, nSigma_TOF_pion_0=99;
1472  Float_t nSigma_TPC_kaon_1=99, nSigma_TOF_kaon_1=99;
1473  Float_t nSigma_TPC_prot_2=99, nSigma_TOF_prot_2=99, nSigma_TPC_pion_2=99, nSigma_TOF_pion_2=99;
1474  AliPIDResponse::EDetPidStatus status_TPC_0, status_TPC_1, status_TPC_2, status_TOF_0, status_TOF_1, status_TOF_2;
1475  status_TPC_0 = pid_resp->CheckPIDStatus(AliPIDResponse::kTPC,(AliAODTrack*)cand->GetDaughter(0));
1476  status_TOF_0 = pid_resp->CheckPIDStatus(AliPIDResponse::kTOF,(AliAODTrack*)cand->GetDaughter(0));
1477  status_TPC_1 = pid_resp->CheckPIDStatus(AliPIDResponse::kTPC,(AliAODTrack*)cand->GetDaughter(1));
1478  status_TOF_1 = pid_resp->CheckPIDStatus(AliPIDResponse::kTOF,(AliAODTrack*)cand->GetDaughter(1));
1479  status_TPC_2 = pid_resp->CheckPIDStatus(AliPIDResponse::kTPC,(AliAODTrack*)cand->GetDaughter(2));
1480  status_TOF_2 = pid_resp->CheckPIDStatus(AliPIDResponse::kTOF,(AliAODTrack*)cand->GetDaughter(2));
1481  if(status_TPC_0 == AliPIDResponse::kDetPidOk){
1482  nSigma_TPC_pion_0 = pid_resp->NumberOfSigmasTPC((AliAODTrack*)cand->GetDaughter(0),AliPID::kPion);
1483  nSigma_TPC_prot_0 = pid_resp->NumberOfSigmasTPC((AliAODTrack*)cand->GetDaughter(0),AliPID::kProton);
1484  }
1485  if(status_TOF_0 == AliPIDResponse::kDetPidOk){
1486  nSigma_TOF_pion_0 = pid_resp->NumberOfSigmasTOF((AliAODTrack*)cand->GetDaughter(0),AliPID::kPion);
1487  nSigma_TOF_prot_0 = pid_resp->NumberOfSigmasTOF((AliAODTrack*)cand->GetDaughter(0),AliPID::kProton);
1488  }
1489  if(status_TPC_1 == AliPIDResponse::kDetPidOk){
1490  nSigma_TPC_kaon_1 = pid_resp->NumberOfSigmasTPC((AliAODTrack*)cand->GetDaughter(1),AliPID::kKaon);
1491  }
1492  if(status_TOF_1 == AliPIDResponse::kDetPidOk){
1493  nSigma_TOF_kaon_1 = pid_resp->NumberOfSigmasTOF((AliAODTrack*)cand->GetDaughter(1),AliPID::kKaon);
1494  }
1495  if(status_TPC_2 == AliPIDResponse::kDetPidOk){
1496  nSigma_TPC_pion_2 = pid_resp->NumberOfSigmasTPC((AliAODTrack*)cand->GetDaughter(2),AliPID::kPion);
1497  nSigma_TPC_prot_2 = pid_resp->NumberOfSigmasTPC((AliAODTrack*)cand->GetDaughter(2),AliPID::kProton);
1498  }
1499  if(status_TOF_2 == AliPIDResponse::kDetPidOk){
1500  nSigma_TOF_pion_2 = pid_resp->NumberOfSigmasTOF((AliAODTrack*)cand->GetDaughter(2),AliPID::kPion);
1501  nSigma_TOF_prot_2 = pid_resp->NumberOfSigmasTOF((AliAODTrack*)cand->GetDaughter(2),AliPID::kProton);
1502  }
1503 
1504  Float_t pt_prong0 = (Float_t) ((AliAODTrack*) cand->GetDaughter(0))->Pt();
1505  Float_t pt_prong1 = (Float_t) ((AliAODTrack*) cand->GetDaughter(1))->Pt();
1506  Float_t pt_prong2 = (Float_t) ((AliAODTrack*) cand->GetDaughter(2))->Pt();
1507  //
1508  // look if the candidate satisfies the PID cuts
1509  //
1510  switch (PIDcase)
1511  {
1512  // (TPC_prot_0 && TPC_kaon_1) || (TPC_prot_2 && TPC_kaon_1)
1513  case 1:
1514  if( func_TPCprot_down(pt_prong0)< nSigma_TPC_prot_0 && nSigma_TPC_prot_0<func_TPCprot_up(pt_prong0) && func_TPCkaon_down(pt_prong1)<nSigma_TPC_kaon_1 && nSigma_TPC_kaon_1<func_TPCkaon_up(pt_prong1) ) is_pKpi_passed = kTRUE;
1515  if( func_TPCprot_down(pt_prong2)< nSigma_TPC_prot_2 && nSigma_TPC_prot_2<func_TPCprot_up(pt_prong2) && func_TPCkaon_down(pt_prong1)<nSigma_TPC_kaon_1 && nSigma_TPC_kaon_1<func_TPCkaon_up(pt_prong1) ) is_piKp_passed = kTRUE;
1516  break;
1517  // (TPC_prot_0 && TOF_prot_0 && TPC_kaon_1) || (TPC_prot_2 && TOF_prot_2 && TPC_kaon_1)
1518  case 2:
1519  if( func_TPCprot_down(pt_prong0)< nSigma_TPC_prot_0 && nSigma_TPC_prot_0<func_TPCprot_up(pt_prong0) && func_TOFprot_down(pt_prong0)<nSigma_TOF_prot_0 && nSigma_TOF_prot_0<func_TOFprot_up(pt_prong0) && func_TPCkaon_down(pt_prong1)<nSigma_TPC_kaon_1 && nSigma_TPC_kaon_1<func_TPCkaon_up(pt_prong1) ) is_pKpi_passed = kTRUE;
1520  if( func_TPCprot_down(pt_prong2)< nSigma_TPC_prot_2 && nSigma_TPC_prot_2<func_TPCprot_up(pt_prong2) && func_TOFprot_down(pt_prong2)<nSigma_TOF_prot_2 && nSigma_TOF_prot_2<func_TOFprot_up(pt_prong2) && func_TPCkaon_down(pt_prong1)<nSigma_TPC_kaon_1 && nSigma_TPC_kaon_1<func_TPCkaon_up(pt_prong1) ) is_piKp_passed = kTRUE;
1521  break;
1522  // (TPC_prot_0 && TOF_prot_0 && TOF_kaon_1) || (TPC_prot_2 && TOF_prot_2 && TOF_kaon_1)
1523  case 3:
1524  if( func_TPCprot_down(pt_prong0)< nSigma_TPC_prot_0 && nSigma_TPC_prot_0<func_TPCprot_up(pt_prong0) && func_TOFprot_down(pt_prong0)<nSigma_TOF_prot_0 && nSigma_TOF_prot_0<func_TOFprot_up(pt_prong0) && func_TOFkaon_down(pt_prong1)<nSigma_TOF_kaon_1 && nSigma_TOF_kaon_1<func_TOFkaon_up(pt_prong1) ) is_pKpi_passed = kTRUE;
1525  if( func_TPCprot_down(pt_prong2)< nSigma_TPC_prot_2 && nSigma_TPC_prot_2<func_TPCprot_up(pt_prong2) && func_TOFprot_down(pt_prong2)<nSigma_TOF_prot_2 && nSigma_TOF_prot_2<func_TOFprot_up(pt_prong2) && func_TOFkaon_down(pt_prong1)<nSigma_TOF_kaon_1 && nSigma_TOF_kaon_1<func_TOFkaon_up(pt_prong1) ) is_piKp_passed = kTRUE;
1526  break;
1527  // (TPC_prot_0 && TOF_prot_0 && TPC_kaon_1 && TOF_kaon_1) || (TPC_prot_2 && TOF_prot_2 && TPC_kaon_1 & TOF_kaon_1)
1528  case 4:
1529  if( func_TPCprot_down(pt_prong0)< nSigma_TPC_prot_0 && nSigma_TPC_prot_0<func_TPCprot_up(pt_prong0) && func_TOFprot_down(pt_prong0)<nSigma_TOF_prot_0 && nSigma_TOF_prot_0<func_TOFprot_up(pt_prong0) && func_TPCkaon_down(pt_prong1)<nSigma_TPC_kaon_1 && nSigma_TPC_kaon_1<func_TPCkaon_up(pt_prong1) && func_TOFkaon_down(pt_prong1)<nSigma_TOF_kaon_1 && nSigma_TOF_kaon_1<func_TOFkaon_up(pt_prong1) ) is_pKpi_passed = kTRUE;
1530  if( func_TPCprot_down(pt_prong2)< nSigma_TPC_prot_2 && nSigma_TPC_prot_2<func_TPCprot_up(pt_prong2) && func_TOFprot_down(pt_prong2)<nSigma_TOF_prot_2 && nSigma_TOF_prot_2<func_TOFprot_up(pt_prong2) && func_TPCkaon_down(pt_prong1)<nSigma_TPC_kaon_1 && nSigma_TPC_kaon_1<func_TPCkaon_up(pt_prong1) && func_TOFkaon_down(pt_prong1)<nSigma_TOF_kaon_1 && nSigma_TOF_kaon_1<func_TOFkaon_up(pt_prong1) ) is_piKp_passed = kTRUE;
1531  break;
1532  // (TOF_prot_0 && TOF_kaon_1) || (TOF_prot_2 && TOF_kaon_1)
1533  case 5:
1534  if( func_TOFprot_down(pt_prong0)< nSigma_TOF_prot_0 && nSigma_TOF_prot_0<func_TOFprot_up(pt_prong0) && func_TOFkaon_down(pt_prong1)<nSigma_TOF_kaon_1 && nSigma_TOF_kaon_1<func_TOFkaon_up(pt_prong1) ) is_pKpi_passed = kTRUE;
1535  if( func_TOFprot_down(pt_prong2)< nSigma_TOF_prot_2 && nSigma_TOF_prot_2<func_TOFprot_up(pt_prong2) && func_TOFkaon_down(pt_prong1)<nSigma_TOF_kaon_1 && nSigma_TOF_kaon_1<func_TOFkaon_up(pt_prong1) ) is_piKp_passed = kTRUE;
1536  break;
1537  // (TOF_prot_0 && TPC_kaon_1) || (TOF_prot_2 && TPC_kaon_1)
1538  case 6:
1539  if( func_TOFprot_down(pt_prong0)< nSigma_TOF_prot_0 && nSigma_TOF_prot_0<func_TOFprot_up(pt_prong0) && func_TPCkaon_down(pt_prong1)<nSigma_TPC_kaon_1 && nSigma_TPC_kaon_1<func_TPCkaon_up(pt_prong1) ) is_pKpi_passed = kTRUE;
1540  if( func_TOFprot_down(pt_prong2)< nSigma_TOF_prot_2 && nSigma_TOF_prot_2<func_TOFprot_up(pt_prong2) && func_TPCkaon_down(pt_prong1)<nSigma_TPC_kaon_1 && nSigma_TPC_kaon_1<func_TPCkaon_up(pt_prong1) ) is_piKp_passed = kTRUE;
1541  break;
1542  // (TOF_prot_0 && TPC_kaon_1 && TOF_kaon_1) || (TOF_prot_2 && TPC_kaon_1 && TOF_kaon_1)
1543  case 7:
1544  if( func_TOFprot_down(pt_prong0)< nSigma_TOF_prot_0 && nSigma_TOF_prot_0<func_TOFprot_up(pt_prong0) && func_TPCkaon_down(pt_prong1)<nSigma_TPC_kaon_1 && nSigma_TPC_kaon_1<func_TPCkaon_up(pt_prong1) && func_TOFkaon_down(pt_prong1)<nSigma_TOF_kaon_1 && nSigma_TOF_kaon_1<func_TOFkaon_up(pt_prong1) ) is_pKpi_passed = kTRUE;
1545  if( func_TOFprot_down(pt_prong2)< nSigma_TOF_prot_2 && nSigma_TOF_prot_2<func_TOFprot_up(pt_prong2) && func_TPCkaon_down(pt_prong1)<nSigma_TPC_kaon_1 && nSigma_TPC_kaon_1<func_TPCkaon_up(pt_prong1) && func_TOFkaon_down(pt_prong1)<nSigma_TOF_kaon_1 && nSigma_TOF_kaon_1<func_TOFkaon_up(pt_prong1) ) is_piKp_passed = kTRUE;
1546  break;
1547  // (|TPC_prot_0|<3 && TOF_prot_0 && TOF_kaon_1) || (|TPC_prot_2|<3 && TOF_prot_2 && TOF_kaon_1)
1548  case 8:
1549  if( -3< nSigma_TPC_prot_0 && nSigma_TPC_prot_0<3 && func_TOFprot_down(pt_prong0)<nSigma_TOF_prot_0 && nSigma_TOF_prot_0<func_TOFprot_up(pt_prong0) && func_TOFkaon_down(pt_prong1)<nSigma_TOF_kaon_1 && nSigma_TOF_kaon_1<func_TOFkaon_up(pt_prong1) ) is_pKpi_passed = kTRUE;
1550  if( -3< nSigma_TPC_prot_2 && nSigma_TPC_prot_2<3 && func_TOFprot_down(pt_prong2)<nSigma_TOF_prot_2 && nSigma_TOF_prot_2<func_TOFprot_up(pt_prong2) && func_TOFkaon_down(pt_prong1)<nSigma_TOF_kaon_1 && nSigma_TOF_kaon_1<func_TOFkaon_up(pt_prong1) ) is_piKp_passed = kTRUE;
1551  break;
1552  // (|TPC_prot_0|<3 && TOF_prot_0 && TPC_kaon_1) || (|TPC_prot_2|<3 && TOF_prot_2 && TPC_kaon_1)
1553  case 9:
1554  if( -3< nSigma_TPC_prot_0 && nSigma_TPC_prot_0<3 && func_TOFprot_down(pt_prong0)<nSigma_TOF_prot_0 && nSigma_TOF_prot_0<func_TOFprot_up(pt_prong0) && func_TPCkaon_down(pt_prong1)<nSigma_TPC_kaon_1 && nSigma_TPC_kaon_1<func_TPCkaon_up(pt_prong1) ) is_pKpi_passed = kTRUE;
1555  if( -3< nSigma_TPC_prot_2 && nSigma_TPC_prot_2<3 && func_TOFprot_down(pt_prong2)<nSigma_TOF_prot_2 && nSigma_TOF_prot_2<func_TOFprot_up(pt_prong2) && func_TPCkaon_down(pt_prong1)<nSigma_TPC_kaon_1 && nSigma_TPC_kaon_1<func_TPCkaon_up(pt_prong1) ) is_piKp_passed = kTRUE;
1556  break;
1557  // (|TPC_prot_0|<3 && TOF_prot_0 && TPC_kaon_1 && TOF_kaon_1) || (|TPC_prot_2|<3 && TOF_prot_2 && TPC_kaon_1 && TOF_kaon_1)
1558  case 10:
1559  if( -3< nSigma_TPC_prot_0 && nSigma_TPC_prot_0<3 && func_TOFprot_down(pt_prong0)<nSigma_TOF_prot_0 && nSigma_TOF_prot_0<func_TOFprot_up(pt_prong0) && func_TPCkaon_down(pt_prong1)<nSigma_TPC_kaon_1 && nSigma_TPC_kaon_1<func_TPCkaon_up(pt_prong1) && func_TOFkaon_down(pt_prong1)<nSigma_TOF_kaon_1 && nSigma_TOF_kaon_1<func_TOFkaon_up(pt_prong1) ) is_pKpi_passed = kTRUE;
1560  if( -3< nSigma_TPC_prot_2 && nSigma_TPC_prot_2<3 && func_TOFprot_down(pt_prong2)<nSigma_TOF_prot_2 && nSigma_TOF_prot_2<func_TOFprot_up(pt_prong2) && func_TPCkaon_down(pt_prong1)<nSigma_TPC_kaon_1 && nSigma_TPC_kaon_1<func_TPCkaon_up(pt_prong1) && func_TOFkaon_down(pt_prong1)<nSigma_TOF_kaon_1 && nSigma_TOF_kaon_1<func_TOFkaon_up(pt_prong1) ) is_piKp_passed = kTRUE;
1561  break;
1562 
1563  default:
1564  break;
1565  }
1566 
1567 
1568  return;
1569 }
Int_t IsSelectedCombinedPIDProb(AliAODRecoDecayHF *obj)
void ExplorePID(AliPIDResponse *pid_resp, AliAODRecoDecayHF3Prong *cand, UInt_t PIDcase, Bool_t &is_pKpi_passed, Bool_t &is_piKp_passed)
Bool_t fUseSpecialCut
cut strategy (standard or KF)
void SetAsym(Bool_t asym)
Definition: AliAODPidHF.h:101
Int_t PtBin(Float_t pt) const
Definition: AliRDHFCuts.h:330
double Double_t
Definition: External.C:58
virtual Bool_t IsInFiducialAcceptance(Double_t pt, Double_t y) const
Bool_t IsSignalMC(AliAODRecoDecay *d, AliAODEvent *aod, Int_t pdg) const
void SetPidprot(AliAODPidHF *pidProt)
AliRDHFCutsXictopKpi & operator=(const AliRDHFCutsXictopKpi &source)
Double_t mass
Bool_t CheckTOFPIDStatus(AliAODTrack *track) const
void SetPIDThreshold(AliPID::EParticleType species, Double_t threshold)
virtual void SetStandardCutsPbPb2011()
void SetNVars(Int_t nVars)
Definition: AliRDHFCuts.h:445
Double_t fMaxRapidityCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:501
void EnableSemiCentralTrigger()
Definition: AliRDHFCuts.h:101
Int_t IsSelectedNSigmaPbPb(AliAODRecoDecayHF *obj)
void SetGlobalIndex()
Definition: AliRDHFCuts.h:213
AliRDHFCuts & operator=(const AliRDHFCuts &source)
Bool_t fUsePID
Definition: AliRDHFCuts.h:476
Int_t MatchTPCTOFMin(AliAODTrack *track, Int_t specie)
PID nSigma strategy closer to the Bayesian approach with Max. prob.
void SetPidHF(AliAODPidHF *pidObj)
see enum below
Definition: AliRDHFCuts.h:227
AliAODPidHF * GetPidHF() const
Definition: AliRDHFCuts.h:264
void SetTOF(Bool_t tof)
Definition: AliAODPidHF.h:108
Bool_t HasBadDaughters() const
Float_t func_TPCprot_down(Float_t x)
void SetUseCombined(Bool_t useCombined=kTRUE)
Definition: AliAODPidHF.h:213
void SetUseDefaultPriors(Bool_t defaultP)
Definition: AliAODPidHF.h:214
void SetCombDetectors(ECombDetectors pidComb)
Definition: AliAODPidHF.h:125
Float_t func_TPCkaon_down(Float_t x)
int Int_t
Definition: External.C:63
Bool_t fUseTrackSelectionWithFilterBits
flag to reject kink daughters
Definition: AliRDHFCuts.h:512
void SetCuts(Int_t nVars, Int_t nPtBins, Float_t **cutsRD)
Int_t fnVarsForOpt
Definition: AliRDHFCuts.h:471
void ResetMaskAndEnableMBTrigger()
Definition: AliRDHFCuts.h:81
virtual void GetCutVarsForOpt(AliAODRecoDecayHF *d, Float_t *vars, Int_t nvars, Int_t *pdgdaughters)
unsigned int UInt_t
Definition: External.C:33
AliPIDCombined * GetPidCombined() const
Definition: AliAODPidHF.h:174
float Float_t
Definition: External.C:68
const Double_t ptmax
Double_t fMaxPtCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:500
Float_t func_TPCprot_up(Float_t x)
switch for cut on d0p*d0K vs. d0K*d0pi
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
AliRDHFCutsXictopKpi(const char *name="CutsLctopKpi")
ECutsStrategy fCutsStrategy
PID threshold for each species.
Bool_t fKeepSignalMC
max rapidity of candidate (if !=-999 overrides IsInFiducialAcceptance)
Definition: AliRDHFCuts.h:502
Double_t GetSigmaVert(const AliAODEvent *aod=0x0)
Float_t func_TOFprot_up(Float_t x)
virtual void SetStandardCutsPbPb2010()
virtual void SetStandardCutsPPb2013()
Int_t fIsSelectedPID
outcome of cuts selection
Definition: AliRDHFCuts.h:498
Int_t CombinePIDCuts(Int_t returnvalue, Int_t returnvaluePID) const
Bool_t GetMC() const
Definition: AliAODPidHF.h:161
Int_t MakeRawPid(AliAODTrack *track, Int_t specie)
AliPIDResponse * GetPidResponse() const
Definition: AliAODPidHF.h:173
void SetPidpion(AliAODPidHF *pidPion)
void SetSigma(Double_t *sigma)
Definition: AliAODPidHF.h:52
Int_t IsSelectedCombinedPID(AliAODRecoDecayHF *obj)
Float_t * fCutsRD
fnVars*fnPtBins
Definition: AliRDHFCuts.h:474
virtual void SetStandardCutsPP2010()
void SetPIDStrategy(EPIDStrategy pidStrategy)
virtual Int_t IsSelectedPID(AliAODRecoDecayHF *obj)
void SetVarsForOpt(Int_t nVars, Bool_t *forOpt)
void SetVarNames(Int_t nVars, TString *varNames, Bool_t *isUpperCut)
Float_t func_TPCkaon_up(Float_t x)
Bool_t * fVarsForOpt
number of cut vars to be optimized for candidates
Definition: AliRDHFCuts.h:472
Bool_t isMC
Bool_t AreDaughtersSelected(AliAODRecoDecayHF *rd, const AliAODEvent *aod=0x0) const
void EnableCentralTrigger()
Definition: AliRDHFCuts.h:89
decay
Definition: HFPtSpectrum.C:42
Bool_t GetOnePad() const
Definition: AliAODPidHF.h:162
void SetUsePID(Bool_t flag=kTRUE)
Definition: AliRDHFCuts.h:221
void SetMC(Bool_t mc)
Definition: AliAODPidHF.h:114
Float_t func_TOFprot_down(Float_t x)
Int_t IsSelectedCombinedPIDpPb(AliAODRecoDecayHF *obj)
void SetPtBins(Int_t nPtBinLimits, Float_t *ptBinLimits)
AliKFParticle * ReconstructKF(AliAODRecoDecayHF3Prong *d, Int_t *pdgs, Double_t field, Bool_t constraint) const
void SetITS(Bool_t its)
Definition: AliAODPidHF.h:109
void SetTOFdecide(Bool_t tOFdecide)
Definition: AliAODPidHF.h:120
void SetMatch(Int_t match)
Definition: AliAODPidHF.h:111
Int_t IsSelectedCombinedPIDSoft(AliAODRecoDecayHF *obj)
void AddTrackCuts(const AliESDtrackCuts *cuts)
Definition: AliRDHFCuts.h:219
void SetPLimit(Double_t *plim, Int_t npLim)
AliKFParticle * ApplyVertexingKF(Int_t *iprongs, Int_t nprongs, Int_t *pdgs, Bool_t topoCostraint, Double_t bzkG, Double_t *mass) const
vertexing KF:
void SetTPC(Bool_t tpc)
Definition: AliAODPidHF.h:107
bool Bool_t
Definition: External.C:53
Double_t CosPointingAngle() const
Float_t func_TOFkaon_down(Float_t x)
void SetTriggerClass(TString trclass0, TString trclass1="")
Definition: AliRDHFCuts.h:208
AliAODPidHF * fPidHF
enable AOD049 centrality cleanup
Definition: AliRDHFCuts.h:478
Int_t IsSelectedCombinedPIDpPb2(AliAODRecoDecayHF *obj)
Double_t fPIDThreshold[AliPID::kSPECIES]
PIS strategy (nsigma, combined)
void SetOptPileup(Int_t opt=0)
Definition: AliRDHFCuts.h:235
Int_t GetGlobalIndex(Int_t iVar, Int_t iPtBin) const
Double_t DecayLength() const
Int_t nptbins
Double_t fMinPtCand
outcome of PID selection
Definition: AliRDHFCuts.h:499
void SetOnePad(Bool_t onepad)
Definition: AliAODPidHF.h:116
Int_t IsSelectedPIDStrong(AliAODRecoDecayHF *obj)
Float_t func_TOFkaon_up(Float_t x)
void SetPidResponse(AliPIDResponse *pidResp)
Definition: AliAODPidHF.h:124