43 const auto &log = logger<LogArea::PauliBlocking>();
50 log.debug(
"Action ", *
this,
" is pauli-blocked with f = ", f);
72 interaction_point += part.position();
74 interaction_point /= incoming_particles_.size();
75 return interaction_point;
91 return std::make_pair(UB, UI3);
95 assert(id_process != 0);
96 const auto &log = logger<LogArea::Action>();
101 p.set_history(
p.get_history().collisions_per_particle + 1, id_process,
113 log.debug(
"Particle map now has ", particles->
size(),
" elements.");
127 double scale_B = 0.0;
130 double scale_I3 = 0.0;
135 : std::make_pair(0.0, 0));
136 scale_B += scale.first;
137 scale_I3 += scale.second * p_in.type().isospin3_rel();
143 : std::make_pair(0.0, 0));
144 scale_B -= scale.first;
151 potentials.second * scale_I3;
155 const double kinetic_energy_cm)
const {
159 std::pair<double, double> masses = {t_a.
mass(), t_b.
mass()};
166 reaction +
": not enough energy, " + std::to_string(kinetic_energy_cm) +
184 const double kinetic_energy_cm) {
185 const auto &log = logger<LogArea::Action>();
190 const double pcm =
pCM(kinetic_energy_cm, masses.first, masses.second);
192 log.warn(
"Particle: ", p_a->pdgcode(),
" radial momentum: ", pcm);
193 log.warn(
"Ektot: ", kinetic_energy_cm,
" m_a: ", masses.first,
194 " m_b: ", masses.second);
200 p_a->set_4momentum(masses.first, phitheta.
threevec() * pcm);
205 log.debug(
"p_a: ", *p_a,
"\np_b: ", *p_b);
212 const double cm_kin_energy = p_tot.abs();
214 const std::pair<double, double> masses =
sample_masses(cm_kin_energy);
224 const double sqrts =
sqrt_s();
226 double mab, r, probability, pcm_ab, pcm;
230 pcm =
pCM(sqrts, mab, m_c);
231 pcm_ab =
pCM(mab, m_a, m_b);
232 probability = pcm * pcm_ab * 4 / (sqrts * sqrts);
233 }
while (r > probability);
238 pcm * phitheta.
threevec() / std::sqrt(pcm * pcm + mab * mab);
250 if (before != after) {
251 std::stringstream particle_names;
253 particle_names <<
p.type().name();
255 particle_names <<
" vs. ";
257 particle_names <<
p.type().name();
259 particle_names <<
"\n";
260 const auto &log = logger<LogArea::Action>();
262 log.error() << particle_names.str() << err_msg;
270 throw std::runtime_error(
"Conservation laws violated in photon process");
272 throw std::runtime_error(
"Conservation laws violated in process " +
273 std::to_string(id_process));
278 std::ostream &
operator<<(std::ostream &out,
const ActionList &actions) {
279 out <<
"ActionList {\n";
280 for (
const auto &a : actions) {
281 out <<
"- " << a <<
'\n';
friend std::ostream & operator<<(std::ostream &out, const Action &action)
Dispatches formatting to the virtual Action::format_debug_output function.
Potentials * pot_pointer
Pointer to a Potential class.
const ParticleType & type_of_pout(const ParticleData &p_out) const
Get the type of a given particle.
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...
The ThreeVector class represents a physical three-vector with the components .
double sqrt_s() const
Determine the total energy in the center-of-mass frame [GeV].
bool is_string_soft_process(ProcessType p)
Check if a given process type is a soft string excitation.
constexpr std::uint32_t ID_PROCESS_PHOTON
Process ID for any photon process.
RectangularLattice< FourVector > * UI3_lat_pointer
Pointer to the symmmetry potential on the lattice.
ProcessType process_type_
type of process
Collection of useful constants that are known at compile time.
ThreeVector threevec() const
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 ...
bool is_pauli_blocked(const Particles &particles, const PauliBlocker &p_bl) const
Check if the action is Pauli-blocked.
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...
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...
FourVector total_momentum() const
Sum of 4-momenta of incoming particles.
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...
FourVector total_momentum_of_outgoing_particles() const
Calculate the total kinetic momentum of the outgoing particles.
RectangularLattice< FourVector > * UB_lat_pointer
Pointer to the skyrme potential on the lattice.
ThreeVector threevec() const
std::string report_deviations(const Particles &particles) const
Checks if the current particle list has still the same values and reports about differences.
double min_mass_kinematic() const
The minimum mass of the resonance that is kinematically allowed.
elastic scattering: particles remain the same, only momenta change
const std::string & name() const
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...
Particle type contains the static properties of a particle species.
void set_4momentum(const FourVector &momentum_vector)
Set the particle's 4-momentum directly.
ParticleList incoming_particles_
List with data of incoming particles.
std::pair< FourVector, FourVector > get_potential_at_interaction_point() const
Get the skyrme and asymmetry potential at the interaction point.
A container for storing conserved values.
hard string process involving 2->2 QCD process by PYTHIA.
bool all_of(Container &&c, UnaryPredicate &&p)
Convenience wrapper for std::all_of that operates on a complete container.
A class that stores parameters needed for Pauli blocking, tabulates necessary integrals and computes ...
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...
bool is_valid(const Particles &particles) const
Check whether the action still applies.
FourVector get_interaction_point() const
Get the interaction point.
void check_conservation(const uint32_t id_process) const
Check various conservation laws.
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).
std::pair< double, int > force_scale(const ParticleType &data) const
Evaluates the scaling factor of the forces acting on the 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 ParticleList & incoming_particles() const
Get the list of particles that go into the action.
Angles provides a common interface for generating directions: i.e., two angles that should be interpr...
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.
double isospin3_rel() const
void distribute_isotropically()
Populate the object with a new direction.
The Particles class abstracts the storage and manipulation of particles.
bool is_valid(const ParticleData ©) const
Check whether the ParticleData copy is still a valid copy of the one stored in the Particles object...
T pCM(const T sqrts, const T mass_a, const T mass_b) noexcept
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
ParticleData contains the dynamic information of a certain particle.
virtual ~Action()
Virtual Destructor.
const double time_of_execution_
Time at which the action is supposed to be performed (absolute time in the lab frame in fm/c)...
virtual void perform(Particles *particles, uint32_t id_process)
Actually perform the action, e.g.