 |
Version: SMASH-2.0
|
|
Go to the documentation of this file.
49 " is pauli-blocked with f = ", f);
71 interaction_point += part.position();
88 for (
int i = 1; i < 4; i++) {
89 const double d = std::abs(r[i]);
105 return interaction_point;
121 return std::make_pair(UB, UI3);
125 assert(id_process != 0);
130 p.set_history(
p.get_history().collisions_per_particle + 1, id_process,
142 logg[
LAction].debug(
"Particle map now has ", particles->
size(),
" elements.");
156 double scale_B = 0.0;
159 double scale_I3 = 0.0;
164 : std::make_pair(0.0, 0));
165 scale_B += scale.first;
166 scale_I3 += scale.second * p_in.type().isospin3_rel();
172 : std::make_pair(0.0, 0));
173 scale_B -= scale.first;
180 potentials.second * scale_I3;
187 ParticleList::iterator last_formed_in_part;
188 bool all_incoming_same_formation_time =
194 if (all_incoming_same_formation_time) {
195 last_formed_in_part =
199 b.initial_xsec_scaling_factor();
202 last_formed_in_part =
209 const double form_time_begin = last_formed_in_part->begin_formation_time();
210 const double sc = last_formed_in_part->initial_xsec_scaling_factor();
214 if (new_particle.initial_xsec_scaling_factor() < 1.0) {
219 double sc_out = new_particle.initial_xsec_scaling_factor();
220 new_particle.set_cross_section_scaling_factor(sc * sc_out);
221 if (last_formed_in_part->formation_time() >
222 new_particle.formation_time()) {
226 new_particle.set_slow_formation_times(
231 new_particle.set_slow_formation_times(
232 form_time_begin, last_formed_in_part->formation_time());
233 new_particle.set_cross_section_scaling_factor(sc);
238 if (new_particle.initial_xsec_scaling_factor() == 1.0) {
246 const double kinetic_energy_cm)
const {
250 std::pair<double, double> masses = {t_a.
mass(), t_b.
mass()};
257 reaction +
": not enough energy, " + std::to_string(kinetic_energy_cm) +
275 const double kinetic_energy_cm) {
279 const double pcm =
pCM(kinetic_energy_cm, masses.first, masses.second);
282 logg[
LAction].warn(
"Ektot: ", kinetic_energy_cm,
" m_a: ", masses.first,
283 " m_b: ", masses.second);
294 logg[
LAction].debug(
"p_a: ", *p_a,
"\np_b: ", *p_b);
301 const double cm_kin_energy = p_tot.abs();
303 const std::pair<double, double> masses =
sample_masses(cm_kin_energy);
313 throw std::invalid_argument(
314 "sample_3body_phasespace: Found resonance in to be sampled outgoing "
315 "particles, but assumes stable particles.");
321 const double sqrts =
sqrt_s();
324 double mab, r, probability, pcm_ab, pcm;
328 pcm =
pCM(sqrts, mab, m_c);
329 pcm_ab =
pCM(mab, m_a, m_b);
330 probability = pcm * pcm_ab * 4 / (sqrts * sqrts);
331 }
while (r > probability);
336 pcm * phitheta.
threevec() / std::sqrt(pcm * pcm + mab * mab);
348 if (before != after) {
349 std::stringstream particle_names;
351 particle_names <<
p.type().name();
353 particle_names <<
" vs. ";
355 particle_names <<
p.type().name();
357 particle_names <<
"\n";
359 logg[
LAction].error() << particle_names.str() << err_msg;
367 throw std::runtime_error(
"Conservation laws violated in photon process");
369 throw std::runtime_error(
"Conservation laws violated in process " +
370 std::to_string(id_process));
375 std::ostream &
operator<<(std::ostream &out,
const ActionList &actions) {
376 out <<
"ActionList {\n";
377 for (
const auto &a : actions) {
378 out <<
"- " << a <<
'\n';
virtual void sample_angles(std::pair< double, double > masses, double kinetic_energy_cm)
Sample final-state momenta in general X->2 processes (here: using an isotropical angular distribution...
ParticleList incoming_particles_
List with data of incoming particles.
hard string process involving 2->2 QCD process by PYTHIA.
virtual ~Action()
Virtual Destructor.
FourVector total_momentum() const
Sum of 4-momenta of incoming particles.
const double time_of_execution_
Time at which the action is supposed to be performed (absolute time in the lab frame in fm/c).
void assign_formation_time_to_outgoing_particles()
Assign the formation time to the outgoing particles.
void sample_2body_phasespace()
Sample the full 2-body phase-space (masses, momenta, angles) in the center-of-mass frame for the fina...
const double & initial_xsec_scaling_factor() const
Get the initially assigned cross section scaling factor.
static constexpr int LPauliBlocking
static std::pair< double, int > force_scale(const ParticleType &data)
Evaluates the scaling factor of the forces acting on the particles.
bool is_pauli_blocked(const Particles &particles, const PauliBlocker &p_bl) const
Check if the action is Pauli-blocked.
virtual void check_conservation(const uint32_t id_process) const
Check various conservation laws.
bool is_string_soft_process(ProcessType p)
Check if a given process type is a soft string excitation.
std::ostream & operator<<(std::ostream &out, const ActionPtr &action)
void distribute_isotropically()
Populate the object with a new direction.
PdgCode pdgcode() const
Get the pdgcode of the particle.
double phasespace_dens(const ThreeVector &r, const ThreeVector &p, const Particles &particles, const PdgCode pdg, const ParticleList &disregard) const
Calculate phase-space density of a particle species at the point (r,p).
void update_incoming(const Particles &particles)
Update the incoming particles that are stored in this action to the state they have in the global par...
void set_4momentum(const FourVector &momentum_vector)
Set the particle's 4-momentum directly.
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
bool all_of(Container &&c, UnaryPredicate &&p)
Convenience wrapper for std::all_of that operates on a complete container.
T pCM(const T sqrts, const T mass_a, const T mass_b) noexcept
constexpr double really_small
Numerical error tolerance.
RectangularLattice< FourVector > * UI3_lat_pointer
Pointer to the symmmetry potential on the lattice.
double formation_time() const
Get the absolute formation time of the particle.
A class that stores parameters needed for Pauli blocking, tabulates necessary integrals and computes ...
double box_length_
Box length: needed to determine coordinates of collision correctly in case of collision through the w...
std::pair< double, double > sample_resonance_masses(const ParticleType &t2, const double cms_energy, int L=0) const
Resonance mass sampling for 2-particle final state with two resonances.
RectangularLattice< FourVector > * UB_lat_pointer
Pointer to the skyrme potential on the lattice.
void update(const ParticleList &old_state, ParticleList &new_state, bool do_replace)
Updates the Particles object, replacing the particles in old_state with the particles in new_state.
const ParticleType & type_of_pout(const ParticleData &p_out) const
Get the type of a given particle.
double sample_resonance_mass(const double mass_stable, const double cms_energy, int L=0) const
Resonance mass sampling for 2-particle final state with one resonance (type given by 'this') and one ...
double isospin3_rel() const
std::string report_deviations(const Particles &particles) const
Checks if the current particle list has still the same values and reports about differences.
ProcessType process_type_
type of process
bool is_valid(const Particles &particles) const
Check whether the action still applies.
const std::string & name() const
static constexpr int LAction
std::pair< FourVector, FourVector > get_potential_at_interaction_point() const
Get the skyrme and asymmetry potential at the interaction point.
int stochastic_position_idx_
This stores a randomly-chosen index to an incoming particle.
virtual void perform(Particles *particles, uint32_t id_process)
Actually perform the action, e.g.
FourVector total_momentum_of_outgoing_particles() const
Calculate the total kinetic momentum of the outgoing particles.
const ParticleData & lookup(const ParticleData &old_state) const
Returns the particle that is currently stored in this object given an old copy of that particle.
ParticleList outgoing_particles_
Initially this stores only the PDG codes of final-state particles.
virtual void sample_3body_phasespace()
Sample the full 3-body phase-space (masses, momenta, angles) in the center-of-mass frame for the fina...
ThreeVector threevec() const
double sqrt_s() const
Determine the total energy in the center-of-mass frame [GeV].
bool is_valid(const ParticleData ©) const
Check whether the ParticleData copy is still a valid copy of the one stored in the Particles object.
elastic scattering: particles remain the same, only momenta change
FourVector get_interaction_point() const
Get the interaction point.
Angles provides a common interface for generating directions: i.e., two angles that should be interpr...
constexpr std::uint32_t ID_PROCESS_PHOTON
Process ID for any photon process.
double min_mass_kinematic() const
The minimum mass of the resonance that is kinematically allowed.
Potentials * pot_pointer
Pointer to a Potential class.
const ParticleList & incoming_particles() const
Get the list of particles that go into the action.
virtual std::pair< double, double > sample_masses(double kinetic_energy_cm) const
Sample final-state masses in general X->2 processes (thus also fixing the absolute c....
ThreeVector threevec() const