Version: SMASH-2.2
collidermodus.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2022
3  * SMASH Team
4  *
5  * GNU General Public License (GPLv3 or later)
6  */
7 #ifndef SRC_INCLUDE_SMASH_COLLIDERMODUS_H_
8 #define SRC_INCLUDE_SMASH_COLLIDERMODUS_H_
9 
10 #include <cstring>
11 #include <memory>
12 #include <string>
13 #include <utility>
14 
15 #include "deformednucleus.h"
16 #include "forwarddeclarations.h"
17 #include "fourvector.h"
18 #include "interpolation.h"
19 #include "modusdefault.h"
20 #include "nucleus.h"
21 #include "pdgcode.h"
22 
23 namespace smash {
24 
25 struct ExperimentParameters;
26 
43 class ColliderModus : public ModusDefault {
44  public:
65  explicit ColliderModus(Configuration modus_config,
66  const ExperimentParameters &parameters);
73  std::string custom_file_path(const std::string &file_directory,
74  const std::string &file_name);
87  double initial_conditions(Particles *particles,
88  const ExperimentParameters &parameters);
89 
100  void sample_impact();
101 
103  double nuclei_passing_time() const {
104  const double passing_distance =
105  projectile_->get_nuclear_radius() + target_->get_nuclear_radius();
106  const double passing_time =
107  passing_distance /
108  std::sqrt(sqrt_s_NN_ * sqrt_s_NN_ /
109  ((2 * nucleon_mass) * (2 * nucleon_mass)) -
110  1);
111  return passing_time;
112  }
118  double velocity_projectile() const { return velocity_projectile_; }
123  double velocity_target() const { return velocity_target_; }
127  bool is_collider() const { return true; }
129  double sqrt_s_NN() const { return sqrt_s_NN_; }
131  double impact_parameter() const { return impact_; }
134  return frame_ == CalculationFrame::FixedTarget ? true : false;
135  }
136 
142  using ModusDefault::BadInput::BadInput;
143  };
144 
145  private:
152  std::unique_ptr<Nucleus> projectile_;
160  std::unique_ptr<Nucleus> target_;
166  double total_s_;
172  double sqrt_s_NN_;
184  static std::unique_ptr<DeformedNucleus> create_deformed_nucleus(
185  Configuration &nucleus_cfg, const int ntest,
186  const std::string &nucleus_type);
194  bool same_inputfile(Configuration &proj_config, Configuration &targ_config);
202  double impact_ = 0.;
208  double imp_min_ = 0.0;
210  double imp_max_ = 0.0;
212  double yield_max_ = 0.0;
214  std::unique_ptr<InterpolateDataLinear<double>> impact_interpolation_ =
215  nullptr;
216 
223  void rotate_reaction_plane(double phi, Particles *particles);
224 
243  double velocity_projectile_ = 0.0;
247  double velocity_target_ = 0.0;
258  std::pair<double, double> get_velocities(double mandelstam_s, double m_a,
259  double m_b);
260 
267  friend std::ostream &operator<<(std::ostream &, const ColliderModus &);
268 };
269 
270 } // namespace smash
271 
272 #endif // SRC_INCLUDE_SMASH_COLLIDERMODUS_H_
ColliderModus: Provides a modus for colliding nuclei.
Definition: collidermodus.h:43
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 calculation_frame_is_fixed_target() const
double yield_max_
Maximum value of yield. Needed for custom impact parameter sampling.
bool random_reaction_plane_
Whether the reaction plane should be randomized.
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.
void sample_impact()
Sample impact parameter.
double impact_parameter() const
std::unique_ptr< Nucleus > projectile_
Projectile.
double nuclei_passing_time() const
Time until nuclei have passed through each other.
std::unique_ptr< InterpolateDataLinear< double > > impact_interpolation_
Pointer to the impact parameter interpolation.
FermiMotion fermi_motion()
FermiMotion fermi_motion_
An option to include Fermi motion ("off", "on", "frozen")
double velocity_target() const
double velocity_projectile_
Beam velocity of the projectile.
Sampling sampling_
Method used for sampling of impact parameter.
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...
double total_s_
Center-of-mass energy squared of the nucleus-nucleus collision.
std::unique_ptr< Nucleus > target_
Target.
ColliderModus(Configuration modus_config, const ExperimentParameters &parameters)
Constructor.
double impact_
Impact parameter.
double sqrt_s_NN_
Center-of-mass energy of a nucleon-nucleon collision.
double initial_conditions(Particles *particles, const ExperimentParameters &parameters)
Generates initial state of the particles in the system.
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 ...
double sqrt_s_NN() const
double velocity_projectile() const
static std::unique_ptr< DeformedNucleus > create_deformed_nucleus(Configuration &nucleus_cfg, const int ntest, const std::string &nucleus_type)
Configure Deformed Nucleus.
double velocity_target_
Beam velocity of the target.
bool is_collider() const
double imp_max_
Maximum value of impact parameter.
Interface to the SMASH configuration files.
Base class for Modus classes that provides default function implementations.
Definition: modusdefault.h:44
The Particles class abstracts the storage and manipulation of particles.
Definition: particles.h:33
FermiMotion
Option to use Fermi Motion.
@ Off
Don't use fermi motion.
Sampling
Possible methods of impact parameter sampling.
@ Quadratic
Sample from areal / quadratic distribution.
CalculationFrame
The calculation frame.
friend std::ostream & operator<<(std::ostream &, const ColliderModus &)
Writes the initial state for the ColliderModus to the output stream.
Definition: action.h:24
constexpr double nucleon_mass
Nucleon mass in GeV.
Definition: constants.h:58
Thrown when either projectile_ or target_ nuclei are empty.
Helper structure for Experiment.
BadInput is an error to throw if the configuration options are invalid.
Definition: modusdefault.h:202