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