Bug corrected.
[u/mrichter/AliRoot.git] / STEER / AliAODcascade.h
CommitLineData
5f10117a 1#ifndef ALIAODCASCADE_H
2#define ALIAODCASCADE_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) Xi vertex class
9// Origin: A.Maire, IReS, antonin.maire@ires.in2p3.fr
10// G.Van Buren, BNL, gene@bnl.gov (original STAR MuDsts)
11//
12// Purpose: Having physics observables available for Xis
13//-------------------------------------------------------------------------
14
5f10117a 15
97135b34 16#include "AliAODv0.h"
5f10117a 17
18class AliAODTrack;
19class AliAODVertex;
20
5f10117a 21class AliAODcascade : public AliAODv0 {
22
23public:
24 AliAODcascade();
25
26 AliAODcascade(const AliAODcascade& rSource);
27
28 AliAODcascade( AliAODVertex* rAODVertexXi, // No "const" param, constructor "TRef(const TObject*)" doesn't exist.
29 Int_t rChargeXi,
30 Double_t rDcaXiDaughters,
31 Double_t rDcaXiToPrimVertex,
32 Double_t rDcaBachToPrimVertex,
33 const Double_t* rMomBach,
34
35 AliAODVertex* rAODVertexV0, // No "const" param, see above.
36 Double_t rDcaV0Daughters,
37 Double_t rDcaV0ToPrimVertex,
38 const Double_t* rMomPos,
39 const Double_t* rMomNeg,
40 Double_t* rDcaDaughterToPrimVertex ); // const? -> Need agreement at AliAODRecoDecay level
41
42
43 AliAODcascade( AliAODVertex* rAODVertexXi, // No "const" param, see above.
44 Int_t rChargeXi,
45 Double_t rDcaXiDaughters,
46 Double_t rDcaXiToPrimVertex,
47 Double_t rDcaBachToPrimVertex,
48 const Double_t* rMomBach,
49 const AliAODv0& rAODv0 );
50
51
52
53 virtual ~AliAODcascade();
54
55 AliAODcascade& operator=(const AliAODcascade& rSource);
56
97135b34 57 void Fill(AliAODVertex* rAODVertexXi, // No "const" param, see above.
5f10117a 58 Int_t rChargeXi,
59 Double_t rDcaXiDaughters,
60 Double_t rDcaXiToPrimVertex,
61 Double_t rDcaBachToPrimVertex,
62 const Double_t* rMomBach,
63
64 AliAODVertex* rAODVertexV0, // No "const" param, see above.
65 Double_t rDcaV0Daughters,
66 Double_t rDcaV0ToPrimVertex,
67 const Double_t* rMomPos,
68 const Double_t* rMomNeg,
69 Double_t* rDcaDaughterToPrimVertex ); // const? -> Need agreement at AliAODRecoDecay level
70
71// void Fill( AliAODVertex* rAODVertexXi,
72// Int_t rChargeXi,
73// Double_t rDcaXiDaughters,
74// Double_t rDcaXiToPrimVertex,
75// Double_t rDcaBachToPrimVertex,
76// const Double_t* rMomBach,
77// const AliAODv0& rAODv0 ); // -> To be implemented ...
78
79
80 void ResetXi();
81 void PrintXi(const Double_t& rPrimVtxX,
82 const Double_t& rPrimVtxY,
83 const Double_t& rPrimVtxZ) const;
84
85// ----
86 Int_t ChargeXi() const;
87 Int_t GetBachID() const;
88 Int_t GetLabel() const {return -1;}
89
90 AliAODVertex* GetDecayVertexXi() const;
91 Double_t DecayVertexXiX() const;
92 Double_t DecayVertexXiY() const;
93 Double_t DecayVertexXiZ() const;
94 Double_t Chi2Xi() const;
5f10117a 95
96 Double_t DcaBachToPrimVertex() const;
97 Double_t DcaXiDaughters() const;
98 Double_t DcaXiToPrimVertex() const;
99 Double_t DcaXiToPrimVertex(const Double_t& rPrimVtxX, // hopefully, temporary method ...
100 const Double_t& rPrimVtxY,
101 const Double_t& rPrimVtxZ) const;
102 Double_t CosPointingAngleXi(const Double_t& rPrimVtxX,
103 const Double_t& rPrimVtxY,
104 const Double_t& rPrimVtxZ) const;
105
5f10117a 106 Double_t DecayLengthV0() const;
107 Double_t DecayLengthXi(const Double_t& rPrimVtxX,
108 const Double_t& rPrimVtxY,
109 const Double_t& rPrimVtxZ) const;
97135b34 110
5f10117a 111 Double_t MomBachX() const;
112 Double_t MomBachY() const;
113 Double_t MomBachZ() const;
114
115 Double_t MomXiX() const;
116 Double_t MomXiY() const;
117 Double_t MomXiZ() const;
118
119// ----
120 Double_t Ptot2Bach() const;
121 Double_t Ptot2Xi() const;
122 Double_t Pt2Xi() const;
123 Double_t MomBachAlongXi() const;
124 Double_t MomV0AlongXi() const;
125 Double_t AlphaXi() const;
126 Double_t PtArmXi() const;
127 Double_t EBachPion() const;
128 Double_t EBachKaon() const;
129 Double_t EXi() const;
130 Double_t EOmega() const;
131 Double_t MassXi() const;
132 Double_t MassOmega() const;
133 Double_t RapXi() const;
134 Double_t RapOmega() const;
135
5f10117a 136protected:
137
138 TRef fDecayVertexXi; // ref to decay vertex of the cascade (Xi vertex)
139 Short_t fChargeXi; // charge of Xi
140
141 Double32_t fDcaXiDaughters; // dca between Xi daughters
142 Double32_t fDcaXiToPrimVertex; // dca of Xi to primary vertex
143 Double32_t fDcaBachToPrimVertex; // dca of bachelor to primary vertex
144
145 Double32_t fMomBachX; // momemtum of bachelor along X
146 Double32_t fMomBachY; // momemtum of bachelor along Y
147 Double32_t fMomBachZ; // momemtum of bachelor along Z
5f10117a 148
149 ClassDef(AliAODcascade,1)
150};
151
5f10117a 152//-----------------------------------------------------------
153
5f10117a 154inline Int_t AliAODcascade::ChargeXi() const {return fChargeXi; }
155
156inline AliAODVertex* AliAODcascade::GetDecayVertexXi() const { return (AliAODVertex*)fDecayVertexXi.GetObject(); }
157inline Double_t AliAODcascade::DecayVertexXiX() const {return GetDecayVertexXi()->GetX(); }
158inline Double_t AliAODcascade::DecayVertexXiY() const {return GetDecayVertexXi()->GetY(); }
159inline Double_t AliAODcascade::DecayVertexXiZ() const {return GetDecayVertexXi()->GetZ(); }
160
161inline Double_t AliAODcascade::Chi2Xi() const {return GetDecayVertexXi()->GetChi2(); }
162
5f10117a 163inline Double_t AliAODcascade::DcaBachToPrimVertex() const {return fDcaBachToPrimVertex;}
164inline Double_t AliAODcascade::DcaXiDaughters() const {return fDcaXiDaughters;}
165inline Double_t AliAODcascade::DcaXiToPrimVertex() const {return fDcaXiToPrimVertex;}
166
5f10117a 167inline Double_t AliAODcascade::DecayLengthV0() const {
168 return ::sqrt(::pow(DecayVertexV0X() - DecayVertexXiX(),2) +
169 ::pow(DecayVertexV0Y() - DecayVertexXiY(),2) +
170 ::pow(DecayVertexV0Z() - DecayVertexXiZ(),2));
171}
172
173inline Double_t AliAODcascade::DecayLengthXi(const Double_t& rPrimVtxX,
174 const Double_t& rPrimVtxY,
175 const Double_t& rPrimVtxZ) const {
176 return ::sqrt(::pow(DecayVertexXiX() - rPrimVtxX,2) +
177 ::pow(DecayVertexXiY() - rPrimVtxY,2) +
178 ::pow(DecayVertexXiZ() - rPrimVtxZ,2));
179}
180
5f10117a 181inline Double_t AliAODcascade::MomBachX() const {return fMomBachX;}
182inline Double_t AliAODcascade::MomBachY() const {return fMomBachY;}
183inline Double_t AliAODcascade::MomBachZ() const {return fMomBachZ;}
184
185inline Double_t AliAODcascade::MomXiX() const {return MomV0X()+fMomBachX;}
186inline Double_t AliAODcascade::MomXiY() const {return MomV0Y()+fMomBachY;}
187inline Double_t AliAODcascade::MomXiZ() const {return MomV0Z()+fMomBachZ;}
188
189inline Double_t AliAODcascade::Ptot2Bach() const {
190 return (::pow(fMomBachX,2) + ::pow(fMomBachY,2) + ::pow(fMomBachZ,2) );
191}
192inline Double_t AliAODcascade::Ptot2Xi() const {return ( Pt2Xi() + ::pow(MomXiZ(),2) );}
193inline Double_t AliAODcascade::Pt2Xi() const {
194 return (::pow(MomXiX(),2) + ::pow(MomXiY(),2) );
195}
196
197inline Double_t AliAODcascade::MomBachAlongXi() const {
198 Double_t rPtot2Xi = Ptot2Xi();
199 if (rPtot2Xi)
200 return (MomBachX()*MomXiX() +
201 MomBachY()*MomXiY() +
202 MomBachZ()*MomXiZ()) / ::sqrt(rPtot2Xi);
203 else return 0.;
204}
205
206inline Double_t AliAODcascade::MomV0AlongXi() const {
207 Double_t rPtot2Xi = Ptot2Xi();
208 if (rPtot2Xi)
209 return (MomV0X()*MomXiX() +
210 MomV0Y()*MomXiY() +
211 MomV0Z()*MomXiZ()) / ::sqrt(rPtot2Xi);
212 return 0.;
213}
214
215inline Double_t AliAODcascade::AlphaXi() const {
216 Double_t rMomV0AlongXi = MomV0AlongXi();
217 Double_t rMomBachAlongXi = MomBachAlongXi();
218
219 return (((Float_t) ChargeXi()) * (rMomBachAlongXi - rMomV0AlongXi)/
220 (rMomBachAlongXi + rMomV0AlongXi));
221}
222
223inline Double_t AliAODcascade::PtArmXi() const {
224 return ::sqrt(Ptot2Bach()-MomBachAlongXi()*MomBachAlongXi());
225}
226
5f10117a 227inline Double_t AliAODcascade::MassXi() const {
228 return ::sqrt(::pow(ELambda()+EBachPion(),2)-Ptot2Xi());
229}
230
231inline Double_t AliAODcascade::MassOmega() const {
232 return ::sqrt(::pow(ELambda()+EBachKaon(),2)-Ptot2Xi());
233}
234
235inline Double_t AliAODcascade::RapXi() const {
236 Double_t exi = EXi();
237 Double_t rMomXiZ = MomXiZ();
238 return 0.5*::log((exi+rMomXiZ)/(exi-rMomXiZ));
239}
240
241inline Double_t AliAODcascade::RapOmega() const {
242 Double_t eom = EOmega();
243 Double_t rMomXiZ = MomXiZ();
244 return 0.5*::log((eom+rMomXiZ)/(eom-rMomXiZ));
245}
246
247#endif