Introducing a new AOD class: AliAODcascade (A.Maire)
[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
15#include <TDatabasePDG.h>
16
17#include <AliAODv0.h>
18
19
20#define MASS(PID) TDatabasePDG::Instance()->GetParticle((PID))->Mass()
21#define MASS2(PID) MASS((PID))*MASS((PID))
22
23
24class AliAODTrack;
25class AliAODVertex;
26
27
28
29class AliAODcascade : public AliAODv0 {
30
31public:
32 AliAODcascade();
33
34 AliAODcascade(const AliAODcascade& rSource);
35
36 AliAODcascade( AliAODVertex* rAODVertexXi, // No "const" param, constructor "TRef(const TObject*)" doesn't exist.
37 Int_t rChargeXi,
38 Double_t rDcaXiDaughters,
39 Double_t rDcaXiToPrimVertex,
40 Double_t rDcaBachToPrimVertex,
41 const Double_t* rMomBach,
42
43 AliAODVertex* rAODVertexV0, // No "const" param, see above.
44 Double_t rDcaV0Daughters,
45 Double_t rDcaV0ToPrimVertex,
46 const Double_t* rMomPos,
47 const Double_t* rMomNeg,
48 Double_t* rDcaDaughterToPrimVertex ); // const? -> Need agreement at AliAODRecoDecay level
49
50
51 AliAODcascade( AliAODVertex* rAODVertexXi, // No "const" param, see above.
52 Int_t rChargeXi,
53 Double_t rDcaXiDaughters,
54 Double_t rDcaXiToPrimVertex,
55 Double_t rDcaBachToPrimVertex,
56 const Double_t* rMomBach,
57 const AliAODv0& rAODv0 );
58
59
60
61 virtual ~AliAODcascade();
62
63 AliAODcascade& operator=(const AliAODcascade& rSource);
64
65 void Fill( AliAODVertex* rAODVertexXi, // No "const" param, see above.
66 Int_t rChargeXi,
67 Double_t rDcaXiDaughters,
68 Double_t rDcaXiToPrimVertex,
69 Double_t rDcaBachToPrimVertex,
70 const Double_t* rMomBach,
71
72 AliAODVertex* rAODVertexV0, // No "const" param, see above.
73 Double_t rDcaV0Daughters,
74 Double_t rDcaV0ToPrimVertex,
75 const Double_t* rMomPos,
76 const Double_t* rMomNeg,
77 Double_t* rDcaDaughterToPrimVertex ); // const? -> Need agreement at AliAODRecoDecay level
78
79// void Fill( AliAODVertex* rAODVertexXi,
80// Int_t rChargeXi,
81// Double_t rDcaXiDaughters,
82// Double_t rDcaXiToPrimVertex,
83// Double_t rDcaBachToPrimVertex,
84// const Double_t* rMomBach,
85// const AliAODv0& rAODv0 ); // -> To be implemented ...
86
87
88 void ResetXi();
89 void PrintXi(const Double_t& rPrimVtxX,
90 const Double_t& rPrimVtxY,
91 const Double_t& rPrimVtxZ) const;
92
93// ----
94 Int_t ChargeXi() const;
95 Int_t GetBachID() const;
96 Int_t GetLabel() const {return -1;}
97
98 AliAODVertex* GetDecayVertexXi() const;
99 Double_t DecayVertexXiX() const;
100 Double_t DecayVertexXiY() const;
101 Double_t DecayVertexXiZ() const;
102 Double_t Chi2Xi() const;
103
104
105 Double_t DcaBachToPrimVertex() const;
106 Double_t DcaXiDaughters() const;
107 Double_t DcaXiToPrimVertex() const;
108 Double_t DcaXiToPrimVertex(const Double_t& rPrimVtxX, // hopefully, temporary method ...
109 const Double_t& rPrimVtxY,
110 const Double_t& rPrimVtxZ) const;
111 Double_t CosPointingAngleXi(const Double_t& rPrimVtxX,
112 const Double_t& rPrimVtxY,
113 const Double_t& rPrimVtxZ) const;
114
115
116 Double_t DecayLengthV0() const;
117 Double_t DecayLengthXi(const Double_t& rPrimVtxX,
118 const Double_t& rPrimVtxY,
119 const Double_t& rPrimVtxZ) const;
120
121
122 Double_t MomBachX() const;
123 Double_t MomBachY() const;
124 Double_t MomBachZ() const;
125
126 Double_t MomXiX() const;
127 Double_t MomXiY() const;
128 Double_t MomXiZ() const;
129
130// ----
131 Double_t Ptot2Bach() const;
132 Double_t Ptot2Xi() const;
133 Double_t Pt2Xi() const;
134 Double_t MomBachAlongXi() const;
135 Double_t MomV0AlongXi() const;
136 Double_t AlphaXi() const;
137 Double_t PtArmXi() const;
138 Double_t EBachPion() const;
139 Double_t EBachKaon() const;
140 Double_t EXi() const;
141 Double_t EOmega() const;
142 Double_t MassXi() const;
143 Double_t MassOmega() const;
144 Double_t RapXi() const;
145 Double_t RapOmega() const;
146
147
148protected:
149
150 TRef fDecayVertexXi; // ref to decay vertex of the cascade (Xi vertex)
151 Short_t fChargeXi; // charge of Xi
152
153 Double32_t fDcaXiDaughters; // dca between Xi daughters
154 Double32_t fDcaXiToPrimVertex; // dca of Xi to primary vertex
155 Double32_t fDcaBachToPrimVertex; // dca of bachelor to primary vertex
156
157 Double32_t fMomBachX; // momemtum of bachelor along X
158 Double32_t fMomBachY; // momemtum of bachelor along Y
159 Double32_t fMomBachZ; // momemtum of bachelor along Z
160
161
162 ClassDef(AliAODcascade,1)
163};
164
165
166
167
168//-----------------------------------------------------------
169
170
171
172inline Int_t AliAODcascade::ChargeXi() const {return fChargeXi; }
173
174inline AliAODVertex* AliAODcascade::GetDecayVertexXi() const { return (AliAODVertex*)fDecayVertexXi.GetObject(); }
175inline Double_t AliAODcascade::DecayVertexXiX() const {return GetDecayVertexXi()->GetX(); }
176inline Double_t AliAODcascade::DecayVertexXiY() const {return GetDecayVertexXi()->GetY(); }
177inline Double_t AliAODcascade::DecayVertexXiZ() const {return GetDecayVertexXi()->GetZ(); }
178
179inline Double_t AliAODcascade::Chi2Xi() const {return GetDecayVertexXi()->GetChi2(); }
180
181
182
183inline Double_t AliAODcascade::DcaBachToPrimVertex() const {return fDcaBachToPrimVertex;}
184inline Double_t AliAODcascade::DcaXiDaughters() const {return fDcaXiDaughters;}
185inline Double_t AliAODcascade::DcaXiToPrimVertex() const {return fDcaXiToPrimVertex;}
186
187
188
189
190inline Double_t AliAODcascade::DecayLengthV0() const {
191 return ::sqrt(::pow(DecayVertexV0X() - DecayVertexXiX(),2) +
192 ::pow(DecayVertexV0Y() - DecayVertexXiY(),2) +
193 ::pow(DecayVertexV0Z() - DecayVertexXiZ(),2));
194}
195
196inline Double_t AliAODcascade::DecayLengthXi(const Double_t& rPrimVtxX,
197 const Double_t& rPrimVtxY,
198 const Double_t& rPrimVtxZ) const {
199 return ::sqrt(::pow(DecayVertexXiX() - rPrimVtxX,2) +
200 ::pow(DecayVertexXiY() - rPrimVtxY,2) +
201 ::pow(DecayVertexXiZ() - rPrimVtxZ,2));
202}
203
204
205
206
207
208
209inline Double_t AliAODcascade::MomBachX() const {return fMomBachX;}
210inline Double_t AliAODcascade::MomBachY() const {return fMomBachY;}
211inline Double_t AliAODcascade::MomBachZ() const {return fMomBachZ;}
212
213inline Double_t AliAODcascade::MomXiX() const {return MomV0X()+fMomBachX;}
214inline Double_t AliAODcascade::MomXiY() const {return MomV0Y()+fMomBachY;}
215inline Double_t AliAODcascade::MomXiZ() const {return MomV0Z()+fMomBachZ;}
216
217inline Double_t AliAODcascade::Ptot2Bach() const {
218 return (::pow(fMomBachX,2) + ::pow(fMomBachY,2) + ::pow(fMomBachZ,2) );
219}
220inline Double_t AliAODcascade::Ptot2Xi() const {return ( Pt2Xi() + ::pow(MomXiZ(),2) );}
221inline Double_t AliAODcascade::Pt2Xi() const {
222 return (::pow(MomXiX(),2) + ::pow(MomXiY(),2) );
223}
224
225inline Double_t AliAODcascade::MomBachAlongXi() const {
226 Double_t rPtot2Xi = Ptot2Xi();
227 if (rPtot2Xi)
228 return (MomBachX()*MomXiX() +
229 MomBachY()*MomXiY() +
230 MomBachZ()*MomXiZ()) / ::sqrt(rPtot2Xi);
231 else return 0.;
232}
233
234inline Double_t AliAODcascade::MomV0AlongXi() const {
235 Double_t rPtot2Xi = Ptot2Xi();
236 if (rPtot2Xi)
237 return (MomV0X()*MomXiX() +
238 MomV0Y()*MomXiY() +
239 MomV0Z()*MomXiZ()) / ::sqrt(rPtot2Xi);
240 return 0.;
241}
242
243inline Double_t AliAODcascade::AlphaXi() const {
244 Double_t rMomV0AlongXi = MomV0AlongXi();
245 Double_t rMomBachAlongXi = MomBachAlongXi();
246
247 return (((Float_t) ChargeXi()) * (rMomBachAlongXi - rMomV0AlongXi)/
248 (rMomBachAlongXi + rMomV0AlongXi));
249}
250
251inline Double_t AliAODcascade::PtArmXi() const {
252 return ::sqrt(Ptot2Bach()-MomBachAlongXi()*MomBachAlongXi());
253}
254
255inline Double_t AliAODcascade::EBachPion() const {
256 return ::sqrt(Ptot2Bach()+MASS2("pi-"));
257}
258
259inline Double_t AliAODcascade::EBachKaon() const {
260 return ::sqrt(Ptot2Bach()+MASS2("K-"));
261}
262
263inline Double_t AliAODcascade::EXi() const {
264 return ::sqrt(Ptot2Xi()+MASS2("Xi-"));
265}
266
267inline Double_t AliAODcascade::EOmega() const {
268 return ::sqrt(Ptot2Xi()+MASS2("Omega-"));
269}
270
271inline Double_t AliAODcascade::MassXi() const {
272 return ::sqrt(::pow(ELambda()+EBachPion(),2)-Ptot2Xi());
273}
274
275inline Double_t AliAODcascade::MassOmega() const {
276 return ::sqrt(::pow(ELambda()+EBachKaon(),2)-Ptot2Xi());
277}
278
279inline Double_t AliAODcascade::RapXi() const {
280 Double_t exi = EXi();
281 Double_t rMomXiZ = MomXiZ();
282 return 0.5*::log((exi+rMomXiZ)/(exi-rMomXiZ));
283}
284
285inline Double_t AliAODcascade::RapOmega() const {
286 Double_t eom = EOmega();
287 Double_t rMomXiZ = MomXiZ();
288 return 0.5*::log((eom+rMomXiZ)/(eom-rMomXiZ));
289}
290
291#endif