]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/vertexingHF/AliRDHFCutsDstoKKpi.cxx
Updates D* cuts for peripheral PbPb events
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliRDHFCutsDstoKKpi.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 Ds->KKpi
21//
22// Author: A.Dainese, andrea.dainese@pd.infn.it
23/////////////////////////////////////////////////////////////
24
25#include <TDatabasePDG.h>
26#include <Riostream.h>
27
28#include "AliRDHFCutsDstoKKpi.h"
29#include "AliAODRecoDecayHF3Prong.h"
30#include "AliAODTrack.h"
31#include "AliESDtrack.h"
32
33ClassImp(AliRDHFCutsDstoKKpi)
34
35//--------------------------------------------------------------------------
a9b75906 36AliRDHFCutsDstoKKpi::AliRDHFCutsDstoKKpi(const char* name) :
fba41fa4 37AliRDHFCuts(name),
38fPidOption(0)
e3d40058 39{
40 //
41 // Default Constructor
42 //
2e153422 43 Int_t nvars=16;
e3d40058 44 SetNVars(nvars);
2e153422 45 TString varNames[16]={"inv. mass [GeV]",
4755453e 46 "pTK [GeV/c]",
47 "pTPi [GeV/c]",
48 "d0K [cm]",
49 "d0Pi [cm]",
50 "dist12 [cm]",
51 "sigmavert [cm]",
52 "decLen [cm]",
53 "ptMax [GeV/c]",
54 "cosThetaPoint",
55 "Sum d0^2 (cm^2)",
56 "dca [cm]",
57 "inv. mass (Mphi-MKK) [GeV]",
2e153422 58 "inv. mass (MKo*-MKpi) [GeV]",
59 "Abs(CosineKpiPhiRFrame)^3",
60 "CosPiDsLabFrame"};
61
62 Bool_t isUpperCut[16]={kTRUE,
4755453e 63 kFALSE,
64 kFALSE,
65 kFALSE,
66 kFALSE,
67 kFALSE,
68 kTRUE,
69 kFALSE,
70 kFALSE,
71 kFALSE,
72 kFALSE,
73 kTRUE,
74 kTRUE,
2e153422 75 kTRUE,
76 kFALSE,
4755453e 77 kTRUE};
2e153422 78 SetVarNames(16,varNames,isUpperCut);
79 Bool_t forOpt[16]={kFALSE,
4755453e 80 kFALSE,
e3d40058 81 kFALSE,
82 kFALSE,
83 kFALSE,
84 kFALSE,
85 kTRUE,
4755453e 86 kTRUE,
87 kTRUE,
88 kTRUE,
89 kTRUE,
90 kFALSE,
91 kTRUE,
2e153422 92 kTRUE,
93 kFALSE,
94 kFALSE};
4755453e 95 SetVarsForOpt(7,forOpt);
e3d40058 96 Float_t limits[2]={0,999999999.};
97 SetPtBins(2,limits);
3787d195 98 if(fPidHF)delete fPidHF;
99 fPidHF=new AliAODPidHF();
100 Double_t plim[2]={0.6,0.8};
101 Double_t nsigma[5]={2.,1.,2.,3.,0.};
102
103 fPidHF->SetPLimit(plim);
104 fPidHF->SetAsym(kTRUE);
105 fPidHF->SetSigma(nsigma);
106 fPidHF->SetMatch(1);
107 fPidHF->SetTPC(1);
108 fPidHF->SetTOF(1);
109 fPidHF->SetITS(0);
110 fPidHF->SetTRD(0);
111 fPidHF->SetCompat(kTRUE);
112
e3d40058 113}
114//--------------------------------------------------------------------------
115AliRDHFCutsDstoKKpi::AliRDHFCutsDstoKKpi(const AliRDHFCutsDstoKKpi &source) :
fba41fa4 116 AliRDHFCuts(source),
117 fPidOption(source.fPidOption)
e3d40058 118{
119 //
120 // Copy constructor
121 //
122
123}
124//--------------------------------------------------------------------------
125AliRDHFCutsDstoKKpi &AliRDHFCutsDstoKKpi::operator=(const AliRDHFCutsDstoKKpi &source)
126{
127 //
128 // assignment operator
129 //
130 if(&source == this) return *this;
131
132 AliRDHFCuts::operator=(source);
133
134 return *this;
135}
136
137
138//---------------------------------------------------------------------------
a6003e0a 139void AliRDHFCutsDstoKKpi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters,AliAODEvent *aod) {
e3d40058 140 //
141 // Fills in vars the values of the variables
142 //
143
144 if(nvars!=fnVarsForOpt) {
145 printf("AliRDHFCutsDstoKKpi::GetCutsVarsForOpt: wrong number of variables\n");
146 return;
147 }
148
149 AliAODRecoDecayHF3Prong *dd = (AliAODRecoDecayHF3Prong*)d;
a6003e0a 150
151 //recalculate vertex w/o daughters
152 Bool_t cleanvtx=kFALSE;
153 AliAODVertex *origownvtx=0x0;
154 if(fRemoveDaughtersFromPrimary) {
155 if(dd->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*dd->GetOwnPrimaryVtx());
156 cleanvtx=kTRUE;
157 if(!RecalcOwnPrimaryVtx(dd,aod)) {
158 CleanOwnPrimaryVtx(dd,aod,origownvtx);
159 cleanvtx=kFALSE;
160 }
161 }
162
4755453e 163 Int_t iter=-1;
164 if(fVarsForOpt[0]){
165 iter++;
0b4625fa 166 if(TMath::Abs(pdgdaughters[0])==321){
4755453e 167 vars[iter]=dd->InvMassDsKKpi();
168 }else{
169 vars[iter]=dd->InvMassDspiKK();
170 }
171 }
172 if(fVarsForOpt[1]){
173 iter++;
174 Float_t minPtDau=99999.;
175 for(Int_t iprong=0;iprong<3;iprong++){
176 if(TMath::Abs(pdgdaughters[iprong])==321 &&
177 dd->PtProng(iprong)<minPtDau) minPtDau=dd->PtProng(iprong);
178 }
179 vars[iter]=minPtDau;
180 }
181 if(fVarsForOpt[2]){
182 iter++;
183 for(Int_t iprong=0;iprong<3;iprong++){
184 if(TMath::Abs(pdgdaughters[iprong])==211) {
185 vars[iter]=dd->PtProng(iprong);
186 }
187 }
188 }
189 if(fVarsForOpt[3]){
190 iter++;
191 Float_t minImpParDau=99999.;
192 for(Int_t iprong=0;iprong<3;iprong++){
193 if(TMath::Abs(pdgdaughters[iprong])==321 &&
194 dd->Getd0Prong(iprong)<minImpParDau) minImpParDau=dd->Getd0Prong(iprong);
195 }
196 vars[iter]=minImpParDau;
197 }
198 if(fVarsForOpt[4]){
199 iter++;
200 for(Int_t iprong=0;iprong<3;iprong++){
201 if(TMath::Abs(pdgdaughters[iprong])==211) {
202 vars[iter]=dd->Getd0Prong(iprong);
203 }
204 }
205 }
206 if(fVarsForOpt[5]){
207 iter++;
208 Float_t minDistPair=TMath::Min(dd->GetDist12toPrim(),dd->GetDist23toPrim());
209 vars[iter]=minDistPair;
210 }
211 if(fVarsForOpt[6]){
212 iter++;
213 vars[iter]=dd->GetSigmaVert();
214 }
215 if(fVarsForOpt[7]){
216 iter++;
217 vars[iter] = dd->DecayLength();
218 }
219 if(fVarsForOpt[8]){
220 iter++;
221 Float_t ptmax=0;
222 for(Int_t i=0;i<3;i++){
223 if(dd->PtProng(i)>ptmax)ptmax=dd->PtProng(i);
224 }
225 vars[iter]=ptmax;
226 }
227 if(fVarsForOpt[9]){
228 iter++;
229 vars[iter]=dd->CosPointingAngle();
230 }
231 if(fVarsForOpt[10]){
232 iter++;
233 vars[iter]=dd->Getd0Prong(0)*dd->Getd0Prong(0)+dd->Getd0Prong(1)*dd->Getd0Prong(1)+dd->Getd0Prong(2)*dd->Getd0Prong(2);
234 }
235 if(fVarsForOpt[11]){
236 iter++;
237 Float_t maxDCA=0.;
238 for(Int_t i=0;i<3;i++){
239 if(d->GetDCA(i)>maxDCA) maxDCA=d->GetDCA(i);
240 }
241 vars[iter]=maxDCA;
242 }
243 if(fVarsForOpt[12]){
244 iter++;
2c3decce 245 Double_t mPDGPhi = TDatabasePDG::Instance()->GetParticle(333)->Mass();
0b4625fa 246 if(TMath::Abs(pdgdaughters[0])==321){
2c3decce 247
248 Double_t phimass01=d->InvMass2Prongs(0,1,321,321);
249 vars[iter]=TMath::Abs(phimass01-mPDGPhi);
250 // vars[iter]=dd->InvMass2Prongs(0,1,321,321);
4755453e 251 }else{
2c3decce 252 Double_t phimass12=d->InvMass2Prongs(1,2,321,321);
253 vars[iter]=TMath::Abs(phimass12-mPDGPhi);
254 // vars[iter]=dd->InvMass2Prongs(1,2,321,321);
4755453e 255 }
256 }
257 if(fVarsForOpt[13]){
258 iter++;
2c3decce 259 Double_t mPDGK0star = TDatabasePDG::Instance()->GetParticle(313)->Mass();
0b4625fa 260 if(TMath::Abs(pdgdaughters[0])==321){
2c3decce 261
262 Double_t mass12kpi=d->InvMass2Prongs(1,2,321,211);
263 vars[iter]=TMath::Abs(mass12kpi-mPDGK0star);
264 // vars[iter]=dd->InvMass2Prongs(1,2,321,211);
4755453e 265 }else{
2c3decce 266 Double_t mass01pik=d->InvMass2Prongs(0,1,211,321);
267 vars[iter]=TMath::Abs(mass01pik-mPDGK0star);
268 // vars[iter]=dd->InvMass2Prongs(0,1,211,321);
4755453e 269 }
270 }
2e153422 271 if(fVarsForOpt[14]){
272 iter++;
273 if(TMath::Abs(pdgdaughters[0])==321){
274 vars[iter]=dd->CosPiKPhiRFrameKKpi();
275 }else{
276 vars[iter]=dd->CosPiKPhiRFramepiKK();
277 }
278 }
279 if(fVarsForOpt[15]){
280 iter++;
281 if(TMath::Abs(pdgdaughters[0])==321){
282 vars[iter]=dd->CosPiDsLabFrameKKpi();
283 }else{
284 vars[iter]=dd->CosPiDsLabFramepiKK();
285 }
286 }
a6003e0a 287
288 if(cleanvtx)CleanOwnPrimaryVtx(dd,aod,origownvtx);
e3d40058 289 return;
290}
3787d195 291//---------------------------------------------------------------------------
292Bool_t AliRDHFCutsDstoKKpi::IsInFiducialAcceptance(Double_t pt, Double_t y) const
293{
294 //
295 // Checking if Ds is in fiducial acceptance region
296 //
297
298 if(pt > 5.) {
299 // applying cut for pt > 5 GeV
300 AliDebug(2,Form("pt of Ds = %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 Ds = %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}
313
45ab4739 314//---------------------------------------------------------------------------
315Int_t AliRDHFCutsDstoKKpi::IsSelectedPID(AliAODRecoDecayHF *rd) {
316 // PID selection
317 // return values: 0->NOT OK, 1->OK as KKpi, 2->OK as piKK, 3->OK as both
318 Int_t retCode=3;
319 Bool_t okKKpi=kTRUE;
320 Bool_t okpiKK=kTRUE;
321 if(!fUsePID || !rd) return retCode;
322 if(!fPidHF){
323 AliWarning("AliAODPidHF not created!");
324 return retCode;
325 }
fba41fa4 326
327 Double_t origCompatTOF=fPidHF->GetPCompatTOF();
328 Double_t origThreshTPC=fPidHF->GetPtThresholdTPC();
329 if(fPidOption==kStrong){
330 fPidHF->SetPCompatTOF(999999.);
331 fPidHF->SetPtThresholdTPC(999999.);
332 }
333
334
45ab4739 335 Int_t nKaons=0;
336 Int_t nNotKaons=0;
337 Int_t sign= rd->GetCharge();
338 for(Int_t iDaught=0; iDaught<3; iDaught++){
339 AliAODTrack *track=(AliAODTrack*)rd->GetDaughter(iDaught);
340 Int_t isPion=fPidHF->MakeRawPid(track,AliPID::kPion);
341 Int_t isKaon=fPidHF->MakeRawPid(track,AliPID::kKaon);
342 Int_t isProton=fPidHF->MakeRawPid(track,AliPID::kProton);
343
fba41fa4 344 if(isProton>0 && isKaon<0 && isPion<0){
345 fPidHF->SetPCompatTOF(origCompatTOF);
346 fPidHF->SetPtThresholdTPC(origThreshTPC);
347 return 0;
348 }
45ab4739 349 if(sign!=track->Charge()){// must be kaon
fba41fa4 350 if(isKaon<0){
351 fPidHF->SetPCompatTOF(origCompatTOF);
352 fPidHF->SetPtThresholdTPC(origThreshTPC);
353 return 0;
354 }
355 if(fPidOption==kStrong && isKaon<=0){
356 fPidHF->SetPCompatTOF(origCompatTOF);
357 fPidHF->SetPtThresholdTPC(origThreshTPC);
358 return 0;
359 }
45ab4739 360 }
361 if(isKaon>0 && isPion<0) nKaons++;
362 if(isKaon<0) nNotKaons++;
363 if(iDaught==0){
364 if(isKaon<0) okKKpi=kFALSE;
fba41fa4 365 if(isPion<0) okpiKK=kFALSE;
366 if(fPidOption==kStrong){
367 if(isKaon<=0) okKKpi=kFALSE;
368 if(isPion<=0) okpiKK=kFALSE;
369 }
45ab4739 370 }
371 else if(iDaught==2){
372 if(isKaon<0) okpiKK=kFALSE;
373 if(isPion<0) okKKpi=kFALSE;
fba41fa4 374 if(fPidOption==kStrong){
375 if(isKaon<=0) okpiKK=kFALSE;
376 if(isPion<=0) okKKpi=kFALSE;
377 }
45ab4739 378 }
379 }
fba41fa4 380
381 fPidHF->SetPCompatTOF(origCompatTOF);
382 fPidHF->SetPtThresholdTPC(origThreshTPC);
45ab4739 383
384 if(nKaons>2)return 0;
385 if(nNotKaons>1) return 0;
386
387 if(!okKKpi) retCode-=1;
388 if(!okpiKK) retCode-=2;
389
390 return retCode;
391}
392
e3d40058 393//---------------------------------------------------------------------------
3787d195 394Int_t AliRDHFCutsDstoKKpi::IsSelected(TObject* obj,Int_t selectionLevel, AliAODEvent* aod) {
e3d40058 395 //
396 // Apply selection
397 //
398
399 if(!fCutsRD){
a5b9e447 400 cout<<"Cut matrix not inizialized. Exit..."<<endl;
e3d40058 401 return 0;
402 }
403 //PrintAll();
404 AliAODRecoDecayHF3Prong* d=(AliAODRecoDecayHF3Prong*)obj;
405
406 if(!d){
407 cout<<"AliAODRecoDecayHF3Prong null"<<endl;
408 return 0;
409 }
fba41fa4 410
5e938293 411 if(fKeepSignalMC) if(IsSignalMC(d,aod,431)) return 3;
fba41fa4 412
51dc3cab 413 Double_t ptD=d->Pt();
414 if(ptD<fMinPtCand) return 0;
415 if(ptD>fMaxPtCand) return 0;
e3d40058 416
417 // selection on daughter tracks
418 if(selectionLevel==AliRDHFCuts::kAll ||
419 selectionLevel==AliRDHFCuts::kTracks) {
420 if(!AreDaughtersSelected(d)) return 0;
421 }
422
423
e3d40058 424
45ab4739 425
e3d40058 426 // selection on candidate
427 if(selectionLevel==AliRDHFCuts::kAll ||
428 selectionLevel==AliRDHFCuts::kCandidate) {
3787d195 429 //recalculate vertex w/o daughters
430 AliAODVertex *origownvtx=0x0;
3787d195 431 if(fRemoveDaughtersFromPrimary) {
793fdbec 432 if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx());
433 if(!RecalcOwnPrimaryVtx(d,aod)) {
434 CleanOwnPrimaryVtx(d,aod,origownvtx);
435 return 0;
436 }
3787d195 437 }
e3d40058 438
4755453e 439 Int_t okDsKKpi=1;
440 Int_t okDspiKK=1;
0b4625fa 441 Int_t okMassPhiKKpi=0;
442 Int_t okMassPhipiKK=0;
443 Int_t okMassK0starKKpi=0;
444 Int_t okMassK0starpiKK=0;
445 Int_t okDsPhiKKpi=0;
446 Int_t okDsPhipiKK=0;
447 Int_t okDsK0starKKpi=0;
448 Int_t okDsK0starpiKK=0;
e3d40058 449
4755453e 450 Double_t pt=d->Pt();
451 Int_t ptbin=PtBin(pt);
a5b9e447 452 if (ptbin==-1) {
793fdbec 453 CleanOwnPrimaryVtx(d,aod,origownvtx);
a5b9e447 454 return 0;
455 }
456
4755453e 457 Double_t mDsPDG = TDatabasePDG::Instance()->GetParticle(431)->Mass();
458 Double_t mDsKKpi=d->InvMassDsKKpi();
459 Double_t mDspiKK=d->InvMassDspiKK();
460 if(TMath::Abs(mDsKKpi-mDsPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) okDsKKpi = 0;
461 if(TMath::Abs(mDspiKK-mDsPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) okDspiKK = 0;
a5b9e447 462 if(!okDsKKpi && !okDspiKK){
793fdbec 463 CleanOwnPrimaryVtx(d,aod,origownvtx);
a5b9e447 464 return 0;
4755453e 465 }
a5b9e447 466
467
4755453e 468
469 // cuts on resonant decays (via Phi or K0*)
470 Double_t mPhiPDG = TDatabasePDG::Instance()->GetParticle(333)->Mass();
471 Double_t mK0starPDG = TDatabasePDG::Instance()->GetParticle(313)->Mass();
472 if(okDsKKpi){
473 Double_t mass01phi=d->InvMass2Prongs(0,1,321,321);
474 Double_t mass12K0s=d->InvMass2Prongs(1,2,321,211);
0b4625fa 475 if(TMath::Abs(mass01phi-mPhiPDG)<fCutsRD[GetGlobalIndex(12,ptbin)]) okMassPhiKKpi=1;
476 if(TMath::Abs(mass12K0s-mK0starPDG)<fCutsRD[GetGlobalIndex(13,ptbin)]) okMassK0starKKpi = 1;
477 if(!okMassPhiKKpi && !okMassK0starKKpi) okDsKKpi=0;
478 if(okMassPhiKKpi) okDsPhiKKpi=1;
479 if(okMassK0starKKpi) okDsK0starKKpi=1;
4755453e 480 }
481 if(okDspiKK){
482 Double_t mass01K0s=d->InvMass2Prongs(0,1,211,321);
483 Double_t mass12phi=d->InvMass2Prongs(1,2,321,321);
0b4625fa 484 if(TMath::Abs(mass01K0s-mK0starPDG)<fCutsRD[GetGlobalIndex(13,ptbin)]) okMassK0starpiKK = 1;
485 if(TMath::Abs(mass12phi-mPhiPDG)<fCutsRD[GetGlobalIndex(12,ptbin)]) okMassPhipiKK=1;
486 if(!okMassPhipiKK && !okMassK0starpiKK) okDspiKK=0;
487 if(okMassPhipiKK) okDsPhipiKK=1;
488 if(okMassK0starpiKK) okDsK0starpiKK=1;
4755453e 489 }
a5b9e447 490 if(!okDsKKpi && !okDspiKK){
793fdbec 491 CleanOwnPrimaryVtx(d,aod,origownvtx);
a5b9e447 492 return 0;
493 }
4755453e 494
495 // Cuts on track pairs
a5b9e447 496 for(Int_t i=0;i<3;i++){
497 if(d->GetDCA(i)>fCutsRD[GetGlobalIndex(11,ptbin)]){
793fdbec 498 CleanOwnPrimaryVtx(d,aod,origownvtx);
a5b9e447 499 return 0;
500 }
501 }
4755453e 502 if(d->GetDist12toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)] ||
a5b9e447 503 d->GetDist23toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]){
793fdbec 504 CleanOwnPrimaryVtx(d,aod,origownvtx);
a5b9e447 505 return 0;
506 }
507
4755453e 508
509
a5b9e447 510 //single track
511 if(TMath::Abs(d->Pt2Prong(1)) < fCutsRD[GetGlobalIndex(1,ptbin)]*fCutsRD[GetGlobalIndex(1,ptbin)] ||
512 TMath::Abs(d->Getd0Prong(1))<fCutsRD[GetGlobalIndex(3,ptbin)]){
793fdbec 513 CleanOwnPrimaryVtx(d,aod,origownvtx);
a5b9e447 514 return 0;
515 }
516
517 if(okDsKKpi){
518 if(TMath::Abs(d->Pt2Prong(0)) < fCutsRD[GetGlobalIndex(1,ptbin)]*fCutsRD[GetGlobalIndex(1,ptbin)] ||
519 TMath::Abs(d->Getd0Prong(0))<fCutsRD[GetGlobalIndex(3,ptbin)]) okDsKKpi=0;
520 if(TMath::Abs(d->Pt2Prong(2)) < fCutsRD[GetGlobalIndex(2,ptbin)]*fCutsRD[GetGlobalIndex(2,ptbin)] ||
521 TMath::Abs(d->Getd0Prong(2))<fCutsRD[GetGlobalIndex(4,ptbin)]) okDsKKpi=0;
522 }
523 if(okDspiKK){
524 if(TMath::Abs(d->Pt2Prong(0)) < fCutsRD[GetGlobalIndex(2,ptbin)]*fCutsRD[GetGlobalIndex(2,ptbin)] ||
525 TMath::Abs(d->Getd0Prong(0))<fCutsRD[GetGlobalIndex(4,ptbin)]) okDspiKK=0;
526 if(TMath::Abs(d->Pt2Prong(2)) < fCutsRD[GetGlobalIndex(1,ptbin)]*fCutsRD[GetGlobalIndex(1,ptbin)] ||
527 TMath::Abs(d->Getd0Prong(2))<fCutsRD[GetGlobalIndex(3,ptbin)]) okDspiKK=0;
528 }
529 if(!okDsKKpi && !okDspiKK){
793fdbec 530 CleanOwnPrimaryVtx(d,aod,origownvtx);
a5b9e447 531 return 0;
532 }
0b4625fa 533
4755453e 534 // Cuts on candidate triplet
a5b9e447 535
536 if(d->GetSigmaVert()>fCutsRD[GetGlobalIndex(6,ptbin)]){
793fdbec 537 CleanOwnPrimaryVtx(d,aod,origownvtx);
a5b9e447 538 return 0;
539 }
540
541 if(d->CosPointingAngle()< fCutsRD[GetGlobalIndex(9,ptbin)]){
793fdbec 542 CleanOwnPrimaryVtx(d,aod,origownvtx);
a5b9e447 543 return 0;
544 }
545
546 if(d->Pt2Prong(0)<fCutsRD[GetGlobalIndex(8,ptbin)]*fCutsRD[GetGlobalIndex(8,ptbin)] &&
547 d->Pt2Prong(1)<fCutsRD[GetGlobalIndex(8,ptbin)]*fCutsRD[GetGlobalIndex(8,ptbin)] &&
548 d->Pt2Prong(2)<fCutsRD[GetGlobalIndex(8,ptbin)]*fCutsRD[GetGlobalIndex(8,ptbin)]) {
793fdbec 549 CleanOwnPrimaryVtx(d,aod,origownvtx);
a5b9e447 550 return 0;
551 }
552
553 if(d->DecayLength2()<fCutsRD[GetGlobalIndex(7,ptbin)]*fCutsRD[GetGlobalIndex(7,ptbin)]){
793fdbec 554 CleanOwnPrimaryVtx(d,aod,origownvtx);
a5b9e447 555 return 0;
556 }
557
558
4755453e 559 Double_t sum2=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
a5b9e447 560 if(sum2<fCutsRD[GetGlobalIndex(10,ptbin)]){
793fdbec 561 CleanOwnPrimaryVtx(d,aod,origownvtx);
a5b9e447 562 return 0;
563 }
3787d195 564
981b4d38 565
2e153422 566 if(okDsKKpi){
567 Double_t cosPiKPhiRFKKpi=d->CosPiKPhiRFrameKKpi();
568 Double_t kincutPiKPhiKKpi=TMath::Abs(cosPiKPhiRFKKpi*cosPiKPhiRFKKpi*cosPiKPhiRFKKpi);
569 if(kincutPiKPhiKKpi<fCutsRD[GetGlobalIndex(14,ptbin)]) okDsKKpi=0;
570 }
571 if(okDspiKK){
572 Double_t cosPiKPhiRFpiKK=d->CosPiKPhiRFramepiKK();
573 Double_t kincutPiKPhipiKK=TMath::Abs(cosPiKPhiRFpiKK*cosPiKPhiRFpiKK*cosPiKPhiRFpiKK);
574 if(kincutPiKPhipiKK<fCutsRD[GetGlobalIndex(14,ptbin)]) okDspiKK=0;
575 }
576 if(!okDsKKpi && !okDspiKK){
577 CleanOwnPrimaryVtx(d,aod,origownvtx);
578 return 0;
579 }
580
581
582
583 if(okDsKKpi){
584 Double_t cosPiDsLabFrameKKpi=d->CosPiDsLabFrameKKpi();
585 if(TMath::Abs(cosPiDsLabFrameKKpi)>fCutsRD[GetGlobalIndex(15,ptbin)]) okDsKKpi=0;
586 }
587 if(okDspiKK){
588 Double_t cosPiDsLabFramepiKK=d->CosPiDsLabFramepiKK();
589 if(TMath::Abs(cosPiDsLabFramepiKK)>fCutsRD[GetGlobalIndex(15,ptbin)]) okDspiKK=0;
590 }
591 if(!okDsKKpi && !okDspiKK){
592 CleanOwnPrimaryVtx(d,aod,origownvtx);
593 return 0;
594 }
595
981b4d38 596 // unset recalculated primary vertex when not needed any more
597 CleanOwnPrimaryVtx(d,aod,origownvtx);
598
2e153422 599
a5b9e447 600
0b4625fa 601 if(!okDsKKpi){
602 okDsPhiKKpi=0;
603 okDsK0starKKpi=0;
604 }
605 if(!okDspiKK){
606 okDsPhipiKK=0;
607 okDsK0starpiKK=0;
608 }
609
a5b9e447 610 // PID selection
611 Int_t returnvaluePID=3;
612 if(selectionLevel==AliRDHFCuts::kAll ||
613 selectionLevel==AliRDHFCuts::kCandidate ||
614 selectionLevel==AliRDHFCuts::kPID) {
615 returnvaluePID = IsSelectedPID(d);
616 fIsSelectedPID=returnvaluePID;
617 }
618 if(returnvaluePID==0)return 0;
619
620 Bool_t okPidDsKKpi=returnvaluePID&1;
621 Bool_t okPidDspiKK=returnvaluePID&2;
0b4625fa 622 if(!okPidDsKKpi){
623 okDsPhiKKpi=0;
624 okDsK0starKKpi=0;
625 }
626 if(!okPidDspiKK){
627 okDsPhipiKK=0;
628 okDsK0starpiKK=0;
629 }
630
028e5f2c 631 if((okPidDsKKpi && okDsKKpi)||(okPidDspiKK && okDspiKK)){
632 Int_t returnvalue=0;
633 if(okDsKKpi) returnvalue+=1;
634 if(okDspiKK) returnvalue+=2;
0b4625fa 635 if(okDsPhiKKpi) returnvalue+=4;
636 if(okDsPhipiKK) returnvalue+=8;
637 if(okDsK0starKKpi) returnvalue+=16;
638 if(okDsK0starpiKK) returnvalue+=32;
028e5f2c 639 return returnvalue;
640 }else{
641 return 0;
642 }
4755453e 643 }
a5b9e447 644 return 15;
e3d40058 645
646}
647//---------------------------------------------------------------------------