Fixes for bug #52499: Field polarities inconsistiency
[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;
3c43fb2b 85 Int_t GetLabel() const {return -1;} // Dummy
61690c9e 86
87protected:
88 Double32_t fDcaV0ToPrimVertex; // dca of V0 to primary vertex
105ab4d7 89 Bool_t fOnFlyStatus; // if kTRUE, then this V0 is recontructed
90 // "on fly" during the tracking
91 ClassDef(AliAODv0,2)
61690c9e 92};
93
94inline Double_t AliAODv0::DecayVertexV0X() const {return this->GetSecVtxX();}
95inline Double_t AliAODv0::DecayVertexV0Y() const {return this->GetSecVtxY();}
96inline Double_t AliAODv0::DecayVertexV0Z() const {return this->GetSecVtxZ();}
97
96d949da 98inline Double_t AliAODv0::DecayLengthV0(const Double_t *tParentVertexPosition) const {
61690c9e 99 return ::sqrt(::pow(DecayVertexV0X() - tParentVertexPosition[0],2) +
100 ::pow(DecayVertexV0Y() - tParentVertexPosition[1],2) +
101 ::pow(DecayVertexV0Z() - tParentVertexPosition[2],2));
102}
103
104inline Double_t AliAODv0::DcaV0Daughters() const {return fDCA[0];}
105inline Double_t AliAODv0::DcaV0ToPrimVertex() const {return fDcaV0ToPrimVertex;}
106inline Double_t AliAODv0::DcaPosToPrimVertex() const {return fd0[0];}
107inline Double_t AliAODv0::DcaNegToPrimVertex() const {return fd0[1];}
108
109inline Double_t AliAODv0::RadiusV0() const {
110 return RadiusSecVtx();
111}
112
113inline Double_t AliAODv0::OpenAngleV0() const {
97135b34 114 Double_t lScalPtot1Ptot2 = PxProng(0)*PxProng(1)+PyProng(0)*PyProng(1)+PzProng(0)*PzProng(1);
115 Double_t lPtot1xPtot2 = Ptot2Pos()*Ptot2Neg();
116 return ::acos(lScalPtot1Ptot2/::sqrt(lPtot1xPtot2) );
61690c9e 117}
118
119inline Double_t AliAODv0::MomPosX() const {return fPx[0];}
120inline Double_t AliAODv0::MomPosY() const {return fPy[0];}
121inline Double_t AliAODv0::MomPosZ() const {return fPz[0];}
122inline Double_t AliAODv0::MomNegX() const {return fPx[1];}
123inline Double_t AliAODv0::MomNegY() const {return fPy[1];}
124inline Double_t AliAODv0::MomNegZ() const {return fPz[1];}
125
5cc73331 126inline Double_t AliAODv0::Chi2V0() const {return GetSecondaryVtx()->GetChi2perNDF();}
61690c9e 127
128// Compare eventually AliAODv0::MomV0X() and AliAODRecoDecay::Px()
129inline Double_t AliAODv0::MomV0X() const {return MomPosX()+MomNegX();}
130inline Double_t AliAODv0::MomV0Y() const {return MomPosY()+MomNegY();}
131inline Double_t AliAODv0::MomV0Z() const {return MomPosZ()+MomNegZ();}
132
133inline Double_t AliAODv0::Ptot2Pos() const {
134 return (::pow(MomPosX(),2) + ::pow(MomPosY(),2) + ::pow(MomPosZ(),2) );
135}
136inline Double_t AliAODv0::Ptot2Neg() const {
137 return (::pow(MomNegX(),2) + ::pow(MomNegY(),2) + ::pow(MomNegZ(),2) );
138}
139inline Double_t AliAODv0::Ptot2V0() const {return ( Pt2V0() + ::pow(MomV0Z(),2) );}
140inline Double_t AliAODv0::Pt2V0() const {
141 return (::pow(MomV0X(),2) + ::pow(MomV0Y(),2) );
142}
143
144inline Double_t AliAODv0::MomPosAlongV0() const {
145 Double_t lPtot2V0 = Ptot2V0();
146 if (lPtot2V0)
147 return (MomPosX()*MomV0X() +
148 MomPosY()*MomV0Y() +
149 MomPosZ()*MomV0Z()) / ::sqrt(lPtot2V0);
150 return 0.;
151}
152
153inline Double_t AliAODv0::MomNegAlongV0() const {
154 Double_t lPtot2V0 = Ptot2V0();
155 if (lPtot2V0)
156 return (MomNegX()*MomV0X() +
157 MomNegY()*MomV0Y() +
158 MomNegZ()*MomV0Z()) / ::sqrt(lPtot2V0);
159 return 0.;
160}
161
162inline Double_t AliAODv0::AlphaV0() const {
163 return Alpha();
164}
165inline Double_t AliAODv0::PtArmV0() const {
166 return QtProng(0);
167}
168
169inline Double_t AliAODv0::EPosProton() const {
170 return EProng(0,2212);
171}
172
173inline Double_t AliAODv0::ENegProton() const {
174 return EProng(1,2212);
175}
176
177inline Double_t AliAODv0::EPosPion() const {
178 return EProng(0,211);
179}
180
181inline Double_t AliAODv0::ENegPion() const {
182 return EProng(1,211);
183}
184
185inline Double_t AliAODv0::ELambda() const {
186 return E(3122);
187}
188
189inline Double_t AliAODv0::EK0Short() const {
190 return E(310);
191}
192
193inline Double_t AliAODv0::MassLambda() const {
194 return InvMass2Prongs(0,1,2212,211);
195}
196
197inline Double_t AliAODv0::MassAntiLambda() const {
198 return InvMass2Prongs(0,1,211,2212);
199}
200
201inline Double_t AliAODv0::MassK0Short() const {
202 return InvMass2Prongs(0,1,211,211);
203}
204
205inline Double_t AliAODv0::RapK0Short() const {
206 return Y(310);
207}
208
209inline Double_t AliAODv0::RapLambda() const {
210 return Y(3122);
211}
212
213inline Double_t AliAODv0::PseudoRapV0() const {
214 return Eta();
215}
216
217inline Double_t AliAODv0::PseudoRapPos() const {
218 return EtaProng(0);
219}
220
221inline Double_t AliAODv0::PseudoRapNeg() const {
222 return EtaProng(1);
223}
224//----------------------------------------------------------------------------
225
226#endif