KaliVeda
1.14/2
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVTestEvent.cpp
1
#include <iostream>
2
#include <string>
3
#include <
TMath.h
>
4
#include <
TRandom3.h
>
5
#include "KVTestEvent.h"
6
#include "KVNucleus.h"
7
8
using
std::cout;
9
using
std::cerr;
10
using
std::endl;
11
12
ClassImp
(
KVTestEvent
);
13
14
15
18
19
KVTestEvent::KVTestEvent
():
KVSimEvent
()
20
{
21
//Default constructor
22
23
init
();
24
}
25
26
27
30
31
void
KVTestEvent::init
()
32
{
33
//Default initialisations
34
35
fLower_Limit_theta
= 0.;
36
fLower_Limit_phi
= 0.;
37
fUpper_Limit_theta
= 180.;
38
fUpper_Limit_phi
= 360.;
39
fLower_Limit_Z
= 0;
40
fUpper_Limit_Z
= 0;
41
fLower_Limit_E
= 0.;
42
fUpper_Limit_E
= 0.;
43
fGenMult
= 0;
44
kAMeV
=
kFALSE
;
45
strcpy(
fOption
,
""
);
46
}
47
48
49
57
58
KVTestEvent::KVTestEvent
(
UInt_t
mult,
Option_t
* t):
KVSimEvent
(mult)
59
{
60
//Constructor with arguments
61
//
62
//mult = multiplicity of event
63
//Option string can be
64
// "isotropic": particle directions generated isotropically (1/sin Theta law)
65
// "random": particle directions generated equiprobably
66
67
init
();
68
fGenMult
= mult;
69
strcpy(
fOption
, t);
70
}
71
72
73
75
76
KVTestEvent::~KVTestEvent
()
77
{
78
}
79
80
81
86
87
void
KVTestEvent::SetZRange
(
UInt_t
zlo,
UInt_t
zhi)
88
{
89
//
90
//Set range in Z of nuclei
91
//
92
fLower_Limit_Z
= zlo;
93
fUpper_Limit_Z
= zhi;
94
}
95
96
97
102
103
void
KVTestEvent::SetERange
(
Float_t
elo,
Float_t
ehi)
104
{
105
//
106
//Set range in kinetic energy of nuclei (MeV)
107
//
108
fLower_Limit_E
= elo;
109
fUpper_Limit_E
= ehi;
110
kAMeV
=
kFALSE
;
111
}
112
113
114
119
120
void
KVTestEvent::SetERangeAMeV
(
Float_t
elo,
Float_t
ehi)
121
{
122
//
123
//Set range in kinetic energy of nuclei (MeV/nucleon)
124
//
125
fLower_Limit_E
= elo;
126
fUpper_Limit_E
= ehi;
127
kAMeV
=
kTRUE
;
128
}
129
130
131
136
137
void
KVTestEvent::SetThetaRange
(
Float_t
thmin,
Float_t
thmax)
138
{
139
//
140
//Set polar angular range for nuclei
141
//
142
fLower_Limit_theta
= thmin;
143
fUpper_Limit_theta
= thmax;
144
}
145
146
147
152
153
void
KVTestEvent::SetPhiRange
(
Float_t
phmin,
Float_t
phmax)
154
{
155
//
156
//Set azimuthal angular range for nuclei
157
//
158
fLower_Limit_phi
= phmin;
159
fUpper_Limit_phi
= phmax;
160
}
161
162
163
171
172
void
KVTestEvent::Generate
()
173
{
174
//
175
//Generate an event based on given parameters.
176
//Before using, at least set multiplicity (using constructor with arguments or
177
//KVTestEvent::SetMult), range in Z (KVTestEvent::SetZRange) and range
178
//in energy (KVTestEvent::SetERange or KVTestEvent::SetERangeAMeV).
179
//
180
181
for
(
UInt_t
i = 1; i <=
fGenMult
; i++) {
182
UInt_t
z =
183
gRandom
->
Integer
(
fUpper_Limit_Z
-
fLower_Limit_Z
+ 1) +
184
fLower_Limit_Z
;
185
Float_t
ke =
186
gRandom
->
Uniform
(
fUpper_Limit_E
-
fLower_Limit_E
) +
187
fLower_Limit_E
;
188
KVNucleus
* kvn =
AddParticle
();
189
kvn->
SetZ
(z);
190
if
(
kAMeV
)
191
ke *= kvn->
GetA
();
192
kvn->
SetRandomMomentum
(ke,
fLower_Limit_theta
,
fUpper_Limit_theta
,
193
fLower_Limit_phi
,
fUpper_Limit_phi
,
fOption
);
194
}
195
}
196
197
198
203
204
void
KVTestEvent::Print
(
Option_t
*)
const
205
{
206
//
207
//Print out list of all particles in event
208
//
209
cout <<
"\nKVTestEvent with "
<<
GetMult
() <<
" nuclei:"
<< endl;
210
cout <<
"----------------------------------------"
<< endl;
211
cout <<
"Zmin="
<<
fLower_Limit_Z
<<
" Zmax="
<<
fUpper_Limit_Z
<< endl;
212
cout <<
"Emin="
<<
fLower_Limit_E
<<
" Emax="
<<
fUpper_Limit_E
;
213
if
(
kAMeV
)
214
cout <<
" (MeV/nucleon)"
<< endl;
215
else
216
cout <<
" (MeV)"
<< endl;
217
cout <<
"Thetamin="
<<
fLower_Limit_theta
<<
" Thetamax="
<<
218
fUpper_Limit_theta
<< endl;
219
cout <<
"Phimin="
<<
fLower_Limit_phi
<<
" Phimax="
<<
fUpper_Limit_phi
220
<< endl;
221
cout <<
"----------------------------------------"
<< endl;
222
#ifdef WITH_CPP11
223
for
(
auto
&
n
: *
this
)
n
.Print();
224
#else
225
for
(KVEvent::Iterator it =
begin
(); it !=
end
(); ++it)(*it).Print();
226
#endif
227
}
228
229
UInt_t
unsigned int UInt_t
Float_t
float Float_t
kFALSE
constexpr Bool_t kFALSE
kTRUE
constexpr Bool_t kTRUE
Option_t
const char Option_t
TMath.h
TRandom3.h
gRandom
R__EXTERN TRandom * gRandom
KVNucleus
Description of properties and kinematics of atomic nuclei.
Definition
KVNucleus.h:126
KVNucleus::GetA
Int_t GetA() const
Definition
KVNucleus.cpp:802
KVNucleus::SetZ
void SetZ(Int_t z, Char_t mt=-1)
Definition
KVNucleus.cpp:707
KVParticle::SetRandomMomentum
void SetRandomMomentum(Double_t T, Double_t thmin, Double_t thmax, Double_t phmin, Double_t phmax, Option_t *opt="isotropic")
Definition
KVParticle.cpp:136
KVSimEvent
Container class for simulated nuclei, KVSimNucleus.
Definition
KVSimEvent.h:22
KVTemplateEvent< KVSimNucleus >::begin
Iterator begin() const
Definition
KVTemplateEvent.h:616
KVTemplateEvent< KVSimNucleus >::AddParticle
KVSimNucleus * AddParticle()
Definition
KVTemplateEvent.h:369
KVTemplateEvent< KVSimNucleus >::end
Iterator end() const
Definition
KVTemplateEvent.h:621
KVTemplateEvent< KVSimNucleus >::GetMult
virtual Int_t GetMult(Option_t *opt="") const
Definition
KVTemplateEvent.h:400
KVTestEvent
A simple event generator for testing charged particle array response.
Definition
KVTestEvent.h:57
KVTestEvent::SetThetaRange
void SetThetaRange(Float_t thmin, Float_t thmax)
Definition
KVTestEvent.cpp:137
KVTestEvent::fGenMult
UInt_t fGenMult
multiplicity of nuclei to generate
Definition
KVTestEvent.h:69
KVTestEvent::SetZRange
void SetZRange(UInt_t zlo, UInt_t zhi)
Definition
KVTestEvent.cpp:87
KVTestEvent::fOption
Char_t fOption[12]
[12] option string
Definition
KVTestEvent.h:68
KVTestEvent::fUpper_Limit_E
Float_t fUpper_Limit_E
max E of nuclei
Definition
KVTestEvent.h:61
KVTestEvent::SetPhiRange
void SetPhiRange(Float_t phmin, Float_t phmax)
Definition
KVTestEvent.cpp:153
KVTestEvent::init
void init()
Default initialisations.
Definition
KVTestEvent.cpp:31
KVTestEvent::fLower_Limit_phi
Float_t fLower_Limit_phi
min phi of nuclei
Definition
KVTestEvent.h:67
KVTestEvent::~KVTestEvent
virtual ~KVTestEvent()
Definition
KVTestEvent.cpp:76
KVTestEvent::fUpper_Limit_phi
Float_t fUpper_Limit_phi
max phi of nuclei
Definition
KVTestEvent.h:66
KVTestEvent::fUpper_Limit_theta
Float_t fUpper_Limit_theta
max theta of nuclei
Definition
KVTestEvent.h:64
KVTestEvent::fLower_Limit_Z
UInt_t fLower_Limit_Z
min Z of nuclei
Definition
KVTestEvent.h:60
KVTestEvent::Print
virtual void Print(Option_t *t="") const
Definition
KVTestEvent.cpp:204
KVTestEvent::fLower_Limit_theta
Float_t fLower_Limit_theta
min theta of nuclei
Definition
KVTestEvent.h:65
KVTestEvent::Generate
void Generate()
Definition
KVTestEvent.cpp:172
KVTestEvent::kAMeV
Bool_t kAMeV
true if E limits are in MeV/nucleon
Definition
KVTestEvent.h:63
KVTestEvent::SetERange
void SetERange(Float_t elo, Float_t ehi)
Definition
KVTestEvent.cpp:103
KVTestEvent::KVTestEvent
KVTestEvent()
Default constructor.
Definition
KVTestEvent.cpp:19
KVTestEvent::fUpper_Limit_Z
UInt_t fUpper_Limit_Z
max Z of nuclei
Definition
KVTestEvent.h:59
KVTestEvent::fLower_Limit_E
Float_t fLower_Limit_E
min E of nuclei
Definition
KVTestEvent.h:62
KVTestEvent::SetERangeAMeV
void SetERangeAMeV(Float_t elo, Float_t ehi)
Definition
KVTestEvent.cpp:120
TRandom::Uniform
virtual Double_t Uniform(Double_t x1, Double_t x2)
TRandom::Integer
virtual UInt_t Integer(UInt_t imax)
n
const Int_t n
ClassImp
ClassImp(TPyArg)
kaliveda.doxygen
KVMultiDet
simulation
KVTestEvent.cpp
Generated on Wed Oct 23 2024 12:45:23 for KaliVeda by
1.9.8