Version: SMASH-3.1
collidermodus.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2020,2022-2023
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 
44 class ColliderModus : public ModusDefault {
45  public:
66  explicit ColliderModus(Configuration modus_config,
67  const ExperimentParameters &parameters);
74  std::string custom_file_path(const std::string &file_directory,
75  const std::string &file_name);
88  double initial_conditions(Particles *particles,
89  const ExperimentParameters &parameters);
90 
101  void sample_impact();
102 
104  double nuclei_passing_time() const {
105  const double passing_distance =
106  projectile_->get_nuclear_radius() + target_->get_nuclear_radius();
107  const double passing_time =
108  passing_distance /
109  std::sqrt(sqrt_s_NN_ * sqrt_s_NN_ /
110  ((2 * nucleon_mass) * (2 * nucleon_mass)) -
111  1);
112  return passing_time;
113  }
119  double velocity_projectile() const { return velocity_projectile_; }
124  double velocity_target() const { return velocity_target_; }
128  bool is_collider() const { return true; }
130  double sqrt_s_NN() const { return sqrt_s_NN_; }
132  double impact_parameter() const { return impact_; }
135  return frame_ == CalculationFrame::FixedTarget ? true : false;
136  }
137 
143  using ModusDefault::BadInput::BadInput;
144  };
145 
146  private:
153  std::unique_ptr<Nucleus> projectile_;
161  std::unique_ptr<Nucleus> target_;
167  double total_s_;
173  double sqrt_s_NN_;
185  static std::unique_ptr<DeformedNucleus> create_deformed_nucleus(
186  Configuration &nucleus_cfg, const int ntest,
187  const std::string &nucleus_type);
195  bool same_inputfile(Configuration &proj_config, Configuration &targ_config);
203  double impact_ = 0.;
209  double imp_min_ = 0.0;
211  double imp_max_ = 0.0;
213  double yield_max_ = 0.0;
215  std::unique_ptr<InterpolateDataLinear<double>> impact_interpolation_ =
216  nullptr;
217 
224  void rotate_reaction_plane(double phi, Particles *particles);
225 
244  double velocity_projectile_ = 0.0;
248  double velocity_target_ = 0.0;
259  std::pair<double, double> get_velocities(double mandelstam_s, double m_a,
260  double m_b);
261 
268  friend std::ostream &operator<<(std::ostream &, const ColliderModus &);
269 };
270 
271 } // namespace smash
272 
273 #endif // SRC_INCLUDE_SMASH_COLLIDERMODUS_H_
ColliderModus: Provides a modus for colliding nuclei.
Definition: collidermodus.h:44
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:43
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:166