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