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