Version: SMASH-3.3
smash::ColliderModus Class Reference

#include <collidermodus.h>

ColliderModus: Provides a modus for colliding nuclei.

To use this modus, choose

General:
Modus: Collider

in the configuration file.

Options for ColliderModus go in the "Modi"→"Collider" section of the configuration.

The following configuration options are understood: Collider

Definition at line 48 of file collidermodus.h.

Inheritance diagram for smash::ColliderModus:
smash::ModusDefault

Classes

struct  ColliderEmpty
 Thrown when either projectile_ or target_ nuclei are empty. More...
 

Public Member Functions

 ColliderModus (Configuration modus_config, const ExperimentParameters &parameters)
 Constructor. More...
 
std::string custom_file_path (const std::string &file_directory, const std::string &file_name)
 Creates full path string consisting of file_directory and file_name Needed to initialize a customnucleus. More...
 
double initial_conditions (Particles *particles, const ExperimentParameters &parameters)
 Generates initial state of the particles in the system. More...
 
void sample_impact ()
 Sample impact parameter. More...
 
double nuclei_passing_time () const
 Time until nuclei have passed through each other. More...
 
double velocity_projectile () const
 
double velocity_target () const
 
FermiMotion fermi_motion ()
 
bool is_collider () const
 
double sqrt_s_NN () const
 
double impact_parameter () const
 
bool calculation_frame_is_fixed_target () const
 
bool is_IC_for_hybrid () const
 
const InitialConditionParametersIC_parameters () const
 
const std::map< int32_t, double > & fluid_background () const
 
const RectangularLattice< EnergyMomentumTensor > & fluid_lattice () const
 
void build_fluidization_lattice (double t, const std::vector< Particles > &ensembles, const DensityParameters &dens_par)
 Build lattice of energy momentum tensor. More...
 
void update_fluidization_background (std::map< int32_t, double > &&background)
 Update the background energy density due to hydrodynamics, to be called by an external manager. More...
 
- Public Member Functions inherited from smash::ModusDefault
int impose_boundary_conditions (Particles *, const OutputsList &={})
 Enforces sensible positions for the particles. More...
 
bool is_collider () const
 
bool is_box () const
 
bool is_list () const
 
bool is_sphere () const
 
double sqrt_s_NN () const
 
double impact_parameter () const
 
void sample_impact () const
 sample impact parameter for collider modus More...
 
double velocity_projectile () const
 
double velocity_target () const
 
FermiMotion fermi_motion () const
 
double max_timestep (double) const
 
double equilibration_time () const
 
double length () const
 
double radius () const
 
bool calculation_frame_is_fixed_target () const
 
double nuclei_passing_time () const
 Get the passing time of the two nuclei in a collision. More...
 
bool is_IC_for_hybrid () const
 
const InitialConditionParametersIC_parameters () const
 
const std::map< int32_t, double > & fluid_background ()
 
const RectangularLattice< EnergyMomentumTensor > & fluid_lattice ()
 
void build_fluidization_lattice ([[maybe_unused]] const double t, [[maybe_unused]] const std::vector< Particles > &ensembles, [[maybe_unused]] const DensityParameters &dens_par)
 Build lattice of energy momentum tensor. More...
 
Grid< GridOptions::Normalcreate_grid (const Particles &particles, double min_cell_length, double timestep_duration, CollisionCriterion crit, const bool include_unformed_particles, CellSizeStrategy strategy=CellSizeStrategy::Optimal) const
 Creates the Grid with normal boundary conditions. More...
 
std::unique_ptr< GrandCanThermalizercreate_grandcan_thermalizer (Configuration &conf) const
 Creates GrandCanThermalizer. More...
 

Private Member Functions

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 a customnucleus. More...
 
void validate_IC_kinematic_range ()
 Validate whether the input kinematic range for the Initial Conditions output is valid and inform the user. More...
 
void rotate_reaction_plane (double phi, Particles *particles)
 Rotate the reaction plane about the angle phi. More...
 
std::pair< double, double > get_velocities (double mandelstam_s, double m_a, double m_b)
 Get the frame dependent velocity for each nucleus, using the current reference frame. More...
 

Static Private Member Functions

static std::unique_ptr< DeformedNucleuscreate_deformed_nucleus (Configuration &nucleus_cfg, const int ntest, const std::string &nucleus_type)
 Configure Deformed Nucleus. More...
 
static std::unique_ptr< AlphaClusteredNucleuscreate_alphaclustered_nucleus (Configuration &nucleus_cfg, const int ntest, const std::string &nucleus_type)
 Configure Alpha-Clustered Nucleus. More...
 

Private Attributes

std::unique_ptr< Nucleusprojectile_
 Projectile. More...
 
std::unique_ptr< Nucleustarget_
 Target. More...
 
double total_s_
 Center-of-mass energy squared of the nucleus-nucleus collision. More...
 
double sqrt_s_NN_
 Center-of-mass energy of a nucleon-nucleon collision. More...
 
double impact_ = 0.
 Impact parameter. More...
 
bool random_reaction_plane_
 Whether the reaction plane should be randomized. More...
 
bool IC_for_hybrid_ = false
 Whether the particles will serve as initial conditions for hydrodynamics. More...
 
Sampling sampling_ = InputKeys::modi_collider_impact_sample.default_value()
 Method used for sampling of impact parameter. More...
 
double imp_min_ = InputKeys::modi_collider_impact_value.default_value()
 Minimum value of impact parameter. More...
 
double imp_max_ = InputKeys::modi_collider_impact_value.default_value()
 Maximum value of impact parameter. More...
 
double yield_max_ = 0.0
 Maximum value of yield. Needed for custom impact parameter sampling. More...
 
std::unique_ptr< InterpolateDataLinear< double > > impact_interpolation_
 Pointer to the impact parameter interpolation. More...
 
double initial_z_displacement_
 Initial z-displacement of nuclei. More...
 
CalculationFrame frame_
 Reference frame for the system, as specified from config. More...
 
FermiMotion fermi_motion_
 An option to include Fermi motion ("off", "on", "frozen") More...
 
double velocity_projectile_ = 0.0
 Beam velocity of the projectile. More...
 
double velocity_target_ = 0.0
 Beam velocity of the target. More...
 
std::unique_ptr< InitialConditionParametersIC_parameters_
 Plain Old Data type to hold parameters for initial conditions. More...
 
std::unique_ptr< RectangularLattice< EnergyMomentumTensor > > fluid_lattice_
 Energy-momentum tensor lattice for dynamic fluidization. More...
 
std::unique_ptr< std::map< int32_t, double > > fluid_background_ = nullptr
 Energy density background from hydrodynamic evolution, with particle indices as keys. More...
 

Friends

std::ostream & operator<< (std::ostream &, const ColliderModus &)
 Writes the initial state for the ColliderModus to the output stream. More...
 

Constructor & Destructor Documentation

◆ ColliderModus()

