ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Generators
Epos4_i
share
common
configFile.py
Go to the documentation of this file.
1
#!/usr/bin/env python3
2
3
import
os
4
from
pathlib
import
Path
5
os.environ[
"EPO"
] = os.environ[
"EPO"
] +
"/"
6
BASE = os.environ[
"EPO"
]
7
os.environ[
"SRC"
] = f
"{BASE}/src"
8
os.environ[
"SRCEXT"
] = f
"{BASE}/srcext"
9
os.environ[
"CONF"
] = f
"{BASE}/config"
10
os.environ[
"DAT"
] = f
"{BASE}/"
11
os.environ[
"OPT"
] = str(Path.cwd()) +
"/"
12
os.environ[
"HTO"
] = str(Path.cwd()) +
"/"
13
os.environ[
"CHK"
] = str(Path.cwd()) +
"/"
14
OPT = os.environ[
"OPT"
]
15
os.environ[
"OPX"
] = str(Path.cwd()) +
"/"
if
OPT ==
"./"
else
OPT
16
17
def
build_config_content
(energy, number_of_events, laproj=1, maproj=1, latarg=1, matarg=1, hydro=True,
18
list_of_particle_ids ="110 20 2130 -2130 2230 -2230 1130 -1130 1330 -1330 2330 -2330 3331 -3331",
19
centralityClass=0):
20
21
# Type validation
22
errors = []
23
24
if
not
isinstance(energy, (int, float)):
25
errors.append(
"energy must be a number (int or float)."
)
26
27
if
not
isinstance(number_of_events, int):
28
errors.append(
"number_of_events must be an integer."
)
29
30
if
not
isinstance(centralityClass, int):
31
errors.append(
"centralityClass must be an integer (To check the class numbers, see the relevant file in: src/KWt/)"
)
32
33
for
name, value
in
[
34
(
"laproj"
, laproj),
35
(
"maproj"
, maproj),
36
(
"latarg"
, latarg),
37
(
"matarg"
, matarg),
38
]:
39
if
not
isinstance(value, int):
40
errors.append(f
"{name} must be an integer."
)
41
42
if
not
isinstance(hydro, bool):
43
errors.append(
"hydro must be a boolean (True/False)."
)
44
45
if
isinstance(list_of_particle_ids, (list, tuple)):
46
try
:
47
list_of_particle_ids =
" "
.join(str(int(x))
for
x
in
list_of_particle_ids)
48
except
ValueError:
49
errors.append(
"list_of_particle_ids contains elements that cannot be converted to integers."
)
50
elif
not
isinstance(list_of_particle_ids, str):
51
errors.append(
"list_of_particle_ids must be a string or a list of numbers."
)
52
53
if
errors:
54
print
(
"INPUT PARAMETER ERRORS:"
)
55
for
e
in
errors:
56
print
(
" -"
, e)
57
return
None
58
59
60
content1 = f
"""!EPOS4 configuration file
61
!to define the reaction and simulation options
62
!to define the output
63
!to add analysis plugins (optional)
64
!--------------------------------------------------------------------
65
! proton-proton collision no hydro no hadronic cascade
66
!--------------------------------------------------------------------
67
application hadron !hadron-hadron, hadron-nucleus, or nucleus-nucleus
68
set laproj {laproj} !projectile atomic number
69
set maproj {maproj} !projectile mass number
70
set latarg {latarg} !target atomic number
71
set matarg {matarg} !target mass number
72
set ecms {energy} !sqrt(s)_pp
73
set istmax 25 !max status considered for storage
74
set iranphi 1 !for internal use.
75
!if iranphi=1 event will be rotated such that the impact parameter angle
76
!and the (n=2) event plane angle (based on string segments) coincide.
77
!Particles rotated back at the end.
78
ftime on !string formation time non-zero
79
!suppressed decays (using EPOS id codes, see src/KWt/idt.dt)
80
nodecays {list_of_particle_ids} end
81
"""
82
if
hydro:
83
content2=f
"""core full !core/corona activated
84
hydro hlle !hydro activated
85
eos x3ff !eos activated
86
hacas full !hadronic cascade activated
87
"""
88
else
:
89
content2=f
"""core off !core/corona not activated
90
hydro off !hydro not activated
91
eos off !eos not activated
92
hacas off !hadronic cascade not activated
93
"""
94
content3 =f
"""set ninicon 1 !number of initial conditions used for hydro evolution
95
set nfull {number_of_events} !number of events
96
set nfreeze 1 !number of freeze out events per hydro event
97
set modsho 1 !printout every modsho events
98
set centrality {centralityClass} !0=min bias
99
"""
100
101
return
content1 + content2 + content3
102
print
void print(char *figname, TCanvas *c1)
Definition
TRTCalib_StrawStatusPlots.cxx:26
configFile.build_config_content
build_config_content(energy, number_of_events, laproj=1, maproj=1, latarg=1, matarg=1, hydro=True, list_of_particle_ids="110 20 2130 -2130 2230 -2230 1130 -1130 1330 -1330 2330 -2330 3331 -3331", centralityClass=0)
Definition
configFile.py:19
Generated on
for ATLAS Offline Software by
1.17.0