AliPhysics  41af4b0 (41af4b0)
AliRDHFCutsDStartoKpipi.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: AliRDHFCutsDStartoKpipi.cxx 61203 2013-03-02 22:52:17Z fprino $ */
17 
19 //
20 // Class for cuts on AOD reconstructed DStar->Kpipi
21 //
22 // Author: A.Grelli, alessandro.grelli@uu.nl
23 //
24 // PID method implemented by Y.Wang, yifei@physi.uni-heidelberg.de
25 //
27 
28 #include <TDatabasePDG.h>
29 #include <Riostream.h>
31 #include "AliAODRecoCascadeHF.h"
32 #include "AliRDHFCutsD0toKpi.h"
34 #include "AliAODTrack.h"
35 #include "AliESDtrack.h"
36 #include "AliAODPid.h"
37 #include "AliTPCPIDResponse.h"
38 #include "AliAODVertex.h"
39 #include "AliESDVertex.h"
40 
41 using std::cout;
42 using std::endl;
43 
45 ClassImp(AliRDHFCutsDStartoKpipi);
47 
48 
49 //--------------------------------------------------------------------------
51  AliRDHFCuts(name),
52  fTrackCutsSoftPi(0),
53  fMaxPtPid(9999.),
54  fTPCflag(999.),
55  fCircRadius(0.),
56  fUseTPCtrackCutsOnD0Daughters(kTRUE),
57  fUseTPCtrackCutsOnSoftPion(kFALSE)
58 {
59  //
60  // Default Constructor
61  //
62 
63  Int_t nvars=16;
64  SetNVars(nvars);
65  TString varNames[16]={
66  "inv. mass [GeV]",
67  "dca [cm]",
68  "cosThetaStar",
69  "pTK [GeV/c]",
70  "pTPi [GeV/c]",
71  "d0K [cm]",
72  "d0Pi [cm]",
73  "d0d0 [cm^2]",
74  "cosThetaPoint",
75  "inv. mass half width of D* [GeV]",
76  "half width of (M_Kpipi-M_D0) [GeV]",
77  "PtMin of pi_s [GeV/c]",
78  "PtMax of pi_s [GeV/c]",
79  "theta, angle between the pi_s and decay plane of the D0 [rad]",
80  "|cosThetaPointXY|",
81  "NormDecayLenghtXY"};
82  Bool_t isUpperCut[16]={
83  kTRUE,
84  kTRUE,
85  kTRUE,
86  kFALSE,
87  kFALSE,
88  kTRUE,
89  kTRUE,
90  kTRUE,
91  kFALSE,
92  kTRUE,
93  kTRUE,
94  kTRUE,
95  kTRUE,
96  kFALSE,
97  kFALSE,
98  kFALSE};
99  SetVarNames(nvars,varNames,isUpperCut);
100  Bool_t forOpt[16]={
101  kFALSE,
102  kTRUE,
103  kTRUE,
104  kFALSE,
105  kFALSE,
106  kFALSE,
107  kFALSE,
108  kTRUE,
109  kTRUE,
110  kFALSE,
111  kTRUE,
112  kFALSE,
113  kFALSE,
114  kFALSE,
115  kFALSE,
116  kFALSE};
117  SetVarsForOpt(5,forOpt);
118  Float_t limits[2]={0,999999999.};
119  SetPtBins(2,limits);
120 }
121 //--------------------------------------------------------------------------
123  AliRDHFCuts(source),
124  fTrackCutsSoftPi(0),
125  fMaxPtPid(9999.),
126  fTPCflag(999.),
127  fCircRadius(0.),
130 {
131  //
132  // Copy constructor
133  //
134 
136 
137 }
138 //--------------------------------------------------------------------------
140 {
141  //
142  // assignment operator
143  //
144  if(&source == this) return *this;
145 
146  AliRDHFCuts::operator=(source);
147  if(source.GetTrackCutsSoftPi()) {
148  delete fTrackCutsSoftPi;
149  fTrackCutsSoftPi = new AliESDtrackCuts(*(source.GetTrackCutsSoftPi()));
150  }
151 
152  return *this;
153 }
154 
155 
156 //---------------------------------------------------------------------------
158  //
159  // Fills in vars the values of the variables
160  //
161  if(nvars!=fnVarsForOpt) {
162  printf("AliRDHFCutsDStartoKpipi::GetCutsVarsForOpt: wrong number of variables\n");
163  return;
164  }
165 
166 
167  AliAODRecoCascadeHF* dstarD0pi = (AliAODRecoCascadeHF*)d;
168 
169  AliAODTrack *softPi = (AliAODTrack*)dstarD0pi->GetBachelor();
170 
172 
173 
174  Int_t iter=-1;
175  if(fVarsForOpt[0]){
176  iter++;
177  if(TMath::Abs(pdgdaughters[0])==211) {
178  vars[iter]=dd->InvMassD0();
179  } else {
180  vars[iter]=dd->InvMassD0bar();
181  }
182  }
183  if(fVarsForOpt[1]){
184  iter++;
185  vars[iter]=dd->GetDCA();
186  }
187  if(fVarsForOpt[2]){
188  iter++;
189  if(TMath::Abs(pdgdaughters[0])==211) {
190  vars[iter] = dd->CosThetaStarD0();
191  } else {
192  vars[iter] = dd->CosThetaStarD0bar();
193  }
194  }
195  if(fVarsForOpt[3]){
196  iter++;
197  if(TMath::Abs(pdgdaughters[0])==321) {
198  vars[iter]=dd->PtProng(0);
199  }
200  else{
201  vars[iter]=dd->PtProng(1);
202  }
203  }
204  if(fVarsForOpt[4]){
205  iter++;
206  if(TMath::Abs(pdgdaughters[0])==211) {
207  vars[iter]=dd->PtProng(0);
208  }
209  else{
210  vars[iter]=dd->PtProng(1);
211  }
212  }
213  if(fVarsForOpt[5]){
214  iter++;
215  if(TMath::Abs(pdgdaughters[0])==321) {
216  vars[iter]=dd->Getd0Prong(0);
217  }
218  else{
219  vars[iter]=dd->Getd0Prong(1);
220  }
221  }
222  if(fVarsForOpt[6]){
223  iter++;
224  if(TMath::Abs(pdgdaughters[0])==211) {
225  vars[iter]=dd->Getd0Prong(0);
226  }
227  else{
228  vars[iter]=dd->Getd0Prong(1);
229  }
230  }
231  if(fVarsForOpt[7]){
232  iter++;
233  vars[iter]= dd->Prodd0d0();
234  }
235  if(fVarsForOpt[8]){
236  iter++;
237  vars[iter]=dd->CosPointingAngle();
238  }
239  if(fVarsForOpt[9]){
240  iter++;
241  vars[iter]=dstarD0pi->InvMassDstarKpipi();
242  }
243  if(fVarsForOpt[10]){
244  iter++;
245  vars[iter]=dstarD0pi->DeltaInvMass();
246  }
247  if(fVarsForOpt[11]){
248  iter++;
249  vars[iter] = softPi->Pt();
250  }
251  if(fVarsForOpt[12]){
252  iter++;
253  vars[iter] = softPi->Pt();
254  }
255  if(fVarsForOpt[13]){
256  iter++;
257  vars[iter] =dstarD0pi->AngleD0dkpPisoft();
258  }
259  if(fVarsForOpt[14]){
260  iter++;
261  vars[iter]=TMath::Abs(dd->CosPointingAngleXY());
262  }
263  if(fVarsForOpt[15]){
264  iter++;
265  vars[iter]=(dd->NormalizedDecayLengthXY()*(dd->P()/dd->Pt()));
266  }
267 
268  return;
269 }
270 //---------------------------------------------------------------------------
272  //
273  // Apply selection for D*.
274  // Added functionality to remove the D0 daughters from primary vertex (not dafult)
275 
276  fIsSelectedCuts=0;
277  fIsSelectedPID=0;
278 
279  if(!fCutsRD){
280  cout<<"Cut matrice not inizialized. Exit..."<<endl;
281  return 0;
282  }
283 
285  if(!d){
286  cout<<"AliAODRecoCascadeHF null"<<endl;
287  return 0;
288  }
289 
290  Double_t ptD=d->Pt();
291  if(ptD<fMinPtCand) return 0;
292  if(ptD>fMaxPtCand) return 0;
293 
294 
296  if(!dd){
297  cout<<"AliAODRecoDecayHF2Prong null"<<endl;
298  return 0;
299  }
300 
302 
303  AliAODTrack *b = (AliAODTrack*)d->GetBachelor();
304  if(fTrackCutsSoftPi && fTrackCutsSoftPi->GetRequireTPCRefit()){
305  if(!(b->TestFilterMask(BIT(4)))) return 0;
306  }
307 
308  Int_t returnvalue=1;
309  Int_t returnvaluePID=3;
310 
311 
312  // selection on candidate
313  if(selectionLevel==AliRDHFCuts::kAll ||
314  selectionLevel==AliRDHFCuts::kCandidate) {
315 
316  Double_t pt=d->Pt();
317  Int_t ptbin=PtBin(pt);
318 
319  // DStarMass and D0mass
320  Double_t mDSPDG = TDatabasePDG::Instance()->GetParticle(413)->Mass();
321  Double_t mD0PDG = TDatabasePDG::Instance()->GetParticle(421)->Mass();
322  // delta mass PDG
323  Double_t deltaPDG = mDSPDG-mD0PDG;
324 
325  // Half width DStar mass
326  if(TMath::Abs(mDSPDG - (d->InvMassDstarKpipi()))>fCutsRD[GetGlobalIndex(9,ptbin)]) return 0;
327  // Half width Delta mass
328 
329  if(TMath::Abs(deltaPDG-(d->DeltaInvMass())) > fCutsRD[GetGlobalIndex(10,ptbin)]) return 0;
330 
331  // cut on soft pion pt
332  if(b->Pt() < fCutsRD[GetGlobalIndex(11,ptbin)] || b->Pt() > fCutsRD[GetGlobalIndex(12,ptbin)]) return 0;
333  // cut on the angle between D0 decay plane and soft pion
334  if(d->AngleD0dkpPisoft() > fCutsRD[GetGlobalIndex(13,ptbin)]) return 0;
335 
336  // select D0 that passes D* cuts
337  returnvalue = IsD0FromDStarSelected(pt,dd,selectionLevel, aod);
338  if((b->Charge()==+1 && returnvalue==2) || (b->Charge()==-1 && returnvalue==1)) return 0;
339 
340  }
341 
342  fIsSelectedCuts = returnvalue;
343 
344  // selection on PID
345  if(selectionLevel==AliRDHFCuts::kAll ||
346  selectionLevel==AliRDHFCuts::kCandidate ||
347  selectionLevel==AliRDHFCuts::kPID) {
348  returnvaluePID = IsSelectedPID(d);
349  fIsSelectedPID = returnvaluePID;
350  }
351  if(returnvaluePID!=3) returnvalue =0;
352 
353 
354  // selection on daughter tracks
355  if(selectionLevel==AliRDHFCuts::kAll ||
356  selectionLevel==AliRDHFCuts::kTracks) {
357 
359  //if by mistake both flags turned off in cutobject => only apply to D0daughters (default option)
361  } else { SetUseTPCtrackCutsOnThisDaughter(kFALSE); }
362 
363  if(!AreDaughtersSelected(dd,aod)) return 0;
364  if(fTrackCutsSoftPi) {
365  AliAODVertex *vAOD = d->GetPrimaryVtx();
366  Double_t pos[3],cov[6];
367  vAOD->GetXYZ(pos);
368  vAOD->GetCovarianceMatrix(cov);
369  const AliESDVertex vESD(pos,cov,100.,100);
370 
372  else{ SetUseTPCtrackCutsOnThisDaughter(kFALSE); }
373 
374  if(!IsDaughterSelected(b,&vESD,fTrackCutsSoftPi,aod)) return 0;
375  }
376  }
377 
378  return returnvalue;
379 
380 }
381 //_________________________________________________________________________________________________
383  //
384  // Apply selection for D0 from D*. The selection in on D0 prongs
385  // added functionality to recalculate the primary vertex without D0 prongs (not default)
386  //
387 
388  if(!fCutsRD){
389  cout<<"Cut matrice not inizialized. Exit..."<<endl;
390  return 0;
391  }
392 
394 
395  if(!dd){
396  cout<<"AliAODRecoDecayHF2Prong null"<<endl;
397  return 0;
398  }
399 
400  // selection on daughter tracks is done in IsSelected()
401 
402  Int_t returnvalue=1;
403 
404  // selection on candidate
405  if(selectionLevel==AliRDHFCuts::kAll ||
406  selectionLevel==AliRDHFCuts::kCandidate) {
407 
408  // D0 mass
409  Double_t mD0PDG = TDatabasePDG::Instance()->GetParticle(421)->Mass();
410  // delta mass PDG
411 
412  // add vertex recalculation without daughters
413  AliAODVertex *origownvtx=0x0;
415  if(dd->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*dd->GetOwnPrimaryVtx());
416  if(!RecalcOwnPrimaryVtx(dd,aod)) {
417  CleanOwnPrimaryVtx(dd,aod,origownvtx);
418  return 0;
419  }
420  }
421 
422 
423  if(fUseMCVertex) {
424  if(dd->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*dd->GetOwnPrimaryVtx());
425  if(!SetMCPrimaryVtx(dd,aod)) {
426  CleanOwnPrimaryVtx(dd,aod,origownvtx);
427  return 0;
428  }
429  }
430 
431  Int_t ptbin=PtBin(pt);
432  if (ptbin==-1) {
433  CleanOwnPrimaryVtx(dd,aod,origownvtx);
434  return 0;
435  }
436 
437  Double_t mD0,mD0bar,ctsD0,ctsD0bar;
438 
439  Int_t okD0 =0;
440  Int_t okD0bar =0;
441  okD0=1; okD0bar=1;
442 
443  if(dd->PtProng(1) < fCutsRD[GetGlobalIndex(3,ptbin)] || dd->PtProng(0) < fCutsRD[GetGlobalIndex(4,ptbin)]) okD0 = 0;
444  if(dd->PtProng(0) < fCutsRD[GetGlobalIndex(3,ptbin)] || dd->PtProng(1) < fCutsRD[GetGlobalIndex(4,ptbin)]) okD0bar = 0;
445 
446  if(!okD0 && !okD0bar) {CleanOwnPrimaryVtx(dd,aod,origownvtx); return 0;}
447 
448  if(TMath::Abs(dd->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(5,ptbin)] ||
449  TMath::Abs(dd->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(6,ptbin)]) okD0 = 0;
450  if(TMath::Abs(dd->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(6,ptbin)] ||
451  TMath::Abs(dd->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(5,ptbin)]) okD0bar = 0;
452  if(!okD0 && !okD0bar) {CleanOwnPrimaryVtx(dd,aod,origownvtx); return 0;}
453 
454  if(dd->GetDCA() > fCutsRD[GetGlobalIndex(1,ptbin)]) {CleanOwnPrimaryVtx(dd,aod,origownvtx); return 0;}
455 
456  dd->InvMassD0(mD0,mD0bar);
457  if(TMath::Abs(mD0-mD0PDG) > fCutsRD[GetGlobalIndex(0,ptbin)]) okD0 = 0;
458  if(TMath::Abs(mD0bar-mD0PDG) > fCutsRD[GetGlobalIndex(0,ptbin)]) okD0bar = 0;
459  if(!okD0 && !okD0bar) {CleanOwnPrimaryVtx(dd,aod,origownvtx); return 0;}
460 
461  dd->CosThetaStarD0(ctsD0,ctsD0bar);
462  if(TMath::Abs(ctsD0) > fCutsRD[GetGlobalIndex(2,ptbin)]) okD0 = 0;
463  if(TMath::Abs(ctsD0bar) > fCutsRD[GetGlobalIndex(2,ptbin)]) okD0bar = 0;
464  if(!okD0 && !okD0bar) {CleanOwnPrimaryVtx(dd,aod,origownvtx); return 0;}
465 
466  if(dd->Prodd0d0() > fCutsRD[GetGlobalIndex(7,ptbin)]) {CleanOwnPrimaryVtx(dd,aod,origownvtx); return 0;}
467 
468  if(dd->CosPointingAngle() < fCutsRD[GetGlobalIndex(8,ptbin)]) {CleanOwnPrimaryVtx(dd,aod,origownvtx); return 0;}
469 
470  if(TMath::Abs(dd->CosPointingAngleXY()) < fCutsRD[GetGlobalIndex(14,ptbin)]) {CleanOwnPrimaryVtx(dd,aod,origownvtx); return 0;}
471 
472  Double_t normalDecayLengXY=(dd->NormalizedDecayLengthXY()*(dd->P()/dd->Pt()));
473  if (normalDecayLengXY < fCutsRD[GetGlobalIndex(15, ptbin)]) {CleanOwnPrimaryVtx(dd,aod,origownvtx); return 0;}
474 
475  if (okD0) returnvalue=1; //cuts passed as D0
476  if (okD0bar) returnvalue=2; //cuts passed as D0bar
477  if (okD0 && okD0bar) returnvalue=3; //both
478 
479  // unset recalculated primary vertex when not needed any more
480  CleanOwnPrimaryVtx(dd,aod,origownvtx);
481 
482  }
483 
484  return returnvalue;
485 }
486 //----------------------------------------------------------------------------------
488 {
489  //
490  // D* fiducial acceptance region
491  //
492 
493  if(fMaxRapidityCand>-998.){
494  if(TMath::Abs(y) > fMaxRapidityCand) return kFALSE;
495  else return kTRUE;
496  }
497 
498  if(pt > 5.) {
499  // applying cut for pt > 5 GeV
500  AliDebug(4,Form("pt of D* = %f (> 5), cutting at |y| < 0.8\n",pt));
501  if (TMath::Abs(y) > 0.8){
502  return kFALSE;
503  }
504  } else {
505  // appliying smooth cut for pt < 5 GeV
506  Double_t maxFiducialY = -0.2/15*pt*pt+1.9/15*pt+0.5;
507  Double_t minFiducialY = 0.2/15*pt*pt-1.9/15*pt-0.5;
508  AliDebug(2,Form("pt of D* = %f (< 5), cutting according to the fiducial zone [%f, %f]\n",pt,minFiducialY,maxFiducialY));
509  if (y < minFiducialY || y > maxFiducialY){
510  return kFALSE;
511  }
512  }
513 
514  return kTRUE;
515 }
516 
517 //_______________________________________________________________________________-
519 {
520  //
521  // PID method, n signa approach default
522  //
523 
525  if(!dstar){
526  cout<<"AliAODRecoCascadeHF null"<<endl;
527  return 0;
528  }
529 
530  if(!fUsePID || dstar->Pt() > fMaxPtPid) return 3;
531 
533  if(!d0){
534  cout<<"AliAODRecoDecayHF2Prong null"<<endl;
535  return 0;
536  }
537 
538  // here the PID
539  AliAODTrack *pos = (AliAODTrack*)dstar->Get2Prong()->GetDaughter(0);
540  AliAODTrack *neg = (AliAODTrack*)dstar->Get2Prong()->GetDaughter(1);
541 
542  if (dstar->Charge()>0){
543  if(!SelectPID(pos,2)) return 0;//pion+
544  if(!SelectPID(neg,3)) return 0;//kaon-
545  }else{
546  if(!SelectPID(pos,3)) return 0;//kaon+
547  if(!SelectPID(neg,2)) return 0;//pion-
548  }
549 
550  if ((fPidHF->GetMatch() == 10 || fPidHF->GetMatch() == 11) && fPidHF->GetITS()) { //ITS n sigma band
551  AliAODTrack *softPion = (AliAODTrack*) dstar->GetBachelor();
552 
553  if (fPidHF->CheckBands(AliPID::kPion, AliPIDResponse::kITS, softPion) == -1) {
554  return 0;
555  }
556  }
557 
558  return 3;
559 }
560 
561 //_______________________________________________________________________________-
563 {
564  //
565  // here the PID
566 
567  Bool_t isParticle=kTRUE;
568  Int_t match = fPidHF->GetMatch();
569 
570  if(match == 1){//n-sigma
571  Bool_t TPCon=TMath::Abs(2)>1e-4?kTRUE:kFALSE;
572  Bool_t TOFon=TMath::Abs(3)>1e-4?kTRUE:kFALSE;
573 
574  Bool_t isTPC=kTRUE;
575  Bool_t isTOF=kTRUE;
576 
577  if (TPCon){//TPC
578  if(fPidHF->CheckStatus(track,"TPC")){
579  if(type==2) isTPC=fPidHF->IsPionRaw(track,"TPC");
580  if(type==3) isTPC=fPidHF->IsKaonRaw(track,"TPC");
581  }
582  }
583  if (TOFon){//TOF
584  if(fPidHF->CheckStatus(track,"TOF")){
585  if(type==2) isTOF=fPidHF->IsPionRaw(track,"TOF");
586  if(type==3) isTOF=fPidHF->IsKaonRaw(track,"TOF");
587  }
588  }
589 
590  //--------------------------------
591  // cut on high momentum in the TPC
592  //--------------------------------
593  Double_t pPIDcut = track->P();
594  if(pPIDcut>fTPCflag) isTPC=1;
595 
596  isParticle = isTPC&&isTOF;
597  }
598 
599  if(match == 2){//bayesian
600  //Double_t priors[5]={0.01,0.001,0.3,0.3,0.3};
601  Double_t prob[5]={1.,1.,1.,1.,1.};
602 
603  //fPidHF->SetPriors(priors,5);
604  // fPidHF->BayesianProbability(track,prob);
605 
606  Double_t max=0.;
607  Int_t k=-1;
608  for (Int_t i=0; i<5; i++) {
609  if (prob[i]>max) {k=i; max=prob[i];}
610  }
611  isParticle = Bool_t(k==type);
612  }
613 
614  if (match == 10 || match == 11) { //Assymetric PID using histograms
615  Int_t checkTPC = fPidHF->CheckBands((AliPID::EParticleType) type, AliPIDResponse::kTPC, track);
616  Int_t checkTOF = fPidHF->CheckBands((AliPID::EParticleType) type, AliPIDResponse::kTOF, track);
617 
618  isParticle = checkTPC >= 0 && checkTOF >= 0 ? kTRUE : kFALSE; //Standard: both at least compatible
619  if (match == 11) { //Extra requirement: at least one identified
620  isParticle = isParticle && checkTPC+checkTOF >= 1 ? kTRUE : kFALSE;
621  }
622  }
623 
624  if (match == 12) { //Circular cut
625  Double_t nSigmaTOF = 0;
626  Double_t nSigmaTPC = 0;
627 
628  Double_t radius = fCircRadius;
629 
630  isParticle = kTRUE;
631  if (radius > 0) {
632  Int_t TPCok = fPidHF->GetnSigmaTPC(track, type, nSigmaTPC);
633  Int_t TOFok = fPidHF->GetnSigmaTOF(track, type, nSigmaTOF);
634  if (TPCok != -1 && TOFok != -1) {
635  //Both detectors gave PID information
636  isParticle = TMath::Sqrt(nSigmaTPC*nSigmaTPC + nSigmaTOF*nSigmaTOF) <= radius ? kTRUE : kFALSE;
637  }
638  else {
639  //Maximum one detector gave PID information
640  if (TPCok != -1) {
641  isParticle = nSigmaTPC <= radius ? kTRUE : kFALSE;
642  }
643  if (TOFok != -1) {
644  isParticle = nSigmaTOF <= radius ? kTRUE : kFALSE;
645  }
646  }
647  }
648  }
649 
650  return isParticle;
651 
652 }
653 //__________________________________________________________________________________-
655  //
656  //STANDARD CUTS USED FOR 2010 pp analysis
657  //
658  // Need to be updated for the final cut version
659  //
660 
661  SetName("DStartoD0piCutsStandard");
662  SetTitle("Standard Cuts for D* analysis");
663 
664  // PILE UP REJECTION
666 
667  // EVENT CUTS
668  SetMinVtxContr(1);
669 
670  // CUTS ON SINGLE TRACKS
671  AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default");
672  esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
673  esdTrackCuts->SetRequireTPCRefit(kTRUE);
674  esdTrackCuts->SetRequireITSRefit(kTRUE);
675  esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny);
676  esdTrackCuts->SetMinDCAToVertexXY(0.);
677  esdTrackCuts->SetEtaRange(-0.8,0.8);
678  esdTrackCuts->SetPtRange(0.3,1.e10);
679 
680  // CUTS on SOFT PION
681  AliESDtrackCuts* esdSoftPicuts=new AliESDtrackCuts();
682  esdSoftPicuts->SetRequireSigmaToVertex(kFALSE);
683  esdSoftPicuts->SetRequireTPCRefit(kFALSE);
684  esdSoftPicuts->SetRequireITSRefit(kFALSE);
685  esdSoftPicuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
686  AliESDtrackCuts::kAny);
687  esdSoftPicuts->SetPtRange(0.0,1.e10);
688 
689  AddTrackCuts(esdTrackCuts);
690  AddTrackCutsSoftPi(esdSoftPicuts);
691  delete esdTrackCuts;
692  esdTrackCuts=NULL;
693  delete esdSoftPicuts;
694  esdSoftPicuts=NULL;
695 
696  const Int_t nptbins =13;
697  const Double_t ptmax = 9999.;
698  const Int_t nvars=16;
699  Float_t ptbins[nptbins+1];
700  ptbins[0]=0.;
701  ptbins[1]=0.5;
702  ptbins[2]=1.;
703  ptbins[3]=2.;
704  ptbins[4]=3.;
705  ptbins[5]=4.;
706  ptbins[6]=5.;
707  ptbins[7]=6.;
708  ptbins[8]=7.;
709  ptbins[9]=8.;
710  ptbins[10]=12.;
711  ptbins[11]=16.;
712  ptbins[12]=24.;
713  ptbins[13]=ptmax;
714 
715  SetGlobalIndex(nvars,nptbins);
716  SetPtBins(nptbins+1,ptbins);
717 
718  Float_t cutsMatrixD0toKpiStand[nptbins][nvars]={{0.7,220.*1E-4,0.7,0.21,0.21,500.*1E-4,500.*1E-4,-2000.*1E-8,0.85,0.3,0.1,0.05,100,0.5,-1.,0.},/* pt<0.5*/
719  {0.7,220.*1E-4,0.7,0.21,0.21,500.*1E-4,500.*1E-4,-16000.*1E-8,0.85,0.3,0.1,0.05,100,0.5,-1.,0.},/* 0.5<pt<1*/
720  {0.7,400.*1E-4,0.8,0.7,0.7,400.*1E-4,400.*1E-4,-36000.*1E-8,0.82,0.3,0.1,0.05,100,0.5,-1.,0.},/* 1<pt<2 */
721  {0.7,200.*1E-4,0.8,0.7,0.7,800.*1E-4,800.*1E-4,-16000.*1E-8,0.9,0.3,0.1,0.05,100,0.5,-1.,0.},/* 2<pt<3 */
722  {0.7,500.*1E-4,0.8,1.0,1.0,420.*1E-4,560.*1E-4,-6500.*1E-8,0.9,0.3,0.1,0.05,100,0.5,-1.,0.},/* 3<pt<4 */
723  {0.7,800.*1E-4,0.9,1.2,1.2,700.*1E-4,700.*1E-4,1000.*1E-8,0.9,0.3,0.1,0.05,100,0.5,-1.,0.},/* 4<pt<5 */
724  {0.7,1000.*1E-4,1.0,1.0,1.0,800.*1E-4,800.*1E-4,50000.*1E-8,0.8,0.3,0.1,0.05,100,0.5,-1.,0.},/* 5<pt<6 */
725  {0.7,1000.*1E-4,1.0,1.0,1.0,1000.*1E-4,1000.*1E-4,100000.*1E-8,0.7,0.3,0.1,0.05,100,0.5,-1.,0.},/* 6<pt<7 */
726  {0.7,1000.*1E-4,1.0,1.0,1.0,1000.*1E-4,1000.*1E-4,100000.*1E-8,0.7,0.3,0.1,0.05,100,0.5,-1.,0.},/* 7<pt<8 */
727  {0.7,1000.*1E-4,1.0,1.0,1.0,1000.*1E-4,1000.*1E-4,600000.*1E-8,0.7,0.3,0.1,0.05,100,0.5,-1.,0.},/* 8<pt<12 */
728  {0.7,1000.*1E-4,1.0,1.0,1.0,1500.*1E-4,1500.*1E-4,1000000.*1E-8,0.7,0.3,0.1,0.05,100,0.5,-1.,0.},/* 12<pt<16 */
729  {0.7,1000.*1E-4,1.0,1.0,1.0,1500.*1E-4,1500.*1E-4,1000000.*1E-8,0.7,0.3,0.1,0.05,100,0.5,-1.,0.},/* 16<pt<20 */
730  {0.7,1000.*1E-4,1.0,1.0,1.0,1500.*1E-4,1500.*1E-4,1000000.*1E-8,0.7,0.3,0.1,0.05,100,0.5,-1.,0.}};/* pt>24 */
731 
732 
733  //CREATE TRANSPOSE MATRIX...REVERSE INDICES as required by AliRDHFCuts
734  Float_t **cutsMatrixTransposeStand=new Float_t*[nvars];
735  for(Int_t iv=0;iv<nvars;iv++)cutsMatrixTransposeStand[iv]=new Float_t[nptbins];
736 
737  for (Int_t ibin=0;ibin<nptbins;ibin++){
738  for (Int_t ivar = 0; ivar<nvars; ivar++){
739  cutsMatrixTransposeStand[ivar][ibin]=cutsMatrixD0toKpiStand[ibin][ivar];
740  }
741  }
742 
743  SetCuts(nvars,nptbins,cutsMatrixTransposeStand);
744 
745  for(Int_t iv=0;iv<nvars;iv++) delete [] cutsMatrixTransposeStand[iv];
746  delete [] cutsMatrixTransposeStand;
747  cutsMatrixTransposeStand=NULL;
748 
749  // PID SETTINGS FOR D* analysis
750  AliAODPidHF* pidObj=new AliAODPidHF();
751  //pidObj->SetName("pid4DSatr");
752  Int_t mode=1;
753  Double_t priors[5]={0.01,0.001,0.3,0.3,0.3};
754  pidObj->SetPriors(priors,5);
755  pidObj->SetMatch(mode);
756  pidObj->SetSigma(0,2); // TPC
757  pidObj->SetSigma(3,3); // TOF
758  pidObj->SetTPC(kTRUE);
759  pidObj->SetTOF(kTRUE);
760 
761  SetPidHF(pidObj);
762  SetUsePID(kTRUE);
763 
764  PrintAll();
765 
766  delete pidObj;
767  pidObj=NULL;
768 
769  return;
770 }
771 //_____________________________________________________________________________-
773  //
774  // TEMPORARY, WORK IN PROGRESS ... BUT WORKING!
775  //
776  // Lead Lead
777  //
778 
779  SetName("DStartoD0piCutsStandard");
780  SetTitle("Standard Cuts for D* analysis in PbPb 2010");
781 
782  // EVENT CUTS
783  SetMinVtxContr(1);
784 
785  // CUTS ON SINGLE TRACKS
786  AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default");
787  esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
788  esdTrackCuts->SetRequireTPCRefit(kTRUE);
789  esdTrackCuts->SetRequireITSRefit(kTRUE);
790  esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny);
791  esdTrackCuts->SetMinDCAToVertexXY(0.);
792  esdTrackCuts->SetEtaRange(-0.8,0.8);
793  esdTrackCuts->SetPtRange(0.3,1.e10);
794 
795  // CUTS on SOFT PION
796  AliESDtrackCuts* esdSoftPicuts=new AliESDtrackCuts();
797  esdSoftPicuts->SetRequireSigmaToVertex(kFALSE);
798  esdSoftPicuts->SetRequireTPCRefit(kTRUE);
799  esdSoftPicuts->SetRequireITSRefit(kTRUE);
800  esdSoftPicuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
801  AliESDtrackCuts::kAny); //test d0 asimmetry
802  esdSoftPicuts->SetPtRange(0.25,5);
803 
804  AddTrackCuts(esdTrackCuts);
805  AddTrackCutsSoftPi(esdSoftPicuts);
806  delete esdTrackCuts;
807  esdTrackCuts=NULL;
808  delete esdSoftPicuts;
809  esdSoftPicuts=NULL;
810 
811  const Int_t nptbins =13;
812  const Double_t ptmax = 9999.;
813  const Int_t nvars=16;
814  Float_t ptbins[nptbins+1];
815  ptbins[0]=0.;
816  ptbins[1]=0.5;
817  ptbins[2]=1.;
818  ptbins[3]=2.;
819  ptbins[4]=3.;
820  ptbins[5]=4.;
821  ptbins[6]=5.;
822  ptbins[7]=6.;
823  ptbins[8]=7.;
824  ptbins[9]=8.;
825  ptbins[10]=12.;
826  ptbins[11]=16.;
827  ptbins[12]=24.;
828  ptbins[13]=ptmax;
829 
830  SetGlobalIndex(nvars,nptbins);
831  SetPtBins(nptbins+1,ptbins);
832 
833  Float_t cutsMatrixD0toKpiStand[nptbins][nvars]={{0.7,220.*1E-4,0.7,0.21,0.21,500.*1E-4,500.*1E-4,-2000.*1E-8,0.85,0.3,0.1,0.05,100,0.5,-1.,0.},/* pt<0.5*/
834  {0.7,220.*1E-4,0.7,0.21,0.21,500.*1E-4,500.*1E-4,-16000.*1E-8,0.85,0.3,0.1,0.05,100,0.5,-1.,0.},/* 0.5<pt<1*/
835  {0.7,400.*1E-4,0.8,0.7,0.7,800.*1E-4,800.*1E-4,-36000.*1E-8,0.82,0.3,0.1,0.05,100,0.5,-1.,0.},/* 1<pt<2 */
836  {0.7,200.*1E-4,0.8,0.7,0.7,800.*1E-4,800.*1E-4,-16000.*1E-8,0.9,0.3,0.1,0.05,100,0.5,-1.,0.},/* 2<pt<3 */
837  {0.7,500.*1E-4,0.8,1.0,1.0,420.*1E-4,560.*1E-4,-6500.*1E-8,0.9,0.3,0.1,0.05,100,0.5,-1.,0.},/* 3<pt<4 */
838  {0.7,800.*1E-4,0.9,1.2,1.2,700.*1E-4,700.*1E-4,1000.*1E-8,0.9,0.3,0.1,0.05,100,0.5,-1.,0.},/* 4<pt<5 */
839  {0.7,1000.*1E-4,1.0,1.0,1.0,800.*1E-4,800.*1E-4,50000.*1E-8,0.8,0.3,0.1,0.05,100,0.5,-1.,0.},/* 5<pt<6 */
840  {0.7,1000.*1E-4,1.0,1.0,1.0,1000.*1E-4,1000.*1E-4,100000.*1E-8,0.7,0.3,0.1,0.05,100,0.5,-1.,0.},/* 6<pt<7 */
841  {0.7,1000.*1E-4,1.0,1.0,1.0,1000.*1E-4,1000.*1E-4,100000.*1E-8,0.7,0.3,0.1,0.05,100,0.5,-1.,0.},/* 7<pt<8 */
842  {0.7,1000.*1E-4,1.0,1.0,1.0,1000.*1E-4,1000.*1E-4,600000.*1E-8,0.7,0.3,0.1,0.05,100,0.5,-1.,0.},/* 8<pt<12 */
843  {0.7,1000.*1E-4,1.0,1.0,1.0,1500.*1E-4,1500.*1E-4,1000000.*1E-8,0.7,0.3,0.1,0.05,100,0.5,-1.,0.},/* 12<pt<16 */
844  {0.7,1000.*1E-4,1.0,1.0,1.0,1500.*1E-4,1500.*1E-4,1000000.*1E-8,0.7,0.3,0.1,0.05,100,0.5,-1.,0.},/* 16<pt<24 */
845  {0.7,1000.*1E-4,1.0,1.0,1.0,1500.*1E-4,1500.*1E-4,1000000.*1E-8,0.7,0.3,0.1,0.05,100,0.5,-1.,0.}};/* pt>24 */
846 
847 
848  //CREATE TRANSPOSE MATRIX...REVERSE INDICES as required by AliRDHFCuts
849  Float_t **cutsMatrixTransposeStand=new Float_t*[nvars];
850  for(Int_t iv=0;iv<nvars;iv++)cutsMatrixTransposeStand[iv]=new Float_t[nptbins];
851 
852  for (Int_t ibin=0;ibin<nptbins;ibin++){
853  for (Int_t ivar = 0; ivar<nvars; ivar++){
854  cutsMatrixTransposeStand[ivar][ibin]=cutsMatrixD0toKpiStand[ibin][ivar];
855  }
856  }
857 
858  SetCuts(nvars,nptbins,cutsMatrixTransposeStand);
859 
860  for(Int_t iv=0;iv<nvars;iv++) delete [] cutsMatrixTransposeStand[iv];
861  delete [] cutsMatrixTransposeStand;
862  cutsMatrixTransposeStand=NULL;
863 
864  // PID SETTINGS
865  AliAODPidHF* pidObj=new AliAODPidHF();
866  // pidObj->SetName("pid4DSatr");
867  Int_t mode=1;
868  Double_t priors[5]={0.01,0.001,0.3,0.3,0.3};
869  pidObj->SetPriors(priors,5);
870  pidObj->SetMatch(mode);
871  pidObj->SetSigma(0,2); // TPC
872  pidObj->SetSigma(3,3); // TOF
873  pidObj->SetTPC(kTRUE);
874  pidObj->SetTOF(kTRUE);
875 
876  SetPidHF(pidObj);
877  SetUsePID(kTRUE);
878 
879  PrintAll();
880 
881  delete pidObj;
882  pidObj=NULL;
883 
884  return;
885 
886 }
887 
888 //_____________________________________________________________________________
890  //
891  // Not implemented !!
892  //
894  return;
895 }
896 //_________________________________here the PbPb vs pt _________________________________________
898 
899  // Default 2010 PbPb cut object
900 
901  SetName("DStartoD0piCutsStandard2011");
902  SetTitle("Standard Cuts for D* analysis in PbPb 2011");
903 
904  // EVENT CUTS
905  SetMinVtxContr(1);
906  // MAX Z-VERTEX CUT
907  SetMaxVtxZ(10.);
908 
909  SetTriggerClass("");
913 
914  // CENTRALITY SELECTION
915  SetMinCentrality(0.);
916  SetMaxCentrality(10.);
918 
919  // CUTS ON SINGLE TRACKS
920  AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default");
921  esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
922  esdTrackCuts->SetRequireTPCRefit(kTRUE);
923  esdTrackCuts->SetRequireITSRefit(kTRUE);
924  esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny);
925  esdTrackCuts->SetMinDCAToVertexXY(0.);
926  esdTrackCuts->SetEtaRange(-0.8,0.8);
927  esdTrackCuts->SetPtRange(0.3,1.e10);
928 
929  esdTrackCuts->SetMaxDCAToVertexXY(1.);
930  esdTrackCuts->SetMaxDCAToVertexZ(1.);
931 
932 
933  // CUTS on SOFT PION
934  AliESDtrackCuts* esdSoftPicuts=new AliESDtrackCuts();
935  esdSoftPicuts->SetRequireSigmaToVertex(kFALSE);
936  esdSoftPicuts->SetRequireTPCRefit(kTRUE);
937  esdSoftPicuts->SetRequireITSRefit(kTRUE);
938  esdSoftPicuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
939  AliESDtrackCuts::kAny); //test d0 asimmetry
940  esdSoftPicuts->SetPtRange(0.1,10);
941 
942  esdSoftPicuts->SetMaxDCAToVertexXY(1.);
943  esdSoftPicuts->SetMaxDCAToVertexZ(1.);
944 
945  SetSelectCandTrackSPDFirst(kTRUE, 4);
946 
947  //nothing below 3 GeV/c, speed up the calculation
948  SetMinPtCandidate(3.0);
949 
950  AddTrackCuts(esdTrackCuts);
951  AddTrackCutsSoftPi(esdSoftPicuts);
952  delete esdTrackCuts;
953  esdTrackCuts=NULL;
954  delete esdSoftPicuts;
955  esdSoftPicuts=NULL;
956 
957  const Int_t nptbins =14;
958  const Double_t ptmax = 36.;
959  const Int_t nvars=16;
960  Float_t ptbins[nptbins+1];
961  ptbins[0]=0.5;
962  ptbins[1]=1.;
963  ptbins[2]=2.;
964  ptbins[3]=3.;
965  ptbins[4]=4.;
966  ptbins[5]=5.;
967  ptbins[6]=6.;
968  ptbins[7]=7.;
969  ptbins[8]=8.;
970  ptbins[9]=10.;
971  ptbins[10]=12.;
972  ptbins[11]=16.;
973  ptbins[12]=20.;
974  ptbins[13]=24.;
975  ptbins[14]=ptmax;
976 
977  SetGlobalIndex(nvars,nptbins);
978  SetPtBins(nptbins+1,ptbins);
979 
980  Float_t cutsMatrixD0toKpiStand[nptbins][nvars]={{0.032,220.*1E-4,0.9,0.5,0.5,500.*1E-4,500.*1E-4,-16000.*1E-8,0.85,0.3,0.1,0.05,100,0.5,-1.,9.},/* 0.5<pt<1*/
981  {0.032,350.*1E-4,0.9,0.5,0.5,800.*1E-4,800.*1E-4,-20000.*1E-8,0.96,0.3,0.15,0.05,100,0.5,0.99,10.},/* 1<pt<2 */
982  {0.032,300.*1E-4,0.9,0.5,0.5,900.*1E-4,900.*1E-4,-42000.*1E-8,0.96,0.3,0.15,0.05,100,0.5,0.99,9.},/* 2<pt<3 */
983  {0.036,300.*1E-4,0.8,0.8,0.8,900.*1E-4,900.*1E-4,-39000.*1E-8,0.99,0.3,0.15,0.05,100,0.5,0.998,8.},/* 3<pt<4 */
984  {0.038,225.*1E-4,0.8,1.0,1.0,1000.*1E-4,1000.*1E-4,-30000.*1E-8,0.99,0.3,0.15,0.05,100,0.5,0.998,7.5},/* 4<pt<5 */
985  {0.045,200.*1E-4,1.0,1.0,1.0,1000.*1E-4,1000.*1E-4,-23000.*1E-8,0.99,0.3,0.15,0.05,100,0.5,0.998,7.},/* 5<pt<6 */
986  {0.045,210.*1E-4,1.0,1.0,1.0,1000.*1E-4,1000.*1E-4,-10000.*1E-8,0.982,0.3,0.15,0.05,100,0.5,0.998,6.4},/* 6<pt<7 */
987  {0.050,230.*1E-4,1.0,1.0,1.0,1000.*1E-4,1000.*1E-4,-12700.*1E-8,0.98,0.3,0.15,0.05,100,0.5,0.998,6.4},/* 7<pt<8 */
988  {0.060,200.*1E-4,1.0,0.9,0.9,1000.*1E-4,1000.*1E-4,-7500.*1E-8,0.98,0.3,0.15,0.05,100,0.5,0.998,4.7},/* 8<pt<10 */
989  {0.060,200.*1E-4,1.0,0.9,0.9,1000.*1E-4,1000.*1E-4,-7500.*1E-8,0.97,0.3,0.15,0.05,100,1.0,0.998,4.7},/* 10<pt<12 */
990  {0.074,200.*1E-4,1.0,0.5,0.5,1500.*1E-4,1500.*1E-4,-7500.*1E-8,0.95,0.3,0.15,0.05,100,1.0,0.998,3},/* 12<pt<16 */
991  {0.074,210.*1E-4,1.0,0.5,0.5,1500.*1E-4,1500.*1E-4,-5000.*1E-8,0.95,0.3,0.15,0.05,100,1.0,0.998,2.},/* 16<pt<20 */
992  {0.074,220.*1E-4,1.0,0.5,0.5,1500.*1E-4,1500.*1E-4,-5000.*1E-8,0.93,0.3,0.15,0.05,100,1.0,0.995,2.},/* 20<pt<24 */
993  {0.074,400.*1E-4,1.0,0.5,0.5,2000.*1E-4,2000.*1E-4,40000.*1E-8,0.7,0.3,0.15,0.05,100,1.0,0.9,1.}};/* 24<pt<36 */
994 
995 
996  //CREATE TRANSPOSE MATRIX...REVERSE INDICES as required by AliRDHFCuts
997  Float_t **cutsMatrixTransposeStand=new Float_t*[nvars];
998  for(Int_t iv=0;iv<nvars;iv++)cutsMatrixTransposeStand[iv]=new Float_t[nptbins];
999 
1000  for (Int_t ibin=0;ibin<nptbins;ibin++){
1001  for (Int_t ivar = 0; ivar<nvars; ivar++){
1002  cutsMatrixTransposeStand[ivar][ibin]=cutsMatrixD0toKpiStand[ibin][ivar];
1003  }
1004  }
1005 
1006  SetCuts(nvars,nptbins,cutsMatrixTransposeStand);
1007 
1008  for(Int_t iv=0;iv<nvars;iv++) delete [] cutsMatrixTransposeStand[iv];
1009  delete [] cutsMatrixTransposeStand;
1010  cutsMatrixTransposeStand=NULL;
1011 
1012  // PID SETTINGS // ---
1013  AliAODPidHF* pidObj=new AliAODPidHF();
1014  // pidObj->SetName("pid4DSatr");
1015  Int_t mode=1;
1016 
1017  pidObj->SetMatch(mode);
1018  pidObj->SetSigma(0,3); // TPC -- 2 sigma for pt < 4
1019  pidObj->SetSigma(3,3); // TOF
1020  pidObj->SetTPC(kTRUE);
1021  pidObj->SetTOF(kTRUE);
1022  pidObj->SetOldPid(kFALSE);
1023 
1024  SetPidHF(pidObj);
1025  SetUsePID(kTRUE);
1026 
1027  // PID off for tracks with pt above 4 GeV/c
1028  SetOffHighPtPIDinTPC(4.0);
1030  // flattening
1031  SetHistoForCentralityFlattening(hfl,0.,10,0.,0);
1032 
1033  PrintAll();
1034 
1035  delete pidObj;
1036  pidObj=NULL;
1037 
1038 
1039  return;
1040 }
1041 //-----------------------------------Here the multiplicity pp--------------------------------
1042 
1044 
1045 
1046  //
1047  // STANDARD CUTS USED FOR 2010 pp analysis (multiplicity)
1048  //
1049  //
1050 
1051  SetName("DStartoD0piCutsStandard");
1052  SetTitle("Standard Cuts for D* analysis pp mult");
1053 
1054  // PILE UP REJECTION
1056 
1057  // EVENT CUTS
1058  SetMinVtxContr(1);
1059  // MAX Z-VERTEX CUT
1060  SetMaxVtxZ(10.);
1061 
1062  // CUTS ON SINGLE TRACKS
1063  AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default");
1064  esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
1065  esdTrackCuts->SetRequireTPCRefit(kTRUE);
1066  esdTrackCuts->SetRequireITSRefit(kTRUE);
1067  esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny);
1068  esdTrackCuts->SetMinDCAToVertexXY(0.);
1069  esdTrackCuts->SetEtaRange(-0.8,0.8);
1070  esdTrackCuts->SetPtRange(0.3,1.e10);
1071 
1072  esdTrackCuts->SetMaxDCAToVertexXY(1.);
1073  esdTrackCuts->SetMaxDCAToVertexZ(1.);
1074 
1075 
1076  // CUTS on SOFT PION
1077  AliESDtrackCuts* esdSoftPicuts=new AliESDtrackCuts();
1078  esdSoftPicuts->SetRequireSigmaToVertex(kFALSE);
1079  esdSoftPicuts->SetRequireTPCRefit(kFALSE);
1080  esdSoftPicuts->SetRequireITSRefit(kTRUE);
1081  esdSoftPicuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
1082  AliESDtrackCuts::kAny);
1083  esdSoftPicuts->SetPtRange(0.08,1.e10);
1084  SetUseCentrality(kFALSE);
1085 
1086  AddTrackCuts(esdTrackCuts);
1087  AddTrackCutsSoftPi(esdSoftPicuts);
1088  delete esdTrackCuts;
1089  esdTrackCuts=NULL;
1090  delete esdSoftPicuts;
1091  esdSoftPicuts=NULL;
1092 
1093  const Int_t nptbins =14;
1094  const Double_t ptmax = 9999.;
1095  const Int_t nvars=16;
1096  Float_t ptbins[nptbins+1];
1097  ptbins[0]=0.;
1098  ptbins[1]=0.5;
1099  ptbins[2]=1.;
1100  ptbins[3]=2.;
1101  ptbins[4]=3.;
1102  ptbins[5]=4.;
1103  ptbins[6]=5.;
1104  ptbins[7]=6.;
1105  ptbins[8]=7.;
1106  ptbins[9]=8.;
1107  ptbins[10]=10.;
1108  ptbins[11]=12.;
1109  ptbins[12]=16.;
1110  ptbins[13]=20.;
1111  ptbins[14]=ptmax;
1112 
1113  SetGlobalIndex(nvars,nptbins);
1114  SetPtBins(nptbins+1,ptbins);
1115 
1116  Float_t cutsMatrixD0toKpiStand[nptbins][nvars]={{0.026,220.*1E-4,0.7,0.21,0.21,500.*1E-4,500.*1E-4,-2000.*1E-8,0.85,0.3,0.1,0.05,100,0.5,-1.,0.},/* pt<0.5*/
1117  {0.039,300.*1E-4,0.7,0.21,0.21,500.*1E-4,500.*1E-4,-16000.*1E-8,0.85,0.3,0.1,0.05,100,0.5,-1.,0.},/* 0.5<pt<1*/
1118  {0.022,400.*1E-4,0.8,0.7,0.7,800.*1E-4,800.*1E-4,-20000.*1E-8,0.8,0.3,0.3,0.05,100,0.5,-1.,0.},/* 1<pt<2 */
1119  {0.032,350.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-13000.*1E-8,0.9,0.3,0.3,0.05,100,0.8,-1.,0.},/* 2<pt<3 */
1120  {0.032,500.*1E-4,0.8,0.7,0.7,1000.*1E-4,1000.*1E-4,-8000.*1E-8,0.9,0.3,0.3,0.05,100,0.8,-1.,0.},/* 3<pt<4 */
1121  {0.032,700.*1E-4,0.9,0.9,0.9,1000.*1E-4,1000.*1E-4,10000.*1E-8,0.9,0.3,0.3,0.05,100,1.0,-1.,0.},/* 4<pt<5 */
1122  {0.036,1000.*1E-4,1.0,0.8,0.8,1000.*1E-4,1000.*1E-4,50000.*1E-8,0.9,0.3,0.3,0.05,100,1.0,-1.,0.},/* 5<pt<6 */
1123  {0.036,1000.*1E-4,1.0,0.8,0.8,1000.*1E-4,1000.*1E-4,100000.*1E-8,0.7,0.3,0.3,0.05,100,1.0,-1.,0.},/* 6<pt<7 */
1124  {0.036,1000.*1E-4,1.0,0.8,0.8,1200.*1E-4,1200.*1E-4,100000.*1E-8,0.6,0.3,0.3,0.05,100,1.0,-1.,0.},/* 7<pt<8 */
1125  {0.065,2000.*1E-4,1.0,0.3,0.3,2000.*1E-4,2000.*1E-4,1000000.*1E-8,0.5,0.3,0.3,0.05,100,1.0,-1.,0.},/* 8<pt<10 */
1126  {0.075,2000.*1E-4,1.0,0.3,0.3,2000.*1E-4,2000.*1E-4,1000000.*1E-8,0.3,0.3,0.3,0.05,100,1.0,-1.,0.},/* 10<pt<12 */
1127  {0.084,6000.*1E-4,1.0,0.3,0.3,1500.*1E-4,1500.*1E-4,1000000.*1E-8,0.1,0.3,0.1,0.05,100,1.0,-1.,0.},/* 12<pt<16 */
1128  {0.084,1000.*1E-4,1.0,1.0,1.0,1500.*1E-4,1500.*1E-4,1000000.*1E-8,0.7,0.3,0.1,0.05,100,1.0,-1.,0.},/* 16<pt<20 */
1129  {0.7,1000.*1E-4,1.0,1.0,1.0,1500.*1E-4,1500.*1E-4,1000000.*1E-8,0.7,0.3,0.1,0.05,100,1.0,-1.,0.}};/* pt>24 */
1130 
1131 
1132  //CREATE TRANSPOSE MATRIX...REVERSE INDICES as required by AliRDHFCuts
1133  Float_t **cutsMatrixTransposeStand=new Float_t*[nvars];
1134  for(Int_t iv=0;iv<nvars;iv++)cutsMatrixTransposeStand[iv]=new Float_t[nptbins];
1135 
1136  for (Int_t ibin=0;ibin<nptbins;ibin++){
1137  for (Int_t ivar = 0; ivar<nvars; ivar++){
1138  cutsMatrixTransposeStand[ivar][ibin]=cutsMatrixD0toKpiStand[ibin][ivar];
1139  }
1140  }
1141 
1142  SetCuts(nvars,nptbins,cutsMatrixTransposeStand);
1143 
1144  for(Int_t iv=0;iv<nvars;iv++) delete [] cutsMatrixTransposeStand[iv];
1145  delete [] cutsMatrixTransposeStand;
1146  cutsMatrixTransposeStand=NULL;
1147 
1148  // remove daughters from primary vertex
1150 
1151  // PID SETTINGS FOR D* analysis
1152  AliAODPidHF* pidObj=new AliAODPidHF();
1153  //pidObj->SetName("pid4DSatr");
1154  Int_t mode=1;
1155  pidObj->SetMatch(mode);
1156  pidObj->SetSigma(0,3); // TPC
1157  pidObj->SetSigma(3,3); // TOF
1158  pidObj->SetTPC(kTRUE);
1159  pidObj->SetTOF(kTRUE);
1160 
1161  SetPidHF(pidObj);
1162  SetUsePID(kTRUE);
1163  pidObj->SetOldPid(kTRUE);
1164 
1165  PrintAll();
1166 
1167  delete pidObj;
1168  pidObj=NULL;
1169 
1170  return;
1171 
1172 
1173 }
Double_t NormalizedDecayLengthXY() const
Int_t fIsSelectedCuts
fix the daughter track references
Definition: AliRDHFCuts.h:455
Float_t fMaxPtPid
cuts for soft pion (AOD converted to ESD on the flight!)
double Double_t
Definition: External.C:58
virtual void GetCutVarsForOpt(AliAODRecoDecayHF *d, Float_t *vars, Int_t nvars, Int_t *pdgdaughters)
Int_t GetnSigmaTOF(AliAODTrack *track, Int_t species, Double_t &sigma) const
Bool_t GetITS() const
Definition: AliAODPidHF.h:143
Double_t DeltaInvMass() const
Bool_t fUseMCVertex
flag to switch on the removal of duaghters from the primary vertex computation
Definition: AliRDHFCuts.h:440
void SetMaxVtxZ(Float_t z=1e6)
Definition: AliRDHFCuts.h:61
Bool_t IsKaonRaw(AliAODTrack *track, TString detector) const
Bool_t SetMCPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod) const
Bool_t fRemoveDaughtersFromPrimary
Definition: AliRDHFCuts.h:439
void SetStandardCutsPP2010DStarMult(Bool_t rec=kFALSE)
void SetHistoForCentralityFlattening(TH1F *h, Double_t minCentr, Double_t maxCentr, Double_t centrRef=0., Int_t switchTRand=0)
Int_t GetnSigmaTPC(AliAODTrack *track, Int_t species, Double_t &sigma) const
void SetUseCentrality(Int_t flag=1)
Bool_t fUseTPCtrackCutsOnD0Daughters
Radius for circular PID nsigma cut.
Int_t IsD0FromDStarSelected(Double_t pt, TObject *obj, Int_t selectionLevel, AliAODEvent *aod) const
void SetPriors(Double_t *priors, Int_t npriors)
void SetNVars(Int_t nVars)
Definition: AliRDHFCuts.h:404
virtual Int_t IsSelectedPID(AliAODRecoDecayHF *rd)
Double_t CosPointingAngleXY() const
Double_t fMaxRapidityCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:459
void EnableSemiCentralTrigger()
Definition: AliRDHFCuts.h:97
void SetGlobalIndex()
Definition: AliRDHFCuts.h:201
AliRDHFCuts & operator=(const AliRDHFCuts &source)
Bool_t fUsePID
Definition: AliRDHFCuts.h:434
void SetSelectCandTrackSPDFirst(Bool_t flag, Double_t ptmax)
Flag and pt-maximum to check if the candidate daughters fulfill the kFirst criteria.
Definition: AliRDHFCuts.h:386
void SetPidHF(AliAODPidHF *pidObj)
see enum below
Definition: AliRDHFCuts.h:215
Double_t AngleD0dkpPisoft() const
void SetStandardCutsPbPb2011DStar(TH1F *hfl)
void SetTOF(Bool_t tof)
Definition: AliAODPidHF.h:95
Bool_t HasBadDaughters() const
Int_t CheckBands(AliPID::EParticleType specie, AliPIDResponse::EDetector detector, AliAODTrack *track)
void SetMinVtxContr(Int_t contr=1)
Definition: AliRDHFCuts.h:59
int Int_t
Definition: External.C:63
Bool_t fUseTrackSelectionWithFilterBits
flag to reject kink daughters
Definition: AliRDHFCuts.h:469
void SetCuts(Int_t nVars, Int_t nPtBins, Float_t **cutsRD)
Int_t fnVarsForOpt
Definition: AliRDHFCuts.h:429
void ResetMaskAndEnableMBTrigger()
Definition: AliRDHFCuts.h:77
void SetMinCentrality(Float_t minCentrality=0.)
Definition: AliRDHFCuts.h:51
Double_t CosThetaStarD0bar() const
angle of K
float Float_t
Definition: External.C:68
const Double_t ptmax
Double_t fMaxPtCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:458
Bool_t CheckStatus(AliAODTrack *track, TString detectors) const
AliAODTrack * GetBachelor() const
AliAODVertex * GetOwnPrimaryVtx() const
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel, AliAODEvent *aod)
void AddTrackCutsSoftPi(const AliESDtrackCuts *cuts)
Int_t fIsSelectedPID
outcome of cuts selection
Definition: AliRDHFCuts.h:456
Int_t mode
Definition: anaM.C:41
AliESDtrackCuts * fTrackCutsSoftPi
void SetSigma(Double_t *sigma)
Definition: AliAODPidHF.h:39
Float_t * fCutsRD
fnVars*fnPtBins
Definition: AliRDHFCuts.h:432
void SetMaxCentrality(Float_t maxCentrality=100.)
Definition: AliRDHFCuts.h:52
void SetUseTPCtrackCutsOnThisDaughter(Bool_t flag=kTRUE)
Definition: AliRDHFCuts.h:245
void SetVarsForOpt(Int_t nVars, Bool_t *forOpt)
void SetVarNames(Int_t nVars, TString *varNames, Bool_t *isUpperCut)
virtual AliESDtrackCuts * GetTrackCutsSoftPi() const
Bool_t * fVarsForOpt
number of cut vars to be optimized for candidates
Definition: AliRDHFCuts.h:430
Bool_t AreDaughtersSelected(AliAODRecoDecayHF *rd, const AliAODEvent *aod=0x0) const
void EnableCentralTrigger()
Definition: AliRDHFCuts.h:85
virtual Int_t SelectPID(AliAODTrack *track, Int_t type)
Bool_t IsPionRaw(AliAODTrack *track, TString detector) const
void SetUsePID(Bool_t flag=kTRUE)
Definition: AliRDHFCuts.h:209
virtual void PrintAll() const
virtual Bool_t IsInFiducialAcceptance(Double_t pt, Double_t y) const
void CleanOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod, AliAODVertex *origownvtx) const
void SetRemoveDaughtersFromPrim(Bool_t removeDaughtersPrim)
Definition: AliRDHFCuts.h:219
void SetOldPid(Bool_t oldPid)
Definition: AliAODPidHF.h:108
void SetPtBins(Int_t nPtBinLimits, Float_t *ptBinLimits)
Int_t GetMatch() const
Definition: AliAODPidHF.h:145
void SetMatch(Int_t match)
Definition: AliAODPidHF.h:98
AliAODVertex * GetPrimaryVtx() const
Double_t InvMassDstarKpipi() const
Float_t fTPCflag
maximum Dstar Pt for using PID
void AddTrackCuts(const AliESDtrackCuts *cuts)
Definition: AliRDHFCuts.h:207
void SetOffHighPtPIDinTPC(Float_t TPCrem=999.)
void SetTPC(Bool_t tpc)
Definition: AliAODPidHF.h:94
void SetMinPtCandidate(Double_t ptCand=-1.)
Definition: AliRDHFCuts.h:220
bool Bool_t
Definition: External.C:53
Double_t CosPointingAngle() const
AliRDHFCutsDStartoKpipi(const char *name="CutsDStartoKpipi")
Bool_t fUseTPCtrackCutsOnSoftPion
flag to apply TPC track quality cuts on D0 daughter from Dstar decay (used for different strategies f...
AliAODRecoDecayHF2Prong * Get2Prong() const
void SetTriggerClass(TString trclass0, TString trclass1="")
Definition: AliRDHFCuts.h:197
AliAODPidHF * fPidHF
enable AOD049 centrality cleanup
Definition: AliRDHFCuts.h:436
Bool_t RecalcOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod) const
Int_t PtBin(Double_t pt) const
void SetOptPileup(Int_t opt=0)
Definition: AliRDHFCuts.h:223
Int_t GetGlobalIndex(Int_t iVar, Int_t iPtBin) const
Int_t nptbins
Double_t fMinPtCand
outcome of PID selection
Definition: AliRDHFCuts.h:457
Bool_t IsDaughterSelected(AliAODTrack *track, const AliESDVertex *primary, AliESDtrackCuts *cuts, const AliAODEvent *aod=0x0) const
AliRDHFCutsDStartoKpipi & operator=(const AliRDHFCutsDStartoKpipi &source)