]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/vertexingHF/AliAODRecoDecayHF3Prong.cxx
Added like-sign 3Prong
[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;
dcb444c9 89
90 AliAODRecoDecayHF::operator=(source);
91
3244eeed 92 fDist12toPrim= source.fDist12toPrim;
93 fDist23toPrim= source.fDist23toPrim;
94 fSigmaVert= source.fSigmaVert;
dcb444c9 95
3244eeed 96 return *this;
97}
98//--------------------------------------------------------------------------
99Bool_t AliAODRecoDecayHF3Prong::SelectDplus(const Double_t *cuts)
100 const {
101//
102// This function compares the Dplus with a set of cuts:
103//
104// cuts[0] = inv. mass half width [GeV]
105// cuts[1] = pTK [GeV/c]
106// cuts[2] = pTPi [GeV/c]
107// cuts[3] = d0K [cm] lower limit!
108// cuts[4] = d0Pi [cm] lower limit!
109// cuts[5] = dist12 (cm)
110// cuts[6] = sigmavert (cm)
111// cuts[7] = dist prim-sec (cm)
112// cuts[8] = pM=Max{pT1,pT2,pT3} (GeV/c)
113// cuts[9] = cosThetaPoint
114// cuts[10] = Sum d0^2 (cm^2)
115// cuts[11] = dca cut (cm)
116//
117// If candidate Dplus does not pass the cuts return kFALSE
118//
119
120 Double_t mDplusPDG = TDatabasePDG::Instance()->GetParticle(411)->Mass();
121 Double_t mDplus=InvMassDplus();
122 if(TMath::Abs(mDplus-mDplusPDG)>cuts[0])return kFALSE;
123 //single track
124 if(TMath::Abs(PtProng(1)) < cuts[1] || TMath::Abs(Getd0Prong(1))<cuts[3])return kFALSE;//Kaon
125 if(TMath::Abs(PtProng(0)) < cuts[2] || TMath::Abs(Getd0Prong(0))<cuts[4])return kFALSE;//Pion1
126 if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion2
127
128 //DCA
81679460 129 for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
3244eeed 130
131 //2track cuts
132 if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
133 if(Getd0Prong(0)*Getd0Prong(1)<0. && Getd0Prong(2)*Getd0Prong(1)<0.)return kFALSE;
134
135 //sec vert
136 if(fSigmaVert>cuts[6])return kFALSE;
137
138 if(DecayLength()<cuts[7])return kFALSE;
139
140 if(TMath::Abs(PtProng(0))<cuts[8] && TMath::Abs(PtProng(1))<cuts[8] && TMath::Abs(PtProng(2))<cuts[8])return kFALSE;
141 if(CosPointingAngle() < cuts[9])return kFALSE;
142 Double_t sum2=Getd0Prong(0)*Getd0Prong(0)+Getd0Prong(1)*Getd0Prong(1)+Getd0Prong(2)*Getd0Prong(2);
143 if(sum2<cuts[10])return kFALSE;
144 return kTRUE;
145}
79250a2b 146//--------------------------------------------------------------------------
147Bool_t AliAODRecoDecayHF3Prong::SelectDs(const Double_t *cuts,Int_t &okDsKKpi,Int_t &okDspiKK)
148 const {
149//
6ea608bf 150// This function compares the Ds with a set of cuts
151// (same variables as D+, for now)
79250a2b 152//
153// cuts[0] = inv. mass half width [GeV]
6ea608bf 154// cuts[1] = pTK [GeV/c]
155// cuts[2] = pTPi [GeV/c]
156// cuts[3] = d0K [cm] lower limit!
157// cuts[4] = d0Pi [cm] lower limit!
158// cuts[5] = dist12 (cm)
159// cuts[6] = sigmavert (cm)
160// cuts[7] = dist prim-sec (cm)
161// cuts[8] = pM=Max{pT1,pT2,pT3} (GeV/c)
162// cuts[9] = cosThetaPoint
163// cuts[10] = Sum d0^2 (cm^2)
164// cuts[11] = dca cut (cm)
81679460 165// cuts[12] = max. inv. mass difference(Mphi-MKK and MK0*-MKpi) [GeV]
79250a2b 166//
167// If candidate Ds does not pass the cuts return kFALSE
168//
169 Double_t mDsKKpi,mDspiKK;
170 okDsKKpi=1; okDspiKK=1;
171
172 Double_t mDsPDG = TDatabasePDG::Instance()->GetParticle(431)->Mass();
173
174 mDsKKpi=InvMassDsKKpi();
175 mDspiKK=InvMassDspiKK();
176
177 if(TMath::Abs(mDsKKpi-mDsPDG)>cuts[0]) okDsKKpi = 0;
178 if(TMath::Abs(mDspiKK-mDsPDG)>cuts[0]) okDspiKK = 0;
179 if(!okDsKKpi && !okDspiKK) return kFALSE;
180
6ea608bf 181 //single track
182 if(TMath::Abs(PtProng(0)) < cuts[1] || TMath::Abs(Getd0Prong(0))<cuts[3])return kFALSE;//Kaon1
183 if(TMath::Abs(PtProng(1)) < cuts[1] || TMath::Abs(Getd0Prong(1))<cuts[3])return kFALSE;//Kaon2
81679460 184 if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion
6ea608bf 185
81679460 186 // cuts on resonant decays (via Phi or K0*)
187 Bool_t okMassPhi=1;
188 Double_t mass01phi=InvMass2Prongs(0,1,321,321);
189 Double_t mass12phi=InvMass2Prongs(1,2,321,321);
190 Double_t mPhiPDG = TDatabasePDG::Instance()->GetParticle(333)->Mass();
191 if(TMath::Abs(mass01phi-mPhiPDG)>cuts[12] && TMath::Abs(mass12phi-mPhiPDG)>cuts[12]) okMassPhi = 0;
192 Bool_t okMassK0star=1;
193 Double_t mass01K0s=InvMass2Prongs(0,1,211,321);
194 Double_t mass12K0s=InvMass2Prongs(1,2,321,211);
195 Double_t mK0sPDG = TDatabasePDG::Instance()->GetParticle(313)->Mass();
196 if(TMath::Abs(mass01K0s-mK0sPDG)>cuts[12] && TMath::Abs(mass12K0s-mK0sPDG)>cuts[12]) okMassK0star = 0;
197 if(!okMassPhi && !okMassK0star) return kFALSE;
198
6ea608bf 199 //DCA
81679460 200 for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
6ea608bf 201
202 //2track cuts
203 if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
6ea608bf 204
205 //sec vert
206 if(fSigmaVert>cuts[6])return kFALSE;
207
208 if(DecayLength()<cuts[7])return kFALSE;
209
210 if(TMath::Abs(PtProng(0))<cuts[8] && TMath::Abs(PtProng(1))<cuts[8] && TMath::Abs(PtProng(2))<cuts[8])return kFALSE;
211 if(CosPointingAngle() < cuts[9])return kFALSE;
212 Double_t sum2=Getd0Prong(0)*Getd0Prong(0)+Getd0Prong(1)*Getd0Prong(1)+Getd0Prong(2)*Getd0Prong(2);
213 if(sum2<cuts[10])return kFALSE;
214
79250a2b 215 return kTRUE;
216}
217//--------------------------------------------------------------------------
218Bool_t AliAODRecoDecayHF3Prong::SelectLc(const Double_t *cuts,Int_t &okLcpKpi,Int_t &okLcpiKp)
219 const {
220//
6ea608bf 221// This function compares the Lc with a set of cuts
222// (same variables as D+, for now)
79250a2b 223//
224// cuts[0] = inv. mass half width [GeV]
6ea608bf 225// cuts[1] = pTP [GeV/c]
226// cuts[2] = pTPi and pTK [GeV/c]
227// cuts[3] = d0P [cm] lower limit!
228// cuts[4] = d0Pi and d0K [cm] lower limit!
229// cuts[5] = dist12 (cm)
230// cuts[6] = sigmavert (cm)
231// cuts[7] = dist prim-sec (cm)
232// cuts[8] = pM=Max{pT1,pT2,pT3} (GeV/c)
233// cuts[9] = cosThetaPoint
234// cuts[10] = Sum d0^2 (cm^2)
235// cuts[11] = dca cut (cm)
79250a2b 236//
237// If candidate Lc does not pass the cuts return kFALSE
238//
239 Double_t mLcpKpi,mLcpiKp;
240 okLcpKpi=1; okLcpiKp=1;
241
242 Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
243
244 mLcpKpi=InvMassLcpKpi();
245 mLcpiKp=InvMassLcpiKp();
246
247 if(TMath::Abs(mLcpKpi-mLcPDG)>cuts[0]) okLcpKpi = 0;
248 if(TMath::Abs(mLcpiKp-mLcPDG)>cuts[0]) okLcpiKp = 0;
249 if(!okLcpKpi && !okLcpiKp) return kFALSE;
250
6ea608bf 251 //single track
252 if(TMath::Abs(PtProng(0)) < cuts[1] || TMath::Abs(Getd0Prong(0))<cuts[3])return kFALSE;//Proton
253 if(TMath::Abs(PtProng(1)) < cuts[2] || TMath::Abs(Getd0Prong(1))<cuts[4])return kFALSE;//Kaon
254 if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion
255
256 //DCA
81679460 257 for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
6ea608bf 258
259 //2track cuts
260 if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
261 if(Getd0Prong(0)*Getd0Prong(1)<0. && Getd0Prong(2)*Getd0Prong(1)<0.)return kFALSE;
262
263 //sec vert
264 if(fSigmaVert>cuts[6])return kFALSE;
265
266 if(DecayLength()<cuts[7])return kFALSE;
267
268 if(TMath::Abs(PtProng(0))<cuts[8] && TMath::Abs(PtProng(1))<cuts[8] && TMath::Abs(PtProng(2))<cuts[8])return kFALSE;
269 if(CosPointingAngle() < cuts[9])return kFALSE;
270 Double_t sum2=Getd0Prong(0)*Getd0Prong(0)+Getd0Prong(1)*Getd0Prong(1)+Getd0Prong(2)*Getd0Prong(2);
271 if(sum2<cuts[10])return kFALSE;
272
79250a2b 273 return kTRUE;
274}