Bug fix - the reco-param index was initialized in case of an array of reco-param...
[u/mrichter/AliRoot.git] / STEER / AliAODv0.h
CommitLineData
61690c9e 1#ifndef AliAODv0_H
2#define AliAODv0_H
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
14//class AliESDEvent;
15//class AliESDv0;
16
17class AliAODv0 : public AliAODRecoDecay {
18
19public:
20
21 AliAODv0();
22 // AliAODv0(AliESDv0 *rV0Vertex, AliESDEvent *rEvent);
23 AliAODv0(AliAODVertex *rAODVertex, Double_t rDcaV0Daughters, Double_t rDcaV0ToPrimVertex,
24 Double_t *rMomPos, Double_t *rMomNeg, Double_t *rDcaDaughterToPrimVertex);
25 virtual ~AliAODv0();
26
27 AliAODv0(const AliAODv0& rAliAODv0);
28 AliAODv0& operator=(const AliAODv0& rAliAODv0);
29
30 // void Fill(AliESDv0 *rV0Vertex, AliESDEvent *rEvent);
31 void Fill(AliAODVertex *rAODVertex, Double_t rDcaV0Daughters, Double_t rDcaV0ToPrimVertex,
32 Double_t *rMomPos, Double_t *rMomNeg, Double_t *rDcaDaughterToPrimVertex);
33 void ResetV0();
34 void Print(Option_t* option = "") const;
35
105ab4d7 36 void SetOnFlyStatus(Bool_t status){fOnFlyStatus=status;}
37 Bool_t GetOnFlyStatus() const {return fOnFlyStatus;}
38
61690c9e 39 Double_t DecayVertexV0X() const;
40 Double_t DecayVertexV0Y() const;
41 Double_t DecayVertexV0Z() const;
42
43 Double_t DecayLengthV0(double*) const;
44
45 Double_t DcaV0Daughters() const;
46 Double_t DcaV0ToPrimVertex() const;
47 Double_t DcaPosToPrimVertex() const;
48 Double_t DcaNegToPrimVertex() const;
49 Double_t RadiusV0() const;
50 Double_t OpenAngleV0() const;
51
52 Double_t MomPosX() const;
53 Double_t MomPosY() const;
54 Double_t MomPosZ() const;
55 Double_t MomNegX() const;
56 Double_t MomNegY() const;
57 Double_t MomNegZ() const;
58
59 // Int_t KeyPos() const;
60 // Int_t KeyNeg() const;
61
62 Double_t Chi2V0() const;
63
64 Double_t MomV0X() const;
65 Double_t MomV0Y() const;
66 Double_t MomV0Z() const;
67
68 Double_t Ptot2Pos() const;
69 Double_t Ptot2Neg() const;
70 Double_t Ptot2V0() const;
71 Double_t Pt2V0() const;
72 Double_t MomPosAlongV0() const;
73 Double_t MomNegAlongV0() const;
74 Double_t AlphaV0() const;
75 Double_t PtArmV0() const;
76 Double_t EPosProton() const;
77 Double_t ENegProton() const;
78 Double_t EPosPion() const;
79 Double_t ENegPion() const;
80 Double_t ELambda() const;
81 Double_t EK0Short() const;
82 Double_t MassLambda() const;
83 Double_t MassAntiLambda() const;
84 Double_t MassK0Short() const;
85 Double_t RapK0Short() const;
86 Double_t RapLambda() const;
87 Double_t PseudoRapV0() const;
88 Double_t PseudoRapPos() const;
89 Double_t PseudoRapNeg() const;
3c43fb2b 90
91 Int_t GetLabel() const {return -1;} // Dummy
61690c9e 92
93protected:
94 Double32_t fDcaV0ToPrimVertex; // dca of V0 to primary vertex
105ab4d7 95 Bool_t fOnFlyStatus; // if kTRUE, then this V0 is recontructed
96 // "on fly" during the tracking
97 ClassDef(AliAODv0,2)
61690c9e 98};
99
100inline Double_t AliAODv0::DecayVertexV0X() const {return this->GetSecVtxX();}
101inline Double_t AliAODv0::DecayVertexV0Y() const {return this->GetSecVtxY();}
102inline Double_t AliAODv0::DecayVertexV0Z() const {return this->GetSecVtxZ();}
103
104inline Double_t AliAODv0::DecayLengthV0(double *tParentVertexPosition) const {
105 return ::sqrt(::pow(DecayVertexV0X() - tParentVertexPosition[0],2) +
106 ::pow(DecayVertexV0Y() - tParentVertexPosition[1],2) +
107 ::pow(DecayVertexV0Z() - tParentVertexPosition[2],2));
108}
109
110inline Double_t AliAODv0::DcaV0Daughters() const {return fDCA[0];}
111inline Double_t AliAODv0::DcaV0ToPrimVertex() const {return fDcaV0ToPrimVertex;}
112inline Double_t AliAODv0::DcaPosToPrimVertex() const {return fd0[0];}
113inline Double_t AliAODv0::DcaNegToPrimVertex() const {return fd0[1];}
114
115inline Double_t AliAODv0::RadiusV0() const {
116 return RadiusSecVtx();
117}
118
119inline Double_t AliAODv0::OpenAngleV0() const {
120 Double_t lPtot1xPtot2 = PxProng(0)*PxProng(1)+PyProng(0)*PyProng(1)+PzProng(0)*PzProng(1);
121 Double_t lPtot1Ptot2_2 = Ptot2Pos()*Ptot2Neg();
122 return ::acos(lPtot1xPtot2/::sqrt(lPtot1Ptot2_2) );
123}
124
125inline Double_t AliAODv0::MomPosX() const {return fPx[0];}
126inline Double_t AliAODv0::MomPosY() const {return fPy[0];}
127inline Double_t AliAODv0::MomPosZ() const {return fPz[0];}
128inline Double_t AliAODv0::MomNegX() const {return fPx[1];}
129inline Double_t AliAODv0::MomNegY() const {return fPy[1];}
130inline Double_t AliAODv0::MomNegZ() const {return fPz[1];}
131
132// inline Int_t AliAODv0::KeyPos() const {return fKeyPos;}
133// inline Int_t AliAODv0::KeyNeg() const {return fKeyNeg;}
134
5cc73331 135inline Double_t AliAODv0::Chi2V0() const {return GetSecondaryVtx()->GetChi2perNDF();}
61690c9e 136
137// Compare eventually AliAODv0::MomV0X() and AliAODRecoDecay::Px()
138inline Double_t AliAODv0::MomV0X() const {return MomPosX()+MomNegX();}
139inline Double_t AliAODv0::MomV0Y() const {return MomPosY()+MomNegY();}
140inline Double_t AliAODv0::MomV0Z() const {return MomPosZ()+MomNegZ();}
141
142inline Double_t AliAODv0::Ptot2Pos() const {
143 return (::pow(MomPosX(),2) + ::pow(MomPosY(),2) + ::pow(MomPosZ(),2) );
144}
145inline Double_t AliAODv0::Ptot2Neg() const {
146 return (::pow(MomNegX(),2) + ::pow(MomNegY(),2) + ::pow(MomNegZ(),2) );
147}
148inline Double_t AliAODv0::Ptot2V0() const {return ( Pt2V0() + ::pow(MomV0Z(),2) );}
149inline Double_t AliAODv0::Pt2V0() const {
150 return (::pow(MomV0X(),2) + ::pow(MomV0Y(),2) );
151}
152
153inline Double_t AliAODv0::MomPosAlongV0() const {
154 Double_t lPtot2V0 = Ptot2V0();
155 if (lPtot2V0)
156 return (MomPosX()*MomV0X() +
157 MomPosY()*MomV0Y() +
158 MomPosZ()*MomV0Z()) / ::sqrt(lPtot2V0);
159 return 0.;
160}
161
162inline Double_t AliAODv0::MomNegAlongV0() const {
163 Double_t lPtot2V0 = Ptot2V0();
164 if (lPtot2V0)
165 return (MomNegX()*MomV0X() +
166 MomNegY()*MomV0Y() +
167 MomNegZ()*MomV0Z()) / ::sqrt(lPtot2V0);
168 return 0.;
169}
170
171inline Double_t AliAODv0::AlphaV0() const {
172 return Alpha();
173}
174inline Double_t AliAODv0::PtArmV0() const {
175 return QtProng(0);
176}
177
178inline Double_t AliAODv0::EPosProton() const {
179 return EProng(0,2212);
180}
181
182inline Double_t AliAODv0::ENegProton() const {
183 return EProng(1,2212);
184}
185
186inline Double_t AliAODv0::EPosPion() const {
187 return EProng(0,211);
188}
189
190inline Double_t AliAODv0::ENegPion() const {
191 return EProng(1,211);
192}
193
194inline Double_t AliAODv0::ELambda() const {
195 return E(3122);
196}
197
198inline Double_t AliAODv0::EK0Short() const {
199 return E(310);
200}
201
202inline Double_t AliAODv0::MassLambda() const {
203 return InvMass2Prongs(0,1,2212,211);
204}
205
206inline Double_t AliAODv0::MassAntiLambda() const {
207 return InvMass2Prongs(0,1,211,2212);
208}
209
210inline Double_t AliAODv0::MassK0Short() const {
211 return InvMass2Prongs(0,1,211,211);
212}
213
214inline Double_t AliAODv0::RapK0Short() const {
215 return Y(310);
216}
217
218inline Double_t AliAODv0::RapLambda() const {
219 return Y(3122);
220}
221
222inline Double_t AliAODv0::PseudoRapV0() const {
223 return Eta();
224}
225
226inline Double_t AliAODv0::PseudoRapPos() const {
227 return EtaProng(0);
228}
229
230inline Double_t AliAODv0::PseudoRapNeg() const {
231 return EtaProng(1);
232}
233//----------------------------------------------------------------------------
234
235#endif