AliPhysics  96866e8 (96866e8)
AliAODRecoDecayHF3Prong.cxx
Go to the documentation of this file.
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 
16 /* $Id$ */
17 
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
24 
25 #include <TDatabasePDG.h>
26 #include "AliAODRecoDecayHF.h"
28 #include "AliAODTrack.h"
29 #include "AliESDtrack.h"
30 #include "AliVertexerTracks.h"
31 #include "TVector3.h"
32 #include "TLorentzVector.h"
33 
35 ClassImp(AliAODRecoDecayHF3Prong);
37 
38 //--------------------------------------------------------------------------
41  fSigmaVert(0),
42  fDist12toPrim(0),
43  fDist23toPrim(0)
44 {
45  //
47  //
48 }
49 //--------------------------------------------------------------------------
51  Double_t *px,Double_t *py,Double_t *pz,
52  Double_t *d0,Double_t *d0err,
53  Double_t *dca, Double_t sigvert,
54  Double_t dist12,Double_t dist23,Short_t charge) :
55  AliAODRecoDecayHF(vtx2,3,charge,px,py,pz,d0,d0err),
56  fSigmaVert(sigvert),
57  fDist12toPrim(dist12),
58  fDist23toPrim(dist23)
59 {
60  //
62  //
63  SetDCAs(3,dca);
64 }
65 //--------------------------------------------------------------------------
67  Double_t *d0,Double_t *d0err,
68  Double_t *dca, Double_t sigvert,
69  Double_t dist12,Double_t dist23, Short_t charge) :
70  AliAODRecoDecayHF(vtx2,3,charge,d0,d0err),
71  fSigmaVert(sigvert),
72  fDist12toPrim(dist12),
73  fDist23toPrim(dist23)
74 {
75  //
77  //
78  SetDCAs(3,dca);
79 }
80 //--------------------------------------------------------------------------
82  AliAODRecoDecayHF(source),
83  fSigmaVert(source.fSigmaVert),
86 {
87  //
89  //
90 }
91 //--------------------------------------------------------------------------
93 {
94  //
96  //
97  if(&source == this) return *this;
98 
100 
103  fSigmaVert= source.fSigmaVert;
104 
105  return *this;
106 }
107 //--------------------------------------------------------------------------
109  const {
128 
129  Double_t mDplusPDG = TDatabasePDG::Instance()->GetParticle(411)->Mass();
130  Double_t mDplus=InvMassDplus();
131  if(TMath::Abs(mDplus-mDplusPDG)>cuts[0])return kFALSE;
132  //single track
133  if(TMath::Abs(PtProng(1)) < cuts[1] || TMath::Abs(Getd0Prong(1))<cuts[3])return kFALSE;//Kaon
134  if(TMath::Abs(PtProng(0)) < cuts[2] || TMath::Abs(Getd0Prong(0))<cuts[4])return kFALSE;//Pion1
135  if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion2
136 
137  //DCA
138  for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
139 
140  //2track cuts
141  if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
142  if(Getd0Prong(0)*Getd0Prong(1)<0. && Getd0Prong(2)*Getd0Prong(1)<0.)return kFALSE;
143 
144  //sec vert
145  if(fSigmaVert>cuts[6])return kFALSE;
146 
147  if(DecayLength()<cuts[7])return kFALSE;
148 
149  if(TMath::Abs(PtProng(0))<cuts[8] && TMath::Abs(PtProng(1))<cuts[8] && TMath::Abs(PtProng(2))<cuts[8])return kFALSE;
150  if(CosPointingAngle() < cuts[9])return kFALSE;
151  Double_t sum2=Getd0Prong(0)*Getd0Prong(0)+Getd0Prong(1)*Getd0Prong(1)+Getd0Prong(2)*Getd0Prong(2);
152  if(sum2<cuts[10])return kFALSE;
153  return kTRUE;
154 }
155 //--------------------------------------------------------------------------
156 Bool_t AliAODRecoDecayHF3Prong::SelectDs(const Double_t *cuts,Int_t &okDsKKpi,Int_t &okDspiKK, Int_t &okMassPhi, Int_t &okMassK0star)
157  const {
179  Double_t mDsKKpi,mDspiKK;
180  okDsKKpi=1; okDspiKK=1;
181  okMassPhi=0; okMassK0star=0;
182 
183  Double_t mDsPDG = TDatabasePDG::Instance()->GetParticle(431)->Mass();
184 
185  mDsKKpi=InvMassDsKKpi();
186  mDspiKK=InvMassDspiKK();
187 
188  if(TMath::Abs(mDsKKpi-mDsPDG)>cuts[0]) okDsKKpi = 0;
189  if(TMath::Abs(mDspiKK-mDsPDG)>cuts[0]) okDspiKK = 0;
190  if(!okDsKKpi && !okDspiKK) return kFALSE;
191 
192  //single track
193  if(TMath::Abs(PtProng(0)) < cuts[1] || TMath::Abs(Getd0Prong(0))<cuts[3])return kFALSE;//Kaon1
194  if(TMath::Abs(PtProng(1)) < cuts[1] || TMath::Abs(Getd0Prong(1))<cuts[3])return kFALSE;//Kaon2
195  if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion
196 
197  // cuts on resonant decays (via Phi or K0*)
198  Double_t mPhiPDG = TDatabasePDG::Instance()->GetParticle(333)->Mass();
199  Double_t mK0starPDG = TDatabasePDG::Instance()->GetParticle(313)->Mass();
200  if(okDsKKpi){
201  Double_t mass01phi=InvMass2Prongs(0,1,321,321);
202  Double_t mass12K0s=InvMass2Prongs(1,2,321,211);
203  if(TMath::Abs(mass01phi-mPhiPDG)<cuts[12]) okMassPhi=1;
204  if(TMath::Abs(mass12K0s-mK0starPDG)<cuts[13]) okMassK0star = 1;
205  if(!okMassPhi && !okMassK0star) okDsKKpi=kFALSE;
206  }
207  if(okDspiKK){
208  Double_t mass01K0s=InvMass2Prongs(0,1,211,321);
209  Double_t mass12phi=InvMass2Prongs(1,2,321,321);
210  if(TMath::Abs(mass01K0s-mK0starPDG)<cuts[13]) okMassK0star = 1;
211  if(TMath::Abs(mass12phi-mPhiPDG)<cuts[12]) okMassPhi=1;
212  if(!okMassPhi && !okMassK0star) okDspiKK=kFALSE;
213  }
214  if(!okDsKKpi && !okDspiKK) return kFALSE;
215 
216 
217 
218 
219  //DCA
220  for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
221 
222  //2track cuts
223  if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
224 
225  //sec vert
226  if(fSigmaVert>cuts[6])return kFALSE;
227 
228  if(DecayLength()<cuts[7])return kFALSE;
229 
230  if(TMath::Abs(PtProng(0))<cuts[8] && TMath::Abs(PtProng(1))<cuts[8] && TMath::Abs(PtProng(2))<cuts[8])return kFALSE;
231  if(CosPointingAngle() < cuts[9])return kFALSE;
232  Double_t sum2=Getd0Prong(0)*Getd0Prong(0)+Getd0Prong(1)*Getd0Prong(1)+Getd0Prong(2)*Getd0Prong(2);
233  if(sum2<cuts[10])return kFALSE;
234 
235  return kTRUE;
236 }
237 //--------------------------------------------------------------------------
239  const {
259  Double_t mLcpKpi,mLcpiKp;
260  okLcpKpi=1; okLcpiKp=1;
261 
262  Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
263 
264  mLcpKpi=InvMassLcpKpi();
265  mLcpiKp=InvMassLcpiKp();
266 
267  if(TMath::Abs(mLcpKpi-mLcPDG)>cuts[0]) okLcpKpi = 0;
268  if(TMath::Abs(mLcpiKp-mLcPDG)>cuts[0]) okLcpiKp = 0;
269  if(!okLcpKpi && !okLcpiKp) return kFALSE;
270 
271  //single track
272  if(TMath::Abs(PtProng(0)) < cuts[1] || TMath::Abs(Getd0Prong(0))<cuts[3])return kFALSE;//Proton
273  if(TMath::Abs(PtProng(1)) < cuts[2] || TMath::Abs(Getd0Prong(1))<cuts[4])return kFALSE;//Kaon
274  if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion
275 
276  //DCA
277  for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
278 
279  //2track cuts
280  if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
281  if(Getd0Prong(0)*Getd0Prong(1)<0. && Getd0Prong(2)*Getd0Prong(1)<0.)return kFALSE;
282 
283  //sec vert
284  if(fSigmaVert>cuts[6])return kFALSE;
285 
286  if(DecayLength()<cuts[7])return kFALSE;
287 
288  if(TMath::Abs(PtProng(0))<cuts[8] && TMath::Abs(PtProng(1))<cuts[8] && TMath::Abs(PtProng(2))<cuts[8])return kFALSE;
289  if(CosPointingAngle() < cuts[9])return kFALSE;
290  Double_t sum2=Getd0Prong(0)*Getd0Prong(0)+Getd0Prong(1)*Getd0Prong(1)+Getd0Prong(2)*Getd0Prong(2);
291  if(sum2<cuts[10])return kFALSE;
292 
293  return kTRUE;
294 }
295 
296 
297 //----------------------------------------------------------------------
299 const {
301 
302  Int_t indexPi;
303  Int_t indexK1;
304  Int_t indexK2;
305 
306  if (option==0){ //KKpi
307  indexPi=2;
308  indexK1=0;
309  indexK2=1;
310  }else if (option==1){ //piKK
311  indexPi=0;
312  indexK1=1;
313  indexK2=2;
314  }else{ //KpiK
315  indexPi=1;
316  indexK1=0;
317  indexK2=2;
318  }
319 
320  Double_t ePhi=EProng(indexK1,321)+EProng(indexK2,321);
321  Double_t pxPhi=PxProng(indexK1)+PxProng(indexK2);
322  Double_t pyPhi=PyProng(indexK1)+PyProng(indexK2);
323  Double_t pzPhi=PzProng(indexK1)+PzProng(indexK2);
324  Double_t bxPhi=pxPhi/ePhi;
325  Double_t byPhi=pyPhi/ePhi;
326  Double_t bzPhi=pzPhi/ePhi;
327 
328  TVector3 vecK1Phiframe;
329  TLorentzVector vecK1(PxProng(indexK1),PyProng(indexK1),PzProng(indexK1),EProng(indexK1,321));
330  vecK1.Boost(-bxPhi,-byPhi,-bzPhi);
331  vecK1.Boost(vecK1Phiframe);
332  vecK1Phiframe=vecK1.BoostVector();
333 
334  TVector3 vecPiPhiframe;
335  TLorentzVector vecPi(PxProng(indexPi),PyProng(indexPi),PzProng(indexPi),EProng(indexPi,211));
336  vecPi.Boost(-bxPhi,-byPhi,-bzPhi);
337  vecPi.Boost(vecPiPhiframe);
338  vecPiPhiframe=vecPi.BoostVector();
339 
340  Double_t innera=vecPiPhiframe.Dot(vecK1Phiframe);
341  Double_t norm1a=TMath::Sqrt(vecPiPhiframe.Dot(vecPiPhiframe));
342  Double_t norm2a=TMath::Sqrt(vecK1Phiframe.Dot(vecK1Phiframe));
343  Double_t cosK1PhiFrame=innera/(norm1a*norm2a);
344 
345  return cosK1PhiFrame;
346 
347 }
348 
349 //----------------------------------------------------------------------
351 const {
353 
354  Int_t indexPi;
355 
356  if (option==0){ //KKpi
357  indexPi=2;
358  }else if (option==1){//piKK
359  indexPi=0;
360  }else{ //KpiK
361  indexPi=1;
362  }
363 
364 
365  Double_t bxD=Px()/E(431);
366  Double_t byD=Py()/E(431);
367  Double_t bzD=Pz()/E(431);
368 
369  TVector3 piDsframe;
370  TLorentzVector vecPi(PxProng(indexPi),PyProng(indexPi),PzProng(indexPi),EProng(indexPi,211));
371  vecPi.Boost(-bxD,-byD,-bzD);
372  vecPi.Boost(piDsframe);
373  piDsframe=vecPi.BoostVector();
374 
375  TVector3 vecDs(Px(),Py(),Pz());
376 
377  Double_t inner=vecDs.Dot(piDsframe);
378  Double_t norm1=TMath::Sqrt(vecDs.Dot(vecDs));
379  Double_t norm2=TMath::Sqrt(piDsframe.Dot(piDsframe));
380  Double_t cosPiDsFrame=inner/(norm1*norm2);
381 
382 
383  return cosPiDsFrame;
384 
385 }
386 
387 //----------------------------------------------------------------------
390 
391  AliVertexerTracks vertexer(aod->GetMagneticField());
392  Double_t pos[3],cov[6];
393  AliAODVertex* aodV=aod->GetPrimaryVertex();
394  aodV->GetXYZ(pos);
395  aodV->GetCovarianceMatrix(cov);
396  Double_t chi2=aodV->GetChi2();
397  Int_t nC=aodV->GetNContributors();
398  AliESDVertex vprim(pos,cov,chi2,nC);
399  vertexer.SetVtxStart(&vprim);
400  TObjArray threeTrackArray(3);
401 
402  for(Int_t iDau=0; iDau<GetNDaughters(); iDau++){
403  AliVTrack* at=(AliVTrack*)GetDaughter(iDau);
404  threeTrackArray.AddAt(new AliESDtrack(at),iDau);
405  }
406 
407  AliESDVertex* secVert=vertexer.VertexForSelectedESDTracks(&threeTrackArray,kFALSE,kTRUE,kFALSE);
408  Double_t disp=secVert->GetDispersion();
409 
410  threeTrackArray.Delete();
411  delete secVert;
412  return disp;
413 
414 }
415 //--------------------------------------------------------------------------
417  //Delete data member to reduce size of AliAOD.VertexingHF.root
418  //They will be recomputed at the analysis level
419  AliAODRecoDecayHF::DeleteRecoD();//delete data members of AliAODRecoDecayHF
420  if(fSigmaVert) fSigmaVert =0.;
421 }
Int_t charge
AliAODRecoDecayHF & operator=(const AliAODRecoDecayHF &source)
double Double_t
Definition: External.C:58
Double_t CosPiDsLabFrame(Int_t option) const
Bool_t SelectLc(const Double_t *cuts, Int_t &okLcpKpi, Int_t &okLcpiKp) const
Double_t fDist23toPrim
distance prim vert - 2 opposite sign track vertex
virtual void DeleteRecoD()
Double_t fDist12toPrim
track dispersion around the secondary vertex
int Int_t
Definition: External.C:63
Bool_t SelectDs(const Double_t *cuts, Int_t &okDsKKpi, Int_t &okDspiKK, Int_t &okMassPhi, Int_t &okMassK0star) const
Double_t ComputeSigmaVert(const AliAODEvent *aod) const
short Short_t
Definition: External.C:23
Bool_t SelectDplus(const Double_t *cuts) const
Double_t CosPiKPhiRFrame(Int_t option) const
AliAODRecoDecayHF3Prong & operator=(const AliAODRecoDecayHF3Prong &source)
bool Bool_t
Definition: External.C:53
Double_t CosPointingAngle() const
Double_t DecayLength() const