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