]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/vertexingHF/AliRDHFCutsDplustoKpipi.cxx
updated for photonic electron efficiency
[u/mrichter/AliRoot.git] / PWGHF / vertexingHF / AliRDHFCutsDplustoKpipi.cxx
CommitLineData
e3d40058 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
27de2dfb 16/* $Id$ */
17
e3d40058 18/////////////////////////////////////////////////////////////
19//
20// Class for cuts on AOD reconstructed D+->Kpipi
21//
22// Author: R. Bala, bala@to.infn.it
23// G. Ortona, ortona@to.infn.it
24/////////////////////////////////////////////////////////////
25
26#include <TDatabasePDG.h>
27#include <Riostream.h>
28
c3379416 29#include "AliAODPidHF.h"
e3d40058 30#include "AliRDHFCutsDplustoKpipi.h"
31#include "AliAODRecoDecayHF3Prong.h"
32#include "AliAODTrack.h"
33#include "AliESDtrack.h"
34
73173a6a 35
c64cb1f6 36using std::cout;
37using std::endl;
38
e3d40058 39ClassImp(AliRDHFCutsDplustoKpipi)
40
41//--------------------------------------------------------------------------
a9b75906 42AliRDHFCutsDplustoKpipi::AliRDHFCutsDplustoKpipi(const char* name) :
da24b73f 43AliRDHFCuts(name),
a6003e0a 44 fUseStrongPid(0),
45 fMaxPtStrongPid(0.),
83553641 46 fMaxPStrongPidK(0.),
47 fMaxPStrongPidpi(0.),
3ec9254b 48 fUseImpParProdCorrCut(kFALSE)
e3d40058 49{
50 //
51 // Default Constructor
52 //
3ec9254b 53 Int_t nvars=14;
e3d40058 54 SetNVars(nvars);
3ec9254b 55 TString varNames[14]={"inv. mass [GeV]",
e3d40058 56 "pTK [GeV/c]",
57 "pTPi [GeV/c]",
58 "d0K [cm] lower limit!",
59 "d0Pi [cm] lower limit!",
60 "dist12 (cm)",
61 "sigmavert (cm)",
62 "dist prim-sec (cm)",
63 "pM=Max{pT1,pT2,pT3} (GeV/c)",
64 "cosThetaPoint",
65 "Sum d0^2 (cm^2)",
3ec9254b 66 "dca cut (cm)",
67 "dec len XY (cm)",
68 "cosThetaPointXY"};
69 Bool_t isUpperCut[14]={kTRUE,
e3d40058 70 kFALSE,
71 kFALSE,
72 kFALSE,
73 kFALSE,
74 kFALSE,
75 kTRUE,
76 kFALSE,
77 kFALSE,
78 kFALSE,
79 kFALSE,
3ec9254b 80 kTRUE,
81 kFALSE,
82 kFALSE};
e3d40058 83 SetVarNames(nvars,varNames,isUpperCut);
3ec9254b 84 Bool_t forOpt[14]={kFALSE,
e3d40058 85 kFALSE,
86 kFALSE,
87 kFALSE,
88 kFALSE,
89 kFALSE,
90 kTRUE,
91 kTRUE,
92 kTRUE,
93 kTRUE,
94 kTRUE,
3ec9254b 95 kFALSE,
96 kTRUE,
97 kTRUE};
98 SetVarsForOpt(7,forOpt);
e3d40058 99 Float_t limits[2]={0,999999999.};
100 SetPtBins(2,limits);
73173a6a 101 if(fPidHF)delete fPidHF;
102 fPidHF=new AliAODPidHF();
103 Double_t plim[2]={0.6,0.8};
104 Double_t nsigma[5]={2.,1.,2.,3.,0.};
105
106 fPidHF->SetPLimit(plim);
107 fPidHF->SetAsym(kTRUE);
108 fPidHF->SetSigma(nsigma);
109 fPidHF->SetMatch(1);
110 fPidHF->SetTPC(1);
111 fPidHF->SetTOF(1);
112 fPidHF->SetITS(0);
113 fPidHF->SetTRD(0);
114 fPidHF->SetCompat(kTRUE);
115
116
e3d40058 117}
370f7180 118
119
120
121
122
123
124
125
e3d40058 126//--------------------------------------------------------------------------
127AliRDHFCutsDplustoKpipi::AliRDHFCutsDplustoKpipi(const AliRDHFCutsDplustoKpipi &source) :
da24b73f 128 AliRDHFCuts(source),
3ec9254b 129 fUseStrongPid(source.fUseStrongPid),
a6003e0a 130 fMaxPtStrongPid(source.fMaxPtStrongPid),
83553641 131 fMaxPStrongPidK(source.fMaxPStrongPidK),
132 fMaxPStrongPidpi(source.fMaxPStrongPidpi),
3ec9254b 133 fUseImpParProdCorrCut(source.fUseImpParProdCorrCut)
e3d40058 134{
135 //
136 // Copy constructor
137 //
138
139}
140//--------------------------------------------------------------------------
141AliRDHFCutsDplustoKpipi &AliRDHFCutsDplustoKpipi::operator=(const AliRDHFCutsDplustoKpipi &source)
142{
143 //
144 // assignment operator
145 //
146 if(&source == this) return *this;
147
148 AliRDHFCuts::operator=(source);
149
f9778130 150 fUseStrongPid=source.fUseStrongPid;
151 fMaxPtStrongPid=source.fMaxPtStrongPid;
83553641 152 fMaxPStrongPidK=source.fMaxPStrongPidK;
153 fMaxPStrongPidpi=source.fMaxPStrongPidpi;
f9778130 154 fUseImpParProdCorrCut=source.fUseImpParProdCorrCut;
155
e3d40058 156 return *this;
157}
73173a6a 158//
e3d40058 159
160
161//---------------------------------------------------------------------------
a6003e0a 162void AliRDHFCutsDplustoKpipi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters,AliAODEvent *aod) {
e3d40058 163 //
164 // Fills in vars the values of the variables
165 //
166
167
168 if(nvars!=fnVarsForOpt) {
169 printf("AliRDHFCutsDplustoKpipi::GetCutsVarsForOpt: wrong number of variables\n");
170 return;
171 }
172
173 AliAODRecoDecayHF3Prong *dd = (AliAODRecoDecayHF3Prong*)d;
a6003e0a 174
175 //recalculate vertex w/o daughters
176 Bool_t cleanvtx=kFALSE;
177 AliAODVertex *origownvtx=0x0;
178 if(fRemoveDaughtersFromPrimary) {
179 if(dd->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*dd->GetOwnPrimaryVtx());
180 cleanvtx=kTRUE;
181 if(!RecalcOwnPrimaryVtx(dd,aod)) {
182 CleanOwnPrimaryVtx(dd,aod,origownvtx);
183 cleanvtx=kFALSE;
184 }
185 }
e3d40058 186
e3d40058 187 Int_t iter=-1;
188 if(fVarsForOpt[0]){
189 iter++;
190 vars[iter]=dd->InvMassDplus();
191 }
192 if(fVarsForOpt[1]){
193 iter++;
194 for(Int_t iprong=0;iprong<3;iprong++){
195 if(TMath::Abs(pdgdaughters[iprong])==321) {
196 vars[iter]=dd->PtProng(iprong);
197 }
198 }
199 }
200 if(fVarsForOpt[2]){
201 iter++;
4755453e 202 Float_t minPtDau=1000000.0;
e3d40058 203 for(Int_t iprong=0;iprong<3;iprong++){
204 if(TMath::Abs(pdgdaughters[iprong])==211) {
4755453e 205 if(dd->PtProng(iprong)<minPtDau){
206 minPtDau=dd->PtProng(iprong);
207 }
e3d40058 208 }
209 }
4755453e 210 vars[iter]=minPtDau;
e3d40058 211 }
212 if(fVarsForOpt[3]){
213 iter++;
214 for(Int_t iprong=0;iprong<3;iprong++){
215 if(TMath::Abs(pdgdaughters[iprong])==321) {
216 vars[iter]=dd->Getd0Prong(iprong);
217 }
218 }
219 }
220 if(fVarsForOpt[4]){
221 iter++;
4755453e 222 Float_t minImpParDau=1000000.0;
e3d40058 223 for(Int_t iprong=0;iprong<3;iprong++){
224 if(TMath::Abs(pdgdaughters[iprong])==211) {
4755453e 225 if(dd->Getd0Prong(iprong)<minImpParDau){
226 minImpParDau=dd->Getd0Prong(iprong);
227 }
e3d40058 228 }
229 }
4755453e 230 vars[iter]=minImpParDau;
e3d40058 231 }
232 if(fVarsForOpt[5]){
233 iter++;
4755453e 234 Float_t dist12 = dd->GetDist12toPrim();
235 Float_t dist23 = dd->GetDist23toPrim();
236 if(dist12<dist23)vars[iter]=dist12;
237 else vars[iter]=dist23;
e3d40058 238 }
239 if(fVarsForOpt[6]){
240 iter++;
e0fb900a 241 vars[iter]=dd->GetSigmaVert(aod);
e3d40058 242 }
243 if(fVarsForOpt[7]){
244 iter++;
245 vars[iter] = dd->DecayLength();
246 }
247 if(fVarsForOpt[8]){
248 iter++;
249 Float_t ptmax=0;
250 for(Int_t i=0;i<3;i++){
251 if(dd->PtProng(i)>ptmax)ptmax=dd->PtProng(i);
252 }
253 vars[iter]=ptmax;
254 }
255 if(fVarsForOpt[9]){
256 iter++;
257 vars[iter]=dd->CosPointingAngle();
258 }
259 if(fVarsForOpt[10]){
260 iter++;
261 vars[iter]=dd->Getd0Prong(0)*dd->Getd0Prong(0)+dd->Getd0Prong(1)*dd->Getd0Prong(1)+dd->Getd0Prong(2)*dd->Getd0Prong(2);
262 }
263 if(fVarsForOpt[11]){
264 iter++;
4755453e 265 Float_t maxDCA=0;
266 for(Int_t iprong=0;iprong<3;iprong++){
267 if(dd->GetDCA(iprong)<maxDCA){
268 maxDCA=dd->GetDCA(iprong);
269 }
270 }
271 vars[iter]=maxDCA;
e3d40058 272 }
3ec9254b 273 if(fVarsForOpt[12]){
274 iter++;
9c90a16e 275 vars[iter]=dd->NormalizedDecayLengthXY()*dd->P()/dd->Pt();
3ec9254b 276 }
277 if(fVarsForOpt[13]){
278 iter++;
9c90a16e 279 vars[iter]=dd->CosPointingAngleXY();
3ec9254b 280 }
a6003e0a 281
282 if(cleanvtx)CleanOwnPrimaryVtx(dd,aod,origownvtx);
283
e3d40058 284 return;
285}
c1cc7a53 286//---------------------------------------------------------------------------
287Bool_t AliRDHFCutsDplustoKpipi::IsInFiducialAcceptance(Double_t pt, Double_t y) const
288{
289 //
290 // Checking if Dplus is in fiducial acceptance region
291 //
292
293 if(pt > 5.) {
294 // applying cut for pt > 5 GeV
295 AliDebug(2,Form("pt of D+ = %f (> 5), cutting at |y| < 0.8",pt));
296 if (TMath::Abs(y) > 0.8) return kFALSE;
297
298 } else {
299 // appliying smooth cut for pt < 5 GeV
300 Double_t maxFiducialY = -0.2/15*pt*pt+1.9/15*pt+0.5;
301 Double_t minFiducialY = 0.2/15*pt*pt-1.9/15*pt-0.5;
302 AliDebug(2,Form("pt of D+ = %f (< 5), cutting according to the fiducial zone [%f, %f]\n",pt,minFiducialY,maxFiducialY));
303 if (y < minFiducialY || y > maxFiducialY) return kFALSE;
304 }
305
306 return kTRUE;
307}
73173a6a 308
4214a55d 309//---------------------------------------------------------------------------
310Int_t AliRDHFCutsDplustoKpipi::GetPIDBitMask(AliAODRecoDecayHF *rd)
311{
4450342d 312 if(!fUsePID || !rd) return -1;
4214a55d 313 //if(fUsePID)printf("i am inside the pid \n");
314 Int_t mask=0;
315 Int_t sign=rd->GetCharge();
316 for(Int_t daught=0;daught<3;daught++){
317 AliAODTrack *track=(AliAODTrack*)rd->GetDaughter(daught);
318
319 if(sign==track->Charge()){//pions
320 Int_t isPion=fPidHF->MakeRawPid(track,AliPID::kPion);
321 if(isPion==0)mask+=1;
322 else if(isPion>0)mask+=3;
323 mask=mask<<2;
324 }
325 else{//kaons
326 Int_t isKaon=fPidHF->MakeRawPid(track,AliPID::kKaon);
327 if(isKaon==0)mask+=1;
328 else if(isKaon>0)mask+=3;
329 mask=mask<<2;
330 }
331 }
332 mask=mask>>2;
333 return mask;
334}
73173a6a 335//---------------------------------------------------------------------------
bc116f28 336Int_t AliRDHFCutsDplustoKpipi::IsSelectedPID(AliAODRecoDecayHF *rd)
337{
338 //
595cc7e2 339 // PID selection, returns 3 if accepted, 0 if not accepted
bc116f28 340 //
595cc7e2 341 if(!fUsePID || !rd) return 3;
73173a6a 342 //if(fUsePID)printf("i am inside the pid \n");
343 Int_t nkaons=0;
344 Int_t nNotKaons=0;
345 Int_t sign= rd->GetCharge();
346 for(Int_t daught=0;daught<3;daught++){
347 AliAODTrack *track=(AliAODTrack*)rd->GetDaughter(daught);
348 Int_t isPion=fPidHF->MakeRawPid(track,AliPID::kPion);
349 Int_t isKaon=fPidHF->MakeRawPid(track,AliPID::kKaon);
350 Int_t isProton=fPidHF->MakeRawPid(track,AliPID::kProton);
351
352 if(isProton>0 && isKaon<0 && isPion<0) return 0;
353 if(isKaon>0 && isPion<0) nkaons++;
354 if(isKaon<0) nNotKaons++;
355 if(sign==track->Charge()){//pions
356 if(isPion<0)return 0;
83553641 357 if(rd->Pt()<fMaxPtStrongPid && isPion<=0 && fUseStrongPid&2 && track->P()<fMaxPStrongPidpi)return 0;
a6003e0a 358 }
359 else{//kaons
360 if(isKaon<0)return 0;
83553641 361 if(rd->Pt()<fMaxPtStrongPid && isKaon<=0 && fUseStrongPid&1&& track->P()<fMaxPStrongPidK)return 0;
73173a6a 362 }
73173a6a 363 }
364
365 if(nkaons>1)return 0;
366 if(nNotKaons==3)return 0;
367
595cc7e2 368 return 3;
73173a6a 369}
370
371
e3d40058 372//---------------------------------------------------------------------------
c1cc7a53 373Int_t AliRDHFCutsDplustoKpipi::IsSelected(TObject* obj,Int_t selectionLevel, AliAODEvent* aod) {
e3d40058 374 //
595cc7e2 375 // Apply selection, returns 3 if accepted, 0 if not accepted
e3d40058 376 //
377
5d2d6118 378
379 fIsSelectedCuts=0;
380 fIsSelectedPID=0;
381
e3d40058 382 if(!fCutsRD){
4755453e 383 cout<<"Cut matrix not inizialized. Exit..."<<endl;
e3d40058 384 return 0;
385 }
386 //PrintAll();
387 AliAODRecoDecayHF3Prong* d=(AliAODRecoDecayHF3Prong*)obj;
388
389
390 if(!d){
391 cout<<"AliAODRecoDecayHF3Prong null"<<endl;
392 return 0;
393 }
394
5e938293 395 if(fKeepSignalMC) if(IsSignalMC(d,aod,411)) return 3;
396
73173a6a 397 // PID selection
595cc7e2 398 Int_t returnvaluePID=3;
399 Int_t returnvalueCuts=3;
e3d40058 400
5639e412 401 Double_t pt=d->Pt();
402 if(pt<fMinPtCand) return 0;
403 if(pt>fMaxPtCand) return 0;
dcc2ade0 404
ba27eecd 405 if(d->HasBadDaughters()) return 0;
73173a6a 406
e3d40058 407 // selection on candidate
408 if(selectionLevel==AliRDHFCuts::kAll ||
409 selectionLevel==AliRDHFCuts::kCandidate) {
410
c1cc7a53 411 //recalculate vertex w/o daughters
412 AliAODVertex *origownvtx=0x0;
c1cc7a53 413 if(fRemoveDaughtersFromPrimary) {
793fdbec 414 if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx());
415 if(!RecalcOwnPrimaryVtx(d,aod)) {
416 CleanOwnPrimaryVtx(d,aod,origownvtx);
417 return 0;
418 }
c1cc7a53 419 }
420
e3d40058 421 Int_t ptbin=PtBin(pt);
c1cc7a53 422 if (ptbin==-1) {
793fdbec 423 CleanOwnPrimaryVtx(d,aod,origownvtx);
c1cc7a53 424 return 0;
425 }
73173a6a 426
e3d40058 427 Double_t mDplusPDG = TDatabasePDG::Instance()->GetParticle(411)->Mass();
428 Double_t mDplus=d->InvMassDplus();
793fdbec 429 if(TMath::Abs(mDplus-mDplusPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
e3d40058 430
c1cc7a53 431 //2track cuts
793fdbec 432 if(d->GetDist12toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]|| d->GetDist23toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
5d2d6118 433
434 Double_t sum2=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
793fdbec 435 if(sum2<fCutsRD[GetGlobalIndex(10,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
5d2d6118 436
3ec9254b 437 if(fUseImpParProdCorrCut){
438 if(d->Getd0Prong(0)*d->Getd0Prong(1)<0. && d->Getd0Prong(2)*d->Getd0Prong(1)<0.) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
439 }
440
5d2d6118 441
442 //DCA
793fdbec 443 for(Int_t i=0;i<3;i++) if(d->GetDCA(i)>fCutsRD[GetGlobalIndex(11,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
5d2d6118 444
793fdbec 445 if(d->Pt2Prong(1) < fCutsRD[GetGlobalIndex(1,ptbin)]*fCutsRD[GetGlobalIndex(1,ptbin)] || TMath::Abs(d->Getd0Prong(1))<fCutsRD[GetGlobalIndex(3,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}//Kaon
5d2d6118 446
793fdbec 447 if(d->Pt2Prong(0) < fCutsRD[GetGlobalIndex(2,ptbin)]*fCutsRD[GetGlobalIndex(2,ptbin)] || TMath::Abs(d->Getd0Prong(0))<fCutsRD[GetGlobalIndex(4,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}//Pion1
5d2d6118 448
793fdbec 449 if(d->Pt2Prong(2) < fCutsRD[GetGlobalIndex(2,ptbin)]*fCutsRD[GetGlobalIndex(2,ptbin)] || TMath::Abs(d->Getd0Prong(2))<fCutsRD[GetGlobalIndex(4,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}//Pion2
5d2d6118 450
793fdbec 451 if(d->Pt2Prong(0)<fCutsRD[GetGlobalIndex(8,ptbin)]*fCutsRD[GetGlobalIndex(8,ptbin)] && d->Pt2Prong(1)<fCutsRD[GetGlobalIndex(8,ptbin)]*fCutsRD[GetGlobalIndex(8,ptbin)] && d->Pt2Prong(2)<fCutsRD[GetGlobalIndex(8,ptbin)]*fCutsRD[GetGlobalIndex(8,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
5d2d6118 452
793fdbec 453 if(d->DecayLength2()<fCutsRD[GetGlobalIndex(7,ptbin)]*fCutsRD[GetGlobalIndex(7,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
5d2d6118 454
793fdbec 455 if(d->CosPointingAngle()< fCutsRD[GetGlobalIndex(9,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
5d2d6118 456
9c90a16e 457 if(d->NormalizedDecayLengthXY()*d->P()/pt<fCutsRD[GetGlobalIndex(12,ptbin)]){CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
5d2d6118 458
3ec9254b 459 if(d->CosPointingAngleXY()<fCutsRD[GetGlobalIndex(13,ptbin)]){CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
930eb764 460
e0fb900a 461 //sec vert
462 Double_t sigmavert=d->GetSigmaVert(aod);
463 if(sigmavert>fCutsRD[GetGlobalIndex(6,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
464
c1cc7a53 465 // unset recalculated primary vertex when not needed any more
793fdbec 466 CleanOwnPrimaryVtx(d,aod,origownvtx);
c1cc7a53 467
5d2d6118 468 fIsSelectedCuts=returnvalueCuts;
469
f754294e 470 //if(!returnvalueCuts) return 0; // returnvalueCuts cannot be 0 here
e3d40058 471 }
dcc2ade0 472
473 if(selectionLevel==AliRDHFCuts::kAll ||
474 selectionLevel==AliRDHFCuts::kCandidate ||
475 selectionLevel==AliRDHFCuts::kPID) {
476 returnvaluePID = IsSelectedPID(d);
5d2d6118 477 fIsSelectedPID=returnvaluePID;
dcc2ade0 478 }
479 if(returnvaluePID==0)return 0;
480
481 // selection on daughter tracks
482 if(selectionLevel==AliRDHFCuts::kAll ||
483 selectionLevel==AliRDHFCuts::kTracks) {
484 if(!AreDaughtersSelected(d)) return 0;
485 }
486
487
488
c1cc7a53 489
595cc7e2 490 return 3;
e3d40058 491}
370f7180 492
493
494
495
e3d40058 496//---------------------------------------------------------------------------
370f7180 497
498
499void AliRDHFCutsDplustoKpipi::SetStandardCutsPP2010() {
500 //
501 //STANDARD CUTS USED FOR 2010 pp analysis
502 //
503
504 SetName("DplustoKpipiCutsStandard");
505 SetTitle("Standard Cuts for D+ analysis");
506
507 // PILE UP REJECTION
508 SetOptPileup(AliRDHFCuts::kRejectPileupEvent);
509
510 // EVENT CUTS
511 SetMinVtxContr(1);
512
513 AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts();
514 esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
515 //default
516 esdTrackCuts->SetRequireTPCRefit(kTRUE);
517 esdTrackCuts->SetRequireITSRefit(kTRUE);
518 //esdTrackCuts->SetMinNClustersITS(4); // default is 5
519 esdTrackCuts->SetMinNClustersTPC(70);
520 esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
521 AliESDtrackCuts::kAny);
522 // default is kBoth, otherwise kAny
523 esdTrackCuts->SetMinDCAToVertexXY(0.);
524 esdTrackCuts->SetPtRange(0.3,1.e10);
525
526 AddTrackCuts(esdTrackCuts);
527
528
738ad720 529 const Int_t nptbins =15;
3ec9254b 530 const Int_t nvars=14;
370f7180 531 Float_t ptbins[nptbins+1];
532 ptbins[0]=0.;
533 ptbins[1]=1;
534 ptbins[2]=2.;
535 ptbins[3]=3.;
536 ptbins[4]=4.;
537 ptbins[5]=5.;
538 ptbins[6]=6.;
738ad720 539 ptbins[7]=7.;
540 ptbins[8]=8.;
541 ptbins[9]=9.;
542 ptbins[10]=10.;
543 ptbins[11]=12.;
544 ptbins[12]=14.;
545 ptbins[13]=16.;
546 ptbins[14]=24.;
547 ptbins[15]=99999.;
370f7180 548
549
550 Float_t** anacutsval;
551 anacutsval=new Float_t*[nvars];
552
553 for(Int_t ic=0;ic<nvars;ic++){anacutsval[ic]=new Float_t[nptbins];}
e11ae259 554
370f7180 555 //Double_t cutsDplus[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0.,10000000000.};
370f7180 556 for(Int_t ipt=0;ipt<nptbins;ipt++){
3ec9254b 557 anacutsval[0][ipt]=0.2;
558 anacutsval[3][ipt]=0.;
559 anacutsval[4][ipt]=0.;
560 anacutsval[5][ipt]=0.01;
561 anacutsval[11][ipt]=10000000000.;
738ad720 562 }
3ec9254b 563
370f7180 564 anacutsval[1][0]=0.3;
738ad720 565 anacutsval[1][1]=0.4;
3ec9254b 566 anacutsval[1][2]=0.4;
370f7180 567 anacutsval[2][0]=0.3;
568 anacutsval[2][1]=0.3;
3ec9254b 569 anacutsval[2][2]=0.4;
370f7180 570 for(Int_t ipt=3;ipt<nptbins;ipt++){
3ec9254b 571 anacutsval[1][ipt]=0.4;
572 anacutsval[2][ipt]=0.4;
370f7180 573 }
65b4f6d7 574
370f7180 575 anacutsval[6][0]=0.022100;
576 anacutsval[6][1]=0.022100;
577 anacutsval[6][2]=0.034;
578 anacutsval[6][3]=0.020667;
579 anacutsval[6][4]=0.020667;
580 anacutsval[6][5]=0.023333;
3ec9254b 581
65b4f6d7 582
370f7180 583 anacutsval[7][0]=0.08;
584 anacutsval[7][1]=0.08;
585 anacutsval[7][2]=0.09;
586 anacutsval[7][3]=0.095;
587 anacutsval[7][4]=0.095;
3ec9254b 588
370f7180 589 anacutsval[8][0]=0.5;
590 anacutsval[8][1]=0.5;
591 anacutsval[8][2]=1.0;
592 anacutsval[8][3]=0.5;
3ec9254b 593 anacutsval[8][4]=0.5;
594
595
738ad720 596 anacutsval[9][0]=0.97;
597 anacutsval[9][1]=0.936;
370f7180 598 anacutsval[9][2]=0.95;
599 anacutsval[9][3]=0.95;
600 anacutsval[9][4]= 0.95;
601 anacutsval[9][5]=0.92;
602 anacutsval[9][6]=0.92;
603 anacutsval[9][7]=0.92;
604 anacutsval[9][8]=0.92;
605 anacutsval[9][9]=0.90;
738ad720 606 for(Int_t ipt=10;ipt<nptbins;ipt++){
607 anacutsval[9][ipt]=0.90;
608 }
609
370f7180 610
611 anacutsval[10][0]=0.0055;
612 anacutsval[10][1]=0.0055;
613 anacutsval[10][2]= 0.0028;
614 anacutsval[10][3]=0.000883;
3ec9254b 615 anacutsval[10][4]=0.000883;
616
65b4f6d7 617
3ec9254b 618 for(Int_t ipt=5;ipt<nptbins;ipt++){
619 anacutsval[6][ipt]=0.02333;
620 anacutsval[7][ipt]=0.115;
621 anacutsval[8][ipt]=0.5;
622 anacutsval[10][ipt]=0.000883;
623 }
624
738ad720 625 anacutsval[12][0]=8;
626 anacutsval[12][1]=8;
627
628 anacutsval[13][0]=0.98;
629 anacutsval[13][1]=0.98;
630 for(Int_t ipt=2;ipt<nptbins;ipt++){
631 anacutsval[12][ipt]=0.;
632 anacutsval[13][ipt]=0.;
633 }
634
635
636
ae39ad32 637 SetGlobalIndex(nvars,nptbins);
370f7180 638 SetPtBins(nptbins+1,ptbins);
639 SetCuts(nvars,nptbins,anacutsval);
640 SetUsePID(kTRUE);
641 SetRemoveDaughtersFromPrim(kTRUE);
3ec9254b 642
370f7180 643 PrintAll();
644
e11ae259 645 for(Int_t iic=0;iic<nvars;iic++){delete [] anacutsval[iic];}
646 delete [] anacutsval;
647 anacutsval=NULL;
648
370f7180 649 return;
650}
651
652
653void AliRDHFCutsDplustoKpipi::SetStandardCutsPbPb2010() {
654 //
655 //STANDARD CUTS USED FOR 2010 Pb Pb analysis.... not optimized yet
656 //
657
658 SetName("DplustoKpipiCutsStandard");
659 SetTitle("Standard Cuts for D+ analysis in PbPb2010 run");
660
661 // PILE UP REJECTION
662 //SetOptPileup(AliRDHFCuts::kRejectPileupEvent);
663
664 // EVENT CUTS
665 SetMinVtxContr(1);
666
667
668 AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts();
669 esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
670 //default
671 esdTrackCuts->SetRequireTPCRefit(kTRUE);
672 esdTrackCuts->SetRequireITSRefit(kTRUE);
673 //esdTrackCuts->SetMinNClustersITS(4); // default is 5
674 esdTrackCuts->SetMinNClustersTPC(70);
675 esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
676 AliESDtrackCuts::kAny);
677 // default is kBoth, otherwise kAny
3ec9254b 678 esdTrackCuts->SetMinDCAToVertexXY(0.);
370f7180 679 esdTrackCuts->SetPtRange(0.8,1.e10);
680
681 AddTrackCuts(esdTrackCuts);
682
683 const Int_t nptbins=10;
684 Float_t* ptbins;
685 ptbins=new Float_t[nptbins+1];
e11ae259 686
370f7180 687 ptbins[0]=0.;
688 ptbins[1]=1.;
689 ptbins[2]=2.;
690 ptbins[3]=3.;
691 ptbins[4]=4.;
692 ptbins[5]=5.;
693 ptbins[6]=6.;
694 ptbins[7]=8.;
695 ptbins[8]=12.;
696 ptbins[9]=16.;
697 ptbins[10]=24.;
3ec9254b 698 const Int_t nvars=14;
370f7180 699
370f7180 700 Float_t** anacutsval;
701 anacutsval=new Float_t*[nvars];
702
703 for(Int_t ic=0;ic<nvars;ic++){anacutsval[ic]=new Float_t[nptbins];}
704 //Double_t cutsDplus[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0.,10000000000.};
3ec9254b 705
370f7180 706 for(Int_t ipt=0;ipt<nptbins;ipt++){
3ec9254b 707 anacutsval[0][ipt]=0.2;
708 anacutsval[1][ipt]=0.8;
709 anacutsval[2][ipt]=0.8;
710 anacutsval[3][ipt]=0.;
711 anacutsval[4][ipt]=0.;
712 anacutsval[5][ipt]=0.01;
713 anacutsval[11][ipt]=10000000000.;
714 anacutsval[12][ipt]=0.;
715 anacutsval[13][ipt]=0.;
370f7180 716 }
9c90a16e 717 anacutsval[1][5]=0.9;
718
719 anacutsval[6][0]=0.022100;
720 anacutsval[6][1]=0.022100;
721 anacutsval[6][2]=0.034;
722 anacutsval[6][3]=0.020667;
723 anacutsval[6][4]=0.020667;
724 anacutsval[6][5]=0.023333;
370f7180 725
9c90a16e 726 anacutsval[7][0]=0.08;
727 anacutsval[7][1]=0.08;
728 anacutsval[7][2]=0.17;
729 anacutsval[7][3]=0.14;
730 anacutsval[7][4]=0.14;
731 anacutsval[7][5]=0.19;
732
733 anacutsval[8][0]=0.8;
734 anacutsval[8][1]=0.8;
735 anacutsval[8][2]=1.1;
736 anacutsval[8][3]=0.5;
737 anacutsval[8][4]=0.5;
738 anacutsval[8][5]=0.5;
739
740 anacutsval[9][0]=0.995;
741 anacutsval[9][1]=0.995;
742 anacutsval[9][2]=0.997;
743 anacutsval[9][3]=0.998;
744 anacutsval[9][4]=0.998;
745 anacutsval[9][5]=0.995;
746
747 anacutsval[10][0]=0.0055;
748 anacutsval[10][1]=0.0055;
749 anacutsval[10][2]= 0.0028;
750 anacutsval[10][3]=0.000883;
751 anacutsval[10][4]=0.000883;
752 anacutsval[10][5]=0.000883;
3ec9254b 753
9c90a16e 754 anacutsval[12][5]=12.;
755 anacutsval[13][5]=0.998571;
756 anacutsval[12][6]=10.;
757 anacutsval[13][6]=0.997143;
3ec9254b 758
9c90a16e 759 for(Int_t ipt=6;ipt<nptbins;ipt++){
760 anacutsval[6][ipt]=0.02333;
761 anacutsval[7][ipt]=0.19;
762 anacutsval[8][ipt]=2.0;
763 anacutsval[9][ipt]=0.997;
764 anacutsval[10][ipt]=0.000883;
765 }
766 anacutsval[7][6]=0.14;
767 anacutsval[9][6]=0.995;
62ad0d28 768
370f7180 769 SetPtBins(nptbins+1,ptbins);
770 SetCuts(nvars,nptbins,anacutsval);
771 SetUsePID(kTRUE);
9c90a16e 772 SetMinCentrality(1E-10);
5bccd3e8 773 SetMaxCentrality(20.);
774 SetUseCentrality(AliRDHFCuts::kCentV0M);
370f7180 775 SetRemoveDaughtersFromPrim(kFALSE);
3ec9254b 776
370f7180 777 PrintAll();
778
7a29658d 779 for(Int_t iic=0;iic<nvars;iic++){delete [] anacutsval[iic];}
e11ae259 780 delete [] anacutsval;
781 anacutsval=NULL;
782
783 delete [] ptbins;
784 ptbins=NULL;
785
370f7180 786 return;
787}
ef078e23 788
0c22e2ac 789
790void AliRDHFCutsDplustoKpipi::SetStandardCutsPbPb2011() {
791
792 // Default 2010 PbPb cut object
cb6ed3cd 793 SetStandardCutsPbPb2010();
0c22e2ac 794
795 // Enable all 2011 PbPb run triggers
796 //
797 SetTriggerClass("");
798 ResetMaskAndEnableMBTrigger();
799 EnableCentralTrigger();
800 EnableSemiCentralTrigger();
801
802}
4450342d 803//--------------------------------------------------------------------------
804
805UInt_t AliRDHFCutsDplustoKpipi::GetPIDTrackTPCTOFBitMap(AliAODTrack *track) const{
806
807 UInt_t bitmap=0;
808
809 Double_t sigmaTPCPionHyp=-999.;
810 Double_t sigmaTPCKaonHyp=-999.;
811 Double_t sigmaTPCProtonHyp=-999.;
812 Double_t sigmaTOFPionHyp=-999.;
813 Double_t sigmaTOFKaonHyp=-999.;
814 Double_t sigmaTOFProtonHyp=-999.;
815
816 Int_t oksigmaTPCPionHyp=fPidHF->GetnSigmaTPC(track,2,sigmaTPCPionHyp);
817 Int_t oksigmaTPCKaonHyp=fPidHF->GetnSigmaTPC(track,3,sigmaTPCKaonHyp);
818 Int_t oksigmaTPCProtonHyp=fPidHF->GetnSigmaTPC(track,4,sigmaTPCProtonHyp);
819 Int_t oksigmaTOFPionHyp=fPidHF->GetnSigmaTOF(track,2,sigmaTOFPionHyp);
820 Int_t oksigmaTOFKaonHyp=fPidHF->GetnSigmaTOF(track,3,sigmaTOFKaonHyp);
821 Int_t oksigmaTOFProtonHyp=fPidHF->GetnSigmaTOF(track,4,sigmaTOFProtonHyp);
4940d5bf 822
823 sigmaTPCPionHyp=TMath::Abs(sigmaTPCPionHyp);
824 sigmaTPCKaonHyp=TMath::Abs(sigmaTPCKaonHyp);
825 sigmaTPCProtonHyp=TMath::Abs(sigmaTPCProtonHyp);
826 sigmaTOFPionHyp=TMath::Abs(sigmaTOFPionHyp);
827 sigmaTOFKaonHyp=TMath::Abs(sigmaTOFKaonHyp);
2d719fc0 828 sigmaTOFProtonHyp=TMath::Abs(sigmaTOFProtonHyp);
4940d5bf 829
4450342d 830 if (oksigmaTPCPionHyp && sigmaTPCPionHyp>0.){
831 if (sigmaTPCPionHyp<1.) bitmap+=1<<kTPCPionLess1;
832 else{
833 if (sigmaTPCPionHyp<2.) bitmap+=1<<kTPCPionMore1Less2;
834 else {
835 if (sigmaTPCPionHyp<3.) bitmap+=1<<kTPCPionMore2Less3;
836 else bitmap+=1<<kTPCPionMore3;
837 }
838 }
839 }
840
841 if (oksigmaTPCKaonHyp && sigmaTPCKaonHyp>0.){
842 if (sigmaTPCKaonHyp<1.) bitmap+=1<<kTPCKaonLess1;
843 else{
844 if (sigmaTPCKaonHyp<2.) bitmap+=1<<kTPCKaonMore1Less2;
845 else {
846 if (sigmaTPCKaonHyp<3.) bitmap+=1<<kTPCKaonMore2Less3;
847 else bitmap+=1<<kTPCKaonMore3;
848 }
849 }
850 }
851
852 if (oksigmaTPCProtonHyp && sigmaTPCProtonHyp>0.){
853 if (sigmaTPCProtonHyp<1.) bitmap+=1<<kTPCProtonLess1;
854 else{
855 if (sigmaTPCProtonHyp<2.) bitmap+=1<<kTPCProtonMore1Less2;
856 else {
857 if (sigmaTPCProtonHyp<3.) bitmap+=1<<kTPCProtonMore2Less3;
858 else bitmap+=1<<kTPCProtonMore3;
859 }
860 }
861 }
862
863 if (oksigmaTOFPionHyp && sigmaTOFPionHyp>0.){
864 if (sigmaTOFPionHyp<1.) bitmap+=1<<kTOFPionLess1;
865 else{
866 if (sigmaTOFPionHyp<2.) bitmap+=1<<kTOFPionMore1Less2;
867 else {
868 if (sigmaTOFPionHyp<3.) bitmap+=1<<kTOFPionMore2Less3;
869 else bitmap+=1<<kTOFPionMore3;
870 }
871 }
872 }
873
874 if (oksigmaTOFKaonHyp && sigmaTOFKaonHyp>0.){
875 if (sigmaTOFKaonHyp<1.) bitmap+=1<<kTOFKaonLess1;
876 else{
877 if (sigmaTOFKaonHyp<2.) bitmap+=1<<kTOFKaonMore1Less2;
878 else {
879 if (sigmaTOFKaonHyp<3.) bitmap+=1<<kTOFKaonMore2Less3;
880 else bitmap+=1<<kTOFKaonMore3;
881 }
882 }
883 }
884
885 if (oksigmaTOFProtonHyp && sigmaTOFProtonHyp>0.){
886 if (sigmaTOFProtonHyp<1.) bitmap+=1<<kTOFProtonLess1;
887 else{
888 if (sigmaTOFProtonHyp<2.) bitmap+=1<<kTOFProtonMore1Less2;
889 else {
890 if (sigmaTOFProtonHyp<3.) bitmap+=1<<kTOFProtonMore2Less3;
891 else bitmap+=1<<kTOFProtonMore3;
892 }
893 }
894 }
895
896
897
898 return bitmap;
899
900}