Constructor.
Takes all there is to take from the (truncated!) configuration object (only contains configuration for this modus).
38 Configuration modus_cfg = modus_config.extract_complete_sub_configuration(
43 Configuration proj_cfg = modus_cfg.extract_complete_sub_configuration(
45 Configuration targ_cfg =
49 bool same_file =
false;
57 proj_cfg, params.testparticles, same_file);
59 logg[
LCollider].info() <<
"Projectile is alpha-clustered with woods-saxon "
60 "parameters for the He-clusters listed below.";
64 projectile_ = std::make_unique<Nucleus>(proj_cfg, params.testparticles);
67 throw ColliderEmpty(
"Input Error: Projectile nucleus is empty.");
75 target_ = std::make_unique<CustomNucleus>(targ_cfg, params.testparticles,
78 logg[
LCollider].info() <<
"Target is alpha-clustered with woods-saxon "
79 "parameters for the He-clusters listed below.";
83 target_ = std::make_unique<Nucleus>(targ_cfg, params.testparticles);
86 throw ColliderEmpty(
"Input Error: Target nucleus is empty.");
103 int energy_input = 0;
105 const double mass_target =
target_->mass();
107 const double mass_a =
109 const double mass_b =
target_->mass() /
target_->number_of_particles();
115 throw ModusDefault::InvalidEnergy(
116 "Input Error: sqrt(s_NN) is not larger than masses:\n" +
122 mass_projec * mass_target / (mass_a * mass_b) +
123 mass_projec * mass_projec + mass_target * mass_target;
131 throw ModusDefault::InvalidEnergy(
133 "E_Tot must be nonnegative.");
137 mass_projec, mass_target);
146 throw ModusDefault::InvalidEnergy(
148 "E_Kin must be nonnegative.");
152 mass_projec, mass_target);
160 throw ModusDefault::InvalidEnergy(
162 "P_Lab must be nonnegative.");
166 mass_projec, mass_target);
173 const double e_tot_p =
176 if (e_tot_p < 0 || e_tot_t < 0) {
177 throw ModusDefault::InvalidEnergy(
179 "E_Tot must be nonnegative.");
182 e_tot_t *
target_->number_of_particles(),
183 mass_projec, mass_target);
190 const double e_kin_p =
193 if (e_kin_p < 0 || e_kin_t < 0) {
194 throw ModusDefault::InvalidEnergy(
196 "E_Kin must be nonnegative.");
199 e_kin_t *
target_->number_of_particles(),
200 mass_projec, mass_target);
207 const double p_lab_p =
210 if (p_lab_p < 0 || p_lab_t < 0) {
211 throw ModusDefault::InvalidEnergy(
213 "P_Lab must be nonnegative.");
216 p_lab_t *
target_->number_of_particles(),
217 mass_projec, mass_target);
221 if (energy_input == 0) {
222 throw std::domain_error(
223 "Input Error: Non-existent collision energy. "
224 "Please provide one of Sqrtsnn/E_Kin/P_Lab.");
226 if (energy_input > 1) {
227 throw std::invalid_argument(
228 "Input Error: Redundant collision energy. "
229 "Please provide only one of Sqrtsnn/E_Kin/P_Lab.");
245 throw std::invalid_argument(
246 "Input Error: Need impact parameter spectrum for custom sampling."
247 " Please provide Values and Yields.");
249 const std::vector<double> impacts =
251 const std::vector<double> yields =
253 if (impacts.size() != yields.size()) {
254 throw std::invalid_argument(
255 "Input Error: Need as many impact parameter values as yields. "
256 "Please make sure that Values and Yields have the same length.");
259 InterpolateDataLinear<double>(impacts, yields));
261 const auto imp_minmax =
262 std::minmax_element(impacts.begin(), impacts.end());
265 yield_max_ = *std::max_element(yields.begin(), yields.end());
269 const std::array<double, 2> range =
296 if (modus_cfg.has_value(
313 double threshold = modus_cfg.take(
321 double form_time_fraction = modus_cfg.take(
323 if (threshold <= 0 || max_time < min_time || min_time < 0 || cells < 2 ||
324 form_time_fraction < 0) {
326 <<
"Bad parameters chosen for dynamic initial conditions. At least "
327 "one of the following inequalities is violated:\n"
328 <<
" Energy_Density_Threshold = " << threshold <<
" > 0\n"
329 <<
" Maximum_Time = " << max_time <<
" > " << min_time
330 <<
" = Minimum_Time > 0\n"
331 "Fluidization_Cells = "
333 <<
" Formation_Time_Fraction < 0";
334 throw std::invalid_argument(
"Please adjust the configuration file.");
340 double min_size = std::max(min_time, 40.);
341 std::array<double, 3>
length{2 * min_size, 2 * min_size, 2 * min_size};
342 std::array<double, 3> origin{-min_size, -min_size, -min_size};
343 std::array<int, 3> cell_array{cells, cells, cells};
346 std::make_unique<RectangularLattice<EnergyMomentumTensor>>(
355 <<
"Preparing dynamic Initial Conditions with threshold " << threshold
356 <<
" GeV/fm³ in energy density, between " << min_time <<
" and "
357 << max_time <<
" fm.";
360 std::pow(2 * M_PI * params.gaussian_sigma, -1.5);
CalculationFrame frame_
Reference frame for the system, as specified from config.
double imp_min_
Minimum value of impact parameter.
double initial_z_displacement_
Initial z-displacement of nuclei.
bool IC_for_hybrid_
Whether the particles will serve as initial conditions for hydrodynamics.
double yield_max_
Maximum value of yield. Needed for custom impact parameter sampling.
bool random_reaction_plane_
Whether the reaction plane should be randomized.
std::unique_ptr< Nucleus > projectile_
Projectile.
std::unique_ptr< InterpolateDataLinear< double > > impact_interpolation_
Pointer to the impact parameter interpolation.
FermiMotion fermi_motion_
An option to include Fermi motion ("off", "on", "frozen")
static std::unique_ptr< AlphaClusteredNucleus > create_alphaclustered_nucleus(Configuration &nucleus_cfg, const int ntest, const std::string &nucleus_type)
Configure Alpha-Clustered Nucleus.
Sampling sampling_
Method used for sampling of impact parameter.
std::unique_ptr< RectangularLattice< EnergyMomentumTensor > > fluid_lattice_
Energy-momentum tensor lattice for dynamic fluidization.
double total_s_
Center-of-mass energy squared of the nucleus-nucleus collision.
std::unique_ptr< Nucleus > target_
Target.
double impact_
Impact parameter.
double sqrt_s_NN_
Center-of-mass energy of a nucleon-nucleon collision.
bool same_inputfile(Configuration &proj_config, Configuration &targ_config)
Checks if target and projectile are read from the same external file if they are both initialized as ...
std::unique_ptr< std::map< int32_t, double > > fluid_background_
Energy density background from hydrodynamic evolution, with particle indices as keys.
void validate_IC_kinematic_range()
Validate whether the input kinematic range for the Initial Conditions output is valid and inform the ...
static std::unique_ptr< DeformedNucleus > create_deformed_nucleus(Configuration &nucleus_cfg, const int ntest, const std::string &nucleus_type)
Configure Deformed Nucleus.
std::unique_ptr< InitialConditionParameters > IC_parameters_
Plain Old Data type to hold parameters for initial conditions.
double imp_max_
Maximum value of impact parameter.
static bool remove_particle_
Whether fluidization actions remove the particle from the evolution.
@ On
Use fermi motion in combination with potentials.
@ Frozen
Use fermi motion without potentials.
@ Off
Don't use fermi motion.
@ ConstantTau
Hypersurface crossed at a fixed proper time.
@ Dynamic
Dynamic fluidization based on local densities.
@ Custom
Sample from custom, user-defined distribution.
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
static constexpr int LInitialConditions
double s_from_Ekin(double e_kin, double m_P, double m_T)
Convert E_kin to Mandelstam-s for a fixed-target setup, with a projectile of mass m_P and a kinetic e...
std::string to_string(ThermodynamicQuantity quantity)
Convert a ThermodynamicQuantity enum value to its corresponding string.
static constexpr int LCollider
double s_from_Etot(double e_tot, double m_P, double m_T)
Convert E_tot to Mandelstam-s for a fixed-target setup, with a projectile of mass m_P and a total ene...
double s_from_plab(double plab, double m_P, double m_T)
Convert p_lab to Mandelstam-s for a fixed-target setup, with a projectile of mass m_P and momentum pl...