BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
UParticle.cxx
Go to the documentation of this file.
1
#include <iostream>
2
using namespace
std
;
3
4
#include "
TObject.h
"
5
#include "
TParticle.h
"
6
#include "
UParticle.h
"
7
8
//____________________________________________________________________
9
//
10
// UParticle
11
//
12
// Class for particle description.
13
//
14
15
//--------------------------------------------------------------------
16
UParticle::UParticle
()
17
{
18
// Default constructor
19
fIndex
=
fPdg
=
fStatus
=
fParent
=
fParentDecay
=
fMate
=
fDecay
= 0;
20
fChild
[0] =
fChild
[1] = 0;
21
fPx
=
fPy
=
fPz
=
fE
= 0.;
22
fX
=
fY
=
fZ
=
fT
= 0.;
23
fWeight
= 0.;
24
}
25
//--------------------------------------------------------------------
26
27
//--------------------------------------------------------------------
28
UParticle::UParticle
(
Int_t
index,
29
Int_t
pdg,
30
Int_t
status,
31
Int_t
parent,
32
Int_t
parentDecay,
33
Int_t
mate,
34
Int_t
decay,
35
Int_t
child[2],
36
Double_t
px,
37
Double_t
py,
38
Double_t
pz,
39
Double_t
e,
40
Double_t
x,
41
Double_t
y,
42
Double_t
z,
43
Double_t
t,
44
Double_t
weight)
45
{
46
// Standard constructor
47
fIndex
= index;
48
fPdg
= pdg;
49
fStatus
= status;
50
fParent
= parent;
51
fParentDecay
= parentDecay;
52
fMate
= mate;
53
fDecay
= decay;
54
fChild
[0] = child[0];
55
fChild
[1] = child[1];
56
fPx
= px;
57
fPy
= py;
58
fPz
= pz;
59
fE
= e;
60
fX
= x;
61
fY
= y;
62
fZ
= z;
63
fT
= t;
64
fWeight
= weight;
65
}
66
//--------------------------------------------------------------------
67
68
//--------------------------------------------------------------------
69
UParticle::UParticle
(
Int_t
index,
70
Int_t
pdg,
71
Int_t
status,
72
Int_t
parent,
73
Int_t
parentDecay,
74
Int_t
mate,
75
Int_t
decay,
76
Int_t
child[2],
77
TLorentzVector
mom,
78
TLorentzVector
pos,
79
Double_t
weight)
80
{
81
// Standard constructor
82
fIndex
= index;
83
fPdg
= pdg;
84
fStatus
= status;
85
fParent
= parent;
86
fParentDecay
= parentDecay;
87
fMate
= mate;
88
fDecay
= decay;
89
fChild
[0] = child[0];
90
fChild
[1] = child[1];
91
fPx
= mom.
Px
();
92
fPy
= mom.
Py
();
93
fPz
= mom.
Pz
();
94
fE
= mom.
E
();
95
fX
= pos.
X
();
96
fY
= pos.
Y
();
97
fZ
= pos.
Z
();
98
fT
= pos.
T
();
99
fWeight
= weight;
100
}
101
//--------------------------------------------------------------------
102
103
//--------------------------------------------------------------------
104
UParticle::UParticle
(
const
UParticle
& right)
105
{
106
// Copy constructor
107
*
this
= right;
108
}
109
//--------------------------------------------------------------------
110
111
//--------------------------------------------------------------------
112
UParticle::UParticle
(
const
TParticle
& right)
113
{
114
// Copy constructor from the TParticle
115
*
this
= right;
116
}
117
//--------------------------------------------------------------------
118
119
//--------------------------------------------------------------------
120
UParticle::~UParticle
()
121
{
122
// Destructor
123
}
124
//--------------------------------------------------------------------
125
126
//--------------------------------------------------------------------
127
const
UParticle
&
UParticle::operator=
(
const
UParticle
& right)
128
{
129
// Assignment operator
130
fIndex
= right.
fIndex
;
131
fPdg
= right.
fPdg
;
132
fStatus
= right.
fStatus
;
133
fParent
= right.
fParent
;
134
fParentDecay
= right.
fParentDecay
;
135
fMate
= right.
fMate
;
136
fDecay
= right.
fDecay
;
137
fChild
[0] = right.
fChild
[0];
138
fChild
[1] = right.
fChild
[1];
139
fPx
= right.
fPx
;
140
fPy
= right.
fPy
;
141
fPz
= right.
fPz
;
142
fE
= right.
fE
;
143
fX
= right.
fX
;
144
fY
= right.
fY
;
145
fZ
= right.
fZ
;
146
fT
= right.
fT
;
147
fWeight
= right.
fWeight
;
148
return
(*
this
);
149
}
150
//--------------------------------------------------------------------
151
152
//--------------------------------------------------------------------
153
const
UParticle
&
UParticle::operator=
(
const
TParticle
& right)
154
{
155
// Assignment operator from the TParticle
156
fIndex
= 0;
157
fPdg
= right.
GetPdgCode
();
158
fStatus
= right.
GetStatusCode
();
159
fParent
= right.
GetFirstMother
();
160
fParentDecay
= 0;
161
fMate
= 0;
162
fDecay
= 0;
163
fChild
[0] = right.
GetFirstDaughter
();
164
fChild
[1] = right.
GetLastDaughter
();
165
fPx
= right.
Px
();
166
fPy
= right.
Py
();
167
fPz
= right.
Pz
();
168
fE
= right.
Energy
();
169
fX
= right.
Vx
();
170
fY
= right.
Vy
();
171
fZ
= right.
Vz
();
172
fT
= right.
T
();
173
fWeight
= right.
GetWeight
();
174
return
(*
this
);
175
}
176
//--------------------------------------------------------------------
177
178
//--------------------------------------------------------------------
179
const
Bool_t
UParticle::operator==
(
const
UParticle
& right)
const
180
{
181
// If equal operator
182
return
(
fIndex
== right.
fIndex
&&
fPdg
== right.
fPdg
&&
fStatus
== right.
fStatus
&&
fParent
== right.
fParent
183
&&
fParentDecay
== right.
fParentDecay
&&
fMate
== right.
fMate
&&
fDecay
== right.
fDecay
184
&&
fChild
[0] == right.
fChild
[0] &&
fChild
[1] == right.
fChild
[1]
185
&& ((
TMath::Abs
((
fPx
- right.
fPx
) /
fPx
) < 0.0001)
186
|| (
TMath::Abs
(
fPx
) < 1e-16 &&
TMath::Abs
(right.
fPx
) < 1e-16))
187
&& ((
TMath::Abs
((
fPy
- right.
fPy
) /
fPy
) < 0.0001)
188
|| (
TMath::Abs
(
fPy
) < 1e-16 &&
TMath::Abs
(right.
fPy
) < 1e-16))
189
&& ((
TMath::Abs
((
fPz
- right.
fPz
) /
fPz
) < 0.0001)
190
|| (
TMath::Abs
(
fPz
) < 1e-16 &&
TMath::Abs
(right.
fPz
) < 1e-16))
191
&& ((
TMath::Abs
((
fE
- right.
fE
) /
fE
) < 0.0001) || (
TMath::Abs
(
fE
) < 1e-16 &&
TMath::Abs
(right.
fE
) < 1e-16))
192
&& ((
TMath::Abs
((
fX
- right.
fX
) /
fX
) < 0.0001) || (
TMath::Abs
(
fX
) < 1e-16 &&
TMath::Abs
(right.
fX
) < 1e-16))
193
&& ((
TMath::Abs
((
fY
- right.
fY
) /
fY
) < 0.0001) || (
TMath::Abs
(
fY
) < 1e-16 &&
TMath::Abs
(right.
fY
) < 1e-16))
194
&& ((
TMath::Abs
((
fZ
- right.
fZ
) /
fZ
) < 0.0001) || (
TMath::Abs
(
fZ
) < 1e-16 &&
TMath::Abs
(right.
fZ
) < 1e-16))
195
&& ((
TMath::Abs
((
fT
- right.
fT
) /
fT
) < 0.0001) || (
TMath::Abs
(
fT
) < 1e-16 &&
TMath::Abs
(right.
fT
) < 1e-16))
196
&& ((
TMath::Abs
((
fWeight
- right.
fWeight
) /
fWeight
) < 0.0001)
197
|| (
TMath::Abs
(
fWeight
) < 1e-16 &&
TMath::Abs
(right.
fWeight
) < 1e-16)));
198
}
199
//--------------------------------------------------------------------
200
201
//--------------------------------------------------------------------
202
void
UParticle::Print
(
Option_t
* option)
203
{
204
// Print the data members to the standard output
205
cout <<
"------------------------------------------------"
<< endl
206
<<
"-I- Particle -I-"
<< endl
207
<<
"Index : "
<<
fIndex
<< endl
208
<<
"PDG code : "
<<
fPdg
<< endl
209
<<
"Status code : "
<<
fStatus
<< endl
210
<<
"Parent index : "
<<
fParent
<< endl
211
<<
"Parent decay index : "
<<
fParentDecay
<< endl
212
<<
"Last collision partner : "
<<
fMate
<< endl
213
<<
"Decay index : "
<<
fDecay
<< endl
214
<<
"First child index : "
<<
fChild
[0] << endl
215
<<
"Last child index : "
<<
fChild
[1] << endl
216
<<
"Momentum (px, py, pz) (GeV) : ("
<<
fPx
<<
", "
<<
fPy
<<
", "
<<
fPz
<<
")"
<< endl
217
<<
"Energy (GeV) : "
<<
fE
<< endl
218
<<
"Position (x, y, z) (fm) : ("
<<
fX
<<
", "
<<
fY
<<
", "
<<
fZ
<<
")"
<< endl
219
<<
"Creation time (fm) : "
<<
fT
<< endl
220
<<
"Weight : "
<<
fWeight
<< endl
221
<<
"------------------------------------------------"
<< endl;
222
}
223
//--------------------------------------------------------------------
Bool_t
bool Bool_t
Int_t
int Int_t
Double_t
double Double_t
Option_t
const char Option_t
TObject.h
TParticle.h
TLorentzVector
TLorentzVector::Y
Double_t Y() const
TLorentzVector::Px
Double_t Px() const
TLorentzVector::Pz
Double_t Pz() const
TLorentzVector::X
Double_t X() const
TLorentzVector::Py
Double_t Py() const
TLorentzVector::E
Double_t E() const
TLorentzVector::Z
Double_t Z() const
TLorentzVector::T
Double_t T() const
TParticle
TParticle::Px
Double_t Px() const
TParticle::Py
Double_t Py() const
TParticle::GetStatusCode
Int_t GetStatusCode() const
TParticle::Energy
Double_t Energy() const
TParticle::GetPdgCode
Int_t GetPdgCode() const
TParticle::GetWeight
Float_t GetWeight() const
TParticle::GetFirstDaughter
Int_t GetFirstDaughter() const
TParticle::Pz
Double_t Pz() const
TParticle::GetFirstMother
Int_t GetFirstMother() const
TParticle::Vy
Double_t Vy() const
TParticle::T
Double_t T() const
TParticle::Vx
Double_t Vx() const
TParticle::Vz
Double_t Vz() const
TParticle::GetLastDaughter
Int_t GetLastDaughter() const
UParticle::fX
Double32_t fX
Definition
UParticle.h:29
UParticle::fPx
Double32_t fPx
Definition
UParticle.h:25
UParticle::fZ
Double32_t fZ
Definition
UParticle.h:31
UParticle::fT
Double32_t fT
Definition
UParticle.h:32
UParticle::UParticle
UParticle()
default constructor
Definition
UParticle.cxx:16
UParticle::fStatus
Int_t fStatus
Definition
UParticle.h:19
UParticle::fMate
Int_t fMate
Definition
UParticle.h:22
UParticle::operator=
const UParticle & operator=(const UParticle &right)
operator =
Definition
UParticle.cxx:127
UParticle::fE
Double32_t fE
Definition
UParticle.h:28
UParticle::fParentDecay
Int_t fParentDecay
Definition
UParticle.h:21
UParticle::fPz
Double32_t fPz
Definition
UParticle.h:27
UParticle::fIndex
Int_t fIndex
Definition
UParticle.h:17
UParticle::operator==
const Bool_t operator==(const UParticle &right) const
comare tracks
Definition
UParticle.cxx:179
UParticle::fWeight
Double32_t fWeight
Definition
UParticle.h:33
UParticle::fPdg
Int_t fPdg
Definition
UParticle.h:18
UParticle::fDecay
Int_t fDecay
Definition
UParticle.h:23
UParticle::fPy
Double32_t fPy
Definition
UParticle.h:26
UParticle::fParent
Int_t fParent
Definition
UParticle.h:20
UParticle::fY
Double32_t fY
Definition
UParticle.h:30
UParticle::Print
void Print(Option_t *option="")
print info about this particle
Definition
UParticle.cxx:202
UParticle::fChild
Int_t fChild[2]
Definition
UParticle.h:24
UParticle::~UParticle
virtual ~UParticle()
Definition
UParticle.cxx:120
UParticle.h
TMath::Abs
Double_t Abs(Double_t d)
std
Definition
json.hpp:4446
generators
unigen_format
UParticle.cxx
Generated on
for BmnRoot by
1.17.0