19 centralityClass=0):
20
21
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:
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!--------------------------------------------------------------------
67application hadron !hadron-hadron, hadron-nucleus, or nucleus-nucleus
68set laproj {laproj} !projectile atomic number
69set maproj {maproj} !projectile mass number
70set latarg {latarg} !target atomic number
71set matarg {matarg} !target mass number
72set ecms {energy} !sqrt(s)_pp
73set istmax 25 !max status considered for storage
74set 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.
78ftime on !string formation time non-zero
79!suppressed decays (using EPOS id codes, see src/KWt/idt.dt)
80nodecays {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
95set nfull {number_of_events} !number of events
96set nfreeze 1 !number of freeze out events per hydro event
97set modsho 1 !printout every modsho events
98set centrality {centralityClass} !0=min bias
99"""
100
101 return content1 + content2 + content3
102
void print(char *figname, TCanvas *c1)