]>
Commit | Line | Data |
---|---|---|
d77fd7b3 | 1 | #ifndef ALIAODV0_H |
2 | #define ALIAODV0_H | |
3 | ||
4 | /* Copyright(c) 2004-2005, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | //------------------------------------------------------------------------- | |
8 | // Implementation of the Analysis Oriented Data (AOD) V0 vertex class | |
d77fd7b3 | 9 | // Origin: B.Hippolyte, IReS, hippolyt@in2p3.fr |
10 | // G.Van Buren, BNL, gene@bnl.gov (original STAR MuDsts) | |
2d8e3807 | 11 | // Purpose: Having observables for physics available for V0s |
d77fd7b3 | 12 | //------------------------------------------------------------------------- |
13 | ||
14 | #include <TObject.h> | |
a98dba45 | 15 | #include <TDatabasePDG.h> |
16 | ||
17 | #define MASS(PID) TDatabasePDG::Instance()->GetParticle((PID))->Mass() | |
18 | #define MASS2(PID) MASS((PID))*MASS((PID)) | |
d77fd7b3 | 19 | |
20 | class AliESD; | |
21 | class AliESDVertex; | |
22 | class AliESDv0; | |
23 | class AliESDtrack; | |
24 | ||
25 | ||
26 | class AliAODv0 : public TObject { | |
27 | ||
28 | public: | |
29 | AliAODv0(); | |
2d8e3807 | 30 | AliAODv0(AliESDv0 *rV0Vertex, AliESD *rEvent); |
c028b974 | 31 | AliAODv0(const AliAODv0& rAliAODv0); |
32 | virtual ~AliAODv0(); | |
33 | ||
34 | AliAODv0& operator=(const AliAODv0& rAliAODv0); | |
35 | ||
2d8e3807 | 36 | void Fill(AliESDv0 *rV0Vertex, AliESD *rEvent); |
37 | void ResetV0(); | |
d77fd7b3 | 38 | |
2d8e3807 | 39 | Double_t DecayVertexV0X() const; |
40 | Double_t DecayVertexV0Y() const; | |
41 | Double_t DecayVertexV0Z() const; | |
a98dba45 | 42 | |
c028b974 | 43 | Double_t DecayLengthV0(double*) const; |
d77fd7b3 | 44 | |
2d8e3807 | 45 | Double_t DcaV0Daughters() const; |
46 | Double_t DcaV0ToPrimVertex() const; | |
47 | Double_t DcaPosToPrimVertex() const; | |
48 | Double_t DcaNegToPrimVertex() const; | |
c028b974 | 49 | Double_t CosPointAngle(Double_t&, Double_t&, Double_t&) const; |
50 | Double_t RadiusV0() const; | |
51 | Double_t OpenAngleV0() const; | |
2d8e3807 | 52 | |
53 | Double_t MomPosX() const; | |
54 | Double_t MomPosY() const; | |
55 | Double_t MomPosZ() const; | |
56 | Double_t MomNegX() const; | |
57 | Double_t MomNegY() const; | |
58 | Double_t MomNegZ() const; | |
59 | ||
60 | Int_t KeyPos() const; | |
61 | Int_t KeyNeg() const; | |
62 | ||
63 | Double_t Chi2V0() const; | |
64 | ||
65 | Double_t MomV0X() const; | |
66 | Double_t MomV0Y() const; | |
67 | Double_t MomV0Z() const; | |
68 | ||
69 | Double_t Ptot2Pos() const; | |
70 | Double_t Ptot2Neg() const; | |
71 | Double_t Ptot2V0() const; | |
72 | Double_t Pt2V0() const; | |
73 | Double_t MomPosAlongV0() const; | |
74 | Double_t MomNegAlongV0() const; | |
75 | Double_t AlphaV0() const; | |
76 | Double_t PtArmV0() const; | |
a98dba45 | 77 | Double_t EPosProton() const; |
78 | Double_t ENegProton() const; | |
79 | Double_t EPosPion() const; | |
80 | Double_t ENegPion() const; | |
81 | Double_t ELambda() const; | |
82 | Double_t EK0Short() const; | |
83 | Double_t MassLambda() const; | |
84 | Double_t MassAntiLambda() const; | |
85 | Double_t MassK0Short() const; | |
86 | Double_t RapK0Short() const; | |
87 | Double_t RapLambda() const; | |
c028b974 | 88 | Double_t PseudoRapV0() const; |
89 | Double_t PseudoRapPos() const; | |
90 | Double_t PseudoRapNeg() const; | |
a98dba45 | 91 | |
d77fd7b3 | 92 | |
93 | protected: | |
2d8e3807 | 94 | Double_t fDecayVertexV0X; // decay vertex of V0 along X |
95 | Double_t fDecayVertexV0Y; // decay vertex of V0 along Y | |
96 | Double_t fDecayVertexV0Z; // decay vertex of V0 along Z | |
97 | Double_t fDcaV0Daughters; // dca between V0 daughters | |
98 | Double_t fDcaV0ToPrimVertex; // dca of V0 to primary vertex | |
99 | Double_t fDcaPosToPrimVertex; // dca of pos daughter to primary vertex | |
100 | Double_t fDcaNegToPrimVertex; // dca of pos daughter to primary vertex | |
101 | Double_t fMomPosX; // momemtum of pos daughter along X | |
102 | Double_t fMomPosY; // momemtum of pos daughter along Y | |
103 | Double_t fMomPosZ; // momemtum of pos daughter along Z | |
104 | Double_t fMomNegX; // momemtum of neg daughter along X | |
105 | Double_t fMomNegY; // momemtum of neg daughter along Y | |
106 | Double_t fMomNegZ; // momemtum of neg daughter along Z | |
107 | ||
c028b974 | 108 | UInt_t fKeyPos; // track key/index to pos daughter |
109 | UInt_t fKeyNeg; // track key/index to neg daughter | |
2d8e3807 | 110 | |
111 | Double_t fChi2; // main quality variable of V0 | |
2d8e3807 | 112 | |
113 | ClassDef(AliAODv0,1) | |
d77fd7b3 | 114 | }; |
115 | ||
2d8e3807 | 116 | inline Double_t AliAODv0::DecayVertexV0X() const {return fDecayVertexV0X;} |
117 | inline Double_t AliAODv0::DecayVertexV0Y() const {return fDecayVertexV0Y;} | |
118 | inline Double_t AliAODv0::DecayVertexV0Z() const {return fDecayVertexV0Z;} | |
d77fd7b3 | 119 | |
c028b974 | 120 | inline Double_t AliAODv0::DecayLengthV0(double *tParentVertexPosition) const { |
121 | return ::sqrt(::pow(DecayVertexV0X() - tParentVertexPosition[0],2) + | |
122 | ::pow(DecayVertexV0Y() - tParentVertexPosition[1],2) + | |
123 | ::pow(DecayVertexV0Z() - tParentVertexPosition[2],2)); | |
a98dba45 | 124 | } |
125 | ||
2d8e3807 | 126 | inline Double_t AliAODv0::DcaV0Daughters() const {return fDcaV0Daughters;} |
127 | inline Double_t AliAODv0::DcaV0ToPrimVertex() const {return fDcaV0ToPrimVertex;} | |
128 | inline Double_t AliAODv0::DcaPosToPrimVertex() const {return fDcaPosToPrimVertex;} | |
129 | inline Double_t AliAODv0::DcaNegToPrimVertex() const {return fDcaNegToPrimVertex;} | |
d77fd7b3 | 130 | |
2d8e3807 | 131 | inline Double_t AliAODv0::MomPosX() const {return fMomPosX;} |
132 | inline Double_t AliAODv0::MomPosY() const {return fMomPosY;} | |
133 | inline Double_t AliAODv0::MomPosZ() const {return fMomPosZ;} | |
134 | inline Double_t AliAODv0::MomNegX() const {return fMomNegX;} | |
135 | inline Double_t AliAODv0::MomNegY() const {return fMomNegY;} | |
136 | inline Double_t AliAODv0::MomNegZ() const {return fMomNegZ;} | |
d77fd7b3 | 137 | |
2d8e3807 | 138 | inline Int_t AliAODv0::KeyPos() const {return fKeyPos;} |
139 | inline Int_t AliAODv0::KeyNeg() const {return fKeyNeg;} | |
d77fd7b3 | 140 | |
2d8e3807 | 141 | inline Double_t AliAODv0::Chi2V0() const {return fChi2;} |
d77fd7b3 | 142 | |
c028b974 | 143 | inline Double_t AliAODv0::CosPointAngle(Double_t& refPointX, Double_t& refPointY, Double_t& refPointZ) const { |
144 | ||
145 | Double_t deltaPos[3]; //vector between the reference point and the V0 vertex | |
146 | deltaPos[0] = fDecayVertexV0X - refPointX; | |
147 | deltaPos[1] = fDecayVertexV0Y - refPointY; | |
148 | deltaPos[2] = fDecayVertexV0Z - refPointZ; | |
149 | ||
150 | Double_t deltaPos2 = deltaPos[0]*deltaPos[0] + deltaPos[1]*deltaPos[1] + deltaPos[2]*deltaPos[2]; | |
151 | ||
152 | Double_t cosinePointingAngle = (deltaPos[0]*MomV0X() + | |
153 | deltaPos[1]*MomV0Y() + | |
154 | deltaPos[2]*MomV0Z() ) / | |
155 | TMath::Sqrt(Ptot2V0() * deltaPos2); | |
156 | return cosinePointingAngle; | |
157 | } | |
158 | ||
2d8e3807 | 159 | inline Double_t AliAODv0::MomV0X() const {return MomPosX()+MomNegX();} |
160 | inline Double_t AliAODv0::MomV0Y() const {return MomPosY()+MomNegY();} | |
161 | inline Double_t AliAODv0::MomV0Z() const {return MomPosZ()+MomNegZ();} | |
d77fd7b3 | 162 | |
2d8e3807 | 163 | inline Double_t AliAODv0::Ptot2Pos() const { |
164 | return (::pow(MomPosX(),2) + ::pow(MomPosY(),2) + ::pow(MomPosZ(),2) ); | |
d77fd7b3 | 165 | } |
2d8e3807 | 166 | inline Double_t AliAODv0::Ptot2Neg() const { |
167 | return (::pow(MomNegX(),2) + ::pow(MomNegY(),2) + ::pow(MomNegZ(),2) ); | |
d77fd7b3 | 168 | } |
2d8e3807 | 169 | inline Double_t AliAODv0::Pt2V0() const { |
170 | return (::pow(MomV0X(),2) + ::pow(MomV0Y(),2) ); | |
d77fd7b3 | 171 | } |
172 | ||
2d8e3807 | 173 | inline Double_t AliAODv0::Ptot2V0() const {return ( Pt2V0() + ::pow(MomV0Z(),2) );} |
d77fd7b3 | 174 | |
2d8e3807 | 175 | inline Double_t AliAODv0::MomPosAlongV0() const { |
176 | Double_t lPtot2V0 = Ptot2V0(); | |
177 | if (lPtot2V0) | |
178 | return (MomPosX()*MomV0X() + | |
179 | MomPosY()*MomV0Y() + | |
180 | MomPosZ()*MomV0Z()) / ::sqrt(lPtot2V0); | |
d77fd7b3 | 181 | return 0.; |
182 | } | |
183 | ||
2d8e3807 | 184 | inline Double_t AliAODv0::MomNegAlongV0() const { |
185 | Double_t lPtot2V0 = Ptot2V0(); | |
186 | if (lPtot2V0) | |
187 | return (MomNegX()*MomV0X() + | |
188 | MomNegY()*MomV0Y() + | |
189 | MomNegZ()*MomV0Z()) / ::sqrt(lPtot2V0); | |
d77fd7b3 | 190 | return 0.; |
191 | } | |
192 | ||
2d8e3807 | 193 | inline Double_t AliAODv0::AlphaV0() const { |
d77fd7b3 | 194 | return 1.-(2./(1.+(MomPosAlongV0()/MomNegAlongV0()))); |
195 | } | |
2d8e3807 | 196 | inline Double_t AliAODv0::PtArmV0() const { |
d77fd7b3 | 197 | return ::sqrt(Ptot2Pos()-MomPosAlongV0()*MomPosAlongV0()); |
198 | } | |
199 | ||
a98dba45 | 200 | inline Double_t AliAODv0::EPosProton() const { |
201 | return ::sqrt(Ptot2Pos()+MASS2("proton")); | |
202 | } | |
203 | ||
204 | inline Double_t AliAODv0::ENegProton() const { | |
205 | return ::sqrt(Ptot2Neg()+MASS2("antiproton")); | |
206 | } | |
207 | ||
208 | inline Double_t AliAODv0::EPosPion() const { | |
209 | return ::sqrt(Ptot2Pos()+MASS2("pi+")); | |
210 | } | |
211 | ||
212 | inline Double_t AliAODv0::ENegPion() const { | |
213 | return ::sqrt(Ptot2Neg()+MASS2("pi-")); | |
214 | } | |
215 | ||
216 | inline Double_t AliAODv0::ELambda() const { | |
217 | return ::sqrt(Ptot2V0()+MASS2("Lambda0")); | |
218 | } | |
219 | ||
220 | inline Double_t AliAODv0::EK0Short() const { | |
221 | return ::sqrt(Ptot2V0()+MASS2("K_S0")); | |
222 | } | |
223 | ||
224 | inline Double_t AliAODv0::MassLambda() const { | |
225 | return ::sqrt(::pow(EPosProton()+ENegPion(),2)-Ptot2V0()); | |
226 | } | |
227 | ||
228 | inline Double_t AliAODv0::MassAntiLambda() const { | |
229 | return ::sqrt(::pow(ENegProton()+EPosPion(),2)-Ptot2V0()); | |
230 | } | |
231 | ||
232 | inline Double_t AliAODv0::MassK0Short() const { | |
233 | return ::sqrt(::pow(EPosPion()+ENegPion(),2)-Ptot2V0()); | |
234 | } | |
235 | ||
236 | inline Double_t AliAODv0::RapK0Short() const { | |
237 | Double_t ek0 = EK0Short(); | |
238 | Double_t mMomV0Z = MomV0Z(); | |
239 | return 0.5*::log((ek0+mMomV0Z)/(ek0-mMomV0Z)); | |
240 | } | |
241 | ||
242 | inline Double_t AliAODv0::RapLambda() const { | |
243 | Double_t eLambda = ELambda(); | |
244 | Double_t mMomV0Z = MomV0Z(); | |
245 | return 0.5*::log((eLambda+mMomV0Z)/(eLambda-mMomV0Z)); | |
246 | } | |
247 | ||
c028b974 | 248 | inline Double_t AliAODv0::RadiusV0() const { |
249 | return ::sqrt( fDecayVertexV0X*fDecayVertexV0X | |
250 | + fDecayVertexV0Y*fDecayVertexV0Y ); | |
251 | } | |
d77fd7b3 | 252 | |
c028b974 | 253 | inline Double_t AliAODv0::PseudoRapV0() const { |
254 | Double_t lTheta = ::acos( MomV0Z()/::sqrt(Ptot2V0()) ); | |
255 | return ( -::log(TMath::Tan(lTheta/2.)) ); | |
256 | } | |
d77fd7b3 | 257 | |
c028b974 | 258 | inline Double_t AliAODv0::PseudoRapPos() const { |
259 | Double_t lTheta = ::acos( MomPosZ()/::sqrt(Ptot2Pos()) ); | |
260 | return ( -::log(TMath::Tan(lTheta/2.)) ); | |
261 | } | |
262 | ||
263 | inline Double_t AliAODv0::PseudoRapNeg() const { | |
264 | Double_t lTheta = ::acos( MomNegZ()/::sqrt(Ptot2Neg()) ); | |
265 | return ( -::log(TMath::Tan(lTheta/2.)) ); | |
266 | } | |
267 | ||
268 | inline Double_t AliAODv0::OpenAngleV0() const { | |
269 | Double_t lPtot1xPtot2 = fMomPosX*fMomNegX+fMomPosY*fMomNegY+fMomPosZ*fMomNegZ; | |
270 | Double_t lPtot1Ptot2_2 = Ptot2Pos()*Ptot2Neg(); | |
271 | return ::acos(lPtot1xPtot2/::sqrt(lPtot1Ptot2_2) ); | |
272 | } | |
273 | ||
274 | #endif |