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