BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
UParticle.h
Go to the documentation of this file.
1#ifndef UPARTICLE_H
2#define UPARTICLE_H
3
4#include "TLorentzVector.h"
5#include "TMath.h"
6#include "TObject.h"
7
8class TParticle;
9
10/**
11 * unigen particle
12 */
13class UParticle : public TObject
14{
15
16 private:
17 Int_t fIndex; // index of this particle
18 Int_t fPdg; // PDG code
19 Int_t fStatus; // Status
20 Int_t fParent; // Index of parent
21 Int_t fParentDecay; // Parent decay index
22 Int_t fMate; // index of last collision partner
23 Int_t fDecay; // decay index (-1 if not decayed)
24 Int_t fChild[2]; // index of first and last child
25 Double32_t fPx; // px (GeV)
26 Double32_t fPy; // py (GeV)
27 Double32_t fPz; // pz (GeV)
28 Double32_t fE; // Energy (GeV)
29 Double32_t fX; // x (fm)
30 Double32_t fY; // y (fm)
31 Double32_t fZ; // z (fm)
32 Double32_t fT; // t (fm)
34
35 public:
36 /**
37 * default constructor
38 */
39 UParticle();
40 /**
41 * constructor
42 * @param index particle index
43 * @param pdg pid of track
44 * @param status particle status
45 * @param parent parent index
46 * @param parentDecay parent decay index
47 * @param mate index of last collision partner
48 * @param decay decay index (-1 if not decayed)
49 * @param child index of first and last child
50 * @param px px momentum
51 * @param py py momentum
52 * @param pz pz momentum
53 * @param e energy
54 * @param x freezout -x
55 * @param y freezout -y
56 * @param z freezout - z
57 * @param t freezout - t
58 * @param weight particle weight
59 */
60 UParticle(Int_t index,
61 Int_t pdg,
62 Int_t status,
63 Int_t parent,
64 Int_t parentDecay,
65 Int_t mate,
66 Int_t decay,
67 Int_t child[2],
68 Double_t px,
69 Double_t py,
70 Double_t pz,
71 Double_t e,
72 Double_t x,
73 Double_t y,
74 Double_t z,
75 Double_t t,
76 Double_t weight);
77 /**
78 * constructor
79 * @param index particle index
80 * @param pdg pid of track
81 * @param status particle status
82 * @param parent parent index
83 * @param parentDecay parent decay index
84 * @param mate index of last collision partner
85 * @param decay decay index (-1 if not decayed)
86 * @param child index of first and last child
87 * @param mom particle momentum
88 * @param pos particle freezout postion
89 * @param weight particle weight
90 */
91 UParticle(Int_t index,
92 Int_t pdg,
93 Int_t status,
94 Int_t parent,
95 Int_t parentDecay,
96 Int_t mate,
97 Int_t decay,
98 Int_t child[2],
100 TLorentzVector pos,
101 Double_t weight);
102 /**
103 * copy constructor
104 * @param right uparticle to copy
105 */
106 UParticle(const UParticle& right);
107 /**
108 * copy ctor
109 * @param right TParticle to copy
110 */
111 UParticle(const TParticle& right);
112 virtual ~UParticle();
113 /**
114 * operator =
115 * @param right particle
116 * @return this overwriten particle
117 */
118 const UParticle& operator=(const UParticle& right);
119 /**
120 * copy TParticle into this particle
121 * @param right TParticle to copy
122 * @return copy of TParticle in Unigen format
123 */
124 const UParticle& operator=(const TParticle& right);
125 /**
126 * comare tracks
127 * @param right track to compare
128 * @return true if particles are the same, false otherwise
129 */
130 const Bool_t operator==(const UParticle& right) const;
131 /**
132 * print info about this particle
133 * @param option not used
134 */
135 void Print(Option_t* option = "");
136 /**
137 *
138 * @return particle index
139 */
140 inline Int_t GetIndex() const { return fIndex; }
141 /**
142 *
143 * @return particle pid
144 */
145 inline Int_t GetPdg() const { return fPdg; }
146 /**
147 *
148 * @return particle status
149 */
150 inline Int_t GetStatus() const { return fStatus; }
151 /**
152 *
153 * @return particle's parent index
154 */
155 inline Int_t GetParent() const { return fParent; }
156 /**
157 *
158 * @return particle's parent decay index
159 */
160 inline Int_t GetParentDecay() const { return fParentDecay; }
161 /**
162 *
163 * @return index of last collision partner
164 */
165 inline Int_t GetMate() const { return fMate; }
166 /**
167 *
168 * @return decay index (-1 if not decayed)
169 */
170 inline Int_t GetDecay() const { return fDecay; }
171 /**
172 *
173 * @return first child index
174 */
175 inline Int_t GetFirstChild() const { return fChild[0]; }
176 /**
177 *
178 * @return last child index
179 */
180 inline Int_t GetLastChild() const { return fChild[1]; }
181 /**
182 *
183 * @return px
184 */
185 inline Double_t Px() const { return fPx; }
186 /**
187 *
188 * @return py
189 */
190 inline Double_t Py() const { return fPy; }
191 /**
192 *
193 * @return pz
194 */
195 inline Double_t Pz() const { return fPz; }
196 /**
197 *
198 * @return energy
199 */
200 inline Double_t E() const { return fE; }
201 /**
202 *
203 * @return track momentum
204 */
205 inline TLorentzVector GetMomentum() const { return TLorentzVector(fPx, fPy, fPz, fE); }
206 /**
207 *
208 * @param mom momentum to fill
209 */
210 inline void Momentum(TLorentzVector& mom) const { mom.SetPxPyPzE(fPx, fPy, fPz, fE); }
211 /**
212 *
213 * @return freezout-X
214 */
215 inline Double_t X() const { return fX; }
216 /**
217 *
218 * @return freezout-Y
219 */
220 inline Double_t Y() const { return fY; }
221 /**
222 *
223 * @return freezout-Z
224 */
225 inline Double_t Z() const { return fZ; }
226 /**
227 *
228 * @return freezout-T
229 */
230 inline Double_t T() const { return fT; }
231 /**
232 *
233 * @return freezout position
234 */
235 inline TLorentzVector GetPosition() const { return TLorentzVector(fX, fY, fZ, fT); }
236 /**
237 *
238 * @param pos position to fill by this track position coord.
239 */
240 inline void Position(TLorentzVector& pos) const { pos.SetXYZT(fX, fY, fZ, fT); }
241 /**
242 *
243 * @return particle weight
244 */
245 inline Double_t GetWeight() const { return fWeight; }
246 /**
247 *
248 * @param index index
249 */
250 inline void SetIndex(Int_t index) { fIndex = index; }
251 /**
252 *
253 * @param pdg pid code
254 */
255 inline void SetPdg(Int_t pdg) { fPdg = pdg; }
256 /**
257 *
258 * @param status status
259 */
260 inline void SetStatus(Int_t status) { fStatus = status; }
261 /**
262 *
263 * @param parent parent index
264 */
265 inline void SetParent(Int_t parent) { fParent = parent; }
266 /**
267 *
268 * @param parentDecay parent decay index
269 */
270 inline void SetParentDecay(Int_t parentDecay) { fParentDecay = parentDecay; }
271 /**
272 *
273 * @param mate index of last collision partner
274 */
275 inline void SetMate(Int_t mate) { fMate = mate; }
276 /**
277 *
278 * @param decay decay code (-1 if no decayed)
279 */
280 inline void SetDecay(Int_t decay) { fDecay = decay; }
281 /**
282 *
283 * @param child index of first and last child
284 */
285 inline void SetChild(Int_t child[2])
286 {
287 fChild[0] = child[0];
288 fChild[1] = child[1];
289 }
290 /**
291 *
292 * @param child first child index
293 */
294 inline void SetFirstChild(Int_t child) { fChild[0] = child; }
295 /**
296 *
297 * @param child last child index
298 */
299 inline void SetLastChild(Int_t child) { fChild[1] = child; }
300 /**
301 *
302 * @param px px momentum
303 */
304 inline void SetPx(Double_t px) { fPx = px; }
305 /**
306 *
307 * @param py py momentum
308 */
309 inline void SetPy(Double_t py) { fPy = py; }
310 /**
311 *
312 * @param pz pz momentum
313 */
314 inline void SetPz(Double_t pz) { fPz = pz; }
315 /**
316 *
317 * @param e energy
318 */
319 inline void SetE(Double_t e) { fE = e; }
320 /**
321 * set momentum
322 * @param px px
323 * @param py py
324 * @param pz pz
325 * @param e energy
326 */
327 inline void SetMomentum(Double_t px, Double_t py, Double_t pz, Double_t e)
328 {
329 fPx = px;
330 fPy = py;
331 fPz = pz;
332 fE = e;
333 }
334 /**
335 * set momentum
336 * @param mom momentum
337 */
339 {
340 fPx = mom.Px();
341 fPy = mom.Py();
342 fPz = mom.Pz();
343 fE = mom.E();
344 }
345 /**
346 *
347 * @param x freezout-X
348 */
349 inline void SetX(Double_t x) { fX = x; }
350 /**
351 *
352 * @param y freezout-Y
353 */
354 inline void SetY(Double_t y) { fY = y; }
355 /**
356 *
357 * @param z freezout-Z
358 */
359 inline void SetZ(Double_t z) { fZ = z; }
360 /**
361 *
362 * @param t freezout-T
363 */
364 inline void SetT(Double_t t) { fT = t; }
365 /**
366 * set freezout position
367 * @param x X
368 * @param y Y
369 * @param z Z
370 * @param t T
371 */
373 {
374 fX = x;
375 fY = y;
376 fZ = z;
377 fT = t;
378 }
379 /**
380 * set postition
381 * @param pos new position
382 */
384 {
385 fX = pos.X();
386 fY = pos.Y();
387 fZ = pos.Z();
388 fT = pos.T();
389 }
390 /**
391 *
392 * @param weight weight
393 */
394 inline void SetWeight(Double_t weight) { fWeight = weight; }
395
397};
398
399#endif
bool Bool_t
int Int_t
double Double32_t
double Double_t
const char Option_t
#define ClassDef(name, id)
void SetXYZT(Double_t x, Double_t y, Double_t z, Double_t t)
Double_t Y() const
Double_t Px() const
Double_t Pz() const
Double_t X() const
Double_t Py() const
void SetPxPyPzE(Double_t px, Double_t py, Double_t pz, Double_t e)
Double_t E() const
Double_t Z() const
Double_t T() const
unigen particle
Definition UParticle.h:14
void SetIndex(Int_t index)
Definition UParticle.h:250
Int_t GetPdg() const
Definition UParticle.h:145
Double_t Py() const
Definition UParticle.h:190
Double32_t fX
Definition UParticle.h:29
Int_t GetDecay() const
Definition UParticle.h:170
void SetChild(Int_t child[2])
Definition UParticle.h:285
void SetY(Double_t y)
Definition UParticle.h:354
Double32_t fPx
Definition UParticle.h:25
void SetMomentum(Double_t px, Double_t py, Double_t pz, Double_t e)
set momentum
Definition UParticle.h:327
void SetE(Double_t e)
Definition UParticle.h:319
Double_t E() const
Definition UParticle.h:200
Double32_t fZ
Definition UParticle.h:31
Double_t Y() const
Definition UParticle.h:220
void Position(TLorentzVector &pos) const
Definition UParticle.h:240
Double32_t fT
Definition UParticle.h:32
void SetParent(Int_t parent)
Definition UParticle.h:265
UParticle()
default constructor
Definition UParticle.cxx:16
Int_t fStatus
Definition UParticle.h:19
TLorentzVector GetMomentum() const
Definition UParticle.h:205
Int_t GetIndex() const
Definition UParticle.h:140
void SetMomentum(TLorentzVector mom)
set momentum
Definition UParticle.h:338
void SetX(Double_t x)
Definition UParticle.h:349
Int_t fMate
Definition UParticle.h:22
const UParticle & operator=(const UParticle &right)
operator =
Double32_t fE
Definition UParticle.h:28
Int_t GetMate() const
Definition UParticle.h:165
Double_t GetWeight() const
Definition UParticle.h:245
void SetDecay(Int_t decay)
Definition UParticle.h:280
void SetPdg(Int_t pdg)
Definition UParticle.h:255
void SetParentDecay(Int_t parentDecay)
Definition UParticle.h:270
Int_t fParentDecay
Definition UParticle.h:21
Double32_t fPz
Definition UParticle.h:27
Int_t GetParent() const
Definition UParticle.h:155
TLorentzVector GetPosition() const
Definition UParticle.h:235
Double_t Pz() const
Definition UParticle.h:195
Double_t Px() const
Definition UParticle.h:185
Int_t fIndex
Definition UParticle.h:17
const Bool_t operator==(const UParticle &right) const
comare tracks
Double32_t fWeight
Definition UParticle.h:33
void SetPosition(Double_t x, Double_t y, Double_t z, Double_t t)
set freezout position
Definition UParticle.h:372
void Momentum(TLorentzVector &mom) const
Definition UParticle.h:210
Int_t GetFirstChild() const
Definition UParticle.h:175
void SetPz(Double_t pz)
Definition UParticle.h:314
Double_t X() const
Definition UParticle.h:215
Int_t fPdg
Definition UParticle.h:18
void SetZ(Double_t z)
Definition UParticle.h:359
void SetLastChild(Int_t child)
Definition UParticle.h:299
Int_t fDecay
Definition UParticle.h:23
void SetFirstChild(Int_t child)
Definition UParticle.h:294
void SetPosition(TLorentzVector pos)
set postition
Definition UParticle.h:383
void SetPx(Double_t px)
Definition UParticle.h:304
Double_t Z() const
Definition UParticle.h:225
void SetPy(Double_t py)
Definition UParticle.h:309
void SetMate(Int_t mate)
Definition UParticle.h:275
void SetWeight(Double_t weight)
Definition UParticle.h:394
Int_t GetStatus() const
Definition UParticle.h:150
Double_t T() const
Definition UParticle.h:230
Double32_t fPy
Definition UParticle.h:26
Int_t fParent
Definition UParticle.h:20
Double32_t fY
Definition UParticle.h:30
Int_t GetLastChild() const
Definition UParticle.h:180
void Print(Option_t *option="")
print info about this particle
Int_t fChild[2]
Definition UParticle.h:24
void SetT(Double_t t)
Definition UParticle.h:364
Int_t GetParentDecay() const
Definition UParticle.h:160
virtual ~UParticle()
void SetStatus(Int_t status)
Definition UParticle.h:260