1 /**************************************************************************
2 * Copyright(c) 1998-2006, 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 **************************************************************************/
18 /////////////////////////////////////////////////////////////
20 // Base class for AOD reconstructed heavy-flavour 3-prong decay
22 // Author: E.Bruna bruna@to.infn.it, F.Prino prino@to.infn.it
23 /////////////////////////////////////////////////////////////
25 #include <TDatabasePDG.h>
26 #include "AliAODRecoDecayHF.h"
27 #include "AliAODRecoDecayHF3Prong.h"
28 #include "AliAODTrack.h"
29 #include "AliESDtrack.h"
30 #include "AliVertexerTracks.h"
32 #include "TLorentzVector.h"
34 ClassImp(AliAODRecoDecayHF3Prong)
36 //--------------------------------------------------------------------------
37 AliAODRecoDecayHF3Prong::AliAODRecoDecayHF3Prong() :
44 // Default Constructor
47 //--------------------------------------------------------------------------
48 AliAODRecoDecayHF3Prong::AliAODRecoDecayHF3Prong(AliAODVertex *vtx2,
49 Double_t *px,Double_t *py,Double_t *pz,
50 Double_t *d0,Double_t *d0err,
51 Double_t *dca, Double_t sigvert,
52 Double_t dist12,Double_t dist23,Short_t charge) :
53 AliAODRecoDecayHF(vtx2,3,charge,px,py,pz,d0,d0err),
55 fDist12toPrim(dist12),
59 // Constructor with AliAODVertex for decay vertex
63 //--------------------------------------------------------------------------
64 AliAODRecoDecayHF3Prong::AliAODRecoDecayHF3Prong(AliAODVertex *vtx2,
65 Double_t *d0,Double_t *d0err,
66 Double_t *dca, Double_t sigvert,
67 Double_t dist12,Double_t dist23, Short_t charge) :
68 AliAODRecoDecayHF(vtx2,3,charge,d0,d0err),
70 fDist12toPrim(dist12),
74 // Constructor with AliAODVertex for decay vertex and without prongs momenta
78 //--------------------------------------------------------------------------
79 AliAODRecoDecayHF3Prong::AliAODRecoDecayHF3Prong(const AliAODRecoDecayHF3Prong &source) :
80 AliAODRecoDecayHF(source),
81 fSigmaVert(source.fSigmaVert),
82 fDist12toPrim(source.fDist12toPrim),
83 fDist23toPrim(source.fDist23toPrim)
89 //--------------------------------------------------------------------------
90 AliAODRecoDecayHF3Prong &AliAODRecoDecayHF3Prong::operator=(const AliAODRecoDecayHF3Prong &source)
93 // assignment operator
95 if(&source == this) return *this;
97 AliAODRecoDecayHF::operator=(source);
99 fDist12toPrim= source.fDist12toPrim;
100 fDist23toPrim= source.fDist23toPrim;
101 fSigmaVert= source.fSigmaVert;
105 //--------------------------------------------------------------------------
106 Bool_t AliAODRecoDecayHF3Prong::SelectDplus(const Double_t *cuts)
109 // This function compares the Dplus with a set of cuts:
111 // cuts[0] = inv. mass half width [GeV]
112 // cuts[1] = pTK [GeV/c]
113 // cuts[2] = pTPi [GeV/c]
114 // cuts[3] = d0K [cm] lower limit!
115 // cuts[4] = d0Pi [cm] lower limit!
116 // cuts[5] = dist12 (cm)
117 // cuts[6] = sigmavert (cm)
118 // cuts[7] = dist prim-sec (cm)
119 // cuts[8] = pM=Max{pT1,pT2,pT3} (GeV/c)
120 // cuts[9] = cosThetaPoint
121 // cuts[10] = Sum d0^2 (cm^2)
122 // cuts[11] = dca cut (cm)
124 // If candidate Dplus does not pass the cuts return kFALSE
127 Double_t mDplusPDG = TDatabasePDG::Instance()->GetParticle(411)->Mass();
128 Double_t mDplus=InvMassDplus();
129 if(TMath::Abs(mDplus-mDplusPDG)>cuts[0])return kFALSE;
131 if(TMath::Abs(PtProng(1)) < cuts[1] || TMath::Abs(Getd0Prong(1))<cuts[3])return kFALSE;//Kaon
132 if(TMath::Abs(PtProng(0)) < cuts[2] || TMath::Abs(Getd0Prong(0))<cuts[4])return kFALSE;//Pion1
133 if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion2
136 for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
139 if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
140 if(Getd0Prong(0)*Getd0Prong(1)<0. && Getd0Prong(2)*Getd0Prong(1)<0.)return kFALSE;
143 if(fSigmaVert>cuts[6])return kFALSE;
145 if(DecayLength()<cuts[7])return kFALSE;
147 if(TMath::Abs(PtProng(0))<cuts[8] && TMath::Abs(PtProng(1))<cuts[8] && TMath::Abs(PtProng(2))<cuts[8])return kFALSE;
148 if(CosPointingAngle() < cuts[9])return kFALSE;
149 Double_t sum2=Getd0Prong(0)*Getd0Prong(0)+Getd0Prong(1)*Getd0Prong(1)+Getd0Prong(2)*Getd0Prong(2);
150 if(sum2<cuts[10])return kFALSE;
153 //--------------------------------------------------------------------------
154 Bool_t AliAODRecoDecayHF3Prong::SelectDs(const Double_t *cuts,Int_t &okDsKKpi,Int_t &okDspiKK, Int_t &okMassPhi, Int_t &okMassK0star)
157 // This function compares the Ds with a set of cuts
158 // (same variables as D+, for now)
160 // cuts[0] = inv. mass half width [GeV]
161 // cuts[1] = pTK [GeV/c]
162 // cuts[2] = pTPi [GeV/c]
163 // cuts[3] = d0K [cm] lower limit!
164 // cuts[4] = d0Pi [cm] lower limit!
165 // cuts[5] = dist12 (cm)
166 // cuts[6] = sigmavert (cm)
167 // cuts[7] = dist prim-sec (cm)
168 // cuts[8] = pM=Max{pT1,pT2,pT3} (GeV/c)
169 // cuts[9] = cosThetaPoint
170 // cuts[10] = Sum d0^2 (cm^2)
171 // cuts[11] = dca cut (cm)
172 // cuts[12] = max. inv. mass difference(Mphi-MKK) [GeV]
173 // cuts[13] = max. inv. mass difference(MK0*-MKpi) [GeV]
175 // If candidate Ds does not pass the cuts return kFALSE
177 Double_t mDsKKpi,mDspiKK;
178 okDsKKpi=1; okDspiKK=1;
179 okMassPhi=0; okMassK0star=0;
181 Double_t mDsPDG = TDatabasePDG::Instance()->GetParticle(431)->Mass();
183 mDsKKpi=InvMassDsKKpi();
184 mDspiKK=InvMassDspiKK();
186 if(TMath::Abs(mDsKKpi-mDsPDG)>cuts[0]) okDsKKpi = 0;
187 if(TMath::Abs(mDspiKK-mDsPDG)>cuts[0]) okDspiKK = 0;
188 if(!okDsKKpi && !okDspiKK) return kFALSE;
191 if(TMath::Abs(PtProng(0)) < cuts[1] || TMath::Abs(Getd0Prong(0))<cuts[3])return kFALSE;//Kaon1
192 if(TMath::Abs(PtProng(1)) < cuts[1] || TMath::Abs(Getd0Prong(1))<cuts[3])return kFALSE;//Kaon2
193 if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion
195 // cuts on resonant decays (via Phi or K0*)
196 Double_t mPhiPDG = TDatabasePDG::Instance()->GetParticle(333)->Mass();
197 Double_t mK0starPDG = TDatabasePDG::Instance()->GetParticle(313)->Mass();
199 Double_t mass01phi=InvMass2Prongs(0,1,321,321);
200 Double_t mass12K0s=InvMass2Prongs(1,2,321,211);
201 if(TMath::Abs(mass01phi-mPhiPDG)<cuts[12]) okMassPhi=1;
202 if(TMath::Abs(mass12K0s-mK0starPDG)<cuts[13]) okMassK0star = 1;
203 if(!okMassPhi && !okMassK0star) okDsKKpi=kFALSE;
206 Double_t mass01K0s=InvMass2Prongs(0,1,211,321);
207 Double_t mass12phi=InvMass2Prongs(1,2,321,321);
208 if(TMath::Abs(mass01K0s-mK0starPDG)<cuts[13]) okMassK0star = 1;
209 if(TMath::Abs(mass12phi-mPhiPDG)<cuts[12]) okMassPhi=1;
210 if(!okMassPhi && !okMassK0star) okDspiKK=kFALSE;
212 if(!okDsKKpi && !okDspiKK) return kFALSE;
218 for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
221 if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
224 if(fSigmaVert>cuts[6])return kFALSE;
226 if(DecayLength()<cuts[7])return kFALSE;
228 if(TMath::Abs(PtProng(0))<cuts[8] && TMath::Abs(PtProng(1))<cuts[8] && TMath::Abs(PtProng(2))<cuts[8])return kFALSE;
229 if(CosPointingAngle() < cuts[9])return kFALSE;
230 Double_t sum2=Getd0Prong(0)*Getd0Prong(0)+Getd0Prong(1)*Getd0Prong(1)+Getd0Prong(2)*Getd0Prong(2);
231 if(sum2<cuts[10])return kFALSE;
235 //--------------------------------------------------------------------------
236 Bool_t AliAODRecoDecayHF3Prong::SelectLc(const Double_t *cuts,Int_t &okLcpKpi,Int_t &okLcpiKp)
239 // This function compares the Lc with a set of cuts
240 // (same variables as D+, for now)
242 // cuts[0] = inv. mass half width [GeV]
243 // cuts[1] = pTP [GeV/c]
244 // cuts[2] = pTPi and pTK [GeV/c]
245 // cuts[3] = d0P [cm] lower limit!
246 // cuts[4] = d0Pi and d0K [cm] lower limit!
247 // cuts[5] = dist12 (cm)
248 // cuts[6] = sigmavert (cm)
249 // cuts[7] = dist prim-sec (cm)
250 // cuts[8] = pM=Max{pT1,pT2,pT3} (GeV/c)
251 // cuts[9] = cosThetaPoint
252 // cuts[10] = Sum d0^2 (cm^2)
253 // cuts[11] = dca cut (cm)
255 // If candidate Lc does not pass the cuts return kFALSE
257 Double_t mLcpKpi,mLcpiKp;
258 okLcpKpi=1; okLcpiKp=1;
260 Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
262 mLcpKpi=InvMassLcpKpi();
263 mLcpiKp=InvMassLcpiKp();
265 if(TMath::Abs(mLcpKpi-mLcPDG)>cuts[0]) okLcpKpi = 0;
266 if(TMath::Abs(mLcpiKp-mLcPDG)>cuts[0]) okLcpiKp = 0;
267 if(!okLcpKpi && !okLcpiKp) return kFALSE;
270 if(TMath::Abs(PtProng(0)) < cuts[1] || TMath::Abs(Getd0Prong(0))<cuts[3])return kFALSE;//Proton
271 if(TMath::Abs(PtProng(1)) < cuts[2] || TMath::Abs(Getd0Prong(1))<cuts[4])return kFALSE;//Kaon
272 if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion
275 for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
278 if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
279 if(Getd0Prong(0)*Getd0Prong(1)<0. && Getd0Prong(2)*Getd0Prong(1)<0.)return kFALSE;
282 if(fSigmaVert>cuts[6])return kFALSE;
284 if(DecayLength()<cuts[7])return kFALSE;
286 if(TMath::Abs(PtProng(0))<cuts[8] && TMath::Abs(PtProng(1))<cuts[8] && TMath::Abs(PtProng(2))<cuts[8])return kFALSE;
287 if(CosPointingAngle() < cuts[9])return kFALSE;
288 Double_t sum2=Getd0Prong(0)*Getd0Prong(0)+Getd0Prong(1)*Getd0Prong(1)+Getd0Prong(2)*Getd0Prong(2);
289 if(sum2<cuts[10])return kFALSE;
295 //----------------------------------------------------------------------
296 Double_t AliAODRecoDecayHF3Prong::CosPiKPhiRFrame(Int_t option)
298 // computes cosine of angle between pi and K in the phi rest frame
304 if (option==0){ //KKpi
314 Double_t ePhi=EProng(indexK1,321)+EProng(indexK2,321);
315 Double_t pxPhi=PxProng(indexK1)+PxProng(indexK2);
316 Double_t pyPhi=PyProng(indexK1)+PyProng(indexK2);
317 Double_t pzPhi=PzProng(indexK1)+PzProng(indexK2);
318 Double_t bxPhi=pxPhi/ePhi;
319 Double_t byPhi=pyPhi/ePhi;
320 Double_t bzPhi=pzPhi/ePhi;
322 TVector3 vecK1Phiframe;
323 TLorentzVector* vecK1=new TLorentzVector(PxProng(indexK1),PyProng(indexK1),PzProng(indexK1),EProng(indexK1,321));
324 vecK1->Boost(-bxPhi,-byPhi,-bzPhi);
325 vecK1->Boost(vecK1Phiframe);
326 vecK1Phiframe=vecK1->BoostVector();
328 TVector3 vecPiPhiframe;
329 TLorentzVector* vecPi=new TLorentzVector(PxProng(indexPi),PyProng(indexPi),PzProng(indexPi),EProng(indexPi,211));
330 vecPi->Boost(-bxPhi,-byPhi,-bzPhi);
331 vecPi->Boost(vecPiPhiframe);
332 vecPiPhiframe=vecPi->BoostVector();
334 Double_t innera=vecPiPhiframe.Dot(vecK1Phiframe);
335 Double_t norm1a=TMath::Sqrt(vecPiPhiframe.Dot(vecPiPhiframe));
336 Double_t norm2a=TMath::Sqrt(vecK1Phiframe.Dot(vecK1Phiframe));
337 Double_t cosK1PhiFrame=innera/(norm1a*norm2a);
339 return cosK1PhiFrame;
343 //----------------------------------------------------------------------
344 Double_t AliAODRecoDecayHF3Prong::CosPiDsLabFrame(Int_t option)
346 // computes cosine of angle between pi and Ds in the Ds rest frame
350 if (option==0){ //KKpi
357 Double_t bxD=Px()/E(431);
358 Double_t byD=Py()/E(431);
359 Double_t bzD=Pz()/E(431);
362 TLorentzVector* vecPi=new TLorentzVector(PxProng(indexPi),PyProng(indexPi),PzProng(indexPi),EProng(indexPi,211));
363 vecPi->Boost(-bxD,-byD,-bzD);
364 vecPi->Boost(piDsframe);
365 piDsframe=vecPi->BoostVector();
367 TVector3 vecDs(Px(),Py(),Pz());
369 Double_t inner=vecDs.Dot(piDsframe);
370 Double_t norm1=TMath::Sqrt(vecDs.Dot(vecDs));
371 Double_t norm2=TMath::Sqrt(piDsframe.Dot(piDsframe));
372 Double_t cosPiDsFrame=inner/(norm1*norm2);
379 //----------------------------------------------------------------------
380 Double_t AliAODRecoDecayHF3Prong::ComputeSigmaVert(const AliAODEvent* aod) const{
381 // computes track dispersion around secondary vertex starting from tracks
383 AliVertexerTracks vertexer(aod->GetMagneticField());
384 Double_t pos[3],cov[6];
385 AliAODVertex* aodV=aod->GetPrimaryVertex();
387 aodV->GetCovarianceMatrix(cov);
388 Double_t chi2=aodV->GetChi2();
389 Int_t nC=aodV->GetNContributors();
390 AliESDVertex vprim(pos,cov,chi2,nC);
391 vertexer.SetVtxStart(&vprim);
392 TObjArray threeTrackArray(3);
394 for(Int_t iDau=0; iDau<GetNDaughters(); iDau++){
395 AliVTrack* at=(AliVTrack*)GetDaughter(iDau);
396 threeTrackArray.AddAt(new AliESDtrack(at),iDau);
399 AliESDVertex* secVert=vertexer.VertexForSelectedESDTracks(&threeTrackArray,kFALSE,kTRUE,kFALSE);
400 Double_t disp=secVert->GetDispersion();
402 threeTrackArray.Delete();