]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/vertexingHF/AliAODRecoCascadeHF.cxx
Fixed typo
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliAODRecoCascadeHF.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-2008, 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 // Class for AOD reconstructed heavy-flavour cascades
19 //
20 // Author: X-M. Zhang, zhangxm@iopp.ccnu.edu.cn
21 /////////////////////////////////////////////////////////////
22
23 #include <TVector3.h>
24 #include <TDatabasePDG.h>
25 #include "AliAODRecoDecay.h"
26 #include "AliAODVertex.h"
27 #include "AliAODRecoDecayHF2Prong.h"
28 #include "AliAODRecoCascadeHF.h"
29
30 ClassImp(AliAODRecoCascadeHF)
31 //-----------------------------------------------------------------------------
32
33 AliAODRecoCascadeHF::AliAODRecoCascadeHF() :
34   AliAODRecoDecayHF2Prong()
35 {
36   //
37   // Default Constructor
38   //
39 }
40 //-----------------------------------------------------------------------------
41 AliAODRecoCascadeHF::AliAODRecoCascadeHF(AliAODVertex *vtx2, Short_t charge,
42                                          Double_t *px, Double_t *py, Double_t *pz,
43                                          Double_t *d0, Double_t *d0err, Double_t dca) :
44   AliAODRecoDecayHF2Prong(vtx2, px, py, pz, d0, d0err, dca)
45 {
46   //
47   //  Constructor with AliAODVertex for decay vertex
48   //
49   SetCharge(charge);
50 }
51 //-----------------------------------------------------------------------------
52 AliAODRecoCascadeHF::AliAODRecoCascadeHF(AliAODVertex *vtx2, Short_t charge,
53                                          Double_t *d0, Double_t *d0err, Double_t dca) :
54   AliAODRecoDecayHF2Prong(vtx2, d0, d0err, dca)
55 {
56   //
57   //  Constructor with decay vertex and without prongs momenta
58   //
59   SetCharge(charge);
60 }
61 //-----------------------------------------------------------------------------
62 AliAODRecoCascadeHF::AliAODRecoCascadeHF(const AliAODRecoCascadeHF &source) :
63   AliAODRecoDecayHF2Prong(source)
64 {
65   //
66   // Copy constructor
67   //
68 }
69 //-----------------------------------------------------------------------------
70 AliAODRecoCascadeHF &AliAODRecoCascadeHF::operator=(const AliAODRecoCascadeHF &source)
71 {
72   //
73   // assignment operator
74   //
75   if(&source == this) return *this;
76
77   AliAODRecoDecayHF2Prong::operator=(source);
78
79   return *this;
80 }
81 //-----------------------------------------------------------------------------
82 AliAODRecoCascadeHF::~AliAODRecoCascadeHF()
83 {
84   //
85   // Default Destructor
86   //
87 }
88 //-----------------------------------------------------------------------------
89 Double_t AliAODRecoCascadeHF::InvMassDstarKpipi() const 
90 {
91   //
92   // 3 prong invariant mass of the D0 daughters and the soft pion
93   //
94
95   Double_t px[3],py[3],pz[3];
96   UInt_t pdg[3]={321,211,211};
97   pdg[0] = (Charge()>0 ? 211 : 321); // positive daughter of D0
98   px[0] = Get2Prong()->PxProng(0);
99   py[0] = Get2Prong()->PyProng(0);
100   pz[0] = Get2Prong()->PzProng(0);
101   pdg[1] = (Charge()>0 ? 321 : 211); // negative daughter of D0
102   px[1] = Get2Prong()->PxProng(1);
103   py[1] = Get2Prong()->PyProng(1);
104   pz[1] = Get2Prong()->PzProng(1);
105   pdg[2] = 211; // soft pion
106   px[2] = PxProng(0);
107   py[2] = PyProng(0);
108   pz[2] = PzProng(0);
109   Short_t dummycharge=0;
110   Double_t dummyd0[3]={0,0,0};
111   AliAODRecoDecay *rd = new AliAODRecoDecay(0x0,3,dummycharge,px,py,pz,dummyd0);
112
113   Double_t minv = rd->InvMass(3,pdg);
114
115   delete rd; rd=NULL;
116
117   return minv;
118 }
119 //-----------------------------------------------------------------------------
120 Bool_t AliAODRecoCascadeHF::SelectDstar(const Double_t *cutsDstar,
121                                         const Double_t *cutsD0,
122                                         Bool_t testD0) const
123 {
124   //
125   // cutsDstar[0] = inv. mass half width of D* [GeV]
126   // cutsDstar[1] = half width of (M_Kpipi-M_D0) [GeV]
127   // cutsDstar[2] = PtMin of pi_s [GeV/c]
128   // cutsDstar[3] = PtMax of pi_s [GeV/c]
129   // cutsDstar[4] = theta, angle between the pi_s and decay plane of the D0 [rad]
130   //
131   // cutsD0[0] = inv. mass half width [GeV]   
132   // cutsD0[1] = dca [cm]
133   // cutsD0[2] = cosThetaStar 
134   // cutsD0[3] = pTK [GeV/c]
135   // cutsD0[4] = pTPi [GeV/c]
136   // cutsD0[5] = d0K [cm]   upper limit!
137   // cutsD0[6] = d0Pi [cm]  upper limit!
138   // cutsD0[7] = d0d0 [cm^2]
139   // cutsD0[8] = cosThetaPoint
140
141
142   // check that the D0 passes the cuts
143   // (if we have a D*+, it has to pass as D0, 
144   //  if we have a D*-, it has to pass as D0bar)
145
146   if(testD0) {
147     Int_t okD0=0,okD0bar=0;
148     Get2Prong()->SelectD0(cutsD0,okD0,okD0bar);
149     if((Charge()==+1 && !okD0) || (Charge()==-1 && !okD0bar)) return kFALSE; 
150   }
151  
152   if( (PtProng(0)<cutsDstar[2]) || (PtProng(0)>cutsDstar[3]) ) return kFALSE;
153
154   Double_t mDstar = TDatabasePDG::Instance()->GetParticle(413)->Mass();
155   Double_t invmDstar = InvMassDstarKpipi();
156   if(TMath::Abs(mDstar-invmDstar)>cutsDstar[0]) return kFALSE;
157
158   Double_t mD0 = TDatabasePDG::Instance()->GetParticle(421)->Mass();
159   if(TMath::Abs((mDstar-mD0)-DeltaInvMass())>cutsDstar[1]) return kFALSE;
160
161   TVector3 p3Trk0(Get2Prong()->PxProng(0),Get2Prong()->PyProng(0),Get2Prong()->PzProng(0)); // from D0
162   TVector3 p3Trk1(Get2Prong()->PxProng(1),Get2Prong()->PyProng(1),Get2Prong()->PzProng(1)); // from D0
163   TVector3 p3Trk2(PxProng(0),PyProng(0),PzProng(0)); // pi_s
164
165   TVector3 perp = p3Trk0.Cross(p3Trk1);
166   Double_t theta = p3Trk2.Angle(perp);
167   if(theta>(TMath::Pi()-theta)) theta = TMath::Pi() - theta;
168   theta = TMath::Pi()/2. - theta;
169
170   if(theta>cutsDstar[4]) return kFALSE;
171
172   Double_t alpha = p3Trk0.Angle(p3Trk2);
173   Double_t belta = p3Trk1.Angle(p3Trk2);
174
175   Double_t cosphi01 = TMath::Cos(alpha) / TMath::Cos(theta);
176   Double_t cosphi02 = TMath::Cos(belta) / TMath::Cos(theta);
177
178   Double_t phi01 = TMath::ACos(cosphi01);
179   Double_t phi02 = TMath::ACos(cosphi02);
180   Double_t phi00 = p3Trk0.Angle(p3Trk1);
181
182   if((phi01>phi00) || (phi02>phi00)) return kFALSE;
183   
184   return kTRUE;
185 }
186 //-----------------------------------------------------------------------------