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"
30 #include "TLorentzVector.h"
32 ClassImp(AliAODRecoDecayHF3Prong)
34 //--------------------------------------------------------------------------
35 AliAODRecoDecayHF3Prong::AliAODRecoDecayHF3Prong() :
42 // Default Constructor
45 //--------------------------------------------------------------------------
46 AliAODRecoDecayHF3Prong::AliAODRecoDecayHF3Prong(AliAODVertex *vtx2,
47 Double_t *px,Double_t *py,Double_t *pz,
48 Double_t *d0,Double_t *d0err,
49 Double_t *dca, Double_t sigvert,
50 Double_t dist12,Double_t dist23,Short_t charge) :
51 AliAODRecoDecayHF(vtx2,3,charge,px,py,pz,d0,d0err),
53 fDist12toPrim(dist12),
57 // Constructor with AliAODVertex for decay vertex
61 //--------------------------------------------------------------------------
62 AliAODRecoDecayHF3Prong::AliAODRecoDecayHF3Prong(AliAODVertex *vtx2,
63 Double_t *d0,Double_t *d0err,
64 Double_t *dca, Double_t sigvert,
65 Double_t dist12,Double_t dist23, Short_t charge) :
66 AliAODRecoDecayHF(vtx2,3,charge,d0,d0err),
68 fDist12toPrim(dist12),
72 // Constructor with AliAODVertex for decay vertex and without prongs momenta
76 //--------------------------------------------------------------------------
77 AliAODRecoDecayHF3Prong::AliAODRecoDecayHF3Prong(const AliAODRecoDecayHF3Prong &source) :
78 AliAODRecoDecayHF(source),
79 fSigmaVert(source.fSigmaVert),
80 fDist12toPrim(source.fDist12toPrim),
81 fDist23toPrim(source.fDist23toPrim)
87 //--------------------------------------------------------------------------
88 AliAODRecoDecayHF3Prong &AliAODRecoDecayHF3Prong::operator=(const AliAODRecoDecayHF3Prong &source)
91 // assignment operator
93 if(&source == this) return *this;
95 AliAODRecoDecayHF::operator=(source);
97 fDist12toPrim= source.fDist12toPrim;
98 fDist23toPrim= source.fDist23toPrim;
99 fSigmaVert= source.fSigmaVert;
103 //--------------------------------------------------------------------------
104 Bool_t AliAODRecoDecayHF3Prong::SelectDplus(const Double_t *cuts)
107 // This function compares the Dplus with a set of cuts:
109 // cuts[0] = inv. mass half width [GeV]
110 // cuts[1] = pTK [GeV/c]
111 // cuts[2] = pTPi [GeV/c]
112 // cuts[3] = d0K [cm] lower limit!
113 // cuts[4] = d0Pi [cm] lower limit!
114 // cuts[5] = dist12 (cm)
115 // cuts[6] = sigmavert (cm)
116 // cuts[7] = dist prim-sec (cm)
117 // cuts[8] = pM=Max{pT1,pT2,pT3} (GeV/c)
118 // cuts[9] = cosThetaPoint
119 // cuts[10] = Sum d0^2 (cm^2)
120 // cuts[11] = dca cut (cm)
122 // If candidate Dplus does not pass the cuts return kFALSE
125 Double_t mDplusPDG = TDatabasePDG::Instance()->GetParticle(411)->Mass();
126 Double_t mDplus=InvMassDplus();
127 if(TMath::Abs(mDplus-mDplusPDG)>cuts[0])return kFALSE;
129 if(TMath::Abs(PtProng(1)) < cuts[1] || TMath::Abs(Getd0Prong(1))<cuts[3])return kFALSE;//Kaon
130 if(TMath::Abs(PtProng(0)) < cuts[2] || TMath::Abs(Getd0Prong(0))<cuts[4])return kFALSE;//Pion1
131 if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion2
134 for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
137 if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
138 if(Getd0Prong(0)*Getd0Prong(1)<0. && Getd0Prong(2)*Getd0Prong(1)<0.)return kFALSE;
141 if(fSigmaVert>cuts[6])return kFALSE;
143 if(DecayLength()<cuts[7])return kFALSE;
145 if(TMath::Abs(PtProng(0))<cuts[8] && TMath::Abs(PtProng(1))<cuts[8] && TMath::Abs(PtProng(2))<cuts[8])return kFALSE;
146 if(CosPointingAngle() < cuts[9])return kFALSE;
147 Double_t sum2=Getd0Prong(0)*Getd0Prong(0)+Getd0Prong(1)*Getd0Prong(1)+Getd0Prong(2)*Getd0Prong(2);
148 if(sum2<cuts[10])return kFALSE;
151 //--------------------------------------------------------------------------
152 Bool_t AliAODRecoDecayHF3Prong::SelectDs(const Double_t *cuts,Int_t &okDsKKpi,Int_t &okDspiKK, Int_t &okMassPhi, Int_t &okMassK0star)
155 // This function compares the Ds with a set of cuts
156 // (same variables as D+, for now)
158 // cuts[0] = inv. mass half width [GeV]
159 // cuts[1] = pTK [GeV/c]
160 // cuts[2] = pTPi [GeV/c]
161 // cuts[3] = d0K [cm] lower limit!
162 // cuts[4] = d0Pi [cm] lower limit!
163 // cuts[5] = dist12 (cm)
164 // cuts[6] = sigmavert (cm)
165 // cuts[7] = dist prim-sec (cm)
166 // cuts[8] = pM=Max{pT1,pT2,pT3} (GeV/c)
167 // cuts[9] = cosThetaPoint
168 // cuts[10] = Sum d0^2 (cm^2)
169 // cuts[11] = dca cut (cm)
170 // cuts[12] = max. inv. mass difference(Mphi-MKK) [GeV]
171 // cuts[13] = max. inv. mass difference(MK0*-MKpi) [GeV]
173 // If candidate Ds does not pass the cuts return kFALSE
175 Double_t mDsKKpi,mDspiKK;
176 okDsKKpi=1; okDspiKK=1;
177 okMassPhi=0; okMassK0star=0;
179 Double_t mDsPDG = TDatabasePDG::Instance()->GetParticle(431)->Mass();
181 mDsKKpi=InvMassDsKKpi();
182 mDspiKK=InvMassDspiKK();
184 if(TMath::Abs(mDsKKpi-mDsPDG)>cuts[0]) okDsKKpi = 0;
185 if(TMath::Abs(mDspiKK-mDsPDG)>cuts[0]) okDspiKK = 0;
186 if(!okDsKKpi && !okDspiKK) return kFALSE;
189 if(TMath::Abs(PtProng(0)) < cuts[1] || TMath::Abs(Getd0Prong(0))<cuts[3])return kFALSE;//Kaon1
190 if(TMath::Abs(PtProng(1)) < cuts[1] || TMath::Abs(Getd0Prong(1))<cuts[3])return kFALSE;//Kaon2
191 if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion
193 // cuts on resonant decays (via Phi or K0*)
194 Double_t mPhiPDG = TDatabasePDG::Instance()->GetParticle(333)->Mass();
195 Double_t mK0starPDG = TDatabasePDG::Instance()->GetParticle(313)->Mass();
197 Double_t mass01phi=InvMass2Prongs(0,1,321,321);
198 Double_t mass12K0s=InvMass2Prongs(1,2,321,211);
199 if(TMath::Abs(mass01phi-mPhiPDG)<cuts[12]) okMassPhi=1;
200 if(TMath::Abs(mass12K0s-mK0starPDG)<cuts[13]) okMassK0star = 1;
201 if(!okMassPhi && !okMassK0star) okDsKKpi=kFALSE;
204 Double_t mass01K0s=InvMass2Prongs(0,1,211,321);
205 Double_t mass12phi=InvMass2Prongs(1,2,321,321);
206 if(TMath::Abs(mass01K0s-mK0starPDG)<cuts[13]) okMassK0star = 1;
207 if(TMath::Abs(mass12phi-mPhiPDG)<cuts[12]) okMassPhi=1;
208 if(!okMassPhi && !okMassK0star) okDspiKK=kFALSE;
210 if(!okDsKKpi && !okDspiKK) return kFALSE;
216 for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
219 if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
222 if(fSigmaVert>cuts[6])return kFALSE;
224 if(DecayLength()<cuts[7])return kFALSE;
226 if(TMath::Abs(PtProng(0))<cuts[8] && TMath::Abs(PtProng(1))<cuts[8] && TMath::Abs(PtProng(2))<cuts[8])return kFALSE;
227 if(CosPointingAngle() < cuts[9])return kFALSE;
228 Double_t sum2=Getd0Prong(0)*Getd0Prong(0)+Getd0Prong(1)*Getd0Prong(1)+Getd0Prong(2)*Getd0Prong(2);
229 if(sum2<cuts[10])return kFALSE;
233 //--------------------------------------------------------------------------
234 Bool_t AliAODRecoDecayHF3Prong::SelectLc(const Double_t *cuts,Int_t &okLcpKpi,Int_t &okLcpiKp)
237 // This function compares the Lc with a set of cuts
238 // (same variables as D+, for now)
240 // cuts[0] = inv. mass half width [GeV]
241 // cuts[1] = pTP [GeV/c]
242 // cuts[2] = pTPi and pTK [GeV/c]
243 // cuts[3] = d0P [cm] lower limit!
244 // cuts[4] = d0Pi and d0K [cm] lower limit!
245 // cuts[5] = dist12 (cm)
246 // cuts[6] = sigmavert (cm)
247 // cuts[7] = dist prim-sec (cm)
248 // cuts[8] = pM=Max{pT1,pT2,pT3} (GeV/c)
249 // cuts[9] = cosThetaPoint
250 // cuts[10] = Sum d0^2 (cm^2)
251 // cuts[11] = dca cut (cm)
253 // If candidate Lc does not pass the cuts return kFALSE
255 Double_t mLcpKpi,mLcpiKp;
256 okLcpKpi=1; okLcpiKp=1;
258 Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
260 mLcpKpi=InvMassLcpKpi();
261 mLcpiKp=InvMassLcpiKp();
263 if(TMath::Abs(mLcpKpi-mLcPDG)>cuts[0]) okLcpKpi = 0;
264 if(TMath::Abs(mLcpiKp-mLcPDG)>cuts[0]) okLcpiKp = 0;
265 if(!okLcpKpi && !okLcpiKp) return kFALSE;
268 if(TMath::Abs(PtProng(0)) < cuts[1] || TMath::Abs(Getd0Prong(0))<cuts[3])return kFALSE;//Proton
269 if(TMath::Abs(PtProng(1)) < cuts[2] || TMath::Abs(Getd0Prong(1))<cuts[4])return kFALSE;//Kaon
270 if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion
273 for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
276 if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
277 if(Getd0Prong(0)*Getd0Prong(1)<0. && Getd0Prong(2)*Getd0Prong(1)<0.)return kFALSE;
280 if(fSigmaVert>cuts[6])return kFALSE;
282 if(DecayLength()<cuts[7])return kFALSE;
284 if(TMath::Abs(PtProng(0))<cuts[8] && TMath::Abs(PtProng(1))<cuts[8] && TMath::Abs(PtProng(2))<cuts[8])return kFALSE;
285 if(CosPointingAngle() < cuts[9])return kFALSE;
286 Double_t sum2=Getd0Prong(0)*Getd0Prong(0)+Getd0Prong(1)*Getd0Prong(1)+Getd0Prong(2)*Getd0Prong(2);
287 if(sum2<cuts[10])return kFALSE;
293 //----------------------------------------------------------------------
294 Double_t AliAODRecoDecayHF3Prong::CosPiKPhiRFrame(Int_t option)
296 // computes cosine of angle between pi and K in the phi rest frame
302 if (option==0){ //KKpi
312 Double_t ePhi=EProng(indexK1,321)+EProng(indexK2,321);
313 Double_t pxPhi=PxProng(indexK1)+PxProng(indexK2);
314 Double_t pyPhi=PyProng(indexK1)+PyProng(indexK2);
315 Double_t pzPhi=PzProng(indexK1)+PzProng(indexK2);
316 Double_t bxPhi=pxPhi/ePhi;
317 Double_t byPhi=pyPhi/ePhi;
318 Double_t bzPhi=pzPhi/ePhi;
320 TVector3 vecK1Phiframe;
321 TLorentzVector* vecK1=new TLorentzVector(PxProng(indexK1),PyProng(indexK1),PzProng(indexK1),EProng(indexK1,321));
322 vecK1->Boost(-bxPhi,-byPhi,-bzPhi);
323 vecK1->Boost(vecK1Phiframe);
324 vecK1Phiframe=vecK1->BoostVector();
326 TVector3 vecPiPhiframe;
327 TLorentzVector* vecPi=new TLorentzVector(PxProng(indexPi),PyProng(indexPi),PzProng(indexPi),EProng(indexPi,211));
328 vecPi->Boost(-bxPhi,-byPhi,-bzPhi);
329 vecPi->Boost(vecPiPhiframe);
330 vecPiPhiframe=vecPi->BoostVector();
332 Double_t innera=vecPiPhiframe.Dot(vecK1Phiframe);
333 Double_t norm1a=TMath::Sqrt(vecPiPhiframe.Dot(vecPiPhiframe));
334 Double_t norm2a=TMath::Sqrt(vecK1Phiframe.Dot(vecK1Phiframe));
335 Double_t cosK1PhiFrame=innera/(norm1a*norm2a);
337 return cosK1PhiFrame;
341 //----------------------------------------------------------------------
342 Double_t AliAODRecoDecayHF3Prong::CosPiDsLabFrame(Int_t option)
344 // computes cosine of angle between pi and Ds in the Ds rest frame
348 if (option==0){ //KKpi
355 Double_t bxD=Px()/E(431);
356 Double_t byD=Py()/E(431);
357 Double_t bzD=Pz()/E(431);
360 TLorentzVector* vecPi=new TLorentzVector(PxProng(indexPi),PyProng(indexPi),PzProng(indexPi),EProng(indexPi,211));
361 vecPi->Boost(-bxD,-byD,-bzD);
362 vecPi->Boost(piDsframe);
363 piDsframe=vecPi->BoostVector();
365 TVector3 vecDs(Px(),Py(),Pz());
367 Double_t inner=vecDs.Dot(piDsframe);
368 Double_t norm1=TMath::Sqrt(vecDs.Dot(vecDs));
369 Double_t norm2=TMath::Sqrt(piDsframe.Dot(piDsframe));
370 Double_t cosPiDsFrame=inner/(norm1*norm2);