Version: SMASH-1.8
collidermodus.h
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 #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.;
196  double imp_min_ = 0.0;
198  double imp_max_ = 0.0;
200  double yield_max_ = 0.0;
202  std::unique_ptr<InterpolateDataLinear<double>> impact_interpolation_ =
203  nullptr;
204 
211  void rotate_reaction_plane(double phi, Particles *particles);
212 
223  void sample_impact();
242  bool cll_in_nucleus_ = false;
246  double velocity_projectile_ = 0.0;
250  double velocity_target_ = 0.0;
261  std::pair<double, double> get_velocities(double mandelstam_s, double m_a,
262  double m_b);
263 
270  friend std::ostream &operator<<(std::ostream &, const ColliderModus &);
271 };
272 
273 } // namespace smash
274 
275 #endif // SRC_INCLUDE_COLLIDERMODUS_H_
smash::ColliderModus::impact_interpolation_
std::unique_ptr< InterpolateDataLinear< double > > impact_interpolation_
Pointer to the impact parameter interpolation.
Definition: collidermodus.h:202
smash::ColliderModus::initial_z_displacement_
double initial_z_displacement_
Initial z-displacement of nuclei.
Definition: collidermodus.h:230
smash
Definition: action.h:24
smash::ColliderModus::imp_min_
double imp_min_
Minimum value of impact parameter.
Definition: collidermodus.h:196
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:620
smash::ColliderModus::fermi_motion
FermiMotion fermi_motion()
Definition: collidermodus.h:120
Sampling::Quadratic
Sample from areal / quadratic distribution.
CalculationFrame::CenterOfVelocity
smash::ColliderModus::cll_in_nucleus_
bool cll_in_nucleus_
An option to accept first collisions within the same nucleus.
Definition: collidermodus.h:242
smash::ColliderModus::fermi_motion_
FermiMotion fermi_motion_
An option to include Fermi motion ("off", "on", "frozen")
Definition: collidermodus.h:238
smash::ColliderModus::total_N_number
int total_N_number() const
Definition: collidermodus.h:89
smash::ColliderModus::random_reaction_plane_
bool random_reaction_plane_
Whether the reaction plane should be randomized.
Definition: collidermodus.h:192
interpolation.h
modusdefault.h
smash::ColliderModus::sampling_
Sampling sampling_
Method used for sampling of impact parameter.
Definition: collidermodus.h:194
smash::ColliderModus::sqrt_s_NN_
double sqrt_s_NN_
Center-of-mass energy of a nucleon-nucleon collision.
Definition: collidermodus.h:160
smash::ColliderModus::target_
std::unique_ptr< Nucleus > target_
Target.
Definition: collidermodus.h:148
smash::ColliderModus::nuclei_passing_time
double nuclei_passing_time() const
Time until nuclei have passed through each other.
Definition: collidermodus.h:94
FermiMotion::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:630
smash::ColliderModus::sample_impact
void sample_impact()
Sample impact parameter.
Definition: collidermodus.cc:562
smash::ColliderModus::is_collider
bool is_collider() const
Definition: collidermodus.h:122
smash::nucleon_mass
constexpr double nucleon_mass
Nucleon mass in GeV.
Definition: constants.h:55
smash::ColliderModus::initial_conditions
double initial_conditions(Particles *particles, const ExperimentParameters &parameters)
Generates initial state of the particles in the system.
Definition: collidermodus.cc:470
smash::ColliderModus::velocity_target
double velocity_target() const
Definition: collidermodus.h:114
fourvector.h
smash::ModusDefault::BadInput
Definition: modusdefault.h:183
smash::ColliderModus::velocity_projectile_
double velocity_projectile_
Beam velocity of the projectile.
Definition: collidermodus.h:246
smash::Configuration
Interface to the SMASH configuration files.
Definition: configuration.h:464
forwarddeclarations.h
smash::ColliderModus::imp_max_
double imp_max_
Maximum value of impact parameter.
Definition: collidermodus.h:198
smash::ColliderModus::impact_parameter
double impact_parameter() const
Definition: collidermodus.h:124
deformednucleus.h
smash::ColliderModus::total_s_
double total_s_
Center-of-mass energy squared of the nucleus-nucleus collision.
Definition: collidermodus.h:154
Sampling
Sampling
Possible methods of impact parameter sampling.
Definition: forwarddeclarations.h:103
smash::ColliderModus::frame_
CalculationFrame frame_
Reference frame for the system, as specified from config.
Definition: collidermodus.h:234
smash::ColliderModus::proj_N_number
int proj_N_number() const
Definition: collidermodus.h:91
smash::ModusDefault
Definition: modusdefault.h:44
nucleus.h
smash::ColliderModus::yield_max_
double yield_max_
Maximum value of yield. Needed for custom impact parameter sampling.
Definition: collidermodus.h:200
smash::ColliderModus::operator<<
friend std::ostream & operator<<(std::ostream &, const ColliderModus &)
Definition: collidermodus.cc:441
CalculationFrame
CalculationFrame
The calculation frame.
Definition: forwarddeclarations.h:86
smash::Particles
Definition: particles.h:33
smash::ColliderModus::impact_
double impact_
Impact parameter.
Definition: collidermodus.h:190
smash::ColliderModus
Definition: collidermodus.h:42
smash::ColliderModus::ColliderEmpty
Definition: collidermodus.h:129
pdgcode.h
smash::ColliderModus::projectile_
std::unique_ptr< Nucleus > projectile_
Projectile.
Definition: collidermodus.h:140
smash::ColliderModus::velocity_target_
double velocity_target_
Beam velocity of the target.
Definition: collidermodus.h:250
smash::ExperimentParameters
Helper structure for Experiment.
Definition: experimentparameters.h:23
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:451
smash::ColliderModus::rotate_reaction_plane
void rotate_reaction_plane(double phi, Particles *particles)
Rotate the reaction plane about the angle phi.
Definition: collidermodus.cc:551
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:593
smash::ColliderModus::ColliderModus
ColliderModus(Configuration modus_config, const ExperimentParameters &parameters)
Constructor.
Definition: collidermodus.cc:264
FermiMotion
FermiMotion
Option to use Fermi Motion.
Definition: forwarddeclarations.h:93
smash::ColliderModus::velocity_projectile
double velocity_projectile() const
Definition: collidermodus.h:109
smash::ColliderModus::cll_in_nucleus
bool cll_in_nucleus()
Definition: collidermodus.h:118