]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/vertexingHF/AliAODRecoDecayHF3Prong.cxx
Adding Id to PWG3 classes for better tracking of the coverity defect fixes (Ivana)
[u/mrichter/AliRoot.git] / PWG3 / 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"
3244eeed 29
30ClassImp(AliAODRecoDecayHF3Prong)
31
32//--------------------------------------------------------------------------
33AliAODRecoDecayHF3Prong::AliAODRecoDecayHF3Prong() :
34 AliAODRecoDecayHF(),
35 fSigmaVert(0),
36 fDist12toPrim(0),
37 fDist23toPrim(0)
38{
39 //
40 // Default Constructor
41 //
42}
43//--------------------------------------------------------------------------
44AliAODRecoDecayHF3Prong::AliAODRecoDecayHF3Prong(AliAODVertex *vtx2,
45 Double_t *px,Double_t *py,Double_t *pz,
46 Double_t *d0,Double_t *d0err,
47 Double_t *dca, Double_t sigvert,
48 Double_t dist12,Double_t dist23,Short_t charge) :
49 AliAODRecoDecayHF(vtx2,3,charge,px,py,pz,d0,d0err),
50 fSigmaVert(sigvert),
51 fDist12toPrim(dist12),
52 fDist23toPrim(dist23)
53{
54 //
55 // Constructor with AliAODVertex for decay vertex
56 //
6185d025 57 SetDCAs(3,dca);
3244eeed 58}
59//--------------------------------------------------------------------------
60AliAODRecoDecayHF3Prong::AliAODRecoDecayHF3Prong(AliAODVertex *vtx2,
61 Double_t *d0,Double_t *d0err,
62 Double_t *dca, Double_t sigvert,
63 Double_t dist12,Double_t dist23, Short_t charge) :
64 AliAODRecoDecayHF(vtx2,3,charge,d0,d0err),
65 fSigmaVert(sigvert),
66 fDist12toPrim(dist12),
67 fDist23toPrim(dist23)
68{
69 //
70 // Constructor with AliAODVertex for decay vertex and without prongs momenta
71 //
6185d025 72 SetDCAs(3,dca);
3244eeed 73}
74//--------------------------------------------------------------------------
75AliAODRecoDecayHF3Prong::AliAODRecoDecayHF3Prong(const AliAODRecoDecayHF3Prong &source) :
76 AliAODRecoDecayHF(source),
77 fSigmaVert(source.fSigmaVert),
78 fDist12toPrim(source.fDist12toPrim),
79 fDist23toPrim(source.fDist23toPrim)
80{
81 //
82 // Copy constructor
83 //
84}
85//--------------------------------------------------------------------------
86AliAODRecoDecayHF3Prong &AliAODRecoDecayHF3Prong::operator=(const AliAODRecoDecayHF3Prong &source)
87{
88 //
89 // assignment operator
90 //
91 if(&source == this) return *this;
dcb444c9 92
93 AliAODRecoDecayHF::operator=(source);
94
3244eeed 95 fDist12toPrim= source.fDist12toPrim;
96 fDist23toPrim= source.fDist23toPrim;
97 fSigmaVert= source.fSigmaVert;
dcb444c9 98
3244eeed 99 return *this;
100}
16156b6d 101//-------------Temporary fix: overload AliAODRecoDecay::Charge()-----------
102Short_t AliAODRecoDecayHF3Prong::Charge() const {
103 Short_t charge=0;
104 for(Int_t daught=0;daught<=2;daught++)charge=charge+((AliAODTrack*)GetDaughter(daught))->Charge();
105 return charge;
106}
3244eeed 107//--------------------------------------------------------------------------
108Bool_t AliAODRecoDecayHF3Prong::SelectDplus(const Double_t *cuts)
109 const {
110//
111// This function compares the Dplus with a set of cuts:
112//
113// cuts[0] = inv. mass half width [GeV]
114// cuts[1] = pTK [GeV/c]
115// cuts[2] = pTPi [GeV/c]
116// cuts[3] = d0K [cm] lower limit!
117// cuts[4] = d0Pi [cm] lower limit!
118// cuts[5] = dist12 (cm)
119// cuts[6] = sigmavert (cm)
120// cuts[7] = dist prim-sec (cm)
121// cuts[8] = pM=Max{pT1,pT2,pT3} (GeV/c)
122// cuts[9] = cosThetaPoint
123// cuts[10] = Sum d0^2 (cm^2)
124// cuts[11] = dca cut (cm)
125//
126// If candidate Dplus does not pass the cuts return kFALSE
127//
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
81679460 138 for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
3244eeed 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}
79250a2b 155//--------------------------------------------------------------------------
9fce5365 156Bool_t AliAODRecoDecayHF3Prong::SelectDs(const Double_t *cuts,Int_t &okDsKKpi,Int_t &okDspiKK, Int_t &okMassPhi, Int_t &okMassK0star)
79250a2b 157 const {
158//
6ea608bf 159// This function compares the Ds with a set of cuts
160// (same variables as D+, for now)
79250a2b 161//
162// cuts[0] = inv. mass half width [GeV]
6ea608bf 163// cuts[1] = pTK [GeV/c]
164// cuts[2] = pTPi [GeV/c]
165// cuts[3] = d0K [cm] lower limit!
166// cuts[4] = d0Pi [cm] lower limit!
167// cuts[5] = dist12 (cm)
168// cuts[6] = sigmavert (cm)
169// cuts[7] = dist prim-sec (cm)
170// cuts[8] = pM=Max{pT1,pT2,pT3} (GeV/c)
171// cuts[9] = cosThetaPoint
172// cuts[10] = Sum d0^2 (cm^2)
173// cuts[11] = dca cut (cm)
9fce5365 174// cuts[12] = max. inv. mass difference(Mphi-MKK) [GeV]
175// cuts[13] = max. inv. mass difference(MK0*-MKpi) [GeV]
79250a2b 176//
177// If candidate Ds does not pass the cuts return kFALSE
178//
179 Double_t mDsKKpi,mDspiKK;
180 okDsKKpi=1; okDspiKK=1;
9fce5365 181 okMassPhi=0; okMassK0star=0;
79250a2b 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
6ea608bf 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
81679460 195 if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion
6ea608bf 196
81679460 197 // cuts on resonant decays (via Phi or K0*)
81679460 198 Double_t mPhiPDG = TDatabasePDG::Instance()->GetParticle(333)->Mass();
9fce5365 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
81679460 218
6ea608bf 219 //DCA
81679460 220 for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
6ea608bf 221
222 //2track cuts
223 if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
6ea608bf 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
79250a2b 235 return kTRUE;
236}
237//--------------------------------------------------------------------------
238Bool_t AliAODRecoDecayHF3Prong::SelectLc(const Double_t *cuts,Int_t &okLcpKpi,Int_t &okLcpiKp)
239 const {
240//
6ea608bf 241// This function compares the Lc with a set of cuts
242// (same variables as D+, for now)
79250a2b 243//
244// cuts[0] = inv. mass half width [GeV]
6ea608bf 245// cuts[1] = pTP [GeV/c]
246// cuts[2] = pTPi and pTK [GeV/c]
247// cuts[3] = d0P [cm] lower limit!
248// cuts[4] = d0Pi and d0K [cm] lower limit!
249// cuts[5] = dist12 (cm)
250// cuts[6] = sigmavert (cm)
251// cuts[7] = dist prim-sec (cm)
252// cuts[8] = pM=Max{pT1,pT2,pT3} (GeV/c)
253// cuts[9] = cosThetaPoint
254// cuts[10] = Sum d0^2 (cm^2)
255// cuts[11] = dca cut (cm)
79250a2b 256//
257// If candidate Lc does not pass the cuts return kFALSE
258//
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
6ea608bf 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
81679460 277 for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
6ea608bf 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
79250a2b 293 return kTRUE;
294}