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