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