Version: SMASH-2.0.2
collidermodus.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2020
3  * SMASH Team
4  *
5  * GNU General Public License (GPLv3 or later)
6  */
7 
8 #include "smash/collidermodus.h"
9 
10 #include <algorithm>
11 #include <cmath>
12 #include <cstdlib>
13 #include <cstring>
14 #include <memory>
15 #include <stdexcept>
16 #include <string>
17 #include <tuple>
18 #include <utility>
19 #include <vector>
20 
21 #include "smash/configuration.h"
22 #include "smash/customnucleus.h"
23 #include "smash/cxx14compat.h"
25 #include "smash/fourvector.h"
26 #include "smash/logging.h"
27 #include "smash/random.h"
28 
29 namespace smash {
30 static constexpr int LCollider = LogArea::Collider::id;
331  const ExperimentParameters &params) {
332  Configuration modus_cfg = modus_config["Collider"];
333  // Get the reference frame for the collision calculation.
334  if (modus_cfg.has_value({"Calculation_Frame"})) {
335  frame_ = modus_cfg.take({"Calculation_Frame"});
336  }
337 
338  // Determine whether to allow the first collisions within the same nucleus
339  if (modus_cfg.has_value({"Collisions_Within_Nucleus"})) {
340  cll_in_nucleus_ = modus_cfg.take({"Collisions_Within_Nucleus"});
341  }
342  Configuration proj_cfg = modus_cfg["Projectile"];
343  Configuration targ_cfg = modus_cfg["Target"];
344  /* Needed to check if projectile and target in customnucleus are read from
345  * the same input file.*/
346  bool same_file = false;
347  // Set up the projectile nucleus
348  if (proj_cfg.has_value({"Deformed"})) {
349  projectile_ =
350  create_deformed_nucleus(proj_cfg, params.testparticles, "projectile");
351  } else if (proj_cfg.has_value({"Custom"})) {
352  same_file = same_inputfile(proj_cfg, targ_cfg);
353  projectile_ =
354  make_unique<CustomNucleus>(proj_cfg, params.testparticles, same_file);
355  } else {
356  projectile_ = make_unique<Nucleus>(proj_cfg, params.testparticles);
357  }
358  if (projectile_->size() < 1) {
359  throw ColliderEmpty("Input Error: Projectile nucleus is empty.");
360  }
361 
362  // Set up the target nucleus
363  if (targ_cfg.has_value({"Deformed"})) {
364  target_ = create_deformed_nucleus(targ_cfg, params.testparticles, "target");
365  } else if (targ_cfg.has_value({"Custom"})) {
366  target_ =
367  make_unique<CustomNucleus>(targ_cfg, params.testparticles, same_file);
368  } else {
369  target_ = make_unique<Nucleus>(targ_cfg, params.testparticles);
370  }
371  if (target_->size() < 1) {
372  throw ColliderEmpty("Input Error: Target nucleus is empty.");
373  }
374 
375  // Get the Fermi-Motion input (off, on, frozen)
376  if (modus_cfg.has_value({"Fermi_Motion"})) {
377  // We only read the value, because it is still required by the experiment
378  // class to make sure we don't use frozen Fermi momenta with potentials.
379  fermi_motion_ = modus_cfg.read({"Fermi_Motion"});
380  }
381 
382  // Get the total nucleus-nucleus collision energy. Since there is
383  // no meaningful choice for a default energy, we require the user to
384  // give one (and only one) energy input from the available options.
385  int energy_input = 0;
386  const double mass_projec = projectile_->mass();
387  const double mass_target = target_->mass();
388  // average mass of a particle in that nucleus
389  const double mass_a =
390  projectile_->mass() / projectile_->number_of_particles();
391  const double mass_b = target_->mass() / target_->number_of_particles();
392  // Option 1: Center of mass energy.
393  if (modus_cfg.has_value({"Sqrtsnn"})) {
394  sqrt_s_NN_ = modus_cfg.take({"Sqrtsnn"});
395  // Check that input satisfies the lower bound (everything at rest).
396  if (sqrt_s_NN_ <= mass_a + mass_b) {
398  "Input Error: sqrt(s_NN) is not larger than masses:\n" +
399  std::to_string(sqrt_s_NN_) + " GeV <= " + std::to_string(mass_a) +
400  " GeV + " + std::to_string(mass_b) + " GeV.");
401  }
402  // Set the total nucleus-nucleus collision energy.
403  total_s_ = (sqrt_s_NN_ * sqrt_s_NN_ - mass_a * mass_a - mass_b * mass_b) *
404  mass_projec * mass_target / (mass_a * mass_b) +
405  mass_projec * mass_projec + mass_target * mass_target;
406  energy_input++;
407  }
408  /* Option 2: Total energy per nucleon of the projectile nucleus
409  * (target at rest). */
410  if (modus_cfg.has_value({"E_Tot"})) {
411  const double e_tot = modus_cfg.take({"E_Tot"});
412  if (e_tot < 0) {
414  "Input Error: "
415  "E_Tot must be nonnegative.");
416  }
417  // Set the total nucleus-nucleus collision energy.
418  total_s_ = s_from_Etot(e_tot * projectile_->number_of_particles(),
419  mass_projec, mass_target);
420  sqrt_s_NN_ = std::sqrt(s_from_Etot(e_tot, mass_a, mass_b));
421  energy_input++;
422  }
423  /* Option 3: Kinetic energy per nucleon of the projectile nucleus
424  * (target at rest). */
425  if (modus_cfg.has_value({"E_Kin"})) {
426  const double e_kin = modus_cfg.take({"E_Kin"});
427  if (e_kin < 0) {
429  "Input Error: "
430  "E_Kin must be nonnegative.");
431  }
432  // Set the total nucleus-nucleus collision energy.
433  total_s_ = s_from_Ekin(e_kin * projectile_->number_of_particles(),
434  mass_projec, mass_target);
435  sqrt_s_NN_ = std::sqrt(s_from_Ekin(e_kin, mass_a, mass_b));
436  energy_input++;
437  }
438  // Option 4: Momentum of the projectile nucleus (target at rest).
439  if (modus_cfg.has_value({"P_Lab"})) {
440  const double p_lab = modus_cfg.take({"P_Lab"});
441  if (p_lab < 0) {
443  "Input Error: "
444  "P_Lab must be nonnegative.");
445  }
446  // Set the total nucleus-nucleus collision energy.
447  total_s_ = s_from_plab(p_lab * projectile_->number_of_particles(),
448  mass_projec, mass_target);
449  sqrt_s_NN_ = std::sqrt(s_from_plab(p_lab, mass_a, mass_b));
450  energy_input++;
451  }
452  // Option 5: Total energy per nucleon of _each_ beam
453  if (proj_cfg.has_value({"E_Tot"}) && targ_cfg.has_value({"E_Tot"})) {
454  const double e_tot_p = proj_cfg.take({"E_Tot"});
455  const double e_tot_t = targ_cfg.take({"E_tot"});
456  if (e_tot_p < 0 || e_tot_t < 0) {
458  "Input Error: "
459  "E_Tot must be nonnegative.");
460  }
461  total_s_ = s_from_Etot(e_tot_p * projectile_->number_of_particles(),
462  e_tot_t * target_->number_of_particles(),
463  mass_projec, mass_target);
464  sqrt_s_NN_ = std::sqrt(s_from_Ekin(e_tot_p, e_tot_t, mass_a, mass_b));
465  energy_input++;
466  }
467  // Option 6: Kinetic energy per nucleon of _each_ beam
468  if (proj_cfg.has_value({"E_Kin"}) && targ_cfg.has_value({"E_Kin"})) {
469  const double e_kin_p = proj_cfg.take({"E_Kin"});
470  const double e_kin_t = targ_cfg.take({"E_Kin"});
471  if (e_kin_p < 0 || e_kin_t < 0) {
473  "Input Error: "
474  "E_Kin must be nonnegative.");
475  }
476  total_s_ = s_from_Ekin(e_kin_p * projectile_->number_of_particles(),
477  e_kin_t * target_->number_of_particles(),
478  mass_projec, mass_target);
479  sqrt_s_NN_ = std::sqrt(s_from_Ekin(e_kin_p, e_kin_t, mass_a, mass_b));
480  energy_input++;
481  }
482  // Option 7: Momentum per nucleon of _each_ beam
483  if (proj_cfg.has_value({"P_Lab"}) && targ_cfg.has_value({"P_Lab"})) {
484  const double p_lab_p = proj_cfg.take({"P_Lab"});
485  const double p_lab_t = targ_cfg.take({"P_Lab"});
486  if (p_lab_p < 0 || p_lab_t < 0) {
488  "Input Error: "
489  "P_Lab must be nonnegative.");
490  }
491  total_s_ = s_from_plab(p_lab_p * projectile_->number_of_particles(),
492  p_lab_t * target_->number_of_particles(),
493  mass_projec, mass_target);
494  sqrt_s_NN_ = std::sqrt(s_from_plab(p_lab_p, p_lab_t, mass_a, mass_b));
495  energy_input++;
496  }
497  if (energy_input == 0) {
498  throw std::domain_error(
499  "Input Error: Non-existent collision energy. "
500  "Please provide one of Sqrtsnn/E_Kin/P_Lab.");
501  }
502  if (energy_input > 1) {
503  throw std::domain_error(
504  "Input Error: Redundant collision energy. "
505  "Please provide only one of Sqrtsnn/E_Kin/P_Lab.");
506  }
507 
508  /* Impact parameter setting: Either "Value", "Range", "Max" or "Sample".
509  * Unspecified means 0 impact parameter.*/
510  if (modus_cfg.has_value({"Impact", "Value"})) {
511  impact_ = modus_cfg.take({"Impact", "Value"});
512  imp_min_ = impact_;
513  imp_max_ = impact_;
514  } else {
515  // If impact is not supplied by value, inspect sampling parameters:
516  if (modus_cfg.has_value({"Impact", "Sample"})) {
517  sampling_ = modus_cfg.take({"Impact", "Sample"});
518  if (sampling_ == Sampling::Custom) {
519  if (!(modus_cfg.has_value({"Impact", "Values"}) ||
520  modus_cfg.has_value({"Impact", "Yields"}))) {
521  throw std::domain_error(
522  "Input Error: Need impact parameter spectrum for custom "
523  "sampling. "
524  "Please provide Values and Yields.");
525  }
526  const std::vector<double> impacts =
527  modus_cfg.take({"Impact", "Values"});
528  const std::vector<double> yields = modus_cfg.take({"Impact", "Yields"});
529  if (impacts.size() != yields.size()) {
530  throw std::domain_error(
531  "Input Error: Need as many impact parameter values as yields. "
532  "Please make sure that Values and Yields have the same length.");
533  }
534  impact_interpolation_ = make_unique<InterpolateDataLinear<double>>(
535  InterpolateDataLinear<double>(impacts, yields));
536 
537  const auto imp_minmax =
538  std::minmax_element(impacts.begin(), impacts.end());
539  imp_min_ = *imp_minmax.first;
540  imp_max_ = *imp_minmax.second;
541  yield_max_ = *std::max_element(yields.begin(), yields.end());
542  }
543  }
544  if (modus_cfg.has_value({"Impact", "Range"})) {
545  const std::array<double, 2> range = modus_cfg.take({"Impact", "Range"});
546  imp_min_ = range[0];
547  imp_max_ = range[1];
548  }
549  if (modus_cfg.has_value({"Impact", "Max"})) {
550  imp_min_ = 0.0;
551  imp_max_ = modus_cfg.take({"Impact", "Max"});
552  }
553  }
555  // whether the direction of separation should be ramdomly smapled
557  modus_cfg.take({"Impact", "Random_Reaction_Plane"}, false);
558  // Look for user-defined initial separation between nuclei.
559  if (modus_cfg.has_value({"Initial_Distance"})) {
560  initial_z_displacement_ = modus_cfg.take({"Initial_Distance"});
561  // the displacement is half the distance (both nuclei are shifted
562  // initial_z_displacement_ away from origin)
564  }
565 }
566 
567 std::ostream &operator<<(std::ostream &out, const ColliderModus &m) {
568  return out << "-- Collider Modus:\n"
569  << "sqrt(S) (nucleus-nucleus) = "
570  << format(std::sqrt(m.total_s_), "GeV\n")
571  << "sqrt(S) (nucleon-nucleon) = " << format(m.sqrt_s_NN_, "GeV\n")
572  << "Projectile:\n"
573  << *m.projectile_ << "\nTarget:\n"
574  << *m.target_;
575 }
576 
577 std::unique_ptr<DeformedNucleus> ColliderModus::create_deformed_nucleus(
578  Configuration &nucleus_cfg, int ntest, const std::string &nucleus_type) {
579  bool auto_deform = nucleus_cfg.take({"Deformed", "Automatic"});
580  bool is_beta2 = nucleus_cfg.has_value({"Deformed", "Beta_2"}) ? true : false;
581  bool is_beta4 = nucleus_cfg.has_value({"Deformed", "Beta_4"}) ? true : false;
582  std::unique_ptr<DeformedNucleus> nucleus;
583 
584  if ((auto_deform && (!is_beta2 && !is_beta4)) ||
585  (!auto_deform && (is_beta2 && is_beta4))) {
586  nucleus = make_unique<DeformedNucleus>(nucleus_cfg, ntest, auto_deform);
587  return nucleus;
588  } else {
589  throw std::domain_error("Deformation of " + nucleus_type +
590  " nucleus not configured "
591  "properly, please check whether all necessary "
592  "parameters are set.");
593  }
594 }
595 
597  const ExperimentParameters &) {
598  sample_impact();
599 
600  logg[LCollider].info() << "Impact parameter = " << format(impact_, "fm");
601  // Populate the nuclei with appropriately distributed nucleons.
602  // If deformed, this includes rotating the nucleus.
603  projectile_->arrange_nucleons();
604  target_->arrange_nucleons();
605 
606  // Use the total mandelstam variable to get the frame-dependent velocity for
607  // each nucleus. Position a is projectile, position b is target.
608  double v_a, v_b;
609  std::tie(v_a, v_b) =
610  get_velocities(total_s_, projectile_->mass(), target_->mass());
611 
612  // If velocities are larger or equal to 1, throw an exception.
613  if (v_a >= 1.0 || v_b >= 1.0) {
614  throw std::domain_error(
615  "Found velocity equal to or larger than 1 in "
616  "ColliderModus::initial_conditions.\nConsider using "
617  "the center of velocity reference frame.");
618  }
619 
620  // Calculate the beam velocity of the projectile and the target, which will be
621  // used to calculate the beam momenta in experiment.cc
623  velocity_projectile_ = v_a;
624  velocity_target_ = v_b;
625  }
626 
627  // Generate Fermi momenta if necessary
630  // Frozen: Fermi momenta will be ignored during the propagation to
631  // avoid that the nuclei will fly apart.
632  projectile_->generate_fermi_momenta();
633  target_->generate_fermi_momenta();
635  logg[LCollider].info() << "Fermi motion is ON.";
636  } else {
637  logg[LCollider].info() << "FROZEN Fermi motion is on.";
638  }
639  } else if (fermi_motion_ == FermiMotion::Off) {
640  // No Fermi-momenta are generated in this case
641  logg[LCollider].info() << "Fermi motion is OFF.";
642  } else {
643  throw std::domain_error("Invalid Fermi_Motion input.");
644  }
645 
646  // Boost the nuclei to the appropriate velocity.
647  projectile_->boost(v_a);
648  target_->boost(v_b);
649 
650  // Shift the nuclei into starting positions. Contracted spheres with
651  // nuclear radii should touch exactly at t=0. Modus starts at negative
652  // time corresponding to additional initial displacement.
653  const double d_a = std::max(0., projectile_->get_diffusiveness());
654  const double d_b = std::max(0., target_->get_diffusiveness());
655  const double r_a = projectile_->get_nuclear_radius();
656  const double r_b = target_->get_nuclear_radius();
657  const double dz = initial_z_displacement_;
658 
659  const double simulation_time = -dz / std::abs(v_a);
660  const double proj_z = -dz - std::sqrt(1.0 - v_a * v_a) * (r_a + d_a);
661  const double targ_z =
662  +dz * std::abs(v_b / v_a) + std::sqrt(1.0 - v_b * v_b) * (r_b + d_b);
663  // rotation angle in the transverse plane
664  const double phi =
665  random_reaction_plane_ ? random::uniform(0.0, 2.0 * M_PI) : 0.0;
666 
667  projectile_->shift(proj_z, +impact_ / 2.0, simulation_time);
668  target_->shift(targ_z, -impact_ / 2.0, simulation_time);
669 
670  // Put the particles in the nuclei into code particles.
671  projectile_->copy_particles(particles);
672  target_->copy_particles(particles);
673  rotate_reaction_plane(phi, particles);
674  return simulation_time;
675 }
676 
677 void ColliderModus::rotate_reaction_plane(double phi, Particles *particles) {
678  for (ParticleData &p : *particles) {
679  ThreeVector pos = p.position().threevec();
680  ThreeVector mom = p.momentum().threevec();
681  pos.rotate_around_z(phi);
682  mom.rotate_around_z(phi);
683  p.set_3position(pos);
684  p.set_3momentum(mom);
685  }
686 }
687 
689  switch (sampling_) {
690  case Sampling::Quadratic: {
691  // quadratic sampling: Note that for bmin > bmax, this still yields
692  // the correct distribution (however canonical() = 0 is then the
693  // upper end, not the lower).
694  impact_ = std::sqrt(imp_min_ * imp_min_ +
697  } break;
698  case Sampling::Custom: {
699  // rejection sampling based on given distribution
700  assert(impact_interpolation_ != nullptr);
701  double probability_random = 1;
702  double probability = 0;
703  double b;
704  while (probability_random > probability) {
706  probability = (*impact_interpolation_)(b) / yield_max_;
707  assert(probability < 1.);
708  probability_random = random::uniform(0., 1.);
709  }
710  impact_ = b;
711  } break;
712  case Sampling::Uniform: {
713  // linear sampling. Still, min > max works fine.
715  }
716  }
717 }
718 
719 std::pair<double, double> ColliderModus::get_velocities(double s, double m_a,
720  double m_b) {
721  double v_a = 0.0;
722  double v_b = 0.0;
723  // Frame dependent calculations of velocities. Assume v_a >= 0, v_b <= 0.
724  switch (frame_) {
726  v_a = center_of_velocity_v(s, m_a, m_b);
727  v_b = -v_a;
728  break;
730  // Compute center of mass momentum.
731  double pCM = pCM_from_s(s, m_a, m_b);
732  v_a = pCM / std::sqrt(m_a * m_a + pCM * pCM);
733  v_b = -pCM / std::sqrt(m_b * m_b + pCM * pCM);
734  } break;
736  v_a = fixed_target_projectile_v(s, m_a, m_b);
737  break;
738  default:
739  throw std::domain_error(
740  "Invalid reference frame in "
741  "ColliderModus::get_velocities.");
742  }
743  return std::make_pair(v_a, v_b);
744 }
745 
746 std::string ColliderModus::custom_file_path(const std::string &file_directory,
747  const std::string &file_name) {
748  // make sure that path is correct even if the / at the end is missing
749  if (file_directory.back() == '/') {
750  return file_directory + file_name;
751  } else {
752  return file_directory + '/' + file_name;
753  }
754 }
755 
757  Configuration &targ_config) {
758  /* Check if both nuclei are custom
759  * Only check target as function is called after if statement for projectile.
760  */
761  if (!targ_config.has_value({"Custom"})) {
762  return false;
763  }
764  std::string projectile_file_directory =
765  proj_config.read({"Custom", "File_Directory"});
766  std::string target_file_directory =
767  targ_config.read({"Custom", "File_Directory"});
768  std::string projectile_file_name = proj_config.read({"Custom", "File_Name"});
769  std::string target_file_name = targ_config.read({"Custom", "File_Name"});
770  // Check if files are the same for projectile and target
771  std::string proj_path =
772  custom_file_path(projectile_file_directory, projectile_file_name);
773  std::string targ_path =
774  custom_file_path(target_file_directory, target_file_name);
775  if (proj_path == targ_path) {
776  return true;
777  } else {
778  return false;
779  }
780 }
781 
782 } // namespace smash
smash::ColliderModus::impact_interpolation_
std::unique_ptr< InterpolateDataLinear< double > > impact_interpolation_
Pointer to the impact parameter interpolation.
Definition: collidermodus.h:205
smash::ColliderModus::initial_z_displacement_
double initial_z_displacement_
Initial z-displacement of nuclei.
Definition: collidermodus.h:233
smash
Definition: action.h:24
smash::ColliderModus::imp_min_
double imp_min_
Minimum value of impact parameter.
Definition: collidermodus.h:199
smash::ColliderModus::custom_file_path
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...
Definition: collidermodus.cc:746
customnucleus.h
Sampling::Quadratic
@ Quadratic
Sample from areal / quadratic distribution.
CalculationFrame::CenterOfVelocity
@ CenterOfVelocity
smash::ColliderModus::cll_in_nucleus_
bool cll_in_nucleus_
An option to accept first collisions within the same nucleus.
Definition: collidermodus.h:245
smash::ColliderModus::fermi_motion_
FermiMotion fermi_motion_
An option to include Fermi motion ("off", "on", "frozen")
Definition: collidermodus.h:241
smash::ParticleData
Definition: particledata.h:52
smash::ColliderModus::random_reaction_plane_
bool random_reaction_plane_
Whether the reaction plane should be randomized.
Definition: collidermodus.h:195
smash::Configuration::read
Value read(std::initializer_list< const char * > keys) const
Additional interface for SMASH to read configuration values without removing them.
Definition: configuration.cc:158
smash::ColliderModus::sampling_
Sampling sampling_
Method used for sampling of impact parameter.
Definition: collidermodus.h:197
smash::ColliderModus::sqrt_s_NN_
double sqrt_s_NN_
Center-of-mass energy of a nucleon-nucleon collision.
Definition: collidermodus.h:163
smash::s_from_plab
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
cxx14compat.h
smash::ColliderModus::target_
std::unique_ptr< Nucleus > target_
Target.
Definition: collidermodus.h:151
smash::fixed_target_projectile_v
double fixed_target_projectile_v(double s, double ma, double mb)
Definition: kinematics.h:39
FermiMotion::Off
@ Off
Don't use fermi motion.
smash::ColliderModus::same_inputfile
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 ...
Definition: collidermodus.cc:756
smash::operator<<
std::ostream & operator<<(std::ostream &out, const ActionPtr &action)
Definition: action.h:518
smash::ColliderModus::sample_impact
void sample_impact()
Sample impact parameter.
Definition: collidermodus.cc:688
experimentparameters.h
smash::s_from_Ekin
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
smash::Configuration::has_value
bool has_value(std::initializer_list< const char * > keys) const
Returns whether there is a non-empty value behind the requested keys.
Definition: configuration.cc:181
smash::ColliderModus::initial_conditions
double initial_conditions(Particles *particles, const ExperimentParameters &parameters)
Generates initial state of the particles in the system.
Definition: collidermodus.cc:596
fourvector.h
smash::ThreeVector::rotate_around_z
void rotate_around_z(double theta)
Rotate the vector around the z axis by the given angle theta.
Definition: threevector.h:308
FermiMotion::Frozen
@ Frozen
Use fermi motion without potentials.
smash::logg
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
Definition: logging.cc:39
Sampling::Custom
@ Custom
Sample from custom, user-defined distribution.
smash::ColliderModus::velocity_projectile_
double velocity_projectile_
Beam velocity of the projectile.
Definition: collidermodus.h:249
smash::pCM
T pCM(const T sqrts, const T mass_a, const T mass_b) noexcept
Definition: kinematics.h:79
random.h
smash::center_of_velocity_v
double center_of_velocity_v(double s, double ma, double mb)
Definition: kinematics.h:26
smash::Configuration
Interface to the SMASH configuration files.
Definition: configuration.h:464
smash::ColliderModus::imp_max_
double imp_max_
Maximum value of impact parameter.
Definition: collidermodus.h:201
smash::s_from_Etot
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
smash::ThreeVector
Definition: threevector.h:31
smash::format
FormattingHelper< T > format(const T &value, const char *unit, int width=-1, int precision=-1)
Acts as a stream modifier for std::ostream to output an object with an optional suffix string and wit...
Definition: logging.h:307
smash::ColliderModus::total_s_
double total_s_
Center-of-mass energy squared of the nucleus-nucleus collision.
Definition: collidermodus.h:157
smash::ColliderModus::frame_
CalculationFrame frame_
Reference frame for the system, as specified from config.
Definition: collidermodus.h:237
smash::LCollider
static constexpr int LCollider
Definition: collidermodus.cc:30
collidermodus.h
smash::InterpolateDataLinear< double >
CalculationFrame::FixedTarget
@ FixedTarget
smash::ColliderModus::yield_max_
double yield_max_
Maximum value of yield. Needed for custom impact parameter sampling.
Definition: collidermodus.h:203
smash::Particles
Definition: particles.h:33
smash::ColliderModus::impact_
double impact_
Impact parameter.
Definition: collidermodus.h:193
smash::ColliderModus
Definition: collidermodus.h:43
smash::ColliderModus::ColliderEmpty
Definition: collidermodus.h:132
Sampling::Uniform
@ Uniform
Sample from uniform distribution.
FermiMotion::On
@ On
Use fermi motion in combination with potentials.
smash::ColliderModus::projectile_
std::unique_ptr< Nucleus > projectile_
Projectile.
Definition: collidermodus.h:143
logging.h
configuration.h
smash::ColliderModus::velocity_target_
double velocity_target_
Beam velocity of the target.
Definition: collidermodus.h:253
smash::Configuration::take
Value take(std::initializer_list< const char * > keys)
The default interface for SMASH to read configuration values.
Definition: configuration.cc:140
smash::ExperimentParameters
Helper structure for Experiment.
Definition: experimentparameters.h:24
smash::pdg::p
constexpr int p
Proton.
Definition: pdgcode_constants.h:28
smash::random::uniform
T uniform(T min, T max)
Definition: random.h:88
CalculationFrame::CenterOfMass
@ CenterOfMass
smash::ColliderModus::create_deformed_nucleus
static std::unique_ptr< DeformedNucleus > create_deformed_nucleus(Configuration &nucleus_cfg, const int ntest, const std::string &nucleus_type)
Configure Deformed Nucleus.
Definition: collidermodus.cc:577
smash::ExperimentParameters::testparticles
int testparticles
Number of test particle.
Definition: experimentparameters.h:32
smash::ColliderModus::rotate_reaction_plane
void rotate_reaction_plane(double phi, Particles *particles)
Rotate the reaction plane about the angle phi.
Definition: collidermodus.cc:677
smash::ColliderModus::get_velocities
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.
Definition: collidermodus.cc:719
smash::random::canonical
T canonical()
Definition: random.h:113
smash::ColliderModus::ColliderModus
ColliderModus(Configuration modus_config, const ExperimentParameters &parameters)
Constructor.
Definition: collidermodus.cc:330
smash::ModusDefault::InvalidEnergy
Definition: modusdefault.h:191
smash::pCM_from_s
T pCM_from_s(const T s, const T mass_a, const T mass_b) noexcept
Definition: kinematics.h:66