adding implementations to extract event type and time stamp from RawReader
[u/mrichter/AliRoot.git] / STEER / AliAODv0.h
CommitLineData
97135b34 1#ifndef ALIAODV0_H
2#define ALIAODV0_H
61690c9e 3/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6//-------------------------------------------------------------------------
7// Analysis Oriented Data (AOD) V0 vertex class
8// Authors: B.Hippolyte, IPHC, hippolyt@in2p3.fr
9// G.Van Buren, BNL, gene@bnl.gov (original STAR MuDsts)
10//-------------------------------------------------------------------------
11
12#include "AliAODRecoDecay.h"
13
61690c9e 14class AliAODv0 : public AliAODRecoDecay {
15
16public:
17
18 AliAODv0();
61690c9e 19 AliAODv0(AliAODVertex *rAODVertex, Double_t rDcaV0Daughters, Double_t rDcaV0ToPrimVertex,
96d949da 20 const Double_t *rMomPos, const Double_t *rMomNeg, Double_t *rDcaDaughterToPrimVertex);
61690c9e 21 virtual ~AliAODv0();
22
23 AliAODv0(const AliAODv0& rAliAODv0);
24 AliAODv0& operator=(const AliAODv0& rAliAODv0);
25
61690c9e 26 void Fill(AliAODVertex *rAODVertex, Double_t rDcaV0Daughters, Double_t rDcaV0ToPrimVertex,
97135b34 27 const Double_t *rMomPos, const Double_t *rMomNeg, const Double_t *rDcaDaughterToPrimVertex);
61690c9e 28 void ResetV0();
29 void Print(Option_t* option = "") const;
30
105ab4d7 31 void SetOnFlyStatus(Bool_t status){fOnFlyStatus=status;}
32 Bool_t GetOnFlyStatus() const {return fOnFlyStatus;}
33
61690c9e 34 Double_t DecayVertexV0X() const;
35 Double_t DecayVertexV0Y() const;
36 Double_t DecayVertexV0Z() const;
37
96d949da 38 Double_t DecayLengthV0(const Double_t *) const;
61690c9e 39
96d949da 40 Double_t DcaV0Daughters() const;
41 Double_t DcaV0ToPrimVertex() const;
61690c9e 42 Double_t DcaPosToPrimVertex() const;
43 Double_t DcaNegToPrimVertex() const;
44 Double_t RadiusV0() const;
45 Double_t OpenAngleV0() const;
46
47 Double_t MomPosX() const;
48 Double_t MomPosY() const;
49 Double_t MomPosZ() const;
50 Double_t MomNegX() const;
51 Double_t MomNegY() const;
52 Double_t MomNegZ() const;
53
61690c9e 54 Double_t Chi2V0() const;
55
56 Double_t MomV0X() const;
57 Double_t MomV0Y() const;
58 Double_t MomV0Z() const;
59
60 Double_t Ptot2Pos() const;
61 Double_t Ptot2Neg() const;
62 Double_t Ptot2V0() const;
63 Double_t Pt2V0() const;
64 Double_t MomPosAlongV0() const;
65 Double_t MomNegAlongV0() const;
66 Double_t AlphaV0() const;
67 Double_t PtArmV0() const;
68 Double_t EPosProton() const;
69 Double_t ENegProton() const;
70 Double_t EPosPion() const;
71 Double_t ENegPion() const;
72 Double_t ELambda() const;
73 Double_t EK0Short() const;
74 Double_t MassLambda() const;
75 Double_t MassAntiLambda() const;
76 Double_t MassK0Short() const;
77 Double_t RapK0Short() const;
78 Double_t RapLambda() const;
79 Double_t PseudoRapV0() const;
80 Double_t PseudoRapPos() const;
81 Double_t PseudoRapNeg() const;
3c43fb2b 82
96d949da 83 Short_t GetPosID() const;
84 Short_t GetNegID() const;
6a8e543a 85 Int_t GetLabel() const {return -1;} // Dummy
86 Int_t PdgCode() const {return 0;} // Dummy
87
61690c9e 88protected:
89 Double32_t fDcaV0ToPrimVertex; // dca of V0 to primary vertex
105ab4d7 90 Bool_t fOnFlyStatus; // if kTRUE, then this V0 is recontructed
91 // "on fly" during the tracking
92 ClassDef(AliAODv0,2)
61690c9e 93};
94
95inline Double_t AliAODv0::DecayVertexV0X() const {return this->GetSecVtxX();}
96inline Double_t AliAODv0::DecayVertexV0Y() const {return this->GetSecVtxY();}
97inline Double_t AliAODv0::DecayVertexV0Z() const {return this->GetSecVtxZ();}
98
96d949da 99inline Double_t AliAODv0::DecayLengthV0(const Double_t *tParentVertexPosition) const {
61690c9e 100 return ::sqrt(::pow(DecayVertexV0X() - tParentVertexPosition[0],2) +
101 ::pow(DecayVertexV0Y() - tParentVertexPosition[1],2) +
102 ::pow(DecayVertexV0Z() - tParentVertexPosition[2],2));
103}
104
105inline Double_t AliAODv0::DcaV0Daughters() const {return fDCA[0];}
106inline Double_t AliAODv0::DcaV0ToPrimVertex() const {return fDcaV0ToPrimVertex;}
107inline Double_t AliAODv0::DcaPosToPrimVertex() const {return fd0[0];}
108inline Double_t AliAODv0::DcaNegToPrimVertex() const {return fd0[1];}
109
110inline Double_t AliAODv0::RadiusV0() const {
111 return RadiusSecVtx();
112}
113
114inline Double_t AliAODv0::OpenAngleV0() const {
97135b34 115 Double_t lScalPtot1Ptot2 = PxProng(0)*PxProng(1)+PyProng(0)*PyProng(1)+PzProng(0)*PzProng(1);
116 Double_t lPtot1xPtot2 = Ptot2Pos()*Ptot2Neg();
117 return ::acos(lScalPtot1Ptot2/::sqrt(lPtot1xPtot2) );
61690c9e 118}
119
120inline Double_t AliAODv0::MomPosX() const {return fPx[0];}
121inline Double_t AliAODv0::MomPosY() const {return fPy[0];}
122inline Double_t AliAODv0::MomPosZ() const {return fPz[0];}
123inline Double_t AliAODv0::MomNegX() const {return fPx[1];}
124inline Double_t AliAODv0::MomNegY() const {return fPy[1];}
125inline Double_t AliAODv0::MomNegZ() const {return fPz[1];}
126
5cc73331 127inline Double_t AliAODv0::Chi2V0() const {return GetSecondaryVtx()->GetChi2perNDF();}
61690c9e 128
129// Compare eventually AliAODv0::MomV0X() and AliAODRecoDecay::Px()
130inline Double_t AliAODv0::MomV0X() const {return MomPosX()+MomNegX();}
131inline Double_t AliAODv0::MomV0Y() const {return MomPosY()+MomNegY();}
132inline Double_t AliAODv0::MomV0Z() const {return MomPosZ()+MomNegZ();}
133
134inline Double_t AliAODv0::Ptot2Pos() const {
135 return (::pow(MomPosX(),2) + ::pow(MomPosY(),2) + ::pow(MomPosZ(),2) );
136}
137inline Double_t AliAODv0::Ptot2Neg() const {
138 return (::pow(MomNegX(),2) + ::pow(MomNegY(),2) + ::pow(MomNegZ(),2) );
139}
140inline Double_t AliAODv0::Ptot2V0() const {return ( Pt2V0() + ::pow(MomV0Z(),2) );}
141inline Double_t AliAODv0::Pt2V0() const {
142 return (::pow(MomV0X(),2) + ::pow(MomV0Y(),2) );
143}
144
145inline Double_t AliAODv0::MomPosAlongV0() const {
146 Double_t lPtot2V0 = Ptot2V0();
147 if (lPtot2V0)
148 return (MomPosX()*MomV0X() +
149 MomPosY()*MomV0Y() +
150 MomPosZ()*MomV0Z()) / ::sqrt(lPtot2V0);
151 return 0.;
152}
153
154inline Double_t AliAODv0::MomNegAlongV0() const {
155 Double_t lPtot2V0 = Ptot2V0();
156 if (lPtot2V0)
157 return (MomNegX()*MomV0X() +
158 MomNegY()*MomV0Y() +
159 MomNegZ()*MomV0Z()) / ::sqrt(lPtot2V0);
160 return 0.;
161}
162
163inline Double_t AliAODv0::AlphaV0() const {
164 return Alpha();
165}
166inline Double_t AliAODv0::PtArmV0() const {
167 return QtProng(0);
168}
169
170inline Double_t AliAODv0::EPosProton() const {
171 return EProng(0,2212);
172}
173
174inline Double_t AliAODv0::ENegProton() const {
175 return EProng(1,2212);
176}
177
178inline Double_t AliAODv0::EPosPion() const {
179 return EProng(0,211);
180}
181
182inline Double_t AliAODv0::ENegPion() const {
183 return EProng(1,211);
184}
185
186inline Double_t AliAODv0::ELambda() const {
187 return E(3122);
188}
189
190inline Double_t AliAODv0::EK0Short() const {
191 return E(310);
192}
193
194inline Double_t AliAODv0::MassLambda() const {
195 return InvMass2Prongs(0,1,2212,211);
196}
197
198inline Double_t AliAODv0::MassAntiLambda() const {
199 return InvMass2Prongs(0,1,211,2212);
200}
201
202inline Double_t AliAODv0::MassK0Short() const {
203 return InvMass2Prongs(0,1,211,211);
204}
205
206inline Double_t AliAODv0::RapK0Short() const {
207 return Y(310);
208}
209
210inline Double_t AliAODv0::RapLambda() const {
211 return Y(3122);
212}
213
214inline Double_t AliAODv0::PseudoRapV0() const {
215 return Eta();
216}
217
218inline Double_t AliAODv0::PseudoRapPos() const {
219 return EtaProng(0);
220}
221
222inline Double_t AliAODv0::PseudoRapNeg() const {
223 return EtaProng(1);
224}
225//----------------------------------------------------------------------------
226
227#endif