1 /**************************************************************************
2 * Copyright(c) 1998-2010, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 /////////////////////////////////////////////////////////////
18 // Class for cuts on AOD reconstructed Ds->KKpi
20 // Author: A.Dainese, andrea.dainese@pd.infn.it
21 /////////////////////////////////////////////////////////////
23 #include <TDatabasePDG.h>
24 #include <Riostream.h>
26 #include "AliRDHFCutsDstoKKpi.h"
27 #include "AliAODRecoDecayHF3Prong.h"
28 #include "AliAODTrack.h"
29 #include "AliESDtrack.h"
31 ClassImp(AliRDHFCutsDstoKKpi)
33 //--------------------------------------------------------------------------
34 AliRDHFCutsDstoKKpi::AliRDHFCutsDstoKKpi(const char* name) :
38 // Default Constructor
42 TString varNames[14]={"inv. mass [GeV]",
54 "inv. mass (Mphi-MKK) [GeV]",
55 "inv. mass (MKo*-MKpi) [GeV]"};
56 Bool_t isUpperCut[14]={kTRUE,
70 SetVarNames(14,varNames,isUpperCut);
71 Bool_t forOpt[14]={kFALSE,
85 SetVarsForOpt(7,forOpt);
86 Float_t limits[2]={0,999999999.};
89 //--------------------------------------------------------------------------
90 AliRDHFCutsDstoKKpi::AliRDHFCutsDstoKKpi(const AliRDHFCutsDstoKKpi &source) :
98 //--------------------------------------------------------------------------
99 AliRDHFCutsDstoKKpi &AliRDHFCutsDstoKKpi::operator=(const AliRDHFCutsDstoKKpi &source)
102 // assignment operator
104 if(&source == this) return *this;
106 AliRDHFCuts::operator=(source);
112 //---------------------------------------------------------------------------
113 void AliRDHFCutsDstoKKpi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) {
115 // Fills in vars the values of the variables
118 if(nvars!=fnVarsForOpt) {
119 printf("AliRDHFCutsDstoKKpi::GetCutsVarsForOpt: wrong number of variables\n");
123 AliAODRecoDecayHF3Prong *dd = (AliAODRecoDecayHF3Prong*)d;
128 if(TMath::Abs(pdgdaughters[0]==321)){
129 vars[iter]=dd->InvMassDsKKpi();
131 vars[iter]=dd->InvMassDspiKK();
136 Float_t minPtDau=99999.;
137 for(Int_t iprong=0;iprong<3;iprong++){
138 if(TMath::Abs(pdgdaughters[iprong])==321 &&
139 dd->PtProng(iprong)<minPtDau) minPtDau=dd->PtProng(iprong);
145 for(Int_t iprong=0;iprong<3;iprong++){
146 if(TMath::Abs(pdgdaughters[iprong])==211) {
147 vars[iter]=dd->PtProng(iprong);
153 Float_t minImpParDau=99999.;
154 for(Int_t iprong=0;iprong<3;iprong++){
155 if(TMath::Abs(pdgdaughters[iprong])==321 &&
156 dd->Getd0Prong(iprong)<minImpParDau) minImpParDau=dd->Getd0Prong(iprong);
158 vars[iter]=minImpParDau;
162 for(Int_t iprong=0;iprong<3;iprong++){
163 if(TMath::Abs(pdgdaughters[iprong])==211) {
164 vars[iter]=dd->Getd0Prong(iprong);
170 Float_t minDistPair=TMath::Min(dd->GetDist12toPrim(),dd->GetDist23toPrim());
171 vars[iter]=minDistPair;
175 vars[iter]=dd->GetSigmaVert();
179 vars[iter] = dd->DecayLength();
184 for(Int_t i=0;i<3;i++){
185 if(dd->PtProng(i)>ptmax)ptmax=dd->PtProng(i);
191 vars[iter]=dd->CosPointingAngle();
195 vars[iter]=dd->Getd0Prong(0)*dd->Getd0Prong(0)+dd->Getd0Prong(1)*dd->Getd0Prong(1)+dd->Getd0Prong(2)*dd->Getd0Prong(2);
200 for(Int_t i=0;i<3;i++){
201 if(d->GetDCA(i)>maxDCA) maxDCA=d->GetDCA(i);
207 Double_t mPDGPhi = TDatabasePDG::Instance()->GetParticle(333)->Mass();
208 if(TMath::Abs(pdgdaughters[0]==321)){
210 Double_t phimass01=d->InvMass2Prongs(0,1,321,321);
211 vars[iter]=TMath::Abs(phimass01-mPDGPhi);
212 // vars[iter]=dd->InvMass2Prongs(0,1,321,321);
214 Double_t phimass12=d->InvMass2Prongs(1,2,321,321);
215 vars[iter]=TMath::Abs(phimass12-mPDGPhi);
216 // vars[iter]=dd->InvMass2Prongs(1,2,321,321);
221 Double_t mPDGK0star = TDatabasePDG::Instance()->GetParticle(313)->Mass();
222 if(TMath::Abs(pdgdaughters[0]==321)){
224 Double_t mass12kpi=d->InvMass2Prongs(1,2,321,211);
225 vars[iter]=TMath::Abs(mass12kpi-mPDGK0star);
226 // vars[iter]=dd->InvMass2Prongs(1,2,321,211);
228 Double_t mass01pik=d->InvMass2Prongs(0,1,211,321);
229 vars[iter]=TMath::Abs(mass01pik-mPDGK0star);
230 // vars[iter]=dd->InvMass2Prongs(0,1,211,321);
237 //---------------------------------------------------------------------------
238 Int_t AliRDHFCutsDstoKKpi::IsSelectedPID(AliAODRecoDecayHF *rd) {
240 // return values: 0->NOT OK, 1->OK as KKpi, 2->OK as piKK, 3->OK as both
244 if(!fUsePID || !rd) return retCode;
246 AliWarning("AliAODPidHF not created!");
251 Int_t sign= rd->GetCharge();
252 for(Int_t iDaught=0; iDaught<3; iDaught++){
253 AliAODTrack *track=(AliAODTrack*)rd->GetDaughter(iDaught);
254 Int_t isPion=fPidHF->MakeRawPid(track,AliPID::kPion);
255 Int_t isKaon=fPidHF->MakeRawPid(track,AliPID::kKaon);
256 Int_t isProton=fPidHF->MakeRawPid(track,AliPID::kProton);
258 if(isProton>0 && isKaon<0 && isPion<0) return 0;
259 if(sign!=track->Charge()){// must be kaon
260 if(isKaon<0) return 0;
262 if(isKaon>0 && isPion<0) nKaons++;
263 if(isKaon<0) nNotKaons++;
265 if(isKaon<0) okKKpi=kFALSE;
266 if(isPion<0) okpiKK=kFALSE;
269 if(isKaon<0) okpiKK=kFALSE;
270 if(isPion<0) okKKpi=kFALSE;
274 if(nKaons>2)return 0;
275 if(nNotKaons>1) return 0;
277 if(!okKKpi) retCode-=1;
278 if(!okpiKK) retCode-=2;
283 //---------------------------------------------------------------------------
284 Int_t AliRDHFCutsDstoKKpi::IsSelected(TObject* obj,Int_t selectionLevel) {
290 cout<<"Cut matrice not inizialized. Exit..."<<endl;
294 AliAODRecoDecayHF3Prong* d=(AliAODRecoDecayHF3Prong*)obj;
297 cout<<"AliAODRecoDecayHF3Prong null"<<endl;
302 // selection on daughter tracks
303 if(selectionLevel==AliRDHFCuts::kAll ||
304 selectionLevel==AliRDHFCuts::kTracks) {
305 if(!AreDaughtersSelected(d)) return 0;
311 Int_t returnvaluePID=3;
312 if(selectionLevel==AliRDHFCuts::kAll ||
313 selectionLevel==AliRDHFCuts::kCandidate ||
314 selectionLevel==AliRDHFCuts::kPID) {
315 returnvaluePID = IsSelectedPID(d);
317 if(returnvaluePID==0)return 0;
318 Bool_t okPidDsKKpi=returnvaluePID&1;
319 Bool_t okPidDspiKK=returnvaluePID&2;
322 // selection on candidate
323 if(selectionLevel==AliRDHFCuts::kAll ||
324 selectionLevel==AliRDHFCuts::kCandidate) {
330 Int_t okMassK0star=0;
333 Int_t ptbin=PtBin(pt);
335 Double_t mDsPDG = TDatabasePDG::Instance()->GetParticle(431)->Mass();
336 Double_t mDsKKpi=d->InvMassDsKKpi();
337 Double_t mDspiKK=d->InvMassDspiKK();
338 if(TMath::Abs(mDsKKpi-mDsPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) okDsKKpi = 0;
339 if(TMath::Abs(mDspiKK-mDsPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) okDspiKK = 0;
340 if(!okDsKKpi && !okDspiKK) return 0;
341 if(okPidDsKKpi && !okDsKKpi) return 0;
342 if(okPidDspiKK && !okDspiKK) return 0;
345 if(TMath::Abs(d->PtProng(1)) < fCutsRD[GetGlobalIndex(1,ptbin)] ||
346 TMath::Abs(d->Getd0Prong(1))<fCutsRD[GetGlobalIndex(3,ptbin)]) return 0;
348 if(TMath::Abs(d->PtProng(0)) < fCutsRD[GetGlobalIndex(1,ptbin)] ||
349 TMath::Abs(d->Getd0Prong(0))<fCutsRD[GetGlobalIndex(3,ptbin)]) okDsKKpi=0;
350 if(TMath::Abs(d->PtProng(2)) < fCutsRD[GetGlobalIndex(2,ptbin)] ||
351 TMath::Abs(d->Getd0Prong(2))<fCutsRD[GetGlobalIndex(4,ptbin)]) okDsKKpi=0;
354 if(TMath::Abs(d->PtProng(0)) < fCutsRD[GetGlobalIndex(2,ptbin)] ||
355 TMath::Abs(d->Getd0Prong(0))<fCutsRD[GetGlobalIndex(4,ptbin)]) okDspiKK=0;
356 if(TMath::Abs(d->PtProng(2)) < fCutsRD[GetGlobalIndex(1,ptbin)] ||
357 TMath::Abs(d->Getd0Prong(2))<fCutsRD[GetGlobalIndex(3,ptbin)]) okDspiKK=0;
359 if(!okDsKKpi && !okDspiKK) return 0;
361 // cuts on resonant decays (via Phi or K0*)
362 Double_t mPhiPDG = TDatabasePDG::Instance()->GetParticle(333)->Mass();
363 Double_t mK0starPDG = TDatabasePDG::Instance()->GetParticle(313)->Mass();
365 Double_t mass01phi=d->InvMass2Prongs(0,1,321,321);
366 Double_t mass12K0s=d->InvMass2Prongs(1,2,321,211);
367 if(TMath::Abs(mass01phi-mPhiPDG)<fCutsRD[GetGlobalIndex(12,ptbin)]) okMassPhi=1;
368 if(TMath::Abs(mass12K0s-mK0starPDG)<fCutsRD[GetGlobalIndex(13,ptbin)]) okMassK0star = 1;
369 if(!okMassPhi && !okMassK0star) okDsKKpi=0;
372 Double_t mass01K0s=d->InvMass2Prongs(0,1,211,321);
373 Double_t mass12phi=d->InvMass2Prongs(1,2,321,321);
374 if(TMath::Abs(mass01K0s-mK0starPDG)<fCutsRD[GetGlobalIndex(13,ptbin)]) okMassK0star = 1;
375 if(TMath::Abs(mass12phi-mPhiPDG)<fCutsRD[GetGlobalIndex(12,ptbin)]) okMassPhi=1;
376 if(!okMassPhi && !okMassK0star) okDspiKK=0;
378 if(!okDsKKpi && !okDspiKK) return 0;
380 // Cuts on track pairs
381 for(Int_t i=0;i<3;i++) if(d->GetDCA(i)>fCutsRD[GetGlobalIndex(11,ptbin)]) return 0;
382 if(d->GetDist12toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)] ||
383 d->GetDist23toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]) return 0;
386 // Cuts on candidate triplet
387 if(d->GetSigmaVert()>fCutsRD[GetGlobalIndex(6,ptbin)]) return 0;
388 if(d->DecayLength()<fCutsRD[GetGlobalIndex(7,ptbin)]) return 0;
389 if(TMath::Abs(d->PtProng(0))<fCutsRD[GetGlobalIndex(8,ptbin)] &&
390 TMath::Abs(d->PtProng(1))<fCutsRD[GetGlobalIndex(8,ptbin)] &&
391 TMath::Abs(d->PtProng(2))<fCutsRD[GetGlobalIndex(8,ptbin)]) return 0;
392 if(d->CosPointingAngle()< fCutsRD[GetGlobalIndex(9,ptbin)])return 0;
393 Double_t sum2=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
394 if(sum2<fCutsRD[GetGlobalIndex(10,ptbin)])return 0;
397 if(okDsKKpi) returnvalue+=1;
398 if(okDspiKK) returnvalue+=2;
399 if(okMassPhi) returnvalue+=4;
400 if(okMassK0star) returnvalue+=8;
406 //---------------------------------------------------------------------------