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