smash::ColliderModus::ColliderModus ( Configuration  modus_config,
const ExperimentParameters parameters 
)
explicit

Constructor.

Takes all there is to take from the (truncated!) configuration object (only contains configuration for this modus).

Parameters
[in]modus_configThe configuration object that sets all initial conditions of the experiment.
[in]parametersUnused, but necessary because of templated initialization
Exceptions
ColliderEmptyif projectile or nucleus are empty (i.e. do not contain particles)
InvalidEnergyif sqrts from config is not large enough to support the colliding masses of the nuclei, or if E_kin or P_lab are negative
domain_errorif more or less than exactly one of the input energy options is specified, or if custom impact parameter Values and Yields are improperly supplied
Todo:
include a check that only one method of specifying impact is used

Definition at line 36 of file collidermodus.cc.

37  {
38  Configuration modus_cfg = modus_config.extract_complete_sub_configuration(
40  // Get the reference frame for the collision calculation.
42 
43  Configuration proj_cfg = modus_cfg.extract_complete_sub_configuration(
45  Configuration targ_cfg =
46  modus_cfg.extract_complete_sub_configuration(InputSections::m_c_target);
47  /* Needed to check if projectile and target in customnucleus are read from
48  * the same input file.*/
49  bool same_file = false;
50  // Set up the projectile nucleus
51  if (proj_cfg.has_section(InputSections::m_c_p_deformed)) {
52  projectile_ =
53  create_deformed_nucleus(proj_cfg, params.testparticles, "projectile");
54  } else if (proj_cfg.has_section(InputSections::m_c_p_custom)) {
55  same_file = same_inputfile(proj_cfg, targ_cfg);
56  projectile_ = std::make_unique<CustomNucleus>(
57  proj_cfg, params.testparticles, same_file);
58  } else if (proj_cfg.has_section(InputSections::m_c_p_alphaClustered)) {
59  logg[LCollider].info() << "Projectile is alpha-clustered with woods-saxon "
60  "parameters for the He-clusters listed below.";
61  projectile_ = create_alphaclustered_nucleus(proj_cfg, params.testparticles,
62  "projectile");
63  } else {
64  projectile_ = std::make_unique<Nucleus>(proj_cfg, params.testparticles);
65  }
66  if (projectile_->size() < 1) {
67  throw ColliderEmpty("Input Error: Projectile nucleus is empty.");
68  }
70 
71  // Set up the target nucleus
72  if (targ_cfg.has_section(InputSections::m_c_t_deformed)) {
73  target_ = create_deformed_nucleus(targ_cfg, params.testparticles, "target");
74  } else if (targ_cfg.has_section(InputSections::m_c_t_custom)) {
75  target_ = std::make_unique<CustomNucleus>(targ_cfg, params.testparticles,
76  same_file);
77  } else if (targ_cfg.has_section(InputSections::m_c_t_alphaClustered)) {
78  logg[LCollider].info() << "Target is alpha-clustered with woods-saxon "
79  "parameters for the He-clusters listed below.";
80  target_ =
81  create_alphaclustered_nucleus(targ_cfg, params.testparticles, "target");
82  } else {
83  target_ = std::make_unique<Nucleus>(targ_cfg, params.testparticles);
84  }
85  if (target_->size() < 1) {
86  throw ColliderEmpty("Input Error: Target nucleus is empty.");
87  }
88  target_->set_label(BelongsTo::Target);
89 
90  // Get the Fermi-Motion input (off, on, frozen)
93  logg[LCollider].info() << "Fermi motion is ON.";
94  } else if (fermi_motion_ == FermiMotion::Frozen) {
95  logg[LCollider].info() << "FROZEN Fermi motion is on.";
96  } else if (fermi_motion_ == FermiMotion::Off) {
97  logg[LCollider].info() << "Fermi motion is OFF.";
98  }
99 
100  // Get the total nucleus-nucleus collision energy. Since there is
101  // no meaningful choice for a default energy, we require the user to
102  // give one (and only one) energy input from the available options.
103  int energy_input = 0;
104  const double mass_projec = projectile_->mass();
105  const double mass_target = target_->mass();
106  // average mass of a particle in that nucleus
107  const double mass_a =
108  projectile_->mass() / projectile_->number_of_particles();
109  const double mass_b = target_->mass() / target_->number_of_particles();
110  // Option 1: Center of mass energy.
111  if (modus_cfg.has_value(InputKeys::modi_collider_sqrtSNN)) {
113  // Check that input satisfies the lower bound (everything at rest).
114  if (sqrt_s_NN_ <= mass_a + mass_b) {
115  throw ModusDefault::InvalidEnergy(
116  "Input Error: sqrt(s_NN) is not larger than masses:\n" +
117  std::to_string(sqrt_s_NN_) + " GeV <= " + std::to_string(mass_a) +
118  " GeV + " + std::to_string(mass_b) + " GeV.");
119  }
120  // Set the total nucleus-nucleus collision energy.
121  total_s_ = (sqrt_s_NN_ * sqrt_s_NN_ - mass_a * mass_a - mass_b * mass_b) *
122  mass_projec * mass_target / (mass_a * mass_b) +
123  mass_projec * mass_projec + mass_target * mass_target;
124  energy_input++;
125  }
126  /* Option 2: Total energy per nucleon of the projectile nucleus
127  * (target at rest). */
128  if (modus_cfg.has_value(InputKeys::modi_collider_eTot)) {
129  const double e_tot = modus_cfg.take(InputKeys::modi_collider_eTot);
130  if (e_tot < 0) {
131  throw ModusDefault::InvalidEnergy(
132  "Input Error: "
133  "E_Tot must be nonnegative.");
134  }
135  // Set the total nucleus-nucleus collision energy.
136  total_s_ = s_from_Etot(e_tot * projectile_->number_of_particles(),
137  mass_projec, mass_target);
138  sqrt_s_NN_ = std::sqrt(s_from_Etot(e_tot, mass_a, mass_b));
139  energy_input++;
140  }
141  /* Option 3: Kinetic energy per nucleon of the projectile nucleus
142  * (target at rest). */
143  if (modus_cfg.has_value(InputKeys::modi_collider_eKin)) {
144  const double e_kin = modus_cfg.take(InputKeys::modi_collider_eKin);
145  if (e_kin < 0) {
146  throw ModusDefault::InvalidEnergy(
147  "Input Error: "
148  "E_Kin must be nonnegative.");
149  }
150  // Set the total nucleus-nucleus collision energy.
151  total_s_ = s_from_Ekin(e_kin * projectile_->number_of_particles(),
152  mass_projec, mass_target);
153  sqrt_s_NN_ = std::sqrt(s_from_Ekin(e_kin, mass_a, mass_b));
154  energy_input++;
155  }
156  // Option 4: Momentum of the projectile nucleus (target at rest).
157  if (modus_cfg.has_value(InputKeys::modi_collider_pLab)) {
158  const double p_lab = modus_cfg.take(InputKeys::modi_collider_pLab);
159  if (p_lab < 0) {
160  throw ModusDefault::InvalidEnergy(
161  "Input Error: "
162  "P_Lab must be nonnegative.");
163  }
164  // Set the total nucleus-nucleus collision energy.
165  total_s_ = s_from_plab(p_lab * projectile_->number_of_particles(),
166  mass_projec, mass_target);
167  sqrt_s_NN_ = std::sqrt(s_from_plab(p_lab, mass_a, mass_b));
168  energy_input++;
169  }
170  // Option 5: Total energy per nucleon of _each_ beam
171  if (proj_cfg.has_value(InputKeys::modi_collider_projectile_eTot) &&
172  targ_cfg.has_value(InputKeys::modi_collider_target_eTot)) {
173  const double e_tot_p =
175  const double e_tot_t = targ_cfg.take(InputKeys::modi_collider_target_eTot);
176  if (e_tot_p < 0 || e_tot_t < 0) {
177  throw ModusDefault::InvalidEnergy(
178  "Input Error: "
179  "E_Tot must be nonnegative.");
180  }
181  total_s_ = s_from_Etot(e_tot_p * projectile_->number_of_particles(),
182  e_tot_t * target_->number_of_particles(),
183  mass_projec, mass_target);
184  sqrt_s_NN_ = std::sqrt(s_from_Ekin(e_tot_p, e_tot_t, mass_a, mass_b));
185  energy_input++;
186  }
187  // Option 6: Kinetic energy per nucleon of _each_ beam
188  if (proj_cfg.has_value(InputKeys::modi_collider_projectile_eKin) &&
189  targ_cfg.has_value(InputKeys::modi_collider_target_eKin)) {
190  const double e_kin_p =
192  const double e_kin_t = targ_cfg.take(InputKeys::modi_collider_target_eKin);
193  if (e_kin_p < 0 || e_kin_t < 0) {
194  throw ModusDefault::InvalidEnergy(
195  "Input Error: "
196  "E_Kin must be nonnegative.");
197  }
198  total_s_ = s_from_Ekin(e_kin_p * projectile_->number_of_particles(),
199  e_kin_t * target_->number_of_particles(),
200  mass_projec, mass_target);
201  sqrt_s_NN_ = std::sqrt(s_from_Ekin(e_kin_p, e_kin_t, mass_a, mass_b));
202  energy_input++;
203  }
204  // Option 7: Momentum per nucleon of _each_ beam
205  if (proj_cfg.has_value(InputKeys::modi_collider_projectile_pLab) &&
206  targ_cfg.has_value(InputKeys::modi_collider_target_pLab)) {
207  const double p_lab_p =
209  const double p_lab_t = targ_cfg.take(InputKeys::modi_collider_target_pLab);
210  if (p_lab_p < 0 || p_lab_t < 0) {
211  throw ModusDefault::InvalidEnergy(
212  "Input Error: "
213  "P_Lab must be nonnegative.");
214  }
215  total_s_ = s_from_plab(p_lab_p * projectile_->number_of_particles(),
216  p_lab_t * target_->number_of_particles(),
217  mass_projec, mass_target);
218  sqrt_s_NN_ = std::sqrt(s_from_plab(p_lab_p, p_lab_t, mass_a, mass_b));
219  energy_input++;
220  }
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.");
225  }
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.");
230  }
231 
232  /* Impact parameter setting: Either "Value", "Range", "Max" or "Sample".
233  * Unspecified means 0 impact parameter.*/
234  if (modus_cfg.has_value(InputKeys::modi_collider_impact_value)) {
236  imp_min_ = impact_;
237  imp_max_ = impact_;
238  } else {
239  // If impact is not supplied by value, inspect sampling parameters:
240  if (modus_cfg.has_value(InputKeys::modi_collider_impact_sample)) {
242  if (sampling_ == Sampling::Custom) {
243  if (!(modus_cfg.has_value(InputKeys::modi_collider_impact_values) ||
244  modus_cfg.has_value(InputKeys::modi_collider_impact_yields))) {
245  throw std::invalid_argument(
246  "Input Error: Need impact parameter spectrum for custom sampling."
247  " Please provide Values and Yields.");
248  }
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.");
257  }
258  impact_interpolation_ = std::make_unique<InterpolateDataLinear<double>>(
259  InterpolateDataLinear<double>(impacts, yields));
260 
261  const auto imp_minmax =
262  std::minmax_element(impacts.begin(), impacts.end());
263  imp_min_ = *imp_minmax.first;
264  imp_max_ = *imp_minmax.second;
265  yield_max_ = *std::max_element(yields.begin(), yields.end());
266  }
267  }
268  if (modus_cfg.has_value(InputKeys::modi_collider_impact_range)) {
269  const std::array<double, 2> range =
271  imp_min_ = range[0];
272  imp_max_ = range[1];
273  }
274  if (modus_cfg.has_value(InputKeys::modi_collider_impact_max)) {
275  imp_min_ = 0.0;
277  }
278  }
280  // whether the direction of separation should be randomly sampled
283  // Look for user-defined initial separation between nuclei.
284  // The displacement is half the distance (both nuclei are shifted
285  // initial_z_displacement_ away from origin)
287  modus_cfg.take(InputKeys::modi_collider_initialDistance) / 2.0;
288  if (modus_cfg.has_section(InputSections::m_c_initialConditions)) {
289  IC_for_hybrid_ = true;
290  IC_parameters_ = std::make_unique<InitialConditionParameters>();
291  IC_parameters_->type =
293 
296  if (modus_cfg.has_value(
298  IC_parameters_->proper_time = modus_cfg.take(
300  } else {
301  IC_parameters_->lower_bound = modus_cfg.take(
303  IC_parameters_->proper_time_scaling =
305  }
306  IC_parameters_->rapidity_cut = modus_cfg.take(
308  IC_parameters_->pT_cut =
311  } else if (IC_parameters_->type == FluidizationType::Dynamic) {
313  double threshold = modus_cfg.take(
315  double min_time =
317  double max_time =
319  int cells =
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) {
325  logg[LInitialConditions].fatal()
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 = "
332  << cells << " > 2\n"
333  << " Formation_Time_Fraction < 0";
334  throw std::invalid_argument("Please adjust the configuration file.");
335  }
336 
337  IC_parameters_->fluidizable_processes = modus_cfg.take(
339 
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};
344 
346  std::make_unique<RectangularLattice<EnergyMomentumTensor>>(
347  length, cell_array, origin, false, LatticeUpdate::EveryTimestep);
348  fluid_background_ = std::make_unique<std::map<int32_t, double>>();
349 
350  IC_parameters_->energy_density_threshold = threshold;
351  IC_parameters_->min_time = min_time;
352  IC_parameters_->max_time = max_time;
353  IC_parameters_->num_fluid_cells = cells;
354  logg[LInitialConditions].info()
355  << "Preparing dynamic Initial Conditions with threshold " << threshold
356  << " GeV/fm³ in energy density, between " << min_time << " and "
357  << max_time << " fm.";
358  IC_parameters_->formation_time_fraction = form_time_fraction;
359  IC_parameters_->smearing_kernel_at_0 =
360  std::pow(2 * M_PI * params.gaussian_sigma, -1.5);
361  IC_parameters_->delay_initial_elastic = modus_cfg.take(
363  }
364  }
365 }
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.
double length() const
Definition: modusdefault.h:93
@ 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.
Definition: logging.cc:40
static constexpr int LInitialConditions
Definition: experiment.h:94
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...
Definition: kinematics.h:239
std::string to_string(ThermodynamicQuantity quantity)
Convert a ThermodynamicQuantity enum value to its corresponding string.
Definition: stringify.cc:26
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...
Definition: kinematics.h:211
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...
Definition: kinematics.h:265
static const Key< double > modi_collider_projectile_eKin
See user guide description for more information.
Definition: input_keys.h:3429
static const Key< double > modi_collider_target_pLab
See user guide description for more information.
Definition: input_keys.h:3480
static const Key< double > modi_collider_target_eTot
See user guide description for more information.
Definition: input_keys.h:3453
static const Key< double > modi_collider_initialDistance
See user guide description for more information.
Definition: input_keys.h:3305
static const Key< double > modi_collider_eKin
See user guide description for more information.
Definition: input_keys.h:3185
static const Key< double > modi_collider_pLab
See user guide description for more information.
Definition: input_keys.h:3218
static const Key< bool > modi_collider_initialConditions_delayInitialElastic
See user guide description for more information.
Definition: input_keys.h:4127
static const Key< FluidizationType > modi_collider_initialConditions_type
See user guide description for more information.
Definition: input_keys.h:3928
static const Key< double > modi_collider_sqrtSNN
See user guide description for more information.
Definition: input_keys.h:3233
static const Key< int > modi_collider_initialConditions_fluidCells
See user guide description for more information.
Definition: input_keys.h:4080
static const Key< std::vector< double > > modi_collider_impact_values
See user guide description for more information.
Definition: input_keys.h:3892
static const Key< double > modi_collider_impact_value
See user guide description for more information.
Definition: input_keys.h:3874
static const Key< bool > modi_collider_impact_randomReactionPlane
See user guide description for more information.
Definition: input_keys.h:3819
static const Key< double > modi_collider_initialConditions_scaling
See user guide description for more information.
Definition: input_keys.h:3983
static const Key< std::array< double, 2 > > modi_collider_impact_range
See user guide description for more information.
Definition: input_keys.h:3832
static const Key< double > modi_collider_initialConditions_maxTime
See user guide description for more information.
Definition: input_keys.h:4067
static const Key< double > modi_collider_initialConditions_minTime
See user guide description for more information.
Definition: input_keys.h:4053
static const Key< FluidizableProcessesBitSet > modi_collider_initialConditions_fluidProcesses
See user guide description for more information.
Definition: input_keys.h:4109
static const Key< double > modi_collider_initialConditions_eDenThreshold
See user guide description for more information.
Definition: input_keys.h:4037
static const Key< double > modi_collider_target_eKin
See user guide description for more information.
Definition: input_keys.h:3434
static const Key< CalculationFrame > modi_collider_calculationFrame
See user guide description for more information.
Definition: input_keys.h:3257
static const Key< double > modi_collider_impact_max
See user guide description for more information.
Definition: input_keys.h:3806
static const Key< std::vector< double > > modi_collider_impact_yields
See user guide description for more information.
Definition: input_keys.h:3908
static const Key< double > modi_collider_initialConditions_formTimeFraction
See user guide description for more information.
Definition: input_keys.h:4146
static const Key< double > modi_collider_initialConditions_lowerBound
See user guide description for more information.
Definition: input_keys.h:3943
static const Key< double > modi_collider_eTot
See user guide description for more information.
Definition: input_keys.h:3201
static const Key< double > modi_collider_projectile_pLab
See user guide description for more information.
Definition: input_keys.h:3475
static const Key< Sampling > modi_collider_impact_sample
See user guide description for more information.
Definition: input_keys.h:3861
static const Key< double > modi_collider_initialConditions_rapidityCut
See user guide description for more information.
Definition: input_keys.h:4021
static const Key< double > modi_collider_projectile_eTot
See user guide description for more information.
Definition: input_keys.h:3448
static const Key< FermiMotion > modi_collider_fermiMotion
See user guide description for more information.
Definition: input_keys.h:3289
static const Key< double > modi_collider_initialConditions_properTime
See user guide description for more information.
Definition: input_keys.h:3964
static const Key< double > modi_collider_initialConditions_pTCut
See user guide description for more information.
Definition: input_keys.h:4003
static const Section m_c_p_alphaClustered
Subsection for the alpha-clustered projectile in collider modus.
Definition: input_keys.h:105
static const Section m_c_p_custom
Subsection for the custom projectile in collider modus.
Definition: input_keys.h:108
static const Section m_collider
Subsection for the collider modus.
Definition: input_keys.h:95
static const Section m_c_p_deformed
Subsection for the deformed projectile in collider modus.
Definition: input_keys.h:111
static const Section m_c_projectile
Subsection for the projectile in collider modus.
Definition: input_keys.h:102
static const Section m_c_t_deformed
Subsection for the deformed target in collider modus.
Definition: input_keys.h:125
static const Section m_c_target
Subsection for the target in collider modus.
Definition: input_keys.h:117
static const Section m_c_initialConditions
Subsection for the initial conditions in collider modus.
Definition: input_keys.h:99
static const Section m_c_t_custom
Subsection for the custom target in collider modus.
Definition: input_keys.h:122
static const Section m_c_t_alphaClustered
Subsection for the alpha-clustered target in collider modus.
Definition: input_keys.h:119

Member Function Documentation

◆ custom_file_path()

std::string smash::ColliderModus::custom_file_path ( const std::string &  file_directory,
const std::string &  file_name 
)

Creates full path string consisting of file_directory and file_name Needed to initialize a customnucleus.

Parameters
[in]file_directoryis the path to the external file
[in]file_nameis the name of the external file

Definition at line 652 of file collidermodus.cc.

653  {
654  // make sure that path is correct even if the / at the end is missing
655  if (file_directory.back() == '/') {
656  return file_directory + file_name;
657  } else {
658  return file_directory + '/' + file_name;
659  }
660 }

◆ initial_conditions()

double smash::ColliderModus::initial_conditions ( Particles particles,
const ExperimentParameters parameters 
)

Generates initial state of the particles in the system.

In particular, it initializes the momenta and positions of nucleons withing the colliding nuclei.

Parameters
[out]particlesAn empty list that gets filled up by this function
[in]parametersThe initialization parameters of the system
Returns
The starting time of the simulation (negative, so that nuclei collide exactly at t=0)
Exceptions
domain_errorif the velocities of each nucleus are >= 1, or if input for Fermi motion is invalid

Definition at line 512 of file collidermodus.cc.

513  {
514  // Populate the nuclei with appropriately distributed nucleons.
515  // If deformed, this includes rotating the nucleus.
516  projectile_->arrange_nucleons();
517  target_->arrange_nucleons();
518 
519  // Use the total mandelstam variable to get the frame-dependent velocity for
520  // each nucleus. Position a is projectile, position b is target.
521  double v_a, v_b;
522  std::tie(v_a, v_b) =
523  get_velocities(total_s_, projectile_->mass(), target_->mass());
524 
525  // If velocities are larger or equal to 1, throw an exception.
526  if (v_a >= 1.0 || v_b >= 1.0) {
527  throw std::domain_error(
528  "Found velocity equal to or larger than 1 in "
529  "ColliderModus::initial_conditions.\nConsider using "
530  "the center of velocity reference frame.");
531  }
532 
533  // Calculate the beam velocity of the projectile and the target, which will
534  // be used to calculate the beam momenta in experiment.cc
536  velocity_projectile_ = v_a;
537  velocity_target_ = v_b;
538  }
539 
540  // Generate Fermi momenta if necessary
543  // Frozen: Fermi momenta will be ignored during the propagation to
544  // avoid that the nuclei will fly apart.
545  projectile_->generate_fermi_momenta();
546  target_->generate_fermi_momenta();
547  } else if (fermi_motion_ == FermiMotion::Off) {
548  } else {
549  throw std::invalid_argument("Invalid Fermi_Motion input.");
550  }
551 
552  // Boost the nuclei to the appropriate velocity.
553  projectile_->boost(v_a);
554  target_->boost(v_b);
555 
556  // Shift the nuclei into starting positions. Contracted spheres with
557  // nuclear radii should touch exactly at t=0. Modus starts at negative
558  // time corresponding to additional initial displacement.
559  const double d_a = std::max(0., projectile_->get_diffusiveness());
560  const double d_b = std::max(0., target_->get_diffusiveness());
561  const double r_a = projectile_->get_nuclear_radius();
562  const double r_b = target_->get_nuclear_radius();
563  const double dz = initial_z_displacement_;
564 
565  const double simulation_time = -dz / std::abs(v_a);
566  const double proj_z = -dz - std::sqrt(1.0 - v_a * v_a) * (r_a + d_a);
567  const double targ_z =
568  +dz * std::abs(v_b / v_a) + std::sqrt(1.0 - v_b * v_b) * (r_b + d_b);
569  // rotation angle in the transverse plane
570  const double phi =
571  random_reaction_plane_ ? random::uniform(0.0, 2.0 * M_PI) : 0.0;
572 
573  projectile_->shift(proj_z, +impact_ / 2.0, simulation_time);
574  target_->shift(targ_z, -impact_ / 2.0, simulation_time);
575 
576  // Put the particles in the nuclei into code particles.
577  projectile_->copy_particles(particles);
578  target_->copy_particles(particles);
579  rotate_reaction_plane(phi, particles);
580  return simulation_time;
581 }
void rotate_reaction_plane(double phi, Particles *particles)
Rotate the reaction plane about the angle phi.
std::pair< double, double > get_velocities(double mandelstam_s, double m_a, double m_b)
Get the frame dependent velocity for each nucleus, using the current reference frame.
double velocity_projectile_
Beam velocity of the projectile.
double velocity_target_
Beam velocity of the target.
T uniform(T min, T max)
Definition: random.h:88

◆ sample_impact()

void smash::ColliderModus::sample_impact ( )

Sample impact parameter.

Samples the impact parameter from values between imp_min_ and imp_max_, if linear or quadratic sampling is used. By specifying impact parameters and corresponding yields, custom sampling can be used. This depends on the value of sampling_.

Note that imp_max_ less than imp_min_ also works fine.

Definition at line 594 of file collidermodus.cc.

594  {
595  switch (sampling_) {
596  case Sampling::Quadratic: {
597  // quadratic sampling: Note that for bmin > bmax, this still yields
598  // the correct distribution (however canonical() = 0 is then the
599  // upper end, not the lower).
600  impact_ = std::sqrt(imp_min_ * imp_min_ +
603  } break;
604  case Sampling::Custom: {
605  // rejection sampling based on given distribution
606  assert(impact_interpolation_ != nullptr);
607  double probability_random = 1;
608  double probability = 0;
609  double b;
610  while (probability_random > probability) {
612  probability = (*impact_interpolation_)(b) / yield_max_;
613  assert(probability < 1.);
614  probability_random = random::uniform(0., 1.);
615  }
616  impact_ = b;
617  } break;
618  case Sampling::Uniform: {
619  // linear sampling. Still, min > max works fine.
621  }
622  }
623 }
@ Quadratic
Sample from areal / quadratic distribution.
@ Uniform
Sample from uniform distribution.
T canonical()
Definition: random.h:113

◆ nuclei_passing_time()

double smash::ColliderModus::nuclei_passing_time ( ) const
inline

Time until nuclei have passed through each other.

Definition at line 108 of file collidermodus.h.

108  {
109  const double passing_distance =
110  projectile_->get_nuclear_radius() + target_->get_nuclear_radius();
111  const double passing_time =
112  passing_distance /
113  std::sqrt(sqrt_s_NN_ * sqrt_s_NN_ /
114  ((2 * nucleon_mass) * (2 * nucleon_mass)) -
115  1);
116  return passing_time;
117  }
constexpr double nucleon_mass
Nucleon mass in GeV.
Definition: constants.h:62

◆ velocity_projectile()

double smash::ColliderModus::velocity_projectile ( ) const
inline
Returns
the beam velocity of the projectile, which will be used to calculate the beam momenta in experiment.cc if Fermi motion is frozen.

Definition at line 123 of file collidermodus.h.

123 { return velocity_projectile_; }

◆ velocity_target()

double smash::ColliderModus::velocity_target ( ) const
inline
Returns
the beam velocity of the target, which will be used to calculate the beam momenta in experiment.cc if Fermi motion is frozen.

Definition at line 128 of file collidermodus.h.

128 { return velocity_target_; }

◆ fermi_motion()

FermiMotion smash::ColliderModus::fermi_motion ( )
inline
Returns
The Fermi motion type

Definition at line 130 of file collidermodus.h.

130 { return fermi_motion_; }

◆ is_collider()

bool smash::ColliderModus::is_collider ( ) const
inline
Returns
whether the modus is collider (which is, yes, trivially true)

Definition at line 132 of file collidermodus.h.

132 { return true; }

◆ sqrt_s_NN()

double smash::ColliderModus::sqrt_s_NN ( ) const
inline
Returns
center of mass energy per nucleon pair

Definition at line 134 of file collidermodus.h.

134 { return sqrt_s_NN_; }

◆ impact_parameter()

double smash::ColliderModus::impact_parameter ( ) const
inline
Returns
impact parameter of the collision

Definition at line 136 of file collidermodus.h.

136 { return impact_; }

◆ calculation_frame_is_fixed_target()

bool smash::ColliderModus::calculation_frame_is_fixed_target ( ) const
inline
Returns
Whether the calculation frame is the fixed target frame

Definition at line 138 of file collidermodus.h.

138  {
139  return frame_ == CalculationFrame::FixedTarget ? true : false;
140  }

◆ is_IC_for_hybrid()

bool smash::ColliderModus::is_IC_for_hybrid ( ) const
inline
Returns
Whether this is an initial condition for hydrodynamics

Definition at line 142 of file collidermodus.h.

142 { return IC_for_hybrid_; }

◆ IC_parameters()

const InitialConditionParameters& smash::ColliderModus::IC_parameters ( ) const
inline
Returns
Parameters used in initial conditions for hydrodynamics

Definition at line 144 of file collidermodus.h.

144  {
145  return *IC_parameters_;
146  }

◆ fluid_background()

const std::map<int32_t, double>& smash::ColliderModus::fluid_background ( ) const
inline
Returns
The background energy density map

Definition at line 148 of file collidermodus.h.

148  {
149  return *fluid_background_;
150  }

◆ fluid_lattice()

const RectangularLattice<EnergyMomentumTensor>& smash::ColliderModus::fluid_lattice ( ) const
inline
Returns
Lattice where fluidization is evaluated

Definition at line 152 of file collidermodus.h.

152  {
153  return *fluid_lattice_;
154  }

◆ build_fluidization_lattice()

void smash::ColliderModus::build_fluidization_lattice ( double  t,
const std::vector< Particles > &  ensembles,
const DensityParameters dens_par 
)

Build lattice of energy momentum tensor.

After t>25 fm, the lattice grows at every 5 fm to accommodate for the system expansion.

Parameters
[in]tCurrent time.
[in]ensemblesOnly the first Particles element is actually used.
[in]dens_parContains parameters for density smearing.

Definition at line 691 of file collidermodus.cc.

693  {
694  if (fluid_lattice_ == nullptr) {
695  throw std::logic_error(
696  "Trying to build fluidization lattice with unset pointer in "
697  "ColliderModus.");
698  }
699  if (t < IC_parameters_->min_time.value() ||
700  t > IC_parameters_->max_time.value()) {
701  return;
702  }
703  const double resizing_rate = 5;
704  double side = fluid_lattice_->lattice_sizes()[0] / 2.;
705  if (t > side) {
706  side += resizing_rate;
707  std::array<double, 3> new_length{2 * side, 2 * side, 2 * side};
708  std::array<double, 3> new_origin{-side, -side, -side};
709  fluid_lattice_->reset_and_resize(new_length, new_origin, std::nullopt);
710  logg[LCollider].debug() << "Fluidization lattice resizing at " << t
711  << " fm to " << 2 * side << " fm";
712  }
713 
716  dens_par, ensembles, false);
717 }
void update_lattice_accumulating_ensembles(RectangularLattice< T > *lat, const LatticeUpdate update, const DensityType dens_type, const DensityParameters &par, const std::vector< Particles > &ensembles, const bool compute_gradient)
Updates the contents on the lattice when ensembles are used.
Definition: density.h:644

◆ update_fluidization_background()

void smash::ColliderModus::update_fluidization_background ( std::map< int32_t, double > &&  background)
inline

Update the background energy density due to hydrodynamics, to be called by an external manager.

Parameters
[in]backgroundMap with particle indices as keys and their corresponding background energy density as values.

Definition at line 174 of file collidermodus.h.

174  {
175  *fluid_background_ = std::move(background);
176  }

◆ create_deformed_nucleus()

std::unique_ptr< DeformedNucleus > smash::ColliderModus::create_deformed_nucleus ( Configuration nucleus_cfg,
const int  ntest,
const std::string &  nucleus_type 
)
staticprivate

Configure Deformed Nucleus.

Sets up a deformed nucleus object based on the input parameters in the configuration file.

Parameters
[in]nucleus_cfgSubset of configuration, projectile or target section.
[in]ntestNumber of test particles
[in]nucleus_typeString 'projectile' or 'target'. To display an appropriate error message.
Returns
Pointer to the created deformed nucleus object.

Definition at line 423 of file collidermodus.cc.

424  {
425  assert(has_projectile_or_target(nucleus_cfg));
426  const bool is_projectile = is_about_projectile(nucleus_cfg);
427  const auto &[automatic_key, beta2_key, beta3_key, beta4_key,
428  gamma_key] = [&is_projectile]() {
429  return is_projectile
430  ? std::make_tuple(
436  : std::make_tuple(
437  InputKeys::modi_collider_target_deformed_automatic,
438  InputKeys::modi_collider_target_deformed_beta2,
439  InputKeys::modi_collider_target_deformed_beta3,
440  InputKeys::modi_collider_target_deformed_beta4,
441  InputKeys::modi_collider_target_deformed_gamma);
442  }();
443 
444  bool automatic_deformation = nucleus_cfg.take(automatic_key);
445  bool was_any_beta_given = nucleus_cfg.has_value(beta2_key) ||
446  nucleus_cfg.has_value(beta3_key) ||
447  nucleus_cfg.has_value(beta4_key);
448  bool was_any_deformation_parameter_given =
449  was_any_beta_given || nucleus_cfg.has_value(gamma_key);
450  bool was_gamma_given_without_beta_2 =
451  nucleus_cfg.has_value(gamma_key) && !nucleus_cfg.has_value(beta2_key);
452 
453  if (automatic_deformation && was_any_deformation_parameter_given) {
454  throw std::invalid_argument(
455  "Automatic deformation of " + nucleus_type +
456  " nucleus requested, but deformation parameter(s) were provided as"
457  " well. Please, check the 'Deformed' section in your input file.");
458  } else if (!automatic_deformation && !was_any_beta_given) {
459  throw std::invalid_argument(
460  "Manual deformation of " + nucleus_type +
461  " nucleus requested, but no deformation beta parameter was provided."
462  " Please, check the 'Deformed' section in your input file.");
463  } else if (!automatic_deformation && was_gamma_given_without_beta_2) {
464  throw std::invalid_argument(
465  "Manual deformation of " + nucleus_type +
466  " nucleus requested, but 'Gamma' parameter was provided without "
467  "providing a value of 'Beta_2' having hence no deformation effect. "
468  "Please, check the 'Deformed' section in your input file.");
469  } else {
470  return std::make_unique<DeformedNucleus>(nucleus_cfg, ntest,
471  automatic_deformation);
472  }
473 }
bool has_projectile_or_target(const Configuration &config)
Find out whether a configuration has a projectile or a target sub-section.
Definition: nucleus.cc:588
bool is_about_projectile(const Configuration &config)
Find out whether a configuration is about projectile or target.
Definition: nucleus.cc:594
static const Key< bool > modi_collider_projectile_deformed_automatic
See user guide description for more information.
Definition: input_keys.h:3559
static const Key< double > modi_collider_projectile_deformed_beta3
See user guide description for more information.
Definition: input_keys.h:3597
static const Key< double > modi_collider_projectile_deformed_beta4
See user guide description for more information.
Definition: input_keys.h:3617
static const Key< double > modi_collider_projectile_deformed_beta2
See user guide description for more information.
Definition: input_keys.h:3577
static const Key< double > modi_collider_projectile_deformed_gamma
See user guide description for more information.
Definition: input_keys.h:3637

◆ create_alphaclustered_nucleus()

std::unique_ptr< AlphaClusteredNucleus > smash::ColliderModus::create_alphaclustered_nucleus ( Configuration nucleus_cfg,
const int  ntest,
const std::string &  nucleus_type 
)
staticprivate

Configure Alpha-Clustered Nucleus.

Sets up an alpha-clustered nucleus object based on the input parameters in the configuration file.

Parameters
[in]nucleus_cfgSubset of configuration, projectile or target section.
[in]ntestNumber of test particles
[in]nucleus_typeString 'projectile' or 'target'. To display an appropriate error message.
Returns
Pointer to the created deformed nucleus object.

Definition at line 476 of file collidermodus.cc.

478  {
479  const bool is_projectile = is_about_projectile(nucleus_cfg);
480  const auto &[automatic_key, side_length_key] = [&is_projectile]() {
481  return is_projectile
482  ? std::make_tuple(
483  InputKeys::
484  modi_collider_projectile_alphaClustered_automatic,
485  InputKeys::
486  modi_collider_projectile_alphaClustered_sideLength)
487  : std::make_tuple(
488  InputKeys::modi_collider_target_alphaClustered_automatic,
489  InputKeys::modi_collider_target_alphaClustered_sideLength);
490  }();
491 
492  bool automatic_alphaclustering = nucleus_cfg.take(automatic_key);
493  bool was_sidelength_given = nucleus_cfg.has_value(side_length_key);
494 
495  if (automatic_alphaclustering && was_sidelength_given) {
496  throw std::invalid_argument(
497  "Automatic alpha-clustering of " + nucleus_type +
498  " nucleus requested, but a sidelength was provided as"
499  " well. Please, check the 'Alpha_Clustered' section in your input "
500  "file.");
501  } else if (!automatic_alphaclustering && !was_sidelength_given) {
502  throw std::invalid_argument(
503  "Manual alpha-clustering of " + nucleus_type +
504  " nucleus requested, but no sidelength was provided."
505  " Please, check the 'Alpha_Clustered' section in your input file.");
506  } else {
507  return std::make_unique<AlphaClusteredNucleus>(nucleus_cfg, ntest,
508  automatic_alphaclustering);
509  }
510 }

◆ same_inputfile()

bool smash::ColliderModus::same_inputfile ( Configuration proj_config,
Configuration targ_config 
)
private

Checks if target and projectile are read from the same external file if they are both initialized as a customnucleus.

Function is only called if, projectile is customnucleus.

Parameters
[in]proj_configConfiguration of projectile nucleus
[in]targ_configConfiguration of target nucleus

Definition at line 662 of file collidermodus.cc.

663  {
664  /* Check if both nuclei are custom
665  * Only check target as function is called after if statement for
666  * projectile.
667  */
668  if (!targ_config.has_section(InputSections::m_c_t_custom)) {
669  return false;
670  }
671  std::string projectile_file_directory = proj_config.read(
673  std::string target_file_directory =
675  std::string projectile_file_name =
677  std::string target_file_name =
679  // Check if files are the same for projectile and target
680  std::string proj_path =
681  custom_file_path(projectile_file_directory, projectile_file_name);
682  std::string targ_path =
683  custom_file_path(target_file_directory, target_file_name);
684  if (proj_path == targ_path) {
685  return true;
686  } else {
687  return false;
688  }
689 }
std::string custom_file_path(const std::string &file_directory, const std::string &file_name)
Creates full path string consisting of file_directory and file_name Needed to initialize a customnucl...
static const Key< std::string > modi_collider_projectile_custom_fileDirectory
See user guide description for more information.
Definition: input_keys.h:3500
static const Key< std::string > modi_collider_target_custom_fileName
See user guide description for more information.
Definition: input_keys.h:3523
static const Key< std::string > modi_collider_projectile_custom_fileName
See user guide description for more information.
Definition: input_keys.h:3518
static const Key< std::string > modi_collider_target_custom_fileDirectory
See user guide description for more information.
Definition: input_keys.h:3506

◆ validate_IC_kinematic_range()

void smash::ColliderModus::validate_IC_kinematic_range ( )
private

Validate whether the input kinematic range for the Initial Conditions output is valid and inform the user.

Exceptions
std::invalid_argumentwhen the cuts are invalid

Definition at line 367 of file collidermodus.cc.

367  {
368  bool bad_cuts = false;
369  assert(IC_parameters_->rapidity_cut.has_value());
370  assert(IC_parameters_->pT_cut.has_value());
371  const double rapidity = IC_parameters_->rapidity_cut.value();
372  const double pT = IC_parameters_->pT_cut.value();
373  if (rapidity < 0.0) {
374  logg[LInitialConditions].fatal()
375  << "Rapidity cut for initial conditions configured as |y| < "
376  << rapidity
377  << " is unreasonable. \nPlease choose a positive, non-zero value or "
378  "employ SMASH without rapidity cut.";
379  bad_cuts = true;
380  }
381  if (pT < 0.0) {
382  logg[LInitialConditions].fatal()
383  << "Transverse momentum cut for initial conditions configured as pT < "
384  << pT
385  << " is unreasonable. \nPlease choose a positive, non-zero value or "
386  "employ SMASH without pT cut.";
387  bad_cuts = true;
388  }
389  if (bad_cuts) {
390  throw std::runtime_error(
391  "Kinematic cut for initial conditions malconfigured.");
392  }
393 
394  std::ostringstream message{"Extracting iso-tau initial conditions ",
395  std::ios_base::ate};
396  std::vector<std::string> cuts{};
397  if (rapidity > 0.0) {
398  cuts.emplace_back("|y| <= ");
399  cuts.back() += std::to_string(rapidity);
400  }
401  if (pT > 0.0) {
402  cuts.emplace_back("pT <= ");
403  cuts.back() += std::to_string(pT) + " GeV.";
404  }
405  if (cuts.size() > 0) {
406  message << "in kinematic range: " << join(cuts, "; ") << ".";
407  } else {
408  message << "without kinematic cuts.";
409  }
410  logg[LInitialConditions].info() << message.str();
411 }
std::string join(const std::vector< std::string > &v, const std::string &delim)
Join strings using delimiter.

◆ rotate_reaction_plane()

void smash::ColliderModus::rotate_reaction_plane ( double  phi,
Particles particles 
)
private

Rotate the reaction plane about the angle phi.

Parameters
[in]phiAngle about which to rotate
[in]particlesParticles, whose position is rotated

Definition at line 583 of file collidermodus.cc.

583  {
584  for (ParticleData &p : *particles) {
585  ThreeVector pos = p.position().threevec();
586  ThreeVector mom = p.momentum().threevec();
587  pos.rotate_around_z(phi);
588  mom.rotate_around_z(phi);
589  p.set_3position(pos);
590  p.set_3momentum(mom);
591  }
592 }
constexpr int p
Proton.

◆ get_velocities()

std::pair< double, double > smash::ColliderModus::get_velocities ( double  mandelstam_s,
double  m_a,
double  m_b 
)
private

Get the frame dependent velocity for each nucleus, using the current reference frame.

See also
frame_
Parameters
[in]mandelstam_sThe total center-of-mass energy of the system.
[in]m_aThe (positive) mass of the projectile.
[in]m_bThe (positive) mass of the target.
Returns
A pair < v_a, v_b > containing the velocities of the nuclei.
Exceptions
domain_errorif the reference frame is not properly specified

Definition at line 625 of file collidermodus.cc.

626  {
627  double v_a = 0.0;
628  double v_b = 0.0;
629  // Frame dependent calculations of velocities. Assume v_a >= 0, v_b <= 0.
630  switch (frame_) {
632  v_a = center_of_velocity_v(s, m_a, m_b);
633  v_b = -v_a;
634  break;
636  // Compute center of mass momentum.
637  double pCM = pCM_from_s(s, m_a, m_b);
638  v_a = pCM / std::sqrt(m_a * m_a + pCM * pCM);
639  v_b = -pCM / std::sqrt(m_b * m_b + pCM * pCM);
640  } break;
642  v_a = fixed_target_projectile_v(s, m_a, m_b);
643  break;
644  default:
645  throw std::invalid_argument(
646  "Invalid reference frame in "
647  "ColliderModus::get_velocities.");
648  }
649  return std::make_pair(v_a, v_b);
650 }
T pCM(const T sqrts, const T mass_a, const T mass_b) noexcept
Definition: kinematics.h:79
double fixed_target_projectile_v(double s, double ma, double mb)
Definition: kinematics.h:39
double center_of_velocity_v(double s, double ma, double mb)
Definition: kinematics.h:26
T pCM_from_s(const T s, const T mass_a, const T mass_b) noexcept
Definition: kinematics.h:66

Member Data Documentation

◆ projectile_

std::unique_ptr<Nucleus> smash::ColliderModus::projectile_
private

Projectile.

The object that goes from negative z-values to positive z-values with positive velocity.

Definition at line 193 of file collidermodus.h.

◆ target_

std::unique_ptr<Nucleus> smash::ColliderModus::target_
private

Target.

The object that goes from positive z-values to negative z-values with negative velocity. In fixed target experiments, the target is at rest.

Definition at line 201 of file collidermodus.h.

◆ total_s_

double smash::ColliderModus::total_s_
private

Center-of-mass energy squared of the nucleus-nucleus collision.

Needs to be double to allow for calculations at LHC energies

Definition at line 207 of file collidermodus.h.

◆ sqrt_s_NN_

double smash::ColliderModus::sqrt_s_NN_
private

Center-of-mass energy of a nucleon-nucleon collision.

Needs to be double to allow for calculations at LHC energies

Definition at line 213 of file collidermodus.h.

◆ impact_

double smash::ColliderModus::impact_ = 0.
private

Impact parameter.

The nuclei projectile_ and target_ will be shifted along the x-axis so that their centers move on antiparallel lines that are this distance apart from each other.

Definition at line 264 of file collidermodus.h.

◆ random_reaction_plane_

bool smash::ColliderModus::random_reaction_plane_
private

Whether the reaction plane should be randomized.

Definition at line 266 of file collidermodus.h.

◆ IC_for_hybrid_

bool smash::ColliderModus::IC_for_hybrid_ = false
private

Whether the particles will serve as initial conditions for hydrodynamics.

Definition at line 268 of file collidermodus.h.

◆ sampling_

Sampling smash::ColliderModus::sampling_ = InputKeys::modi_collider_impact_sample.default_value()
private

Method used for sampling of impact parameter.

Definition at line 270 of file collidermodus.h.

◆ imp_min_

double smash::ColliderModus::imp_min_ = InputKeys::modi_collider_impact_value.default_value()
private

Minimum value of impact parameter.

Definition at line 272 of file collidermodus.h.

◆ imp_max_

double smash::ColliderModus::imp_max_ = InputKeys::modi_collider_impact_value.default_value()
private

Maximum value of impact parameter.

Definition at line 274 of file collidermodus.h.

◆ yield_max_

double smash::ColliderModus::yield_max_ = 0.0
private

Maximum value of yield. Needed for custom impact parameter sampling.

Definition at line 276 of file collidermodus.h.

◆ impact_interpolation_

std::unique_ptr<InterpolateDataLinear<double> > smash::ColliderModus::impact_interpolation_
private
Initial value:
=
nullptr

Pointer to the impact parameter interpolation.

Definition at line 278 of file collidermodus.h.

◆ initial_z_displacement_

double smash::ColliderModus::initial_z_displacement_
private

Initial z-displacement of nuclei.

Projectile is shifted on -(this value) in z-direction and target on +(this value)*v_target/v_projectile. In this way projectile and target touch at t=0 in z=0.

Definition at line 295 of file collidermodus.h.

◆ frame_

CalculationFrame smash::ColliderModus::frame_
private

Reference frame for the system, as specified from config.

Definition at line 299 of file collidermodus.h.

◆ fermi_motion_

FermiMotion smash::ColliderModus::fermi_motion_
private

An option to include Fermi motion ("off", "on", "frozen")

Definition at line 303 of file collidermodus.h.

◆ velocity_projectile_

double smash::ColliderModus::velocity_projectile_ = 0.0
private

Beam velocity of the projectile.

Definition at line 307 of file collidermodus.h.

◆ velocity_target_

double smash::ColliderModus::velocity_target_ = 0.0
private

Beam velocity of the target.

Definition at line 311 of file collidermodus.h.

◆ IC_parameters_

std::unique_ptr<InitialConditionParameters> smash::ColliderModus::IC_parameters_
private

Plain Old Data type to hold parameters for initial conditions.

Definition at line 313 of file collidermodus.h.

◆ fluid_lattice_

std::unique_ptr<RectangularLattice<EnergyMomentumTensor> > smash::ColliderModus::fluid_lattice_
private
Initial value:
=
nullptr

Energy-momentum tensor lattice for dynamic fluidization.

Definition at line 315 of file collidermodus.h.

◆ fluid_background_

std::unique_ptr<std::map<int32_t, double> > smash::ColliderModus::fluid_background_ = nullptr
private

Energy density background from hydrodynamic evolution, with particle indices as keys.

Useful when using SMASH as a library.

Definition at line 321 of file collidermodus.h.


The documentation for this class was generated from the following files: