CbmRoot
Loading...
Searching...
No Matches
UParticle.h
Go to the documentation of this file.
1/* Copyright (C) 2008-2016 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig [committer] */
4
5#ifndef UPARTICLE_H
6#define UPARTICLE_H
7
8#include "TLorentzVector.h"
9#include "TObject.h"
10
11class TParticle;
12
13
14class UParticle : public TObject {
15
16private:
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)
33 Double32_t fWeight; // weight
34
35public:
36 UParticle();
37 UParticle(Int_t index, Int_t pdg, Int_t status, Int_t parent, Int_t parentDecay, Int_t mate, Int_t decay,
38 Int_t child[2], Double_t px, Double_t py, Double_t pz, Double_t e, Double_t x, Double_t y, Double_t z,
39 Double_t t, Double_t weight);
40 UParticle(Int_t index, Int_t pdg, Int_t status, Int_t parent, Int_t parentDecay, Int_t mate, Int_t decay,
41 Int_t child[2], TLorentzVector mom, TLorentzVector pos, Double_t weight);
42 UParticle(const UParticle& right);
43 UParticle(const TParticle& right);
44 virtual ~UParticle();
45 const UParticle& operator=(const UParticle& right);
46 const UParticle& operator=(const TParticle& right);
47 Bool_t operator==(const UParticle& right) const;
48 void Print(Option_t* = "") const;
49 inline Int_t GetIndex() const { return fIndex; }
50 inline Int_t GetPdg() const { return fPdg; }
51 inline Int_t GetStatus() const { return fStatus; }
52 inline Int_t GetParent() const { return fParent; }
53 inline Int_t GetParentDecay() const { return fParentDecay; }
54 inline Int_t GetMate() const { return fMate; }
55 inline Int_t GetDecay() const { return fDecay; }
56 inline Int_t GetFirstChild() const { return fChild[0]; }
57 inline Int_t GetLastChild() const { return fChild[1]; }
58 inline Double_t Px() const { return fPx; }
59 inline Double_t Py() const { return fPy; }
60 inline Double_t Pz() const { return fPz; }
61 inline Double_t E() const { return fE; }
62 inline TLorentzVector GetMomentum() const { return TLorentzVector(fPx, fPy, fPz, fE); }
63 inline void Momentum(TLorentzVector& mom) const { mom.SetPxPyPzE(fPx, fPy, fPz, fE); }
64 inline Double_t X() const { return fX; }
65 inline Double_t Y() const { return fY; }
66 inline Double_t Z() const { return fZ; }
67 inline Double_t T() const { return fT; }
68 inline TLorentzVector GetPosition() const { return TLorentzVector(fX, fY, fZ, fT); }
69 inline void Position(TLorentzVector& pos) const { pos.SetXYZT(fX, fY, fZ, fT); }
70 inline Double_t GetWeight() const { return fWeight; }
71 inline void SetIndex(Int_t index) { fIndex = index; }
72 inline void SetPdg(Int_t pdg) { fPdg = pdg; }
73 inline void SetStatus(Int_t status) { fStatus = status; }
74 inline void SetParent(Int_t parent) { fParent = parent; }
75 inline void SetParentDecay(Int_t parentDecay) { fParentDecay = parentDecay; }
76 inline void SetMate(Int_t mate) { fMate = mate; }
77 inline void SetDecay(Int_t decay) { fDecay = decay; }
78 inline void SetChild(Int_t child[2])
79 {
80 fChild[0] = child[0];
81 fChild[1] = child[1];
82 }
83 inline void SetFirstChild(Int_t child) { fChild[0] = child; }
84 inline void SetLastChild(Int_t child) { fChild[1] = child; }
85 inline void SetPx(Double_t px) { fPx = px; }
86 inline void SetPy(Double_t py) { fPy = py; }
87 inline void SetPz(Double_t pz) { fPz = pz; }
88 inline void SetE(Double_t e) { fE = e; }
89 inline void SetMomentum(Double_t px, Double_t py, Double_t pz, Double_t e)
90 {
91 fPx = px;
92 fPy = py;
93 fPz = pz;
94 fE = e;
95 }
96 inline void SetMomentum(TLorentzVector mom)
97 {
98 fPx = mom.Px();
99 fPy = mom.Py();
100 fPz = mom.Pz();
101 fE = mom.E();
102 }
103 inline void SetX(Double_t x) { fX = x; }
104 inline void SetY(Double_t y) { fY = y; }
105 inline void SetZ(Double_t z) { fZ = z; }
106 inline void SetT(Double_t t) { fT = t; }
107 inline void SetPosition(Double_t x, Double_t y, Double_t z, Double_t t)
108 {
109 fX = x;
110 fY = y;
111 fZ = z;
112 fT = t;
113 }
114 inline void SetPosition(TLorentzVector pos)
115 {
116 fX = pos.X();
117 fY = pos.Y();
118 fZ = pos.Z();
119 fT = pos.T();
120 }
121 inline void SetWeight(Double_t weight) { fWeight = weight; }
122
124};
125
126
127#endif
int Int_t
bool Bool_t
void SetIndex(Int_t index)
Definition UParticle.h:71
Int_t GetPdg() const
Definition UParticle.h:50
Double_t Py() const
Definition UParticle.h:59
Double32_t fX
Definition UParticle.h:29
Int_t GetDecay() const
Definition UParticle.h:55
void SetChild(Int_t child[2])
Definition UParticle.h:78
void SetY(Double_t y)
Definition UParticle.h:104
Double32_t fPx
Definition UParticle.h:25
void SetMomentum(Double_t px, Double_t py, Double_t pz, Double_t e)
Definition UParticle.h:89
void SetE(Double_t e)
Definition UParticle.h:88
Double_t E() const
Definition UParticle.h:61
Double32_t fZ
Definition UParticle.h:31
Double_t Y() const
Definition UParticle.h:65
ClassDef(UParticle, 1)
void Position(TLorentzVector &pos) const
Definition UParticle.h:69
Double32_t fT
Definition UParticle.h:32
void Print(Option_t *="") const
void SetParent(Int_t parent)
Definition UParticle.h:74
Int_t fStatus
Definition UParticle.h:19
TLorentzVector GetMomentum() const
Definition UParticle.h:62
Int_t GetIndex() const
Definition UParticle.h:49
void SetMomentum(TLorentzVector mom)
Definition UParticle.h:96
void SetX(Double_t x)
Definition UParticle.h:103
Int_t fMate
Definition UParticle.h:22
const UParticle & operator=(const UParticle &right)
Double32_t fE
Definition UParticle.h:28
Int_t GetMate() const
Definition UParticle.h:54
Double_t GetWeight() const
Definition UParticle.h:70
Int_t fChild[2]
Definition UParticle.h:24
void SetDecay(Int_t decay)
Definition UParticle.h:77
void SetPdg(Int_t pdg)
Definition UParticle.h:72
void SetParentDecay(Int_t parentDecay)
Definition UParticle.h:75
Int_t fParentDecay
Definition UParticle.h:21
Double32_t fPz
Definition UParticle.h:27
Int_t GetParent() const
Definition UParticle.h:52
TLorentzVector GetPosition() const
Definition UParticle.h:68
Double_t Pz() const
Definition UParticle.h:60
Double_t Px() const
Definition UParticle.h:58
Int_t fIndex
Definition UParticle.h:17
Double32_t fWeight
Definition UParticle.h:33
void SetPosition(Double_t x, Double_t y, Double_t z, Double_t t)
Definition UParticle.h:107
void Momentum(TLorentzVector &mom) const
Definition UParticle.h:63
Int_t GetFirstChild() const
Definition UParticle.h:56
void SetPz(Double_t pz)
Definition UParticle.h:87
Double_t X() const
Definition UParticle.h:64
Int_t fPdg
Definition UParticle.h:18
void SetZ(Double_t z)
Definition UParticle.h:105
void SetLastChild(Int_t child)
Definition UParticle.h:84
Int_t fDecay
Definition UParticle.h:23
void SetFirstChild(Int_t child)
Definition UParticle.h:83
void SetPosition(TLorentzVector pos)
Definition UParticle.h:114
void SetPx(Double_t px)
Definition UParticle.h:85
Double_t Z() const
Definition UParticle.h:66
void SetPy(Double_t py)
Definition UParticle.h:86
void SetMate(Int_t mate)
Definition UParticle.h:76
void SetWeight(Double_t weight)
Definition UParticle.h:121
Int_t GetStatus() const
Definition UParticle.h:51
Double_t T() const
Definition UParticle.h:67
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:57
void SetT(Double_t t)
Definition UParticle.h:106
Int_t GetParentDecay() const
Definition UParticle.h:53
virtual ~UParticle()
void SetStatus(Int_t status)
Definition UParticle.h:73
Bool_t operator==(const UParticle &right) const