AliPhysics  58f3d52 (58f3d52)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliRDHFCutsDplustoKpipi.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 D+->Kpipi
21 //
22 // Author: R. Bala, bala@to.infn.it
23 // G. Ortona, ortona@to.infn.it
25 
26 #include <TDatabasePDG.h>
27 #include <Riostream.h>
28 
29 #include "AliAODPidHF.h"
32 #include "AliAODTrack.h"
33 #include "AliESDtrack.h"
34 
35 
36 using std::cout;
37 using std::endl;
38 
40 ClassImp(AliRDHFCutsDplustoKpipi);
42 
43 
44 //--------------------------------------------------------------------------
46  AliRDHFCuts(name),
47  fUseStrongPid(0),
48  fMaxPtStrongPid(0.),
49  fMaxPStrongPidK(0.),
50  fMaxPStrongPidpi(0.),
51  fUseImpParProdCorrCut(kFALSE),
52  fUsed0MeasMinusExpCut(kFALSE),
53  fMaxd0MeasMinusExp(0x0),
54  fUsed0Cut(kFALSE),
55  fMaxd0(0x0),
56  fScaleNormDLxyBypOverPt(kTRUE)
57 {
58  //
59  // Default Constructor
60  //
61  Int_t nvars=14;
62  SetNVars(nvars);
63  TString varNames[14]={"inv. mass [GeV]",
64  "pTK [GeV/c]",
65  "pTPi [GeV/c]",
66  "d0K [cm] lower limit!",
67  "d0Pi [cm] lower limit!",
68  "dist12 (cm)",
69  "sigmavert (cm)",
70  "dist prim-sec (cm)",
71  "pM=Max{pT1,pT2,pT3} (GeV/c)",
72  "cosThetaPoint",
73  "Sum d0^2 (cm^2)",
74  "dca cut (cm)",
75  "dec len XY (cm)",
76  "cosThetaPointXY"};
77  Bool_t isUpperCut[14]={kTRUE,
78  kFALSE,
79  kFALSE,
80  kFALSE,
81  kFALSE,
82  kFALSE,
83  kTRUE,
84  kFALSE,
85  kFALSE,
86  kFALSE,
87  kFALSE,
88  kTRUE,
89  kFALSE,
90  kFALSE};
91  SetVarNames(nvars,varNames,isUpperCut);
92  Bool_t forOpt[14]={kFALSE,
93  kFALSE,
94  kFALSE,
95  kFALSE,
96  kFALSE,
97  kFALSE,
98  kTRUE,
99  kTRUE,
100  kTRUE,
101  kTRUE,
102  kTRUE,
103  kFALSE,
104  kTRUE,
105  kTRUE};
106  SetVarsForOpt(7,forOpt);
107  Float_t limits[2]={0,999999999.};
108  SetPtBins(2,limits);
109  if(fPidHF)delete fPidHF;
110  fPidHF=new AliAODPidHF();
111  Double_t plim[2]={0.6,0.8};
112  Double_t nsigma[5]={2.,1.,2.,3.,0.};
113 
114  fPidHF->SetPLimit(plim,2);
115  fPidHF->SetAsym(kTRUE);
116  fPidHF->SetSigma(nsigma);
117  fPidHF->SetMatch(1);
118  fPidHF->SetTPC(1);
119  fPidHF->SetTOF(1);
120  fPidHF->SetITS(0);
121  fPidHF->SetTRD(0);
122  fPidHF->SetCompat(kTRUE);
123 
124 
125 }
126 
127 
128 
129 
130 
131 
132 
133 
134 //--------------------------------------------------------------------------
136  AliRDHFCuts(source),
137  fUseStrongPid(source.fUseStrongPid),
138  fMaxPtStrongPid(source.fMaxPtStrongPid),
139  fMaxPStrongPidK(source.fMaxPStrongPidK),
140  fMaxPStrongPidpi(source.fMaxPStrongPidpi),
141  fUseImpParProdCorrCut(source.fUseImpParProdCorrCut),
142  fUsed0MeasMinusExpCut(source.fUsed0MeasMinusExpCut),
143  fMaxd0MeasMinusExp(0x0),
144  fUsed0Cut(source.fUsed0Cut),
145  fMaxd0(0x0),
146  fScaleNormDLxyBypOverPt(source.fScaleNormDLxyBypOverPt)
147 {
148  //
149  // Copy constructor
150  //
152  if(source.fMaxd0) Setd0Cut(source.fnPtBins,source.fMaxd0);
153 }
154 //--------------------------------------------------------------------------
156 {
157  //
158  // assignment operator
159  //
160  if(&source == this) return *this;
161 
162  AliRDHFCuts::operator=(source);
163 
170  fUsed0Cut=source.fUsed0Cut;
172  if(source.fMaxd0) Setd0Cut(source.fnPtBins,source.fMaxd0);
174 
175  return *this;
176 }
177 
178 //---------------------------------------------------------------------------
180  //
181  // store the cuts
182  //
183  if(nPtBins!=fnPtBins) {
184  printf("Wrong number of pt bins: it has to be %d\n",fnPtBins);
185  AliFatal("exiting");
186  }
188  for(Int_t ib=0; ib<fnPtBins; ib++) fMaxd0MeasMinusExp[ib] = cutval[ib];
189  fUsed0MeasMinusExpCut=kTRUE;
190  return;
191 }
192 
193 //---------------------------------------------------------------------------
195  //
196  // store the cuts
197  //
198  if(nPtBins!=fnPtBins) {
199  printf("Wrong number of pt bins: it has to be %d\n",fnPtBins);
200  AliFatal("exiting");
201  }
202  if(!fMaxd0) fMaxd0 = new Float_t[fnPtBins];
203  for(Int_t ib=0; ib<fnPtBins; ib++) fMaxd0[ib] = cutval[ib];
204  fUsed0Cut=kTRUE;
205  return;
206 }
207 
208 //---------------------------------------------------------------------------
210  //
211  // Fills in vars the values of the variables
212  //
213 
214 
215  if(nvars!=fnVarsForOpt) {
216  printf("AliRDHFCutsDplustoKpipi::GetCutsVarsForOpt: wrong number of variables\n");
217  return;
218  }
219 
221 
222  //recalculate vertex w/o daughters
223  Bool_t cleanvtx=kFALSE;
224  AliAODVertex *origownvtx=0x0;
226  if(dd->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*dd->GetOwnPrimaryVtx());
227  cleanvtx=kTRUE;
228  if(!RecalcOwnPrimaryVtx(dd,aod)) {
229  CleanOwnPrimaryVtx(dd,aod,origownvtx);
230  cleanvtx=kFALSE;
231  }
232  }
233 
234  Int_t iter=-1;
235  if(fVarsForOpt[0]){
236  iter++;
237  vars[iter]=dd->InvMassDplus();
238  }
239  if(fVarsForOpt[1]){
240  iter++;
241  for(Int_t iprong=0;iprong<3;iprong++){
242  if(TMath::Abs(pdgdaughters[iprong])==321) {
243  vars[iter]=dd->PtProng(iprong);
244  }
245  }
246  }
247  if(fVarsForOpt[2]){
248  iter++;
249  Float_t minPtDau=1000000.0;
250  for(Int_t iprong=0;iprong<3;iprong++){
251  if(TMath::Abs(pdgdaughters[iprong])==211) {
252  if(dd->PtProng(iprong)<minPtDau){
253  minPtDau=dd->PtProng(iprong);
254  }
255  }
256  }
257  vars[iter]=minPtDau;
258  }
259  if(fVarsForOpt[3]){
260  iter++;
261  for(Int_t iprong=0;iprong<3;iprong++){
262  if(TMath::Abs(pdgdaughters[iprong])==321) {
263  vars[iter]=dd->Getd0Prong(iprong);
264  }
265  }
266  }
267  if(fVarsForOpt[4]){
268  iter++;
269  Float_t minImpParDau=1000000.0;
270  for(Int_t iprong=0;iprong<3;iprong++){
271  if(TMath::Abs(pdgdaughters[iprong])==211) {
272  if(dd->Getd0Prong(iprong)<minImpParDau){
273  minImpParDau=dd->Getd0Prong(iprong);
274  }
275  }
276  }
277  vars[iter]=minImpParDau;
278  }
279  if(fVarsForOpt[5]){
280  iter++;
281  Float_t dist12 = dd->GetDist12toPrim();
282  Float_t dist23 = dd->GetDist23toPrim();
283  if(dist12<dist23)vars[iter]=dist12;
284  else vars[iter]=dist23;
285  }
286  if(fVarsForOpt[6]){
287  iter++;
288  vars[iter]=dd->GetSigmaVert(aod);
289  }
290  if(fVarsForOpt[7]){
291  iter++;
292  vars[iter] = dd->DecayLength();
293  }
294  if(fVarsForOpt[8]){
295  iter++;
296  Float_t ptmax=0;
297  for(Int_t i=0;i<3;i++){
298  if(dd->PtProng(i)>ptmax)ptmax=dd->PtProng(i);
299  }
300  vars[iter]=ptmax;
301  }
302  if(fVarsForOpt[9]){
303  iter++;
304  vars[iter]=dd->CosPointingAngle();
305  }
306  if(fVarsForOpt[10]){
307  iter++;
308  vars[iter]=dd->Getd0Prong(0)*dd->Getd0Prong(0)+dd->Getd0Prong(1)*dd->Getd0Prong(1)+dd->Getd0Prong(2)*dd->Getd0Prong(2);
309  }
310  if(fVarsForOpt[11]){
311  iter++;
312  Float_t maxDCA=0;
313  for(Int_t iprong=0;iprong<3;iprong++){
314  if(dd->GetDCA(iprong)<maxDCA){
315  maxDCA=dd->GetDCA(iprong);
316  }
317  }
318  vars[iter]=maxDCA;
319  }
320  if(fVarsForOpt[12]){
321  iter++;
322  if(fScaleNormDLxyBypOverPt) vars[iter]=dd->NormalizedDecayLengthXY()*dd->P()/dd->Pt();
323  else vars[iter]=dd->NormalizedDecayLengthXY();
324  }
325  if(fVarsForOpt[13]){
326  iter++;
327  vars[iter]=dd->CosPointingAngleXY();
328  }
329 
330  if(cleanvtx)CleanOwnPrimaryVtx(dd,aod,origownvtx);
331 
332  return;
333 }
334 //---------------------------------------------------------------------------
336 {
337  //
338  // Checking if Dplus is in fiducial acceptance region
339  //
340 
341  if(fMaxRapidityCand>-998.){
342  if(TMath::Abs(y) > fMaxRapidityCand) return kFALSE;
343  else return kTRUE;
344  }
345 
346  if(pt > 5.) {
347  // applying cut for pt > 5 GeV
348  AliDebug(2,Form("pt of D+ = %f (> 5), cutting at |y| < 0.8",pt));
349  if (TMath::Abs(y) > 0.8) return kFALSE;
350 
351  } else {
352  // appliying smooth cut for pt < 5 GeV
353  Double_t maxFiducialY = -0.2/15*pt*pt+1.9/15*pt+0.5;
354  Double_t minFiducialY = 0.2/15*pt*pt-1.9/15*pt-0.5;
355  AliDebug(2,Form("pt of D+ = %f (< 5), cutting according to the fiducial zone [%f, %f]\n",pt,minFiducialY,maxFiducialY));
356  if (y < minFiducialY || y > maxFiducialY) return kFALSE;
357  }
358 
359  return kTRUE;
360 }
361 
362 //---------------------------------------------------------------------------
364 {
365  if(!fUsePID || !rd) return -1;
366  //if(fUsePID)printf("i am inside the pid \n");
367  Int_t mask=0;
368  Int_t sign=rd->GetCharge();
369  for(Int_t daught=0;daught<3;daught++){
370  AliAODTrack *track=(AliAODTrack*)rd->GetDaughter(daught);
371 
372  if(sign==track->Charge()){//pions
373  Int_t isPion=fPidHF->MakeRawPid(track,AliPID::kPion);
374  if(isPion==0)mask+=1;
375  else if(isPion>0)mask+=3;
376  mask=mask<<2;
377  }
378  else{//kaons
379  Int_t isKaon=fPidHF->MakeRawPid(track,AliPID::kKaon);
380  if(isKaon==0)mask+=1;
381  else if(isKaon>0)mask+=3;
382  mask=mask<<2;
383  }
384  }
385  mask=mask>>2;
386  return mask;
387 }
388 //---------------------------------------------------------------------------
390 {
391  //
392  // PID selection, returns 3 if accepted, 0 if not accepted
393  //
394  if(!fUsePID || !rd) return 3;
395  //if(fUsePID)printf("i am inside the pid \n");
396  Int_t nkaons=0;
397  Int_t nNotKaons=0;
398  Int_t sign= rd->GetCharge();
399  for(Int_t daught=0;daught<3;daught++){
400  AliAODTrack *track=(AliAODTrack*)rd->GetDaughter(daught);
401  Int_t isPion=fPidHF->MakeRawPid(track,AliPID::kPion);
402  Int_t isKaon=fPidHF->MakeRawPid(track,AliPID::kKaon);
403  Int_t isProton=fPidHF->MakeRawPid(track,AliPID::kProton);
404 
405  if(isProton>0 && isKaon<0 && isPion<0) return 0;
406  if(isKaon>0 && isPion<0) nkaons++;
407  if(isKaon<0) nNotKaons++;
408  if(sign==track->Charge()){//pions
409  if(isPion<0)return 0;
410  if(rd->Pt()<fMaxPtStrongPid && isPion<=0 && fUseStrongPid&2 && track->P()<fMaxPStrongPidpi)return 0;
411  }
412  else{//kaons
413  if(isKaon<0)return 0;
414  if(rd->Pt()<fMaxPtStrongPid && isKaon<=0 && fUseStrongPid&1&& track->P()<fMaxPStrongPidK)return 0;
415  }
416  }
417 
418  if(nkaons>1)return 0;
419  if(nNotKaons==3)return 0;
420 
421  return 3;
422 }
423 
424 
425 //---------------------------------------------------------------------------
427  //
428  // Apply selection, returns 3 if accepted, 0 if not accepted
429  //
430 
431 
432  fIsSelectedCuts=0;
433  fIsSelectedPID=0;
434 
435  if(!fCutsRD){
436  cout<<"Cut matrix not inizialized. Exit..."<<endl;
437  return 0;
438  }
439  //PrintAll();
441 
442 
443  if(!d){
444  cout<<"AliAODRecoDecayHF3Prong null"<<endl;
445  return 0;
446  }
447 
448  if(fKeepSignalMC) if(IsSignalMC(d,aod,411)) return 3;
449 
450  // PID selection
451  Int_t returnvaluePID=3;
452  Int_t returnvalueCuts=3;
453 
454  Double_t pt=d->Pt();
455  if(pt<fMinPtCand) return 0;
456  if(pt>fMaxPtCand) return 0;
457 
459 
460  // selection on candidate
461  if(selectionLevel==AliRDHFCuts::kAll ||
462  selectionLevel==AliRDHFCuts::kCandidate) {
463 
464  //recalculate vertex w/o daughters
465  AliAODVertex *origownvtx=0x0;
467  if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx());
468  if(!RecalcOwnPrimaryVtx(d,aod)) {
469  CleanOwnPrimaryVtx(d,aod,origownvtx);
470  return 0;
471  }
472  }
473 
474  if(fUseMCVertex) {
475  if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx());
476  if(!SetMCPrimaryVtx(d,aod)) {
477  CleanOwnPrimaryVtx(d,aod,origownvtx);
478  return 0;
479  }
480  }
481 
482  Int_t ptbin=PtBin(pt);
483  if (ptbin==-1) {
484  CleanOwnPrimaryVtx(d,aod,origownvtx);
485  return 0;
486  }
487 
488  Double_t mDplusPDG = TDatabasePDG::Instance()->GetParticle(411)->Mass();
489  Double_t mDplus=d->InvMassDplus();
490  if(TMath::Abs(mDplus-mDplusPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
491 
492  //2track cuts
493  if(d->GetDist12toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]|| d->GetDist23toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
494 
495  Double_t sum2=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
496  if(sum2<fCutsRD[GetGlobalIndex(10,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
497 
499  if(d->Getd0Prong(0)*d->Getd0Prong(1)<0. && d->Getd0Prong(2)*d->Getd0Prong(1)<0.) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
500  }
501 
502 
503  //DCA
504  for(Int_t i=0;i<3;i++) if(d->GetDCA(i)>fCutsRD[GetGlobalIndex(11,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
505 
506  if(d->Pt2Prong(1) < fCutsRD[GetGlobalIndex(1,ptbin)]*fCutsRD[GetGlobalIndex(1,ptbin)] || TMath::Abs(d->Getd0Prong(1))<fCutsRD[GetGlobalIndex(3,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}//Kaon
507 
508  if(d->Pt2Prong(0) < fCutsRD[GetGlobalIndex(2,ptbin)]*fCutsRD[GetGlobalIndex(2,ptbin)] || TMath::Abs(d->Getd0Prong(0))<fCutsRD[GetGlobalIndex(4,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}//Pion1
509 
510  if(d->Pt2Prong(2) < fCutsRD[GetGlobalIndex(2,ptbin)]*fCutsRD[GetGlobalIndex(2,ptbin)] || TMath::Abs(d->Getd0Prong(2))<fCutsRD[GetGlobalIndex(4,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}//Pion2
511 
512  if(d->Pt2Prong(0)<fCutsRD[GetGlobalIndex(8,ptbin)]*fCutsRD[GetGlobalIndex(8,ptbin)] && d->Pt2Prong(1)<fCutsRD[GetGlobalIndex(8,ptbin)]*fCutsRD[GetGlobalIndex(8,ptbin)] && d->Pt2Prong(2)<fCutsRD[GetGlobalIndex(8,ptbin)]*fCutsRD[GetGlobalIndex(8,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
513 
514  if(d->DecayLength2()<fCutsRD[GetGlobalIndex(7,ptbin)]*fCutsRD[GetGlobalIndex(7,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
515 
516  if(d->CosPointingAngle()< fCutsRD[GetGlobalIndex(9,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
518  if(d->NormalizedDecayLengthXY()*d->P()/pt<fCutsRD[GetGlobalIndex(12,ptbin)]){CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
519  }else{
520  if(d->NormalizedDecayLengthXY()<fCutsRD[GetGlobalIndex(12,ptbin)]){CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
521  }
522  if(d->CosPointingAngleXY()<fCutsRD[GetGlobalIndex(13,ptbin)]){CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
523 
524  //sec vert
525  Double_t sigmavert=d->GetSigmaVert(aod);
526  if(sigmavert>fCutsRD[GetGlobalIndex(6,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
527 
528  // d0meas-exp
530  Double_t dd0max=0;
531  for(Int_t ipr=0; ipr<3; ipr++) {
532  Double_t diffIP, errdiffIP;
533  d->Getd0MeasMinusExpProng(ipr,aod->GetMagneticField(),diffIP,errdiffIP);
534  Double_t normdd0=0.;
535  if(errdiffIP>0) normdd0=diffIP/errdiffIP;
536  if(ipr==0) dd0max=normdd0;
537  else if(TMath::Abs(normdd0)>TMath::Abs(dd0max)) dd0max=normdd0;
538  }
539  if(TMath::Abs(dd0max)>fMaxd0MeasMinusExp[ptbin]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
540  }
541 
542  // d0
543  if(fUsed0Cut){
544  Double_t d0=d->ImpParXY()*10000.;
545  if(TMath::Abs(d0)>fMaxd0[ptbin]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
546  }
547 
548  // unset recalculated primary vertex when not needed any more
549  CleanOwnPrimaryVtx(d,aod,origownvtx);
550 
551  fIsSelectedCuts=returnvalueCuts;
552 
553  //if(!returnvalueCuts) return 0; // returnvalueCuts cannot be 0 here
554  }
555 
556  if(selectionLevel==AliRDHFCuts::kAll ||
557  selectionLevel==AliRDHFCuts::kCandidate ||
558  selectionLevel==AliRDHFCuts::kPID) {
559  returnvaluePID = IsSelectedPID(d);
560  fIsSelectedPID=returnvaluePID;
561  }
562  if(returnvaluePID==0)return 0;
563 
564  // selection on daughter tracks
565  if(selectionLevel==AliRDHFCuts::kAll ||
566  selectionLevel==AliRDHFCuts::kTracks) {
567  if(!AreDaughtersSelected(d,aod)) return 0;
568  }
569 
570 
571 
572 
573  return 3;
574 }
575 
576 
577 
578 
579 //---------------------------------------------------------------------------
580 
581 
583  //
584  //STANDARD CUTS USED FOR 2010 pp analysis
585  //
586 
587  SetName("DplustoKpipiCutsStandard");
588  SetTitle("Standard Cuts for D+ analysis");
589 
590  // PILE UP REJECTION
592 
593  // EVENT CUTS
594  SetMinVtxContr(1);
595 
596  AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts();
597  esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
598  //default
599  esdTrackCuts->SetRequireTPCRefit(kTRUE);
600  esdTrackCuts->SetRequireITSRefit(kTRUE);
601  //esdTrackCuts->SetMinNClustersITS(4); // default is 5
602  esdTrackCuts->SetMinNClustersTPC(70);
603  esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
604  AliESDtrackCuts::kAny);
605  // default is kBoth, otherwise kAny
606  esdTrackCuts->SetMinDCAToVertexXY(0.);
607  esdTrackCuts->SetPtRange(0.3,1.e10);
608 
609  AddTrackCuts(esdTrackCuts);
610 
611 
612  const Int_t nptbins =15;
613  const Int_t nvars=14;
614  Float_t ptbins[nptbins+1];
615  ptbins[0]=0.;
616  ptbins[1]=1;
617  ptbins[2]=2.;
618  ptbins[3]=3.;
619  ptbins[4]=4.;
620  ptbins[5]=5.;
621  ptbins[6]=6.;
622  ptbins[7]=7.;
623  ptbins[8]=8.;
624  ptbins[9]=9.;
625  ptbins[10]=10.;
626  ptbins[11]=12.;
627  ptbins[12]=14.;
628  ptbins[13]=16.;
629  ptbins[14]=24.;
630  ptbins[15]=99999.;
631 
632 
633  Float_t** anacutsval;
634  anacutsval=new Float_t*[nvars];
635 
636  for(Int_t ic=0;ic<nvars;ic++){anacutsval[ic]=new Float_t[nptbins];}
637 
638  //Double_t cutsDplus[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0.,10000000000.};
639  for(Int_t ipt=0;ipt<nptbins;ipt++){
640  anacutsval[0][ipt]=0.2;
641  anacutsval[3][ipt]=0.;
642  anacutsval[4][ipt]=0.;
643  anacutsval[5][ipt]=0.01;
644  anacutsval[11][ipt]=10000000000.;
645  }
646 
647  anacutsval[1][0]=0.3;
648  anacutsval[1][1]=0.4;
649  anacutsval[1][2]=0.4;
650  anacutsval[2][0]=0.3;
651  anacutsval[2][1]=0.3;
652  anacutsval[2][2]=0.4;
653  for(Int_t ipt=3;ipt<nptbins;ipt++){
654  anacutsval[1][ipt]=0.4;
655  anacutsval[2][ipt]=0.4;
656  }
657 
658  anacutsval[6][0]=0.022100;
659  anacutsval[6][1]=0.022100;
660  anacutsval[6][2]=0.034;
661  anacutsval[6][3]=0.020667;
662  anacutsval[6][4]=0.020667;
663  anacutsval[6][5]=0.023333;
664 
665 
666  anacutsval[7][0]=0.08;
667  anacutsval[7][1]=0.08;
668  anacutsval[7][2]=0.09;
669  anacutsval[7][3]=0.095;
670  anacutsval[7][4]=0.095;
671 
672  anacutsval[8][0]=0.5;
673  anacutsval[8][1]=0.5;
674  anacutsval[8][2]=1.0;
675  anacutsval[8][3]=0.5;
676  anacutsval[8][4]=0.5;
677 
678 
679  anacutsval[9][0]=0.97;
680  anacutsval[9][1]=0.936;
681  anacutsval[9][2]=0.95;
682  anacutsval[9][3]=0.95;
683  anacutsval[9][4]= 0.95;
684  anacutsval[9][5]=0.92;
685  anacutsval[9][6]=0.92;
686  anacutsval[9][7]=0.92;
687  anacutsval[9][8]=0.92;
688  anacutsval[9][9]=0.90;
689  for(Int_t ipt=10;ipt<nptbins;ipt++){
690  anacutsval[9][ipt]=0.90;
691  }
692 
693 
694  anacutsval[10][0]=0.0055;
695  anacutsval[10][1]=0.0055;
696  anacutsval[10][2]= 0.0028;
697  anacutsval[10][3]=0.000883;
698  anacutsval[10][4]=0.000883;
699 
700 
701  for(Int_t ipt=5;ipt<nptbins;ipt++){
702  anacutsval[6][ipt]=0.02333;
703  anacutsval[7][ipt]=0.115;
704  anacutsval[8][ipt]=0.5;
705  anacutsval[10][ipt]=0.000883;
706  }
707 
708  anacutsval[12][0]=8;
709  anacutsval[12][1]=8;
710 
711  anacutsval[13][0]=0.98;
712  anacutsval[13][1]=0.98;
713  for(Int_t ipt=2;ipt<nptbins;ipt++){
714  anacutsval[12][ipt]=0.;
715  anacutsval[13][ipt]=0.;
716  }
717 
718 
719 
720  SetGlobalIndex(nvars,nptbins);
721  SetPtBins(nptbins+1,ptbins);
722  SetCuts(nvars,nptbins,anacutsval);
723  SetUsePID(kTRUE);
724  fPidHF->SetOldPid(kTRUE);
726 
727  PrintAll();
728 
729  for(Int_t iic=0;iic<nvars;iic++){delete [] anacutsval[iic];}
730  delete [] anacutsval;
731  anacutsval=NULL;
732 
733  delete esdTrackCuts;
734  esdTrackCuts=NULL;
735 
736  return;
737 }
738 
739 
741  //
742  //STANDARD CUTS USED FOR 2010 Pb Pb analysis.... not optimized yet
743  //
744 
745  SetName("DplustoKpipiCutsStandard");
746  SetTitle("Standard Cuts for D+ analysis in PbPb2010 run");
747 
748  // PILE UP REJECTION
749  //SetOptPileup(AliRDHFCuts::kRejectPileupEvent);
750 
751  // EVENT CUTS
752  SetMinVtxContr(1);
753 
754 
755  AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts();
756  esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
757  //default
758  esdTrackCuts->SetRequireTPCRefit(kTRUE);
759  esdTrackCuts->SetRequireITSRefit(kTRUE);
760  //esdTrackCuts->SetMinNClustersITS(4); // default is 5
761  esdTrackCuts->SetMinNClustersTPC(70);
762  esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
763  AliESDtrackCuts::kAny);
764  // default is kBoth, otherwise kAny
765  esdTrackCuts->SetMinDCAToVertexXY(0.);
766  esdTrackCuts->SetPtRange(0.8,1.e10);
767 
768  AddTrackCuts(esdTrackCuts);
769 
770  const Int_t nptbins=10;
771  Float_t* ptbins;
772  ptbins=new Float_t[nptbins+1];
773 
774  ptbins[0]=0.;
775  ptbins[1]=1.;
776  ptbins[2]=2.;
777  ptbins[3]=3.;
778  ptbins[4]=4.;
779  ptbins[5]=5.;
780  ptbins[6]=6.;
781  ptbins[7]=8.;
782  ptbins[8]=12.;
783  ptbins[9]=16.;
784  ptbins[10]=24.;
785  const Int_t nvars=14;
786 
787  Float_t** anacutsval;
788  anacutsval=new Float_t*[nvars];
789 
790  for(Int_t ic=0;ic<nvars;ic++){anacutsval[ic]=new Float_t[nptbins];}
791  //Double_t cutsDplus[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0.,10000000000.};
792 
793  for(Int_t ipt=0;ipt<nptbins;ipt++){
794  anacutsval[0][ipt]=0.2;
795  anacutsval[1][ipt]=0.8;
796  anacutsval[2][ipt]=0.8;
797  anacutsval[3][ipt]=0.;
798  anacutsval[4][ipt]=0.;
799  anacutsval[5][ipt]=0.01;
800  anacutsval[11][ipt]=10000000000.;
801  anacutsval[12][ipt]=0.;
802  anacutsval[13][ipt]=0.;
803  }
804  anacutsval[1][5]=0.9;
805 
806  anacutsval[6][0]=0.022100;
807  anacutsval[6][1]=0.022100;
808  anacutsval[6][2]=0.034;
809  anacutsval[6][3]=0.020667;
810  anacutsval[6][4]=0.020667;
811  anacutsval[6][5]=0.023333;
812 
813  anacutsval[7][0]=0.08;
814  anacutsval[7][1]=0.08;
815  anacutsval[7][2]=0.17;
816  anacutsval[7][3]=0.14;
817  anacutsval[7][4]=0.14;
818  anacutsval[7][5]=0.19;
819 
820  anacutsval[8][0]=0.8;
821  anacutsval[8][1]=0.8;
822  anacutsval[8][2]=1.1;
823  anacutsval[8][3]=0.5;
824  anacutsval[8][4]=0.5;
825  anacutsval[8][5]=0.5;
826 
827  anacutsval[9][0]=0.995;
828  anacutsval[9][1]=0.995;
829  anacutsval[9][2]=0.997;
830  anacutsval[9][3]=0.998;
831  anacutsval[9][4]=0.998;
832  anacutsval[9][5]=0.995;
833 
834  anacutsval[10][0]=0.0055;
835  anacutsval[10][1]=0.0055;
836  anacutsval[10][2]= 0.0028;
837  anacutsval[10][3]=0.000883;
838  anacutsval[10][4]=0.000883;
839  anacutsval[10][5]=0.000883;
840 
841  anacutsval[12][5]=12.;
842  anacutsval[13][5]=0.998571;
843  anacutsval[12][6]=10.;
844  anacutsval[13][6]=0.997143;
845 
846  for(Int_t ipt=6;ipt<nptbins;ipt++){
847  anacutsval[6][ipt]=0.02333;
848  anacutsval[7][ipt]=0.19;
849  anacutsval[8][ipt]=2.0;
850  anacutsval[9][ipt]=0.997;
851  anacutsval[10][ipt]=0.000883;
852  }
853  anacutsval[7][6]=0.14;
854  anacutsval[9][6]=0.995;
855 
856  SetPtBins(nptbins+1,ptbins);
857  SetCuts(nvars,nptbins,anacutsval);
858  SetUsePID(kTRUE);
859  fPidHF->SetOldPid(kTRUE);
860  SetMinCentrality(1E-10);
861  SetMaxCentrality(20.);
864 
865  PrintAll();
866 
867  for(Int_t iic=0;iic<nvars;iic++){delete [] anacutsval[iic];}
868  delete [] anacutsval;
869  anacutsval=NULL;
870 
871  delete [] ptbins;
872  ptbins=NULL;
873 
874  delete esdTrackCuts;
875  esdTrackCuts=NULL;
876 
877  return;
878 }
879 
880 
882 
883  // Default 2010 PbPb cut object
885 
886  // Enable all 2011 PbPb run triggers
887  //
888  SetTriggerClass("");
892 
893  // new PID
894  fPidHF->SetOldPid(kFALSE);
895 
896 }
897 //--------------------------------------------------------------------------
898 
900 
901  UInt_t bitmap=0;
902 
903  Double_t sigmaTPCPionHyp=-999.;
904  Double_t sigmaTPCKaonHyp=-999.;
905  Double_t sigmaTPCProtonHyp=-999.;
906  Double_t sigmaTOFPionHyp=-999.;
907  Double_t sigmaTOFKaonHyp=-999.;
908  Double_t sigmaTOFProtonHyp=-999.;
909 
910  Int_t oksigmaTPCPionHyp=fPidHF->GetnSigmaTPC(track,2,sigmaTPCPionHyp);
911  Int_t oksigmaTPCKaonHyp=fPidHF->GetnSigmaTPC(track,3,sigmaTPCKaonHyp);
912  Int_t oksigmaTPCProtonHyp=fPidHF->GetnSigmaTPC(track,4,sigmaTPCProtonHyp);
913  Int_t oksigmaTOFPionHyp=fPidHF->GetnSigmaTOF(track,2,sigmaTOFPionHyp);
914  Int_t oksigmaTOFKaonHyp=fPidHF->GetnSigmaTOF(track,3,sigmaTOFKaonHyp);
915  Int_t oksigmaTOFProtonHyp=fPidHF->GetnSigmaTOF(track,4,sigmaTOFProtonHyp);
916 
917  sigmaTPCPionHyp=TMath::Abs(sigmaTPCPionHyp);
918  sigmaTPCKaonHyp=TMath::Abs(sigmaTPCKaonHyp);
919  sigmaTPCProtonHyp=TMath::Abs(sigmaTPCProtonHyp);
920  sigmaTOFPionHyp=TMath::Abs(sigmaTOFPionHyp);
921  sigmaTOFKaonHyp=TMath::Abs(sigmaTOFKaonHyp);
922  sigmaTOFProtonHyp=TMath::Abs(sigmaTOFProtonHyp);
923 
924  if (oksigmaTPCPionHyp && sigmaTPCPionHyp>0.){
925  if (sigmaTPCPionHyp<1.) bitmap+=1<<kTPCPionLess1;
926  else{
927  if (sigmaTPCPionHyp<2.) bitmap+=1<<kTPCPionMore1Less2;
928  else {
929  if (sigmaTPCPionHyp<3.) bitmap+=1<<kTPCPionMore2Less3;
930  else bitmap+=1<<kTPCPionMore3;
931  }
932  }
933  }
934 
935  if (oksigmaTPCKaonHyp && sigmaTPCKaonHyp>0.){
936  if (sigmaTPCKaonHyp<1.) bitmap+=1<<kTPCKaonLess1;
937  else{
938  if (sigmaTPCKaonHyp<2.) bitmap+=1<<kTPCKaonMore1Less2;
939  else {
940  if (sigmaTPCKaonHyp<3.) bitmap+=1<<kTPCKaonMore2Less3;
941  else bitmap+=1<<kTPCKaonMore3;
942  }
943  }
944  }
945 
946  if (oksigmaTPCProtonHyp && sigmaTPCProtonHyp>0.){
947  if (sigmaTPCProtonHyp<1.) bitmap+=1<<kTPCProtonLess1;
948  else{
949  if (sigmaTPCProtonHyp<2.) bitmap+=1<<kTPCProtonMore1Less2;
950  else {
951  if (sigmaTPCProtonHyp<3.) bitmap+=1<<kTPCProtonMore2Less3;
952  else bitmap+=1<<kTPCProtonMore3;
953  }
954  }
955  }
956 
957  if (oksigmaTOFPionHyp && sigmaTOFPionHyp>0.){
958  if (sigmaTOFPionHyp<1.) bitmap+=1<<kTOFPionLess1;
959  else{
960  if (sigmaTOFPionHyp<2.) bitmap+=1<<kTOFPionMore1Less2;
961  else {
962  if (sigmaTOFPionHyp<3.) bitmap+=1<<kTOFPionMore2Less3;
963  else bitmap+=1<<kTOFPionMore3;
964  }
965  }
966  }
967 
968  if (oksigmaTOFKaonHyp && sigmaTOFKaonHyp>0.){
969  if (sigmaTOFKaonHyp<1.) bitmap+=1<<kTOFKaonLess1;
970  else{
971  if (sigmaTOFKaonHyp<2.) bitmap+=1<<kTOFKaonMore1Less2;
972  else {
973  if (sigmaTOFKaonHyp<3.) bitmap+=1<<kTOFKaonMore2Less3;
974  else bitmap+=1<<kTOFKaonMore3;
975  }
976  }
977  }
978 
979  if (oksigmaTOFProtonHyp && sigmaTOFProtonHyp>0.){
980  if (sigmaTOFProtonHyp<1.) bitmap+=1<<kTOFProtonLess1;
981  else{
982  if (sigmaTOFProtonHyp<2.) bitmap+=1<<kTOFProtonMore1Less2;
983  else {
984  if (sigmaTOFProtonHyp<3.) bitmap+=1<<kTOFProtonMore2Less3;
985  else bitmap+=1<<kTOFProtonMore3;
986  }
987  }
988  }
989 
990 
991 
992  return bitmap;
993 
994 }
995 //---------------------------------------------------------------------------
997  //
998  // print all cuts values
999  //
1002  printf("Cuts on d0meas-d0exp:\n");
1003  for(Int_t ib=0;ib<fnPtBins;ib++){
1004  printf("%f ",fMaxd0MeasMinusExp[ib]);
1005  }
1006  printf("\n");
1007  }else{
1008  printf("No cut on d0meas-d0exp:\n");
1009  }
1010  if(fUsed0Cut){
1011  printf("Cuts on d0:\n");
1012  for(Int_t ib=0;ib<fnPtBins;ib++){
1013  printf("%f ",fMaxd0[ib]);
1014  }
1015  printf("\n");
1016  }else{
1017  printf("No cut on d0\n");
1018  }
1020  printf("NormDLxy scaled by p/pt\n");
1021  }else{
1022  printf("NormDLxy NOT scaled by p/pt\n");
1023  }
1025  printf("d0K*d0pi1 vs. d0K*d0pi2 cut enabled\n");
1026  }else{
1027  printf("d0K*d0pi1 vs. d0K*d0pi2 cut disabled\n");
1028  }
1029 }
Double_t NormalizedDecayLengthXY() const
Int_t fIsSelectedCuts
fix the daughter track references
Definition: AliRDHFCuts.h:431
Bool_t fUsed0MeasMinusExpCut
switch for d0K*d0pi1 vs. d0K*d0pi2 cut
void SetAsym(Bool_t asym)
Definition: AliAODPidHF.h:88
double Double_t
Definition: External.C:58
Bool_t IsSignalMC(AliAODRecoDecay *d, AliAODEvent *aod, Int_t pdg) const
void Setd0MeasMinusExpCut(Int_t nPtBins, Float_t *cutval)
void Getd0MeasMinusExpProng(Int_t ip, Double_t magf, Double_t &d0diff, Double_t &errd0diff) const
AliRDHFCutsDplustoKpipi & operator=(const AliRDHFCutsDplustoKpipi &source)
Int_t GetnSigmaTOF(AliAODTrack *track, Int_t species, Double_t &sigma) const
void SetTRD(Bool_t trd)
Definition: AliAODPidHF.h:97
Bool_t fUseMCVertex
flag to switch on the removal of duaghters from the primary vertex computation
Definition: AliRDHFCuts.h:416
Bool_t SetMCPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod) const
Bool_t fRemoveDaughtersFromPrimary
Definition: AliRDHFCuts.h:415
Int_t GetnSigmaTPC(AliAODTrack *track, Int_t species, Double_t &sigma) const
void SetUseCentrality(Int_t flag=1)
Int_t GetPIDBitMask(AliAODRecoDecayHF *rd)
Double_t ImpParXY() const
Float_t fMaxPStrongPidpi
Maximum P of track to apply strong Pid on K.
void Setd0Cut(Int_t nPtBins, Float_t *cutval)
void SetNVars(Int_t nVars)
Definition: AliRDHFCuts.h:383
UInt_t GetPIDTrackTPCTOFBitMap(AliAODTrack *track) const
Double_t CosPointingAngleXY() const
Double_t fMaxRapidityCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:435
void EnableSemiCentralTrigger()
Definition: AliRDHFCuts.h:94
void SetGlobalIndex()
Definition: AliRDHFCuts.h:198
virtual Bool_t IsInFiducialAcceptance(Double_t pt, Double_t y) const
AliRDHFCuts & operator=(const AliRDHFCuts &source)
Bool_t fUsePID
Definition: AliRDHFCuts.h:410
AliRDHFCutsDplustoKpipi(const char *name="CutsDplustoKpipi")
Float_t * fMaxd0
switch for cut on d0
void SetTOF(Bool_t tof)
Definition: AliAODPidHF.h:95
Bool_t HasBadDaughters() const
const Int_t nPtBins
Float_t * fMaxd0MeasMinusExp
switch for cut on d0meas-d0exp
Class for cuts on AOD reconstructed D+->Kpipi.
void SetMinVtxContr(Int_t contr=1)
Definition: AliRDHFCuts.h:59
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
void SetMinCentrality(Float_t minCentrality=0.)
Definition: AliRDHFCuts.h:51
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
unsigned int UInt_t
Definition: External.C:33
Bool_t fUseImpParProdCorrCut
Maximum P of track to apply strong Pid on pi.
float Float_t
Definition: External.C:68
virtual void GetCutVarsForOpt(AliAODRecoDecayHF *d, Float_t *vars, Int_t nvars, Int_t *pdgdaughters)
const Double_t ptmax
Double_t fMaxPtCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:434
Float_t fMaxPStrongPidK
Maximum pt of candidate to apply strong Pid.
AliAODVertex * GetOwnPrimaryVtx() const
Bool_t fKeepSignalMC
max rapidity of candidate (if !=-999 overrides IsInFiducialAcceptance)
Definition: AliRDHFCuts.h:436
Double_t GetSigmaVert(const AliAODEvent *aod=0x0)
Int_t fIsSelectedPID
outcome of cuts selection
Definition: AliRDHFCuts.h:432
Double_t nsigma
Int_t MakeRawPid(AliAODTrack *track, Int_t specie)
void SetSigma(Double_t *sigma)
Definition: AliAODPidHF.h:39
Float_t * fCutsRD
fnVars*fnPtBins
Definition: AliRDHFCuts.h:408
Double_t DecayLength2() const
kinematics & topology
void SetMaxCentrality(Float_t maxCentrality=100.)
Definition: AliRDHFCuts.h:52
void SetVarsForOpt(Int_t nVars, Bool_t *forOpt)
void SetVarNames(Int_t nVars, TString *varNames, Bool_t *isUpperCut)
Bool_t * fVarsForOpt
number of cut vars to be optimized for candidates
Definition: AliRDHFCuts.h:406
Bool_t AreDaughtersSelected(AliAODRecoDecayHF *rd, const AliAODEvent *aod=0x0) const
void EnableCentralTrigger()
Definition: AliRDHFCuts.h:82
void SetUsePID(Bool_t flag=kTRUE)
Definition: AliRDHFCuts.h:206
virtual void PrintAll() const
virtual Int_t IsSelectedPID(AliAODRecoDecayHF *rd)
void CleanOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod, AliAODVertex *origownvtx) const
void SetRemoveDaughtersFromPrim(Bool_t removeDaughtersPrim)
Definition: AliRDHFCuts.h:216
void SetOldPid(Bool_t oldPid)
Definition: AliAODPidHF.h:108
void SetPtBins(Int_t nPtBinLimits, Float_t *ptBinLimits)
void SetITS(Bool_t its)
Definition: AliAODPidHF.h:96
void SetMatch(Int_t match)
Definition: AliAODPidHF.h:98
void AddTrackCuts(const AliESDtrackCuts *cuts)
Definition: AliRDHFCuts.h:204
void SetPLimit(Double_t *plim, Int_t npLim)
void SetTPC(Bool_t tpc)
Definition: AliAODPidHF.h:94
bool Bool_t
Definition: External.C:53
Double_t CosPointingAngle() const
Int_t fnPtBins
cuts on the candidate
Definition: AliRDHFCuts.h:400
void SetCompat(Bool_t comp)
Definition: AliAODPidHF.h:100
void SetTriggerClass(TString trclass0, TString trclass1="")
Definition: AliRDHFCuts.h:194
AliAODPidHF * fPidHF
enable AOD049 centrality cleanup
Definition: AliRDHFCuts.h:412
Bool_t RecalcOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod) const
Int_t PtBin(Double_t pt) const
void SetOptPileup(Int_t opt=0)
Definition: AliRDHFCuts.h:220
Int_t GetGlobalIndex(Int_t iVar, Int_t iPtBin) const
Double_t DecayLength() const
Float_t fMaxPtStrongPid
use strong pid 0 no,1 only for K,2 pi 3 both
Int_t nptbins
Double_t fMinPtCand
outcome of PID selection
Definition: AliRDHFCuts.h:433