]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/vertexingHF/AliAODRecoDecayHF3Prong.cxx
Small changes and fixes (Carmelo)
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliAODRecoDecayHF3Prong.cxx
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
27 ClassImp(AliAODRecoDecayHF3Prong)
28
29 //--------------------------------------------------------------------------
30 AliAODRecoDecayHF3Prong::AliAODRecoDecayHF3Prong() :
31   AliAODRecoDecayHF(), 
32   fSigmaVert(0),
33   fDist12toPrim(0),
34   fDist23toPrim(0)
35 {
36   //
37   // Default Constructor
38   //
39 }
40 //--------------------------------------------------------------------------
41 AliAODRecoDecayHF3Prong::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   //
54   SetDCAs(3,dca);
55 }
56 //--------------------------------------------------------------------------
57 AliAODRecoDecayHF3Prong::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   //
69   SetDCAs(3,dca);
70 }
71 //--------------------------------------------------------------------------
72 AliAODRecoDecayHF3Prong::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 //--------------------------------------------------------------------------
83 AliAODRecoDecayHF3Prong &AliAODRecoDecayHF3Prong::operator=(const AliAODRecoDecayHF3Prong &source)
84 {
85   //
86   // assignment operator
87   //
88   if(&source == this) return *this;
89
90   AliAODRecoDecayHF::operator=(source);
91
92   fDist12toPrim= source.fDist12toPrim;
93   fDist23toPrim= source.fDist23toPrim;
94   fSigmaVert= source.fSigmaVert;
95
96   return *this;
97 }
98 //--------------------------------------------------------------------------
99 Bool_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
129   for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
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 }
146 //--------------------------------------------------------------------------
147 Bool_t AliAODRecoDecayHF3Prong::SelectDs(const Double_t *cuts,Int_t &okDsKKpi,Int_t &okDspiKK, Int_t &okMassPhi, Int_t &okMassK0star)
148   const {
149 //
150 // This function compares the Ds with a set of cuts 
151 // (same variables as D+, for now)
152 //
153 // cuts[0] = inv. mass half width [GeV]   
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)
165 // cuts[12] = max. inv. mass difference(Mphi-MKK) [GeV] 
166 // cuts[13] = max. inv. mass difference(MK0*-MKpi) [GeV] 
167 //
168 // If candidate Ds does not pass the cuts return kFALSE
169 //
170   Double_t mDsKKpi,mDspiKK;
171   okDsKKpi=1; okDspiKK=1;
172   okMassPhi=0; okMassK0star=0;
173
174   Double_t mDsPDG = TDatabasePDG::Instance()->GetParticle(431)->Mass();
175
176   mDsKKpi=InvMassDsKKpi();
177   mDspiKK=InvMassDspiKK();
178
179   if(TMath::Abs(mDsKKpi-mDsPDG)>cuts[0]) okDsKKpi = 0;
180   if(TMath::Abs(mDspiKK-mDsPDG)>cuts[0]) okDspiKK = 0;
181   if(!okDsKKpi && !okDspiKK) return kFALSE;
182
183   //single track
184   if(TMath::Abs(PtProng(0)) < cuts[1] || TMath::Abs(Getd0Prong(0))<cuts[3])return kFALSE;//Kaon1
185   if(TMath::Abs(PtProng(1)) < cuts[1] || TMath::Abs(Getd0Prong(1))<cuts[3])return kFALSE;//Kaon2
186   if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion
187
188   // cuts on resonant decays (via Phi or K0*)
189   Double_t mPhiPDG = TDatabasePDG::Instance()->GetParticle(333)->Mass();
190   Double_t mK0starPDG = TDatabasePDG::Instance()->GetParticle(313)->Mass();
191   if(okDsKKpi){
192     Double_t mass01phi=InvMass2Prongs(0,1,321,321);
193     Double_t mass12K0s=InvMass2Prongs(1,2,321,211);
194     if(TMath::Abs(mass01phi-mPhiPDG)<cuts[12]) okMassPhi=1;
195     if(TMath::Abs(mass12K0s-mK0starPDG)<cuts[13]) okMassK0star = 1;
196     if(!okMassPhi && !okMassK0star) okDsKKpi=kFALSE;
197   }
198   if(okDspiKK){
199     Double_t mass01K0s=InvMass2Prongs(0,1,211,321);
200     Double_t mass12phi=InvMass2Prongs(1,2,321,321);
201     if(TMath::Abs(mass01K0s-mK0starPDG)<cuts[13]) okMassK0star = 1;
202     if(TMath::Abs(mass12phi-mPhiPDG)<cuts[12]) okMassPhi=1;
203     if(!okMassPhi && !okMassK0star) okDspiKK=kFALSE;
204   }
205   if(!okDsKKpi && !okDspiKK) return kFALSE;
206
207
208
209   
210   //DCA
211   for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
212
213   //2track cuts
214   if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
215
216   //sec vert
217   if(fSigmaVert>cuts[6])return kFALSE;
218
219   if(DecayLength()<cuts[7])return kFALSE;
220
221   if(TMath::Abs(PtProng(0))<cuts[8] && TMath::Abs(PtProng(1))<cuts[8] && TMath::Abs(PtProng(2))<cuts[8])return kFALSE;
222   if(CosPointingAngle()   < cuts[9])return kFALSE;
223   Double_t sum2=Getd0Prong(0)*Getd0Prong(0)+Getd0Prong(1)*Getd0Prong(1)+Getd0Prong(2)*Getd0Prong(2);
224   if(sum2<cuts[10])return kFALSE;
225
226   return kTRUE;
227 }
228 //--------------------------------------------------------------------------
229 Bool_t AliAODRecoDecayHF3Prong::SelectLc(const Double_t *cuts,Int_t &okLcpKpi,Int_t &okLcpiKp)
230   const {
231 //
232 // This function compares the Lc with a set of cuts 
233 // (same variables as D+, for now)
234 //
235 // cuts[0] = inv. mass half width [GeV]   
236 // cuts[1] = pTP [GeV/c]
237 // cuts[2] = pTPi and pTK [GeV/c]
238 // cuts[3] = d0P [cm]   lower limit!
239 // cuts[4] = d0Pi and d0K [cm]  lower limit!
240 // cuts[5] = dist12 (cm)
241 // cuts[6] = sigmavert (cm)
242 // cuts[7] = dist prim-sec (cm)
243 // cuts[8] = pM=Max{pT1,pT2,pT3} (GeV/c)
244 // cuts[9] = cosThetaPoint
245 // cuts[10] = Sum d0^2 (cm^2)
246 // cuts[11] = dca cut (cm)
247 //
248 // If candidate Lc does not pass the cuts return kFALSE
249 //
250   Double_t mLcpKpi,mLcpiKp;
251   okLcpKpi=1; okLcpiKp=1;
252
253   Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
254
255   mLcpKpi=InvMassLcpKpi();
256   mLcpiKp=InvMassLcpiKp();
257
258   if(TMath::Abs(mLcpKpi-mLcPDG)>cuts[0]) okLcpKpi = 0;
259   if(TMath::Abs(mLcpiKp-mLcPDG)>cuts[0]) okLcpiKp = 0;
260   if(!okLcpKpi && !okLcpiKp) return kFALSE;
261
262   //single track
263   if(TMath::Abs(PtProng(0)) < cuts[1] || TMath::Abs(Getd0Prong(0))<cuts[3])return kFALSE;//Proton
264   if(TMath::Abs(PtProng(1)) < cuts[2] || TMath::Abs(Getd0Prong(1))<cuts[4])return kFALSE;//Kaon
265   if(TMath::Abs(PtProng(2)) < cuts[2] || TMath::Abs(Getd0Prong(2))<cuts[4])return kFALSE;//Pion
266
267   //DCA
268   for(Int_t i=0;i<3;i++) if(GetDCA(i)>cuts[11])return kFALSE;
269
270   //2track cuts
271   if(fDist12toPrim<cuts[5] || fDist23toPrim<cuts[5])return kFALSE;
272   if(Getd0Prong(0)*Getd0Prong(1)<0. && Getd0Prong(2)*Getd0Prong(1)<0.)return kFALSE;
273
274   //sec vert
275   if(fSigmaVert>cuts[6])return kFALSE;
276
277   if(DecayLength()<cuts[7])return kFALSE;
278
279   if(TMath::Abs(PtProng(0))<cuts[8] && TMath::Abs(PtProng(1))<cuts[8] && TMath::Abs(PtProng(2))<cuts[8])return kFALSE;
280   if(CosPointingAngle()   < cuts[9])return kFALSE;
281   Double_t sum2=Getd0Prong(0)*Getd0Prong(0)+Getd0Prong(1)*Getd0Prong(1)+Getd0Prong(2)*Getd0Prong(2);
282   if(sum2<cuts[10])return kFALSE;
283
284   return kTRUE;
285 }