]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/vertexingHF/AliAODRecoDecayHF3Prong.cxx
Fix typo
[u/mrichter/AliRoot.git] / PWGHF / vertexingHF / AliAODRecoDecayHF3Prong.cxx
CommitLineData
3244eeed 1/**************************************************************************
2 * Copyright(c) 1998-2006, 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
3244eeed 18/////////////////////////////////////////////////////////////
19//
20// Base class for AOD reconstructed heavy-flavour 3-prong decay
21//
22// Author: E.Bruna bruna@to.infn.it, F.Prino prino@to.infn.it
23/////////////////////////////////////////////////////////////
24
25#include <TDatabasePDG.h>
26#include "AliAODRecoDecayHF.h"
27#include "AliAODRecoDecayHF3Prong.h"
16156b6d 28#include "AliAODTrack.h"
e0fb900a 29#include "AliESDtrack.h"
30#include "AliVertexerTracks.h"
2e153422 31#include "TVector3.h"
32#include "TLorentzVector.h"
3244eeed 33
34ClassImp(AliAODRecoDecayHF3Prong)
35
36//--------------------------------------------------------------------------
37AliAODRecoDecayHF3Prong::AliAODRecoDecayHF3Prong() :
38 AliAODRecoDecayHF(),
39 fSigmaVert(0),
40 fDist12toPrim(0),
41 fDist23toPrim(0)
42{
43 //
44 // Default Constructor
45 //
46}
47//--------------------------------------------------------------------------
48AliAODRecoDecayHF3Prong::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),
54 fSigmaVert(sigvert),
55 fDist12toPrim(dist12),
56 fDist23toPrim(dist23)
57{
58 //
59 // Constructor with AliAODVertex for decay vertex
60 //
6185d025 61 SetDCAs(3,dca);
3244eeed 62}
63//--------------------------------------------------------------------------
64AliAODRecoDecayHF3Prong::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),
69 fSigmaVert(sigvert),
70 fDist12toPrim(dist12),
71 fDist23toPrim(dist23)
72{
73 //
74 // Constructor with AliAODVertex for decay vertex and without prongs momenta
75 //
6185d025 76 SetDCAs(3,dca);
3244eeed 77}
78//--------------------------------------------------------------------------
79AliAODRecoDecayHF3Prong::AliAODRecoDecayHF3Prong(const AliAODRecoDecayHF3Prong &source) :
80 AliAODRecoDecayHF(source),
81 fSigmaVert(source.fSigmaVert),
82 fDist12toPrim(source.fDist12toPrim),
83 fDist23toPrim(source.fDist23toPrim)
84{
85 //
86 // Copy constructor
87 //
88}
89//--------------------------------------------------------------------------
90AliAODRecoDecayHF3Prong &AliAODRecoDecayHF3Prong::operator=(const AliAODRecoDecayHF3Prong &source)
91{
92 //
93 // assignment operator
94 //
95 if(&source == this) return *this;
dcb444c9 96
97 AliAODRecoDecayHF::operator=(source);
98
3244eeed 99 fDist12toPrim= source.fDist12toPrim;
100 fDist23toPrim= source.fDist23toPrim;
101 fSigmaVert= source.fSigmaVert;
dcb444c9 102
3244eeed 103 return *this;
104}
105//--------------------------------------------------------------------------
106Bool_t AliAODRecoDecayHF3Prong::SelectDplus(const Double_t *cuts)
107 const {
108//
109// This function compares the Dplus with a set of cuts:
110//
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)
123//
124// If candidate Dplus does not pass the cuts return kFALSE
125//
126
127 Double_t mDplusPDG = TDatabasePDG::Instance()->GetParticle(411)->Mass();
128 Double_t mDplus=InvMassDplus();
129 if(TMath::Abs(mDplus-mDplusPDG)>cuts[0])return kFALSE;
130 //single track
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
134
135 //DCA
81679460 136 for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
3244eeed 137
138 //2track cuts
139 if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
140 if(Getd0Prong(0)*Getd0Prong(1)<0. && Getd0Prong(2)*Getd0Prong(1)<0.)return kFALSE;
141
142 //sec vert
143 if(fSigmaVert>cuts[6])return kFALSE;
144
145 if(DecayLength()<cuts[7])return kFALSE;
146
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;
151 return kTRUE;
152}
79250a2b 153//--------------------------------------------------------------------------
9fce5365 154Bool_t AliAODRecoDecayHF3Prong::SelectDs(const Double_t *cuts,Int_t &okDsKKpi,Int_t &okDspiKK, Int_t &okMassPhi, Int_t &okMassK0star)
79250a2b 155 const {
156//
6ea608bf 157// This function compares the Ds with a set of cuts
158// (same variables as D+, for now)
79250a2b 159//
160// cuts[0] = inv. mass half width [GeV]
6ea608bf 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)
9fce5365 172// cuts[12] = max. inv. mass difference(Mphi-MKK) [GeV]
173// cuts[13] = max. inv. mass difference(MK0*-MKpi) [GeV]
79250a2b 174//
175// If candidate Ds does not pass the cuts return kFALSE
176//
177 Double_t mDsKKpi,mDspiKK;
178 okDsKKpi=1; okDspiKK=1;
9fce5365 179 okMassPhi=0; okMassK0star=0;
79250a2b 180
181 Double_t mDsPDG = TDatabasePDG::Instance()->GetParticle(431)->Mass();
182
183 mDsKKpi=InvMassDsKKpi();
184 mDspiKK=InvMassDspiKK();
185
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;
189
6ea608bf 190 //single track
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
81679460 193 if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion
6ea608bf 194
81679460 195 // cuts on resonant decays (via Phi or K0*)
81679460 196 Double_t mPhiPDG = TDatabasePDG::Instance()->GetParticle(333)->Mass();
9fce5365 197 Double_t mK0starPDG = TDatabasePDG::Instance()->GetParticle(313)->Mass();
198 if(okDsKKpi){
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;
204 }
205 if(okDspiKK){
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;
211 }
212 if(!okDsKKpi && !okDspiKK) return kFALSE;
213
214
215
81679460 216
6ea608bf 217 //DCA
81679460 218 for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
6ea608bf 219
220 //2track cuts
221 if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
6ea608bf 222
223 //sec vert
224 if(fSigmaVert>cuts[6])return kFALSE;
225
226 if(DecayLength()<cuts[7])return kFALSE;
227
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;
232
79250a2b 233 return kTRUE;
234}
235//--------------------------------------------------------------------------
236Bool_t AliAODRecoDecayHF3Prong::SelectLc(const Double_t *cuts,Int_t &okLcpKpi,Int_t &okLcpiKp)
237 const {
238//
6ea608bf 239// This function compares the Lc with a set of cuts
240// (same variables as D+, for now)
79250a2b 241//
242// cuts[0] = inv. mass half width [GeV]
6ea608bf 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)
79250a2b 254//
255// If candidate Lc does not pass the cuts return kFALSE
256//
257 Double_t mLcpKpi,mLcpiKp;
258 okLcpKpi=1; okLcpiKp=1;
259
260 Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
261
262 mLcpKpi=InvMassLcpKpi();
263 mLcpiKp=InvMassLcpiKp();
264
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;
268
6ea608bf 269 //single track
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
273
274 //DCA
81679460 275 for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
6ea608bf 276
277 //2track cuts
278 if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
279 if(Getd0Prong(0)*Getd0Prong(1)<0. && Getd0Prong(2)*Getd0Prong(1)<0.)return kFALSE;
280
281 //sec vert
282 if(fSigmaVert>cuts[6])return kFALSE;
283
284 if(DecayLength()<cuts[7])return kFALSE;
285
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;
290
79250a2b 291 return kTRUE;
292}
2e153422 293
294
295//----------------------------------------------------------------------
296Double_t AliAODRecoDecayHF3Prong::CosPiKPhiRFrame(Int_t option)
297const {
298 // computes cosine of angle between pi and K in the phi rest frame
299
300 Int_t indexPi;
301 Int_t indexK1;
302 Int_t indexK2;
303
304 if (option==0){ //KKpi
305 indexPi=2;
306 indexK1=0;
307 indexK2=1;
cbe0066f 308 }else{ //piKK
2e153422 309 indexPi=0;
310 indexK1=1;
311 indexK2=2;
312 }
313
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;
321
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();
327
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();
333
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);
338
339 return cosK1PhiFrame;
340
341}
342
343//----------------------------------------------------------------------
344Double_t AliAODRecoDecayHF3Prong::CosPiDsLabFrame(Int_t option)
345const {
346 // computes cosine of angle between pi and Ds in the Ds rest frame
347
348 Int_t indexPi;
2e153422 349
350 if (option==0){ //KKpi
351 indexPi=2;
cbe0066f 352 }else{ //piKK
2e153422 353 indexPi=0;
2e153422 354 }
355
356
357 Double_t bxD=Px()/E(431);
358 Double_t byD=Py()/E(431);
359 Double_t bzD=Pz()/E(431);
360
361 TVector3 piDsframe;
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();
366
367 TVector3 vecDs(Px(),Py(),Pz());
368
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);
373
374
375 return cosPiDsFrame;
376
377}
378
e0fb900a 379//----------------------------------------------------------------------
5ba83ee1 380Double_t AliAODRecoDecayHF3Prong::ComputeSigmaVert(const AliAODEvent* aod) const{
e0fb900a 381 // computes track dispersion around secondary vertex starting from tracks
382
383 AliVertexerTracks vertexer(aod->GetMagneticField());
384 Double_t pos[3],cov[6];
385 AliAODVertex* aodV=aod->GetPrimaryVertex();
386 aodV->GetXYZ(pos);
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);
393
394 for(Int_t iDau=0; iDau<GetNDaughters(); iDau++){
395 AliVTrack* at=(AliVTrack*)GetDaughter(iDau);
396 threeTrackArray.AddAt(new AliESDtrack(at),iDau);
397 }
398
399 AliESDVertex* secVert=vertexer.VertexForSelectedESDTracks(&threeTrackArray,kFALSE,kTRUE,kFALSE);
400 Double_t disp=secVert->GetDispersion();
401
402 threeTrackArray.Delete();
403 delete secVert;
404 return disp;
405
406}