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::IsSelected(TObject* obj,Int_t selectionLevel) {
244 cout<<"Cut matrice not inizialized. Exit..."<<endl;
248 AliAODRecoDecayHF3Prong* d=(AliAODRecoDecayHF3Prong*)obj;
251 cout<<"AliAODRecoDecayHF3Prong null"<<endl;
256 // selection on daughter tracks
257 if(selectionLevel==AliRDHFCuts::kAll ||
258 selectionLevel==AliRDHFCuts::kTracks) {
259 if(!AreDaughtersSelected(d)) return 0;
265 // selection on candidate
266 if(selectionLevel==AliRDHFCuts::kAll ||
267 selectionLevel==AliRDHFCuts::kCandidate) {
273 Int_t okMassK0star=0;
276 Int_t ptbin=PtBin(pt);
278 Double_t mDsPDG = TDatabasePDG::Instance()->GetParticle(431)->Mass();
279 Double_t mDsKKpi=d->InvMassDsKKpi();
280 Double_t mDspiKK=d->InvMassDspiKK();
281 if(TMath::Abs(mDsKKpi-mDsPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) okDsKKpi = 0;
282 if(TMath::Abs(mDspiKK-mDsPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) okDspiKK = 0;
283 if(!okDsKKpi && !okDspiKK) return 0;
286 if(TMath::Abs(d->PtProng(1)) < fCutsRD[GetGlobalIndex(1,ptbin)] ||
287 TMath::Abs(d->Getd0Prong(1))<fCutsRD[GetGlobalIndex(3,ptbin)]) return 0;
289 if(TMath::Abs(d->PtProng(0)) < fCutsRD[GetGlobalIndex(1,ptbin)] ||
290 TMath::Abs(d->Getd0Prong(0))<fCutsRD[GetGlobalIndex(3,ptbin)]) okDsKKpi=0;
291 if(TMath::Abs(d->PtProng(2)) < fCutsRD[GetGlobalIndex(2,ptbin)] ||
292 TMath::Abs(d->Getd0Prong(2))<fCutsRD[GetGlobalIndex(4,ptbin)]) okDsKKpi=0;
295 if(TMath::Abs(d->PtProng(0)) < fCutsRD[GetGlobalIndex(2,ptbin)] ||
296 TMath::Abs(d->Getd0Prong(0))<fCutsRD[GetGlobalIndex(4,ptbin)]) okDspiKK=0;
297 if(TMath::Abs(d->PtProng(2)) < fCutsRD[GetGlobalIndex(1,ptbin)] ||
298 TMath::Abs(d->Getd0Prong(2))<fCutsRD[GetGlobalIndex(3,ptbin)]) okDspiKK=0;
300 if(!okDsKKpi && !okDspiKK) return 0;
302 // cuts on resonant decays (via Phi or K0*)
303 Double_t mPhiPDG = TDatabasePDG::Instance()->GetParticle(333)->Mass();
304 Double_t mK0starPDG = TDatabasePDG::Instance()->GetParticle(313)->Mass();
306 Double_t mass01phi=d->InvMass2Prongs(0,1,321,321);
307 Double_t mass12K0s=d->InvMass2Prongs(1,2,321,211);
308 if(TMath::Abs(mass01phi-mPhiPDG)<fCutsRD[GetGlobalIndex(12,ptbin)]) okMassPhi=1;
309 if(TMath::Abs(mass12K0s-mK0starPDG)<fCutsRD[GetGlobalIndex(13,ptbin)]) okMassK0star = 1;
310 if(!okMassPhi && !okMassK0star) okDsKKpi=0;
313 Double_t mass01K0s=d->InvMass2Prongs(0,1,211,321);
314 Double_t mass12phi=d->InvMass2Prongs(1,2,321,321);
315 if(TMath::Abs(mass01K0s-mK0starPDG)<fCutsRD[GetGlobalIndex(13,ptbin)]) okMassK0star = 1;
316 if(TMath::Abs(mass12phi-mPhiPDG)<fCutsRD[GetGlobalIndex(12,ptbin)]) okMassPhi=1;
317 if(!okMassPhi && !okMassK0star) okDspiKK=0;
319 if(!okDsKKpi && !okDspiKK) return 0;
321 // Cuts on track pairs
322 for(Int_t i=0;i<3;i++) if(d->GetDCA(i)>fCutsRD[GetGlobalIndex(11,ptbin)]) return 0;
323 if(d->GetDist12toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)] ||
324 d->GetDist23toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]) return 0;
327 // Cuts on candidate triplet
328 if(d->GetSigmaVert()>fCutsRD[GetGlobalIndex(6,ptbin)]) return 0;
329 if(d->DecayLength()<fCutsRD[GetGlobalIndex(7,ptbin)]) return 0;
330 if(TMath::Abs(d->PtProng(0))<fCutsRD[GetGlobalIndex(8,ptbin)] &&
331 TMath::Abs(d->PtProng(1))<fCutsRD[GetGlobalIndex(8,ptbin)] &&
332 TMath::Abs(d->PtProng(2))<fCutsRD[GetGlobalIndex(8,ptbin)]) return 0;
333 if(d->CosPointingAngle()< fCutsRD[GetGlobalIndex(9,ptbin)])return 0;
334 Double_t sum2=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
335 if(sum2<fCutsRD[GetGlobalIndex(10,ptbin)])return 0;
338 if(okDsKKpi) returnvalue+=1;
339 if(okDspiKK) returnvalue+=2;
340 if(okMassPhi) returnvalue+=4;
341 if(okMassK0star) returnvalue+=8;
347 //---------------------------------------------------------------------------