]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/vertexingHF/AliRDHFCutsDplustoKpipi.cxx
Move reconstruction files to new subfolder,
[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
3e075b37 405 if(fUseTrackSelectionWithFilterBits && 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;
2493b5d3 413 if(fRemoveDaughtersFromPrimary && !fUseMCVertex) {
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
2493b5d3 421 if(fUseMCVertex) {
422 if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx());
423 if(!SetMCPrimaryVtx(d,aod)) {
424 CleanOwnPrimaryVtx(d,aod,origownvtx);
425 return 0;
426 }
427 }
428
e3d40058 429 Int_t ptbin=PtBin(pt);
c1cc7a53 430 if (ptbin==-1) {
793fdbec 431 CleanOwnPrimaryVtx(d,aod,origownvtx);
c1cc7a53 432 return 0;
433 }
73173a6a 434
e3d40058 435 Double_t mDplusPDG = TDatabasePDG::Instance()->GetParticle(411)->Mass();
436 Double_t mDplus=d->InvMassDplus();
793fdbec 437 if(TMath::Abs(mDplus-mDplusPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
e3d40058 438
c1cc7a53 439 //2track cuts
793fdbec 440 if(d->GetDist12toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]|| d->GetDist23toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
5d2d6118 441
442 Double_t sum2=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
793fdbec 443 if(sum2<fCutsRD[GetGlobalIndex(10,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
5d2d6118 444
3ec9254b 445 if(fUseImpParProdCorrCut){
446 if(d->Getd0Prong(0)*d->Getd0Prong(1)<0. && d->Getd0Prong(2)*d->Getd0Prong(1)<0.) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
447 }
448
5d2d6118 449
450 //DCA
793fdbec 451 for(Int_t i=0;i<3;i++) if(d->GetDCA(i)>fCutsRD[GetGlobalIndex(11,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
5d2d6118 452
793fdbec 453 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 454
793fdbec 455 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 456
793fdbec 457 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 458
793fdbec 459 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 460
793fdbec 461 if(d->DecayLength2()<fCutsRD[GetGlobalIndex(7,ptbin)]*fCutsRD[GetGlobalIndex(7,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
5d2d6118 462
793fdbec 463 if(d->CosPointingAngle()< fCutsRD[GetGlobalIndex(9,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
5d2d6118 464
9c90a16e 465 if(d->NormalizedDecayLengthXY()*d->P()/pt<fCutsRD[GetGlobalIndex(12,ptbin)]){CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
5d2d6118 466
3ec9254b 467 if(d->CosPointingAngleXY()<fCutsRD[GetGlobalIndex(13,ptbin)]){CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
930eb764 468
e0fb900a 469 //sec vert
470 Double_t sigmavert=d->GetSigmaVert(aod);
471 if(sigmavert>fCutsRD[GetGlobalIndex(6,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
472
c1cc7a53 473 // unset recalculated primary vertex when not needed any more
793fdbec 474 CleanOwnPrimaryVtx(d,aod,origownvtx);
c1cc7a53 475
5d2d6118 476 fIsSelectedCuts=returnvalueCuts;
477
f754294e 478 //if(!returnvalueCuts) return 0; // returnvalueCuts cannot be 0 here
e3d40058 479 }
dcc2ade0 480
481 if(selectionLevel==AliRDHFCuts::kAll ||
482 selectionLevel==AliRDHFCuts::kCandidate ||
483 selectionLevel==AliRDHFCuts::kPID) {
484 returnvaluePID = IsSelectedPID(d);
5d2d6118 485 fIsSelectedPID=returnvaluePID;
dcc2ade0 486 }
487 if(returnvaluePID==0)return 0;
488
489 // selection on daughter tracks
490 if(selectionLevel==AliRDHFCuts::kAll ||
491 selectionLevel==AliRDHFCuts::kTracks) {
492 if(!AreDaughtersSelected(d)) return 0;
493 }
494
495
496
c1cc7a53 497
595cc7e2 498 return 3;
e3d40058 499}
370f7180 500
501
502
503
e3d40058 504//---------------------------------------------------------------------------
370f7180 505
506
507void AliRDHFCutsDplustoKpipi::SetStandardCutsPP2010() {
508 //
509 //STANDARD CUTS USED FOR 2010 pp analysis
510 //
511
512 SetName("DplustoKpipiCutsStandard");
513 SetTitle("Standard Cuts for D+ analysis");
514
515 // PILE UP REJECTION
516 SetOptPileup(AliRDHFCuts::kRejectPileupEvent);
517
518 // EVENT CUTS
519 SetMinVtxContr(1);
520
521 AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts();
522 esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
523 //default
524 esdTrackCuts->SetRequireTPCRefit(kTRUE);
525 esdTrackCuts->SetRequireITSRefit(kTRUE);
526 //esdTrackCuts->SetMinNClustersITS(4); // default is 5
527 esdTrackCuts->SetMinNClustersTPC(70);
528 esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
529 AliESDtrackCuts::kAny);
530 // default is kBoth, otherwise kAny
531 esdTrackCuts->SetMinDCAToVertexXY(0.);
532 esdTrackCuts->SetPtRange(0.3,1.e10);
533
534 AddTrackCuts(esdTrackCuts);
535
536
738ad720 537 const Int_t nptbins =15;
3ec9254b 538 const Int_t nvars=14;
370f7180 539 Float_t ptbins[nptbins+1];
540 ptbins[0]=0.;
541 ptbins[1]=1;
542 ptbins[2]=2.;
543 ptbins[3]=3.;
544 ptbins[4]=4.;
545 ptbins[5]=5.;
546 ptbins[6]=6.;
738ad720 547 ptbins[7]=7.;
548 ptbins[8]=8.;
549 ptbins[9]=9.;
550 ptbins[10]=10.;
551 ptbins[11]=12.;
552 ptbins[12]=14.;
553 ptbins[13]=16.;
554 ptbins[14]=24.;
555 ptbins[15]=99999.;
370f7180 556
557
558 Float_t** anacutsval;
559 anacutsval=new Float_t*[nvars];
560
561 for(Int_t ic=0;ic<nvars;ic++){anacutsval[ic]=new Float_t[nptbins];}
e11ae259 562
370f7180 563 //Double_t cutsDplus[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0.,10000000000.};
370f7180 564 for(Int_t ipt=0;ipt<nptbins;ipt++){
3ec9254b 565 anacutsval[0][ipt]=0.2;
566 anacutsval[3][ipt]=0.;
567 anacutsval[4][ipt]=0.;
568 anacutsval[5][ipt]=0.01;
569 anacutsval[11][ipt]=10000000000.;
738ad720 570 }
3ec9254b 571
370f7180 572 anacutsval[1][0]=0.3;
738ad720 573 anacutsval[1][1]=0.4;
3ec9254b 574 anacutsval[1][2]=0.4;
370f7180 575 anacutsval[2][0]=0.3;
576 anacutsval[2][1]=0.3;
3ec9254b 577 anacutsval[2][2]=0.4;
370f7180 578 for(Int_t ipt=3;ipt<nptbins;ipt++){
3ec9254b 579 anacutsval[1][ipt]=0.4;
580 anacutsval[2][ipt]=0.4;
370f7180 581 }
65b4f6d7 582
370f7180 583 anacutsval[6][0]=0.022100;
584 anacutsval[6][1]=0.022100;
585 anacutsval[6][2]=0.034;
586 anacutsval[6][3]=0.020667;
587 anacutsval[6][4]=0.020667;
588 anacutsval[6][5]=0.023333;
3ec9254b 589
65b4f6d7 590
370f7180 591 anacutsval[7][0]=0.08;
592 anacutsval[7][1]=0.08;
593 anacutsval[7][2]=0.09;
594 anacutsval[7][3]=0.095;
595 anacutsval[7][4]=0.095;
3ec9254b 596
370f7180 597 anacutsval[8][0]=0.5;
598 anacutsval[8][1]=0.5;
599 anacutsval[8][2]=1.0;
600 anacutsval[8][3]=0.5;
3ec9254b 601 anacutsval[8][4]=0.5;
602
603
738ad720 604 anacutsval[9][0]=0.97;
605 anacutsval[9][1]=0.936;
370f7180 606 anacutsval[9][2]=0.95;
607 anacutsval[9][3]=0.95;
608 anacutsval[9][4]= 0.95;
609 anacutsval[9][5]=0.92;
610 anacutsval[9][6]=0.92;
611 anacutsval[9][7]=0.92;
612 anacutsval[9][8]=0.92;
613 anacutsval[9][9]=0.90;
738ad720 614 for(Int_t ipt=10;ipt<nptbins;ipt++){
615 anacutsval[9][ipt]=0.90;
616 }
617
370f7180 618
619 anacutsval[10][0]=0.0055;
620 anacutsval[10][1]=0.0055;
621 anacutsval[10][2]= 0.0028;
622 anacutsval[10][3]=0.000883;
3ec9254b 623 anacutsval[10][4]=0.000883;
624
65b4f6d7 625
3ec9254b 626 for(Int_t ipt=5;ipt<nptbins;ipt++){
627 anacutsval[6][ipt]=0.02333;
628 anacutsval[7][ipt]=0.115;
629 anacutsval[8][ipt]=0.5;
630 anacutsval[10][ipt]=0.000883;
631 }
632
738ad720 633 anacutsval[12][0]=8;
634 anacutsval[12][1]=8;
635
636 anacutsval[13][0]=0.98;
637 anacutsval[13][1]=0.98;
638 for(Int_t ipt=2;ipt<nptbins;ipt++){
639 anacutsval[12][ipt]=0.;
640 anacutsval[13][ipt]=0.;
641 }
642
643
644
ae39ad32 645 SetGlobalIndex(nvars,nptbins);
370f7180 646 SetPtBins(nptbins+1,ptbins);
647 SetCuts(nvars,nptbins,anacutsval);
648 SetUsePID(kTRUE);
8866570f 649 fPidHF->SetOldPid(kTRUE);
370f7180 650 SetRemoveDaughtersFromPrim(kTRUE);
3ec9254b 651
370f7180 652 PrintAll();
653
e11ae259 654 for(Int_t iic=0;iic<nvars;iic++){delete [] anacutsval[iic];}
655 delete [] anacutsval;
656 anacutsval=NULL;
657
370f7180 658 return;
659}
660
661
662void AliRDHFCutsDplustoKpipi::SetStandardCutsPbPb2010() {
663 //
664 //STANDARD CUTS USED FOR 2010 Pb Pb analysis.... not optimized yet
665 //
666
667 SetName("DplustoKpipiCutsStandard");
668 SetTitle("Standard Cuts for D+ analysis in PbPb2010 run");
669
670 // PILE UP REJECTION
671 //SetOptPileup(AliRDHFCuts::kRejectPileupEvent);
672
673 // EVENT CUTS
674 SetMinVtxContr(1);
675
676
677 AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts();
678 esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
679 //default
680 esdTrackCuts->SetRequireTPCRefit(kTRUE);
681 esdTrackCuts->SetRequireITSRefit(kTRUE);
682 //esdTrackCuts->SetMinNClustersITS(4); // default is 5
683 esdTrackCuts->SetMinNClustersTPC(70);
684 esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
685 AliESDtrackCuts::kAny);
686 // default is kBoth, otherwise kAny
3ec9254b 687 esdTrackCuts->SetMinDCAToVertexXY(0.);
370f7180 688 esdTrackCuts->SetPtRange(0.8,1.e10);
689
690 AddTrackCuts(esdTrackCuts);
691
692 const Int_t nptbins=10;
693 Float_t* ptbins;
694 ptbins=new Float_t[nptbins+1];
e11ae259 695
370f7180 696 ptbins[0]=0.;
697 ptbins[1]=1.;
698 ptbins[2]=2.;
699 ptbins[3]=3.;
700 ptbins[4]=4.;
701 ptbins[5]=5.;
702 ptbins[6]=6.;
703 ptbins[7]=8.;
704 ptbins[8]=12.;
705 ptbins[9]=16.;
706 ptbins[10]=24.;
3ec9254b 707 const Int_t nvars=14;
370f7180 708
370f7180 709 Float_t** anacutsval;
710 anacutsval=new Float_t*[nvars];
711
712 for(Int_t ic=0;ic<nvars;ic++){anacutsval[ic]=new Float_t[nptbins];}
713 //Double_t cutsDplus[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0.,10000000000.};
3ec9254b 714
370f7180 715 for(Int_t ipt=0;ipt<nptbins;ipt++){
3ec9254b 716 anacutsval[0][ipt]=0.2;
717 anacutsval[1][ipt]=0.8;
718 anacutsval[2][ipt]=0.8;
719 anacutsval[3][ipt]=0.;
720 anacutsval[4][ipt]=0.;
721 anacutsval[5][ipt]=0.01;
722 anacutsval[11][ipt]=10000000000.;
723 anacutsval[12][ipt]=0.;
724 anacutsval[13][ipt]=0.;
370f7180 725 }
9c90a16e 726 anacutsval[1][5]=0.9;
727
728 anacutsval[6][0]=0.022100;
729 anacutsval[6][1]=0.022100;
730 anacutsval[6][2]=0.034;
731 anacutsval[6][3]=0.020667;
732 anacutsval[6][4]=0.020667;
733 anacutsval[6][5]=0.023333;
370f7180 734
9c90a16e 735 anacutsval[7][0]=0.08;
736 anacutsval[7][1]=0.08;
737 anacutsval[7][2]=0.17;
738 anacutsval[7][3]=0.14;
739 anacutsval[7][4]=0.14;
740 anacutsval[7][5]=0.19;
741
742 anacutsval[8][0]=0.8;
743 anacutsval[8][1]=0.8;
744 anacutsval[8][2]=1.1;
745 anacutsval[8][3]=0.5;
746 anacutsval[8][4]=0.5;
747 anacutsval[8][5]=0.5;
748
749 anacutsval[9][0]=0.995;
750 anacutsval[9][1]=0.995;
751 anacutsval[9][2]=0.997;
752 anacutsval[9][3]=0.998;
753 anacutsval[9][4]=0.998;
754 anacutsval[9][5]=0.995;
755
756 anacutsval[10][0]=0.0055;
757 anacutsval[10][1]=0.0055;
758 anacutsval[10][2]= 0.0028;
759 anacutsval[10][3]=0.000883;
760 anacutsval[10][4]=0.000883;
761 anacutsval[10][5]=0.000883;
3ec9254b 762
9c90a16e 763 anacutsval[12][5]=12.;
764 anacutsval[13][5]=0.998571;
765 anacutsval[12][6]=10.;
766 anacutsval[13][6]=0.997143;
3ec9254b 767
9c90a16e 768 for(Int_t ipt=6;ipt<nptbins;ipt++){
769 anacutsval[6][ipt]=0.02333;
770 anacutsval[7][ipt]=0.19;
771 anacutsval[8][ipt]=2.0;
772 anacutsval[9][ipt]=0.997;
773 anacutsval[10][ipt]=0.000883;
774 }
775 anacutsval[7][6]=0.14;
776 anacutsval[9][6]=0.995;
62ad0d28 777
370f7180 778 SetPtBins(nptbins+1,ptbins);
779 SetCuts(nvars,nptbins,anacutsval);
780 SetUsePID(kTRUE);
8866570f 781 fPidHF->SetOldPid(kTRUE);
9c90a16e 782 SetMinCentrality(1E-10);
5bccd3e8 783 SetMaxCentrality(20.);
784 SetUseCentrality(AliRDHFCuts::kCentV0M);
370f7180 785 SetRemoveDaughtersFromPrim(kFALSE);
3ec9254b 786
370f7180 787 PrintAll();
788
7a29658d 789 for(Int_t iic=0;iic<nvars;iic++){delete [] anacutsval[iic];}
e11ae259 790 delete [] anacutsval;
791 anacutsval=NULL;
792
793 delete [] ptbins;
794 ptbins=NULL;
795
370f7180 796 return;
797}
ef078e23 798
0c22e2ac 799
800void AliRDHFCutsDplustoKpipi::SetStandardCutsPbPb2011() {
801
802 // Default 2010 PbPb cut object
cb6ed3cd 803 SetStandardCutsPbPb2010();
0c22e2ac 804
805 // Enable all 2011 PbPb run triggers
806 //
807 SetTriggerClass("");
808 ResetMaskAndEnableMBTrigger();
809 EnableCentralTrigger();
810 EnableSemiCentralTrigger();
811
8866570f 812 // new PID
813 fPidHF->SetOldPid(kFALSE);
814
0c22e2ac 815}
4450342d 816//--------------------------------------------------------------------------
817
818UInt_t AliRDHFCutsDplustoKpipi::GetPIDTrackTPCTOFBitMap(AliAODTrack *track) const{
819
820 UInt_t bitmap=0;
821
822 Double_t sigmaTPCPionHyp=-999.;
823 Double_t sigmaTPCKaonHyp=-999.;
824 Double_t sigmaTPCProtonHyp=-999.;
825 Double_t sigmaTOFPionHyp=-999.;
826 Double_t sigmaTOFKaonHyp=-999.;
827 Double_t sigmaTOFProtonHyp=-999.;
828
829 Int_t oksigmaTPCPionHyp=fPidHF->GetnSigmaTPC(track,2,sigmaTPCPionHyp);
830 Int_t oksigmaTPCKaonHyp=fPidHF->GetnSigmaTPC(track,3,sigmaTPCKaonHyp);
831 Int_t oksigmaTPCProtonHyp=fPidHF->GetnSigmaTPC(track,4,sigmaTPCProtonHyp);
832 Int_t oksigmaTOFPionHyp=fPidHF->GetnSigmaTOF(track,2,sigmaTOFPionHyp);
833 Int_t oksigmaTOFKaonHyp=fPidHF->GetnSigmaTOF(track,3,sigmaTOFKaonHyp);
834 Int_t oksigmaTOFProtonHyp=fPidHF->GetnSigmaTOF(track,4,sigmaTOFProtonHyp);
4940d5bf 835
836 sigmaTPCPionHyp=TMath::Abs(sigmaTPCPionHyp);
837 sigmaTPCKaonHyp=TMath::Abs(sigmaTPCKaonHyp);
838 sigmaTPCProtonHyp=TMath::Abs(sigmaTPCProtonHyp);
839 sigmaTOFPionHyp=TMath::Abs(sigmaTOFPionHyp);
840 sigmaTOFKaonHyp=TMath::Abs(sigmaTOFKaonHyp);
2d719fc0 841 sigmaTOFProtonHyp=TMath::Abs(sigmaTOFProtonHyp);
4940d5bf 842
4450342d 843 if (oksigmaTPCPionHyp && sigmaTPCPionHyp>0.){
844 if (sigmaTPCPionHyp<1.) bitmap+=1<<kTPCPionLess1;
845 else{
846 if (sigmaTPCPionHyp<2.) bitmap+=1<<kTPCPionMore1Less2;
847 else {
848 if (sigmaTPCPionHyp<3.) bitmap+=1<<kTPCPionMore2Less3;
849 else bitmap+=1<<kTPCPionMore3;
850 }
851 }
852 }
853
854 if (oksigmaTPCKaonHyp && sigmaTPCKaonHyp>0.){
855 if (sigmaTPCKaonHyp<1.) bitmap+=1<<kTPCKaonLess1;
856 else{
857 if (sigmaTPCKaonHyp<2.) bitmap+=1<<kTPCKaonMore1Less2;
858 else {
859 if (sigmaTPCKaonHyp<3.) bitmap+=1<<kTPCKaonMore2Less3;
860 else bitmap+=1<<kTPCKaonMore3;
861 }
862 }
863 }
864
865 if (oksigmaTPCProtonHyp && sigmaTPCProtonHyp>0.){
866 if (sigmaTPCProtonHyp<1.) bitmap+=1<<kTPCProtonLess1;
867 else{
868 if (sigmaTPCProtonHyp<2.) bitmap+=1<<kTPCProtonMore1Less2;
869 else {
870 if (sigmaTPCProtonHyp<3.) bitmap+=1<<kTPCProtonMore2Less3;
871 else bitmap+=1<<kTPCProtonMore3;
872 }
873 }
874 }
875
876 if (oksigmaTOFPionHyp && sigmaTOFPionHyp>0.){
877 if (sigmaTOFPionHyp<1.) bitmap+=1<<kTOFPionLess1;
878 else{
879 if (sigmaTOFPionHyp<2.) bitmap+=1<<kTOFPionMore1Less2;
880 else {
881 if (sigmaTOFPionHyp<3.) bitmap+=1<<kTOFPionMore2Less3;
882 else bitmap+=1<<kTOFPionMore3;
883 }
884 }
885 }
886
887 if (oksigmaTOFKaonHyp && sigmaTOFKaonHyp>0.){
888 if (sigmaTOFKaonHyp<1.) bitmap+=1<<kTOFKaonLess1;
889 else{
890 if (sigmaTOFKaonHyp<2.) bitmap+=1<<kTOFKaonMore1Less2;
891 else {
892 if (sigmaTOFKaonHyp<3.) bitmap+=1<<kTOFKaonMore2Less3;
893 else bitmap+=1<<kTOFKaonMore3;
894 }
895 }
896 }
897
898 if (oksigmaTOFProtonHyp && sigmaTOFProtonHyp>0.){
899 if (sigmaTOFProtonHyp<1.) bitmap+=1<<kTOFProtonLess1;
900 else{
901 if (sigmaTOFProtonHyp<2.) bitmap+=1<<kTOFProtonMore1Less2;
902 else {
903 if (sigmaTOFProtonHyp<3.) bitmap+=1<<kTOFProtonMore2Less3;
904 else bitmap+=1<<kTOFProtonMore3;
905 }
906 }
907 }
908
909
910
911 return bitmap;
912
913}