]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/vertexingHF/AliAODRecoDecayHF3Prong.cxx
avoiding gcc 4.3 warnings by defining void function pointers instead of void pointers...
[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
16/////////////////////////////////////////////////////////////
17//
18// Base class for AOD reconstructed heavy-flavour 3-prong decay
19//
20// Author: E.Bruna bruna@to.infn.it, F.Prino prino@to.infn.it
21/////////////////////////////////////////////////////////////
22
23#include <TDatabasePDG.h>
24#include "AliAODRecoDecayHF.h"
25#include "AliAODRecoDecayHF3Prong.h"
26
27ClassImp(AliAODRecoDecayHF3Prong)
28
29//--------------------------------------------------------------------------
30AliAODRecoDecayHF3Prong::AliAODRecoDecayHF3Prong() :
31 AliAODRecoDecayHF(),
32 fSigmaVert(0),
33 fDist12toPrim(0),
34 fDist23toPrim(0)
35{
36 //
37 // Default Constructor
38 //
39}
40//--------------------------------------------------------------------------
41AliAODRecoDecayHF3Prong::AliAODRecoDecayHF3Prong(AliAODVertex *vtx2,
42 Double_t *px,Double_t *py,Double_t *pz,
43 Double_t *d0,Double_t *d0err,
44 Double_t *dca, Double_t sigvert,
45 Double_t dist12,Double_t dist23,Short_t charge) :
46 AliAODRecoDecayHF(vtx2,3,charge,px,py,pz,d0,d0err),
47 fSigmaVert(sigvert),
48 fDist12toPrim(dist12),
49 fDist23toPrim(dist23)
50{
51 //
52 // Constructor with AliAODVertex for decay vertex
53 //
6185d025 54 SetDCAs(3,dca);
3244eeed 55}
56//--------------------------------------------------------------------------
57AliAODRecoDecayHF3Prong::AliAODRecoDecayHF3Prong(AliAODVertex *vtx2,
58 Double_t *d0,Double_t *d0err,
59 Double_t *dca, Double_t sigvert,
60 Double_t dist12,Double_t dist23, Short_t charge) :
61 AliAODRecoDecayHF(vtx2,3,charge,d0,d0err),
62 fSigmaVert(sigvert),
63 fDist12toPrim(dist12),
64 fDist23toPrim(dist23)
65{
66 //
67 // Constructor with AliAODVertex for decay vertex and without prongs momenta
68 //
6185d025 69 SetDCAs(3,dca);
3244eeed 70}
71//--------------------------------------------------------------------------
72AliAODRecoDecayHF3Prong::AliAODRecoDecayHF3Prong(const AliAODRecoDecayHF3Prong &source) :
73 AliAODRecoDecayHF(source),
74 fSigmaVert(source.fSigmaVert),
75 fDist12toPrim(source.fDist12toPrim),
76 fDist23toPrim(source.fDist23toPrim)
77{
78 //
79 // Copy constructor
80 //
81}
82//--------------------------------------------------------------------------
83AliAODRecoDecayHF3Prong &AliAODRecoDecayHF3Prong::operator=(const AliAODRecoDecayHF3Prong &source)
84{
85 //
86 // assignment operator
87 //
88 if(&source == this) return *this;
89 fOwnPrimaryVtx = source.fOwnPrimaryVtx;
90 fSecondaryVtx = source.fSecondaryVtx;
91 fCharge = source.fCharge;
92 fNProngs = source.fNProngs;
93 fNDCA = source.fNDCA;
94 fNPID = source.fNPID;
95 fEventNumber = source.fEventNumber;
96 fRunNumber = source.fRunNumber;
97 fDist12toPrim= source.fDist12toPrim;
98 fDist23toPrim= source.fDist23toPrim;
99 fSigmaVert= source.fSigmaVert;
100 if(source.GetNProngs()>0) {
101 fd0 = new Double_t[GetNProngs()];
102 fd0err = new Double_t[GetNProngs()];
103 memcpy(fd0,source.fd0,GetNProngs()*sizeof(Double_t));
104 memcpy(fd0err,source.fd0err,GetNProngs()*sizeof(Double_t));
105 if(source.fPx) {
106 fPx = new Double_t[GetNProngs()];
107 fPy = new Double_t[GetNProngs()];
108 fPz = new Double_t[GetNProngs()];
109 memcpy(fPx,source.fPx,GetNProngs()*sizeof(Double_t));
110 memcpy(fPy,source.fPy,GetNProngs()*sizeof(Double_t));
111 memcpy(fPz,source.fPz,GetNProngs()*sizeof(Double_t));
112 }
113 if(source.fPID) {
114 fPID = new Double_t[5*GetNProngs()];
115 memcpy(fPID,source.fPID,GetNProngs()*sizeof(Double_t));
116 }
117 if(source.fDCA) {
057c80d4 118 fDCA = new Double32_t[GetNProngs()*(GetNProngs()-1)/2];
3244eeed 119 memcpy(fDCA,source.fDCA,(GetNProngs()*(GetNProngs()-1)/2)*sizeof(Float_t));
120 }
6185d025 121 if(source.fProngID) {
122 fProngID = new UShort_t[GetNProngs()];
123 memcpy(fProngID,source.fProngID,GetNProngs()*sizeof(UShort_t));
124 }
3244eeed 125 }
126 return *this;
127}
128//--------------------------------------------------------------------------
129Bool_t AliAODRecoDecayHF3Prong::SelectDplus(const Double_t *cuts)
130 const {
131//
132// This function compares the Dplus with a set of cuts:
133//
134// cuts[0] = inv. mass half width [GeV]
135// cuts[1] = pTK [GeV/c]
136// cuts[2] = pTPi [GeV/c]
137// cuts[3] = d0K [cm] lower limit!
138// cuts[4] = d0Pi [cm] lower limit!
139// cuts[5] = dist12 (cm)
140// cuts[6] = sigmavert (cm)
141// cuts[7] = dist prim-sec (cm)
142// cuts[8] = pM=Max{pT1,pT2,pT3} (GeV/c)
143// cuts[9] = cosThetaPoint
144// cuts[10] = Sum d0^2 (cm^2)
145// cuts[11] = dca cut (cm)
146//
147// If candidate Dplus does not pass the cuts return kFALSE
148//
149
150 Double_t mDplusPDG = TDatabasePDG::Instance()->GetParticle(411)->Mass();
151 Double_t mDplus=InvMassDplus();
152 if(TMath::Abs(mDplus-mDplusPDG)>cuts[0])return kFALSE;
153 //single track
154 if(TMath::Abs(PtProng(1)) < cuts[1] || TMath::Abs(Getd0Prong(1))<cuts[3])return kFALSE;//Kaon
155 if(TMath::Abs(PtProng(0)) < cuts[2] || TMath::Abs(Getd0Prong(0))<cuts[4])return kFALSE;//Pion1
156 if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion2
157
158 //DCA
81679460 159 for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
3244eeed 160
161 //2track cuts
162 if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
163 if(Getd0Prong(0)*Getd0Prong(1)<0. && Getd0Prong(2)*Getd0Prong(1)<0.)return kFALSE;
164
165 //sec vert
166 if(fSigmaVert>cuts[6])return kFALSE;
167
168 if(DecayLength()<cuts[7])return kFALSE;
169
170 if(TMath::Abs(PtProng(0))<cuts[8] && TMath::Abs(PtProng(1))<cuts[8] && TMath::Abs(PtProng(2))<cuts[8])return kFALSE;
171 if(CosPointingAngle() < cuts[9])return kFALSE;
172 Double_t sum2=Getd0Prong(0)*Getd0Prong(0)+Getd0Prong(1)*Getd0Prong(1)+Getd0Prong(2)*Getd0Prong(2);
173 if(sum2<cuts[10])return kFALSE;
174 return kTRUE;
175}
79250a2b 176//--------------------------------------------------------------------------
177Bool_t AliAODRecoDecayHF3Prong::SelectDs(const Double_t *cuts,Int_t &okDsKKpi,Int_t &okDspiKK)
178 const {
179//
6ea608bf 180// This function compares the Ds with a set of cuts
181// (same variables as D+, for now)
79250a2b 182//
183// cuts[0] = inv. mass half width [GeV]
6ea608bf 184// cuts[1] = pTK [GeV/c]
185// cuts[2] = pTPi [GeV/c]
186// cuts[3] = d0K [cm] lower limit!
187// cuts[4] = d0Pi [cm] lower limit!
188// cuts[5] = dist12 (cm)
189// cuts[6] = sigmavert (cm)
190// cuts[7] = dist prim-sec (cm)
191// cuts[8] = pM=Max{pT1,pT2,pT3} (GeV/c)
192// cuts[9] = cosThetaPoint
193// cuts[10] = Sum d0^2 (cm^2)
194// cuts[11] = dca cut (cm)
81679460 195// cuts[12] = max. inv. mass difference(Mphi-MKK and MK0*-MKpi) [GeV]
79250a2b 196//
197// If candidate Ds does not pass the cuts return kFALSE
198//
199 Double_t mDsKKpi,mDspiKK;
200 okDsKKpi=1; okDspiKK=1;
201
202 Double_t mDsPDG = TDatabasePDG::Instance()->GetParticle(431)->Mass();
203
204 mDsKKpi=InvMassDsKKpi();
205 mDspiKK=InvMassDspiKK();
206
207 if(TMath::Abs(mDsKKpi-mDsPDG)>cuts[0]) okDsKKpi = 0;
208 if(TMath::Abs(mDspiKK-mDsPDG)>cuts[0]) okDspiKK = 0;
209 if(!okDsKKpi && !okDspiKK) return kFALSE;
210
6ea608bf 211 //single track
212 if(TMath::Abs(PtProng(0)) < cuts[1] || TMath::Abs(Getd0Prong(0))<cuts[3])return kFALSE;//Kaon1
213 if(TMath::Abs(PtProng(1)) < cuts[1] || TMath::Abs(Getd0Prong(1))<cuts[3])return kFALSE;//Kaon2
81679460 214 if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion
6ea608bf 215
81679460 216 // cuts on resonant decays (via Phi or K0*)
217 Bool_t okMassPhi=1;
218 Double_t mass01phi=InvMass2Prongs(0,1,321,321);
219 Double_t mass12phi=InvMass2Prongs(1,2,321,321);
220 Double_t mPhiPDG = TDatabasePDG::Instance()->GetParticle(333)->Mass();
221 if(TMath::Abs(mass01phi-mPhiPDG)>cuts[12] && TMath::Abs(mass12phi-mPhiPDG)>cuts[12]) okMassPhi = 0;
222 Bool_t okMassK0star=1;
223 Double_t mass01K0s=InvMass2Prongs(0,1,211,321);
224 Double_t mass12K0s=InvMass2Prongs(1,2,321,211);
225 Double_t mK0sPDG = TDatabasePDG::Instance()->GetParticle(313)->Mass();
226 if(TMath::Abs(mass01K0s-mK0sPDG)>cuts[12] && TMath::Abs(mass12K0s-mK0sPDG)>cuts[12]) okMassK0star = 0;
227 if(!okMassPhi && !okMassK0star) return kFALSE;
228
6ea608bf 229 //DCA
81679460 230 for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
6ea608bf 231
232 //2track cuts
233 if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
6ea608bf 234
235 //sec vert
236 if(fSigmaVert>cuts[6])return kFALSE;
237
238 if(DecayLength()<cuts[7])return kFALSE;
239
240 if(TMath::Abs(PtProng(0))<cuts[8] && TMath::Abs(PtProng(1))<cuts[8] && TMath::Abs(PtProng(2))<cuts[8])return kFALSE;
241 if(CosPointingAngle() < cuts[9])return kFALSE;
242 Double_t sum2=Getd0Prong(0)*Getd0Prong(0)+Getd0Prong(1)*Getd0Prong(1)+Getd0Prong(2)*Getd0Prong(2);
243 if(sum2<cuts[10])return kFALSE;
244
79250a2b 245 return kTRUE;
246}
247//--------------------------------------------------------------------------
248Bool_t AliAODRecoDecayHF3Prong::SelectLc(const Double_t *cuts,Int_t &okLcpKpi,Int_t &okLcpiKp)
249 const {
250//
6ea608bf 251// This function compares the Lc with a set of cuts
252// (same variables as D+, for now)
79250a2b 253//
254// cuts[0] = inv. mass half width [GeV]
6ea608bf 255// cuts[1] = pTP [GeV/c]
256// cuts[2] = pTPi and pTK [GeV/c]
257// cuts[3] = d0P [cm] lower limit!
258// cuts[4] = d0Pi and d0K [cm] lower limit!
259// cuts[5] = dist12 (cm)
260// cuts[6] = sigmavert (cm)
261// cuts[7] = dist prim-sec (cm)
262// cuts[8] = pM=Max{pT1,pT2,pT3} (GeV/c)
263// cuts[9] = cosThetaPoint
264// cuts[10] = Sum d0^2 (cm^2)
265// cuts[11] = dca cut (cm)
79250a2b 266//
267// If candidate Lc does not pass the cuts return kFALSE
268//
269 Double_t mLcpKpi,mLcpiKp;
270 okLcpKpi=1; okLcpiKp=1;
271
272 Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
273
274 mLcpKpi=InvMassLcpKpi();
275 mLcpiKp=InvMassLcpiKp();
276
277 if(TMath::Abs(mLcpKpi-mLcPDG)>cuts[0]) okLcpKpi = 0;
278 if(TMath::Abs(mLcpiKp-mLcPDG)>cuts[0]) okLcpiKp = 0;
279 if(!okLcpKpi && !okLcpiKp) return kFALSE;
280
6ea608bf 281 //single track
282 if(TMath::Abs(PtProng(0)) < cuts[1] || TMath::Abs(Getd0Prong(0))<cuts[3])return kFALSE;//Proton
283 if(TMath::Abs(PtProng(1)) < cuts[2] || TMath::Abs(Getd0Prong(1))<cuts[4])return kFALSE;//Kaon
284 if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion
285
286 //DCA
81679460 287 for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
6ea608bf 288
289 //2track cuts
290 if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
291 if(Getd0Prong(0)*Getd0Prong(1)<0. && Getd0Prong(2)*Getd0Prong(1)<0.)return kFALSE;
292
293 //sec vert
294 if(fSigmaVert>cuts[6])return kFALSE;
295
296 if(DecayLength()<cuts[7])return kFALSE;
297
298 if(TMath::Abs(PtProng(0))<cuts[8] && TMath::Abs(PtProng(1))<cuts[8] && TMath::Abs(PtProng(2))<cuts[8])return kFALSE;
299 if(CosPointingAngle() < cuts[9])return kFALSE;
300 Double_t sum2=Getd0Prong(0)*Getd0Prong(0)+Getd0Prong(1)*Getd0Prong(1)+Getd0Prong(2)*Getd0Prong(2);
301 if(sum2<cuts[10])return kFALSE;
302
79250a2b 303 return kTRUE;
304}