Version: SMASH-1.7
collidermodus.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2019
3  * SMASH Team
4  *
5  * GNU General Public License (GPLv3 or later)
6  */
7 #ifndef SRC_INCLUDE_COLLIDERMODUS_H_
8 #define SRC_INCLUDE_COLLIDERMODUS_H_
9 
10 #include <cstring>
11 #include <memory>
12 #include <utility>
13 
14 #include "deformednucleus.h"
15 #include "forwarddeclarations.h"
16 #include "fourvector.h"
17 #include "interpolation.h"
18 #include "modusdefault.h"
19 #include "nucleus.h"
20 #include "pdgcode.h"
21 
22 namespace smash {
23 
24 struct ExperimentParameters;
25 
42 class ColliderModus : public ModusDefault {
43  public:
64  explicit ColliderModus(Configuration modus_config,
65  const ExperimentParameters &parameters);
72  std::string custom_file_path(const std::string &file_directory,
73  const std::string &file_name);
86  double initial_conditions(Particles *particles,
87  const ExperimentParameters &parameters);
89  int total_N_number() const { return target_->size() + projectile_->size(); }
91  int proj_N_number() const { return projectile_->size(); }
92 
94  double nuclei_passing_time() const {
95  const double passing_distance =
96  projectile_->get_nuclear_radius() + target_->get_nuclear_radius();
97  const double passing_time =
98  passing_distance /
99  std::sqrt(sqrt_s_NN_ * sqrt_s_NN_ /
100  ((2 * nucleon_mass) * (2 * nucleon_mass)) -
101  1);
102  return passing_time;
103  }
109  double velocity_projectile() const { return velocity_projectile_; }
114  double velocity_target() const { return velocity_target_; }
118  bool cll_in_nucleus() { return cll_in_nucleus_; }
122  bool is_collider() const { return true; }
124  double impact_parameter() const { return impact_; }
130  using ModusDefault::BadInput::BadInput;
131  };
132 
133  private:
140  std::unique_ptr<Nucleus> projectile_;
148  std::unique_ptr<Nucleus> target_;
154  double total_s_;
160  double sqrt_s_NN_;
172  static std::unique_ptr<DeformedNucleus> create_deformed_nucleus(
173  Configuration &nucleus_cfg, const int ntest,
174  const std::string &nucleus_type);
182  bool same_inputfile(Configuration &proj_config, Configuration &targ_config);
190  double impact_ = 0.;
194  double imp_min_ = 0.0;
196  double imp_max_ = 0.0;
198  double yield_max_ = 0.0;
200  std::unique_ptr<InterpolateDataLinear<double>> impact_interpolation_ =
201  nullptr;
212  void sample_impact();
231  bool cll_in_nucleus_ = false;
235  double velocity_projectile_ = 0.0;
239  double velocity_target_ = 0.0;
250  std::pair<double, double> get_velocities(double mandelstam_s, double m_a,
251  double m_b);
252 
259  friend std::ostream &operator<<(std::ostream &, const ColliderModus &);
260 };
261 
262 } // namespace smash
263 
264 #endif // SRC_INCLUDE_COLLIDERMODUS_H_
FermiMotion
Option to use Fermi Motion.
bool is_collider() const
double yield_max_
Maximum value of yield. Needed for custom impact parameter sampling.
double velocity_target_
Beam velocity of the target.
static std::unique_ptr< DeformedNucleus > create_deformed_nucleus(Configuration &nucleus_cfg, const int ntest, const std::string &nucleus_type)
Configure Deformed Nucleus.
int total_N_number() const
Definition: collidermodus.h:89
double impact_
Impact parameter.
constexpr double nucleon_mass
Nucleon mass in GeV.
Definition: constants.h:55
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...
Interface to the SMASH configuration files.
std::unique_ptr< InterpolateDataLinear< double > > impact_interpolation_
Pointer to the impact parameter interpolation.
double imp_min_
Minimum value of impact parameter.
ColliderModus(Configuration modus_config, const ExperimentParameters &parameters)
Constructor.
std::unique_ptr< Nucleus > projectile_
Projectile.
Base class for Modus classes that provides default function implementations.
Definition: modusdefault.h:44
Sampling sampling_
Method used for sampling of impact parameter.
Thrown when either projectile_ or target_ nuclei are empty.
double impact_parameter() const
FermiMotion fermi_motion()
CalculationFrame
The calculation frame.
BadInput is an error to throw if the configuration options are invalid.
Definition: modusdefault.h:180
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.
FermiMotion fermi_motion_
An option to include Fermi motion ("off", "on", "frozen")
double initial_z_displacement_
Initial z-displacement of nuclei.
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 ...
Sample from areal / quadratic distribution.
Don&#39;t use fermi motion.
ColliderModus: Provides a modus for colliding nuclei.
Definition: collidermodus.h:42
double sqrt_s_NN_
Center-of-mass energy of a nucleon-nucleon collision.
bool cll_in_nucleus_
An option to accept first collisions within the same nucleus.
double initial_conditions(Particles *particles, const ExperimentParameters &parameters)
Generates initial state of the particles in the system.
std::unique_ptr< Nucleus > target_
Target.
double velocity_projectile_
Beam velocity of the projectile.
void sample_impact()
Sample impact parameter.
double velocity_target() const
double velocity_projectile() const
Sampling
Possible methods of impact parameter sampling.
friend std::ostream & operator<<(std::ostream &, const ColliderModus &)
Writes the initial state for the ColliderModus to the output stream.
The Particles class abstracts the storage and manipulation of particles.
Definition: particles.h:33
double imp_max_
Maximum value of impact parameter.
Helper structure for Experiment.
double nuclei_passing_time() const
Time until nuclei have passed through each other.
Definition: collidermodus.h:94
int proj_N_number() const
Definition: collidermodus.h:91
CalculationFrame frame_
Reference frame for the system, as specified from config.
Definition: action.h:24
double total_s_
Center-of-mass energy squared of the nucleus-nucleus collision.