]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/vertexingHF/AliRDHFCutsDplustoKpipi.cxx
Merge branch 'feature-movesplit'
[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
af5d687e 293 if(fMaxRapidityCand>-998.){
294 if(TMath::Abs(y) > fMaxRapidityCand) return kFALSE;
295 else return kTRUE;
296 }
297
c1cc7a53 298 if(pt > 5.) {
299 // applying cut for pt > 5 GeV
300 AliDebug(2,Form("pt of D+ = %f (> 5), cutting at |y| < 0.8",pt));
301 if (TMath::Abs(y) > 0.8) return kFALSE;
302
303 } else {
304 // appliying smooth cut for pt < 5 GeV
305 Double_t maxFiducialY = -0.2/15*pt*pt+1.9/15*pt+0.5;
306 Double_t minFiducialY = 0.2/15*pt*pt-1.9/15*pt-0.5;
307 AliDebug(2,Form("pt of D+ = %f (< 5), cutting according to the fiducial zone [%f, %f]\n",pt,minFiducialY,maxFiducialY));
308 if (y < minFiducialY || y > maxFiducialY) return kFALSE;
309 }
310
311 return kTRUE;
312}
73173a6a 313
4214a55d 314//---------------------------------------------------------------------------
315Int_t AliRDHFCutsDplustoKpipi::GetPIDBitMask(AliAODRecoDecayHF *rd)
316{
4450342d 317 if(!fUsePID || !rd) return -1;
4214a55d 318 //if(fUsePID)printf("i am inside the pid \n");
319 Int_t mask=0;
320 Int_t sign=rd->GetCharge();
321 for(Int_t daught=0;daught<3;daught++){
322 AliAODTrack *track=(AliAODTrack*)rd->GetDaughter(daught);
323
324 if(sign==track->Charge()){//pions
325 Int_t isPion=fPidHF->MakeRawPid(track,AliPID::kPion);
326 if(isPion==0)mask+=1;
327 else if(isPion>0)mask+=3;
328 mask=mask<<2;
329 }
330 else{//kaons
331 Int_t isKaon=fPidHF->MakeRawPid(track,AliPID::kKaon);
332 if(isKaon==0)mask+=1;
333 else if(isKaon>0)mask+=3;
334 mask=mask<<2;
335 }
336 }
337 mask=mask>>2;
338 return mask;
339}
73173a6a 340//---------------------------------------------------------------------------
bc116f28 341Int_t AliRDHFCutsDplustoKpipi::IsSelectedPID(AliAODRecoDecayHF *rd)
342{
343 //
595cc7e2 344 // PID selection, returns 3 if accepted, 0 if not accepted
bc116f28 345 //
595cc7e2 346 if(!fUsePID || !rd) return 3;
73173a6a 347 //if(fUsePID)printf("i am inside the pid \n");
348 Int_t nkaons=0;
349 Int_t nNotKaons=0;
350 Int_t sign= rd->GetCharge();
351 for(Int_t daught=0;daught<3;daught++){
352 AliAODTrack *track=(AliAODTrack*)rd->GetDaughter(daught);
353 Int_t isPion=fPidHF->MakeRawPid(track,AliPID::kPion);
354 Int_t isKaon=fPidHF->MakeRawPid(track,AliPID::kKaon);
355 Int_t isProton=fPidHF->MakeRawPid(track,AliPID::kProton);
356
357 if(isProton>0 && isKaon<0 && isPion<0) return 0;
358 if(isKaon>0 && isPion<0) nkaons++;
359 if(isKaon<0) nNotKaons++;
360 if(sign==track->Charge()){//pions
361 if(isPion<0)return 0;
83553641 362 if(rd->Pt()<fMaxPtStrongPid && isPion<=0 && fUseStrongPid&2 && track->P()<fMaxPStrongPidpi)return 0;
a6003e0a 363 }
364 else{//kaons
365 if(isKaon<0)return 0;
83553641 366 if(rd->Pt()<fMaxPtStrongPid && isKaon<=0 && fUseStrongPid&1&& track->P()<fMaxPStrongPidK)return 0;
73173a6a 367 }
73173a6a 368 }
369
370 if(nkaons>1)return 0;
371 if(nNotKaons==3)return 0;
372
595cc7e2 373 return 3;
73173a6a 374}
375
376
e3d40058 377//---------------------------------------------------------------------------
c1cc7a53 378Int_t AliRDHFCutsDplustoKpipi::IsSelected(TObject* obj,Int_t selectionLevel, AliAODEvent* aod) {
e3d40058 379 //
595cc7e2 380 // Apply selection, returns 3 if accepted, 0 if not accepted
e3d40058 381 //
382
5d2d6118 383
384 fIsSelectedCuts=0;
385 fIsSelectedPID=0;
386
e3d40058 387 if(!fCutsRD){
4755453e 388 cout<<"Cut matrix not inizialized. Exit..."<<endl;
e3d40058 389 return 0;
390 }
391 //PrintAll();
392 AliAODRecoDecayHF3Prong* d=(AliAODRecoDecayHF3Prong*)obj;
393
394
395 if(!d){
396 cout<<"AliAODRecoDecayHF3Prong null"<<endl;
397 return 0;
398 }
399
5e938293 400 if(fKeepSignalMC) if(IsSignalMC(d,aod,411)) return 3;
401
73173a6a 402 // PID selection
595cc7e2 403 Int_t returnvaluePID=3;
404 Int_t returnvalueCuts=3;
e3d40058 405
5639e412 406 Double_t pt=d->Pt();
407 if(pt<fMinPtCand) return 0;
408 if(pt>fMaxPtCand) return 0;
dcc2ade0 409
3e075b37 410 if(fUseTrackSelectionWithFilterBits && d->HasBadDaughters()) return 0;
73173a6a 411
e3d40058 412 // selection on candidate
413 if(selectionLevel==AliRDHFCuts::kAll ||
414 selectionLevel==AliRDHFCuts::kCandidate) {
415
c1cc7a53 416 //recalculate vertex w/o daughters
417 AliAODVertex *origownvtx=0x0;
2493b5d3 418 if(fRemoveDaughtersFromPrimary && !fUseMCVertex) {
793fdbec 419 if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx());
420 if(!RecalcOwnPrimaryVtx(d,aod)) {
421 CleanOwnPrimaryVtx(d,aod,origownvtx);
422 return 0;
423 }
c1cc7a53 424 }
425
2493b5d3 426 if(fUseMCVertex) {
427 if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx());
428 if(!SetMCPrimaryVtx(d,aod)) {
429 CleanOwnPrimaryVtx(d,aod,origownvtx);
430 return 0;
431 }
432 }
433
e3d40058 434 Int_t ptbin=PtBin(pt);
c1cc7a53 435 if (ptbin==-1) {
793fdbec 436 CleanOwnPrimaryVtx(d,aod,origownvtx);
c1cc7a53 437 return 0;
438 }
73173a6a 439
e3d40058 440 Double_t mDplusPDG = TDatabasePDG::Instance()->GetParticle(411)->Mass();
441 Double_t mDplus=d->InvMassDplus();
793fdbec 442 if(TMath::Abs(mDplus-mDplusPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
e3d40058 443
c1cc7a53 444 //2track cuts
793fdbec 445 if(d->GetDist12toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]|| d->GetDist23toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
5d2d6118 446
447 Double_t sum2=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
793fdbec 448 if(sum2<fCutsRD[GetGlobalIndex(10,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
5d2d6118 449
3ec9254b 450 if(fUseImpParProdCorrCut){
451 if(d->Getd0Prong(0)*d->Getd0Prong(1)<0. && d->Getd0Prong(2)*d->Getd0Prong(1)<0.) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
452 }
453
5d2d6118 454
455 //DCA
793fdbec 456 for(Int_t i=0;i<3;i++) if(d->GetDCA(i)>fCutsRD[GetGlobalIndex(11,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
5d2d6118 457
793fdbec 458 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 459
793fdbec 460 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 461
793fdbec 462 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 463
793fdbec 464 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 465
793fdbec 466 if(d->DecayLength2()<fCutsRD[GetGlobalIndex(7,ptbin)]*fCutsRD[GetGlobalIndex(7,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
5d2d6118 467
793fdbec 468 if(d->CosPointingAngle()< fCutsRD[GetGlobalIndex(9,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
5d2d6118 469
9c90a16e 470 if(d->NormalizedDecayLengthXY()*d->P()/pt<fCutsRD[GetGlobalIndex(12,ptbin)]){CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
5d2d6118 471
3ec9254b 472 if(d->CosPointingAngleXY()<fCutsRD[GetGlobalIndex(13,ptbin)]){CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
930eb764 473
e0fb900a 474 //sec vert
475 Double_t sigmavert=d->GetSigmaVert(aod);
476 if(sigmavert>fCutsRD[GetGlobalIndex(6,ptbin)]) {CleanOwnPrimaryVtx(d,aod,origownvtx); return 0;}
477
c1cc7a53 478 // unset recalculated primary vertex when not needed any more
793fdbec 479 CleanOwnPrimaryVtx(d,aod,origownvtx);
c1cc7a53 480
5d2d6118 481 fIsSelectedCuts=returnvalueCuts;
482
f754294e 483 //if(!returnvalueCuts) return 0; // returnvalueCuts cannot be 0 here
e3d40058 484 }
dcc2ade0 485
486 if(selectionLevel==AliRDHFCuts::kAll ||
487 selectionLevel==AliRDHFCuts::kCandidate ||
488 selectionLevel==AliRDHFCuts::kPID) {
489 returnvaluePID = IsSelectedPID(d);
5d2d6118 490 fIsSelectedPID=returnvaluePID;
dcc2ade0 491 }
492 if(returnvaluePID==0)return 0;
493
494 // selection on daughter tracks
495 if(selectionLevel==AliRDHFCuts::kAll ||
496 selectionLevel==AliRDHFCuts::kTracks) {
497 if(!AreDaughtersSelected(d)) return 0;
498 }
499
500
501
c1cc7a53 502
595cc7e2 503 return 3;
e3d40058 504}
370f7180 505
506
507
508
e3d40058 509//---------------------------------------------------------------------------
370f7180 510
511
512void AliRDHFCutsDplustoKpipi::SetStandardCutsPP2010() {
513 //
514 //STANDARD CUTS USED FOR 2010 pp analysis
515 //
516
517 SetName("DplustoKpipiCutsStandard");
518 SetTitle("Standard Cuts for D+ analysis");
519
520 // PILE UP REJECTION
521 SetOptPileup(AliRDHFCuts::kRejectPileupEvent);
522
523 // EVENT CUTS
524 SetMinVtxContr(1);
525
526 AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts();
527 esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
528 //default
529 esdTrackCuts->SetRequireTPCRefit(kTRUE);
530 esdTrackCuts->SetRequireITSRefit(kTRUE);
531 //esdTrackCuts->SetMinNClustersITS(4); // default is 5
532 esdTrackCuts->SetMinNClustersTPC(70);
533 esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
534 AliESDtrackCuts::kAny);
535 // default is kBoth, otherwise kAny
536 esdTrackCuts->SetMinDCAToVertexXY(0.);
537 esdTrackCuts->SetPtRange(0.3,1.e10);
538
539 AddTrackCuts(esdTrackCuts);
540
541
738ad720 542 const Int_t nptbins =15;
3ec9254b 543 const Int_t nvars=14;
370f7180 544 Float_t ptbins[nptbins+1];
545 ptbins[0]=0.;
546 ptbins[1]=1;
547 ptbins[2]=2.;
548 ptbins[3]=3.;
549 ptbins[4]=4.;
550 ptbins[5]=5.;
551 ptbins[6]=6.;
738ad720 552 ptbins[7]=7.;
553 ptbins[8]=8.;
554 ptbins[9]=9.;
555 ptbins[10]=10.;
556 ptbins[11]=12.;
557 ptbins[12]=14.;
558 ptbins[13]=16.;
559 ptbins[14]=24.;
560 ptbins[15]=99999.;
370f7180 561
562
563 Float_t** anacutsval;
564 anacutsval=new Float_t*[nvars];
565
566 for(Int_t ic=0;ic<nvars;ic++){anacutsval[ic]=new Float_t[nptbins];}
e11ae259 567
370f7180 568 //Double_t cutsDplus[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0.,10000000000.};
370f7180 569 for(Int_t ipt=0;ipt<nptbins;ipt++){
3ec9254b 570 anacutsval[0][ipt]=0.2;
571 anacutsval[3][ipt]=0.;
572 anacutsval[4][ipt]=0.;
573 anacutsval[5][ipt]=0.01;
574 anacutsval[11][ipt]=10000000000.;
738ad720 575 }
3ec9254b 576
370f7180 577 anacutsval[1][0]=0.3;
738ad720 578 anacutsval[1][1]=0.4;
3ec9254b 579 anacutsval[1][2]=0.4;
370f7180 580 anacutsval[2][0]=0.3;
581 anacutsval[2][1]=0.3;
3ec9254b 582 anacutsval[2][2]=0.4;
370f7180 583 for(Int_t ipt=3;ipt<nptbins;ipt++){
3ec9254b 584 anacutsval[1][ipt]=0.4;
585 anacutsval[2][ipt]=0.4;
370f7180 586 }
65b4f6d7 587
370f7180 588 anacutsval[6][0]=0.022100;
589 anacutsval[6][1]=0.022100;
590 anacutsval[6][2]=0.034;
591 anacutsval[6][3]=0.020667;
592 anacutsval[6][4]=0.020667;
593 anacutsval[6][5]=0.023333;
3ec9254b 594
65b4f6d7 595
370f7180 596 anacutsval[7][0]=0.08;
597 anacutsval[7][1]=0.08;
598 anacutsval[7][2]=0.09;
599 anacutsval[7][3]=0.095;
600 anacutsval[7][4]=0.095;
3ec9254b 601
370f7180 602 anacutsval[8][0]=0.5;
603 anacutsval[8][1]=0.5;
604 anacutsval[8][2]=1.0;
605 anacutsval[8][3]=0.5;
3ec9254b 606 anacutsval[8][4]=0.5;
607
608
738ad720 609 anacutsval[9][0]=0.97;
610 anacutsval[9][1]=0.936;
370f7180 611 anacutsval[9][2]=0.95;
612 anacutsval[9][3]=0.95;
613 anacutsval[9][4]= 0.95;
614 anacutsval[9][5]=0.92;
615 anacutsval[9][6]=0.92;
616 anacutsval[9][7]=0.92;
617 anacutsval[9][8]=0.92;
618 anacutsval[9][9]=0.90;
738ad720 619 for(Int_t ipt=10;ipt<nptbins;ipt++){
620 anacutsval[9][ipt]=0.90;
621 }
622
370f7180 623
624 anacutsval[10][0]=0.0055;
625 anacutsval[10][1]=0.0055;
626 anacutsval[10][2]= 0.0028;
627 anacutsval[10][3]=0.000883;
3ec9254b 628 anacutsval[10][4]=0.000883;
629
65b4f6d7 630
3ec9254b 631 for(Int_t ipt=5;ipt<nptbins;ipt++){
632 anacutsval[6][ipt]=0.02333;
633 anacutsval[7][ipt]=0.115;
634 anacutsval[8][ipt]=0.5;
635 anacutsval[10][ipt]=0.000883;
636 }
637
738ad720 638 anacutsval[12][0]=8;
639 anacutsval[12][1]=8;
640
641 anacutsval[13][0]=0.98;
642 anacutsval[13][1]=0.98;
643 for(Int_t ipt=2;ipt<nptbins;ipt++){
644 anacutsval[12][ipt]=0.;
645 anacutsval[13][ipt]=0.;
646 }
647
648
649
ae39ad32 650 SetGlobalIndex(nvars,nptbins);
370f7180 651 SetPtBins(nptbins+1,ptbins);
652 SetCuts(nvars,nptbins,anacutsval);
653 SetUsePID(kTRUE);
8866570f 654 fPidHF->SetOldPid(kTRUE);
370f7180 655 SetRemoveDaughtersFromPrim(kTRUE);
3ec9254b 656
370f7180 657 PrintAll();
658
e11ae259 659 for(Int_t iic=0;iic<nvars;iic++){delete [] anacutsval[iic];}
660 delete [] anacutsval;
661 anacutsval=NULL;
662
57d15652 663 delete esdTrackCuts;
664 esdTrackCuts=NULL;
665
370f7180 666 return;
667}
668
669
670void AliRDHFCutsDplustoKpipi::SetStandardCutsPbPb2010() {
671 //
672 //STANDARD CUTS USED FOR 2010 Pb Pb analysis.... not optimized yet
673 //
674
675 SetName("DplustoKpipiCutsStandard");
676 SetTitle("Standard Cuts for D+ analysis in PbPb2010 run");
677
678 // PILE UP REJECTION
679 //SetOptPileup(AliRDHFCuts::kRejectPileupEvent);
680
681 // EVENT CUTS
682 SetMinVtxContr(1);
683
684
685 AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts();
686 esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
687 //default
688 esdTrackCuts->SetRequireTPCRefit(kTRUE);
689 esdTrackCuts->SetRequireITSRefit(kTRUE);
690 //esdTrackCuts->SetMinNClustersITS(4); // default is 5
691 esdTrackCuts->SetMinNClustersTPC(70);
692 esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
693 AliESDtrackCuts::kAny);
694 // default is kBoth, otherwise kAny
3ec9254b 695 esdTrackCuts->SetMinDCAToVertexXY(0.);
370f7180 696 esdTrackCuts->SetPtRange(0.8,1.e10);
697
698 AddTrackCuts(esdTrackCuts);
699
700 const Int_t nptbins=10;
701 Float_t* ptbins;
702 ptbins=new Float_t[nptbins+1];
e11ae259 703
370f7180 704 ptbins[0]=0.;
705 ptbins[1]=1.;
706 ptbins[2]=2.;
707 ptbins[3]=3.;
708 ptbins[4]=4.;
709 ptbins[5]=5.;
710 ptbins[6]=6.;
711 ptbins[7]=8.;
712 ptbins[8]=12.;
713 ptbins[9]=16.;
714 ptbins[10]=24.;
3ec9254b 715 const Int_t nvars=14;
370f7180 716
370f7180 717 Float_t** anacutsval;
718 anacutsval=new Float_t*[nvars];
719
720 for(Int_t ic=0;ic<nvars;ic++){anacutsval[ic]=new Float_t[nptbins];}
721 //Double_t cutsDplus[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0.,10000000000.};
3ec9254b 722
370f7180 723 for(Int_t ipt=0;ipt<nptbins;ipt++){
3ec9254b 724 anacutsval[0][ipt]=0.2;
725 anacutsval[1][ipt]=0.8;
726 anacutsval[2][ipt]=0.8;
727 anacutsval[3][ipt]=0.;
728 anacutsval[4][ipt]=0.;
729 anacutsval[5][ipt]=0.01;
730 anacutsval[11][ipt]=10000000000.;
731 anacutsval[12][ipt]=0.;
732 anacutsval[13][ipt]=0.;
370f7180 733 }
9c90a16e 734 anacutsval[1][5]=0.9;
735
736 anacutsval[6][0]=0.022100;
737 anacutsval[6][1]=0.022100;
738 anacutsval[6][2]=0.034;
739 anacutsval[6][3]=0.020667;
740 anacutsval[6][4]=0.020667;
741 anacutsval[6][5]=0.023333;
370f7180 742
9c90a16e 743 anacutsval[7][0]=0.08;
744 anacutsval[7][1]=0.08;
745 anacutsval[7][2]=0.17;
746 anacutsval[7][3]=0.14;
747 anacutsval[7][4]=0.14;
748 anacutsval[7][5]=0.19;
749
750 anacutsval[8][0]=0.8;
751 anacutsval[8][1]=0.8;
752 anacutsval[8][2]=1.1;
753 anacutsval[8][3]=0.5;
754 anacutsval[8][4]=0.5;
755 anacutsval[8][5]=0.5;
756
757 anacutsval[9][0]=0.995;
758 anacutsval[9][1]=0.995;
759 anacutsval[9][2]=0.997;
760 anacutsval[9][3]=0.998;
761 anacutsval[9][4]=0.998;
762 anacutsval[9][5]=0.995;
763
764 anacutsval[10][0]=0.0055;
765 anacutsval[10][1]=0.0055;
766 anacutsval[10][2]= 0.0028;
767 anacutsval[10][3]=0.000883;
768 anacutsval[10][4]=0.000883;
769 anacutsval[10][5]=0.000883;
3ec9254b 770
9c90a16e 771 anacutsval[12][5]=12.;
772 anacutsval[13][5]=0.998571;
773 anacutsval[12][6]=10.;
774 anacutsval[13][6]=0.997143;
3ec9254b 775
9c90a16e 776 for(Int_t ipt=6;ipt<nptbins;ipt++){
777 anacutsval[6][ipt]=0.02333;
778 anacutsval[7][ipt]=0.19;
779 anacutsval[8][ipt]=2.0;
780 anacutsval[9][ipt]=0.997;
781 anacutsval[10][ipt]=0.000883;
782 }
783 anacutsval[7][6]=0.14;
784 anacutsval[9][6]=0.995;
62ad0d28 785
370f7180 786 SetPtBins(nptbins+1,ptbins);
787 SetCuts(nvars,nptbins,anacutsval);
788 SetUsePID(kTRUE);
8866570f 789 fPidHF->SetOldPid(kTRUE);
9c90a16e 790 SetMinCentrality(1E-10);
5bccd3e8 791 SetMaxCentrality(20.);
792 SetUseCentrality(AliRDHFCuts::kCentV0M);
370f7180 793 SetRemoveDaughtersFromPrim(kFALSE);
3ec9254b 794
370f7180 795 PrintAll();
796
7a29658d 797 for(Int_t iic=0;iic<nvars;iic++){delete [] anacutsval[iic];}
e11ae259 798 delete [] anacutsval;
799 anacutsval=NULL;
800
801 delete [] ptbins;
802 ptbins=NULL;
803
57d15652 804 delete esdTrackCuts;
805 esdTrackCuts=NULL;
806
370f7180 807 return;
808}
ef078e23 809
0c22e2ac 810
811void AliRDHFCutsDplustoKpipi::SetStandardCutsPbPb2011() {
812
813 // Default 2010 PbPb cut object
cb6ed3cd 814 SetStandardCutsPbPb2010();
0c22e2ac 815
816 // Enable all 2011 PbPb run triggers
817 //
818 SetTriggerClass("");
819 ResetMaskAndEnableMBTrigger();
820 EnableCentralTrigger();
821 EnableSemiCentralTrigger();
822
8866570f 823 // new PID
824 fPidHF->SetOldPid(kFALSE);
825
0c22e2ac 826}
4450342d 827//--------------------------------------------------------------------------
828
829UInt_t AliRDHFCutsDplustoKpipi::GetPIDTrackTPCTOFBitMap(AliAODTrack *track) const{
830
831 UInt_t bitmap=0;
832
833 Double_t sigmaTPCPionHyp=-999.;
834 Double_t sigmaTPCKaonHyp=-999.;
835 Double_t sigmaTPCProtonHyp=-999.;
836 Double_t sigmaTOFPionHyp=-999.;
837 Double_t sigmaTOFKaonHyp=-999.;
838 Double_t sigmaTOFProtonHyp=-999.;
839
840 Int_t oksigmaTPCPionHyp=fPidHF->GetnSigmaTPC(track,2,sigmaTPCPionHyp);
841 Int_t oksigmaTPCKaonHyp=fPidHF->GetnSigmaTPC(track,3,sigmaTPCKaonHyp);
842 Int_t oksigmaTPCProtonHyp=fPidHF->GetnSigmaTPC(track,4,sigmaTPCProtonHyp);
843 Int_t oksigmaTOFPionHyp=fPidHF->GetnSigmaTOF(track,2,sigmaTOFPionHyp);
844 Int_t oksigmaTOFKaonHyp=fPidHF->GetnSigmaTOF(track,3,sigmaTOFKaonHyp);
845 Int_t oksigmaTOFProtonHyp=fPidHF->GetnSigmaTOF(track,4,sigmaTOFProtonHyp);
4940d5bf 846
847 sigmaTPCPionHyp=TMath::Abs(sigmaTPCPionHyp);
848 sigmaTPCKaonHyp=TMath::Abs(sigmaTPCKaonHyp);
849 sigmaTPCProtonHyp=TMath::Abs(sigmaTPCProtonHyp);
850 sigmaTOFPionHyp=TMath::Abs(sigmaTOFPionHyp);
851 sigmaTOFKaonHyp=TMath::Abs(sigmaTOFKaonHyp);
2d719fc0 852 sigmaTOFProtonHyp=TMath::Abs(sigmaTOFProtonHyp);
4940d5bf 853
4450342d 854 if (oksigmaTPCPionHyp && sigmaTPCPionHyp>0.){
855 if (sigmaTPCPionHyp<1.) bitmap+=1<<kTPCPionLess1;
856 else{
857 if (sigmaTPCPionHyp<2.) bitmap+=1<<kTPCPionMore1Less2;
858 else {
859 if (sigmaTPCPionHyp<3.) bitmap+=1<<kTPCPionMore2Less3;
860 else bitmap+=1<<kTPCPionMore3;
861 }
862 }
863 }
864
865 if (oksigmaTPCKaonHyp && sigmaTPCKaonHyp>0.){
866 if (sigmaTPCKaonHyp<1.) bitmap+=1<<kTPCKaonLess1;
867 else{
868 if (sigmaTPCKaonHyp<2.) bitmap+=1<<kTPCKaonMore1Less2;
869 else {
870 if (sigmaTPCKaonHyp<3.) bitmap+=1<<kTPCKaonMore2Less3;
871 else bitmap+=1<<kTPCKaonMore3;
872 }
873 }
874 }
875
876 if (oksigmaTPCProtonHyp && sigmaTPCProtonHyp>0.){
877 if (sigmaTPCProtonHyp<1.) bitmap+=1<<kTPCProtonLess1;
878 else{
879 if (sigmaTPCProtonHyp<2.) bitmap+=1<<kTPCProtonMore1Less2;
880 else {
881 if (sigmaTPCProtonHyp<3.) bitmap+=1<<kTPCProtonMore2Less3;
882 else bitmap+=1<<kTPCProtonMore3;
883 }
884 }
885 }
886
887 if (oksigmaTOFPionHyp && sigmaTOFPionHyp>0.){
888 if (sigmaTOFPionHyp<1.) bitmap+=1<<kTOFPionLess1;
889 else{
890 if (sigmaTOFPionHyp<2.) bitmap+=1<<kTOFPionMore1Less2;
891 else {
892 if (sigmaTOFPionHyp<3.) bitmap+=1<<kTOFPionMore2Less3;
893 else bitmap+=1<<kTOFPionMore3;
894 }
895 }
896 }
897
898 if (oksigmaTOFKaonHyp && sigmaTOFKaonHyp>0.){
899 if (sigmaTOFKaonHyp<1.) bitmap+=1<<kTOFKaonLess1;
900 else{
901 if (sigmaTOFKaonHyp<2.) bitmap+=1<<kTOFKaonMore1Less2;
902 else {
903 if (sigmaTOFKaonHyp<3.) bitmap+=1<<kTOFKaonMore2Less3;
904 else bitmap+=1<<kTOFKaonMore3;
905 }
906 }
907 }
908
909 if (oksigmaTOFProtonHyp && sigmaTOFProtonHyp>0.){
910 if (sigmaTOFProtonHyp<1.) bitmap+=1<<kTOFProtonLess1;
911 else{
912 if (sigmaTOFProtonHyp<2.) bitmap+=1<<kTOFProtonMore1Less2;
913 else {
914 if (sigmaTOFProtonHyp<3.) bitmap+=1<<kTOFProtonMore2Less3;
915 else bitmap+=1<<kTOFProtonMore3;
916 }
917 }
918 }
919
920
921
922 return bitmap;
923
924}