20 const ParticleList &in,
const double time,
const int n_frac_photons,
21 const double hadronic_cross_section_input)
23 reac_(bremsstrahlung_reaction_type(in)),
24 number_of_fractional_photons_(n_frac_photons),
25 hadronic_cross_section_(hadronic_cross_section_input) {}
66 for (
const auto &output : outputs) {
67 if (output->is_photon_output()) {
69 output->at_interaction(*
this, 0.0);
79 <<
"Problem in BremsstrahlungAction::generate_final_state().\nThe "
82 <<
" entries. It should however have 1.";
83 throw std::runtime_error(
"");
101 if ((k_max - k_min) < 0.0) {
108 delta_k = (k_max - k_min);
117 double diff_xs_k = diff_xs_pair.first;
118 double diff_xs_theta = diff_xs_pair.second;
121 const double W_theta = diff_xs_theta * (M_PI - 0.0);
122 const double W_k = diff_xs_k * delta_k;
123 weight_ = std::sqrt(W_theta * W_k) /
134 new_particle.set_4position(interaction_point);
135 new_particle.boost_momentum(
150 const double sqrts =
sqrt_s();
151 const double E_ab = sqrts - m_c -
k_;
152 const double pcm =
pCM(sqrts, E_ab, m_c);
153 const double pcm_pions =
pCM(E_ab, m_a, m_b);
160 pcm * phitheta_photon.
threevec() / std::sqrt(pcm * pcm + E_ab * E_ab);
172 double reaction_cross_section) {
173 CollisionBranchPtr dummy_process = std::make_unique<CollisionBranch>(
180 CollisionBranchList process_list;
204 double xsection_pipi = (*pipi_pipi_opp_interpolation)(sqrts);
205 double xsection_pi0pi0 = (*pipi_pi0pi0_interpolation)(sqrts);
208 xsection_pipi = (xsection_pipi <= 0.0) ?
really_small : xsection_pipi;
209 xsection_pi0pi0 = (xsection_pi0pi0 <= 0.0) ?
really_small : xsection_pi0pi0;
213 CollisionBranchList process_list_pipi;
216 process_list_pipi.push_back(std::make_unique<CollisionBranch>(
219 process_list_pipi.push_back(std::make_unique<CollisionBranch>(
220 *pi_z_particle, *pi_z_particle, *photon_particle, xsection_pi0pi0,
224 double total_cross_section = xsection_pipi + xsection_pi0pi0;
226 choose_channel<CollisionBranch>(process_list_pipi, total_cross_section);
228 xsection = proc->
weight();
230 process_list.push_back(std::make_unique<CollisionBranch>(
240 xsection = (*pipi_pipi_same_interpolation)(sqrts);
243 xsection = (*pipi0_pipi0_interpolation)(sqrts);
249 process_list.push_back(std::make_unique<CollisionBranch>(
256 xsection = (*pi0pi0_pipi_interpolation)(sqrts);
261 process_list.push_back(std::make_unique<CollisionBranch>(
262 *pi_p_particle, *pi_m_particle, *photon_particle, xsection,
265 throw std::runtime_error(
"Unknown ReactionType in BremsstrahlungAction.");
273 const double collision_energy =
sqrt_s();
275 double dsigma_dtheta;
281 (*pipi_pipi_opp_dsigma_dk_interpolation)(
k_, collision_energy);
282 dsigma_dtheta = (*pipi_pipi_opp_dsigma_dtheta_interpolation)(
283 theta_, collision_energy);
286 dsigma_dk = (*pipi_pi0pi0_dsigma_dk_interpolation)(
k_, collision_energy);
288 (*pipi_pi0pi0_dsigma_dtheta_interpolation)(
theta_, collision_energy);
292 dsigma_dk = (*pipi_pipi_same_dsigma_dk_interpolation)(
k_, collision_energy);
294 (*pipi_pipi_same_dsigma_dtheta_interpolation)(
theta_, collision_energy);
297 dsigma_dk = (*pipi0_pipi0_dsigma_dk_interpolation)(
k_, collision_energy);
299 (*pipi0_pipi0_dsigma_dtheta_interpolation)(
theta_, collision_energy);
301 dsigma_dk = (*pi0pi0_pipi_dsigma_dk_interpolation)(
k_, collision_energy);
303 (*pi0pi0_pipi_dsigma_dtheta_interpolation)(
theta_, collision_energy);
305 throw std::runtime_error(
306 "Unkown channel when computing differential cross sections for "
307 "bremsstrahlung processes.");
311 dsigma_dk = (dsigma_dk < 0.0) ?
really_small : dsigma_dk;
312 dsigma_dtheta = (dsigma_dtheta < 0.0) ?
really_small : dsigma_dtheta;
315 std::pair<double, double> diff_x_sections = {dsigma_dk, dsigma_dtheta};
317 return diff_x_sections;
323 std::vector<double> photon_momentum =
BREMS_K;
335 std::vector<double> dsigma_dk_pipi_pipi_same =
342 std::vector<double> dsigma_dtheta_pipi_pipi_opp =
344 std::vector<double> dsigma_dtheta_pipi_pipi_same =
346 std::vector<double> dsigma_dtheta_pipi0_pipi0 =
348 std::vector<double> dsigma_dtheta_pipi_pi0pi0 =
350 std::vector<double> dsigma_dtheta_pi0pi0_pipi =
356 sqrts, sigma_pipi_pipi_opp);
358 std::make_unique<InterpolateDataLinear<double>>(sqrts,
359 sigma_pipi_pipi_same);
361 std::make_unique<InterpolateDataLinear<double>>(sqrts, sigma_pipi0_pipi0);
363 std::make_unique<InterpolateDataLinear<double>>(sqrts, sigma_pipi_pi0pi0);
365 std::make_unique<InterpolateDataLinear<double>>(sqrts, sigma_pi0pi0_pipi);
370 std::make_unique<InterpolateData2DSpline>(photon_momentum, sqrts,
371 dsigma_dk_pipi_pipi_opp);
373 std::make_unique<InterpolateData2DSpline>(photon_momentum, sqrts,
374 dsigma_dk_pipi_pipi_same);
376 std::make_unique<InterpolateData2DSpline>(photon_momentum, sqrts,
377 dsigma_dk_pipi0_pipi0);
379 std::make_unique<InterpolateData2DSpline>(photon_momentum, sqrts,
380 dsigma_dk_pipi_pi0pi0);
382 std::make_unique<InterpolateData2DSpline>(photon_momentum, sqrts,
383 dsigma_dk_pi0pi0_pipi);
388 std::make_unique<InterpolateData2DSpline>(photon_angle, sqrts,
389 dsigma_dtheta_pipi_pipi_opp);
391 std::make_unique<InterpolateData2DSpline>(photon_angle, sqrts,
392 dsigma_dtheta_pipi_pipi_same);
394 std::make_unique<InterpolateData2DSpline>(photon_angle, sqrts,
395 dsigma_dtheta_pipi0_pipi0);
397 std::make_unique<InterpolateData2DSpline>(photon_angle, sqrts,
398 dsigma_dtheta_pipi_pi0pi0);
400 std::make_unique<InterpolateData2DSpline>(photon_angle, sqrts,
401 dsigma_dtheta_pi0pi0_pipi);
FourVector total_momentum_of_outgoing_particles() const
Calculate the total kinetic momentum of the outgoing particles.
ParticleList outgoing_particles_
Initially this stores only the PDG codes of final-state particles.
const double time_of_execution_
Time at which the action is supposed to be performed (absolute time in the lab frame in fm).
virtual double check_conservation(const uint32_t id_process) const
Check various conservation laws.
double sqrt_s() const
Determine the total energy in the center-of-mass frame [GeV].
ParticleList incoming_particles_
List with data of incoming particles.
FourVector get_interaction_point() const
Get the interaction point.
ProcessType process_type_
type of process
Angles provides a common interface for generating directions: i.e., two angles that should be interpr...
ThreeVector threevec() const
void distribute_isotropically()
Populate the object with a new direction.
void sample_3body_phasespace()
Sample the final state anisotropically, considering the differential cross sections with respect to t...
ReactionType
Enum for encoding the photon process.
const ReactionType reac_
Reaction process as determined from incoming particles.
double k_
Sampled value of k (photon momentum)
const int number_of_fractional_photons_
Number of photons created for each hadronic scattering, needed for correct weighting.
void add_dummy_hadronic_process(double reaction_cross_section)
Adds one hadronic process with a given cross-section.
void generate_final_state() override
Generate the final-state for the Bremsstrahlung process.
static ReactionType bremsstrahlung_reaction_type(const ParticleList &in)
Determine photon process from incoming particles.
BremsstrahlungAction(const ParticleList &in, const double time, const int n_frac_photons, const double hadronic_cross_section_input)
Construct a ScatterActionBrems object.
void perform_bremsstrahlung(const OutputsList &outputs)
Create the final state and write to output.
CollisionBranchList brems_cross_sections()
Computes the total cross section of the bremsstrahlung process.
double hadronic_cross_section() const
Return the total cross section of the underlying hadronic scattering It is necessary for the weightin...
CollisionBranchList collision_processes_bremsstrahlung_
Holds the bremsstrahlung branch.
double weight_
Weight of the produced photon.
void create_interpolations()
Create interpolation objects for tabularized cross sections: total cross section, differential dSigma...
double theta_
Sampled value of theta (angle of the photon)
std::pair< double, double > brems_diff_cross_sections()
Computes the differential cross sections dSigma/dk and dSigma/dtheta of the bremsstrahlung process.
CollisionBranch is a derivative of ProcessBranch, which is used to represent particular final-state c...
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
ThreeVector velocity() const
Get the velocity (3-vector divided by zero component).
A pointer-like interface to global references to ParticleType objects.
static const ParticleType & find(PdgCode pdgcode)
Returns the ParticleType object for the given pdgcode.
PdgCode stores a Particle Data Group Particle Numbering Scheme particle type number.
std::int32_t code() const
ParticleList particle_list() const
ScatterAction is a special action which takes two incoming particles and performs a scattering,...
void add_collision(CollisionBranchPtr p)
Add a new collision channel.
The ThreeVector class represents a physical three-vector with the components .
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
constexpr int photon
Photon.
static std::unique_ptr< InterpolateData2DSpline > pipi_pi0pi0_dsigma_dk_interpolation
const std::initializer_list< double > BREMS_PIPI_PIPI_SAME_DIFF_SIG_K
dSigma/dk for π+ + π+ -> π+ + π+ + γ or π- + π- -> π- + π- + γ
T pCM(const T sqrts, const T mass_a, const T mass_b) noexcept
const std::initializer_list< double > BREMS_PIPI_PI0PI0_SIG
Total π+- + π-+ -> π0 + π0 + γ cross section.
static std::unique_ptr< InterpolateDataLinear< double > > pipi_pipi_opp_interpolation
const std::initializer_list< double > BREMS_PIPI_PIPI_OPP_SIG
Total π+- + π-+ -> π+- + π-+ + γ cross section.
const std::initializer_list< double > BREMS_PIPI_PI0PI0_DIFF_SIG_THETA
dSigma/dtheta for π+- + π-+ -> π0 + π0 + γ
const std::initializer_list< double > BREMS_PIPI0_PIPI0_DIFF_SIG_K
dSigma/dk for π0 + π -> π0 + π + γ
const std::initializer_list< double > BREMS_PIPI_PIPI_SAME_SIG
Total π+ + π+ -> π+ + π+ + γ or π- + π- -> π- + π- + γ cross section.
static std::unique_ptr< InterpolateDataLinear< double > > pipi_pipi_same_interpolation
static std::unique_ptr< InterpolateData2DSpline > pipi0_pipi0_dsigma_dtheta_interpolation
constexpr std::uint32_t ID_PROCESS_PHOTON
Process ID for any photon process.
static std::unique_ptr< InterpolateData2DSpline > pipi_pipi_opp_dsigma_dk_interpolation
static std::unique_ptr< InterpolateData2DSpline > pi0pi0_pipi_dsigma_dk_interpolation
static std::unique_ptr< InterpolateDataLinear< double > > pipi0_pipi0_interpolation
@ Bremsstrahlung
See here for a short description.
const std::initializer_list< double > BREMS_PIPI_PIPI_OPP_DIFF_SIG_THETA
dSigma/dtheta for π+- + π-+ -> π+- + π-+ + γ
static std::unique_ptr< InterpolateData2DSpline > pipi0_pipi0_dsigma_dk_interpolation
const std::initializer_list< double > BREMS_PI0PI0_PIPI_SIG
Total π0 + π0 -> π+- + π-+ + γ cross section.
const std::initializer_list< double > BREMS_K
photon momentum
const std::initializer_list< double > BREMS_SQRTS
Center-of-mass energy.
const std::initializer_list< double > BREMS_THETA
theta angle with respect to collision axis of incoming pions
const std::initializer_list< double > BREMS_PI0PI0_PIPI_DIFF_SIG_THETA
dSigma/dtheta for π0 + π0 -> π+- + π-+ + γ
static std::unique_ptr< InterpolateDataLinear< double > > pipi_pi0pi0_interpolation
static std::unique_ptr< InterpolateData2DSpline > pipi_pipi_same_dsigma_dtheta_interpolation
constexpr uint64_t pack(int32_t x, int32_t y)
Pack two int32_t into an uint64_t.
const std::initializer_list< double > BREMS_PIPI0_PIPI0_SIG
Total π0 + π -> π0 + π + γ cross section.
const std::initializer_list< double > BREMS_PI0PI0_PIPI_DIFF_SIG_K
dSigma/dk for π0 + π0 -> π+- + π-+ + γ
const std::initializer_list< double > BREMS_PIPI_PI0PI0_DIFF_SIG_K
dSigma/dk for π+- + π-+ -> π0 + π0 + γ
static std::unique_ptr< InterpolateDataLinear< double > > pi0pi0_pipi_interpolation
static std::unique_ptr< InterpolateData2DSpline > pipi_pipi_same_dsigma_dk_interpolation
static std::unique_ptr< InterpolateData2DSpline > pipi_pi0pi0_dsigma_dtheta_interpolation
static std::unique_ptr< InterpolateData2DSpline > pi0pi0_pipi_dsigma_dtheta_interpolation
constexpr double really_small
Numerical error tolerance.
static constexpr int LScatterAction
const std::initializer_list< double > BREMS_PIPI_PIPI_OPP_DIFF_SIG_K
dSigma/dk for π+- + π-+ -> π+- + π-+ + γ
static std::unique_ptr< InterpolateData2DSpline > pipi_pipi_opp_dsigma_dtheta_interpolation
const std::initializer_list< double > BREMS_PIPI0_PIPI0_DIFF_SIG_THETA
dSigma/dtheta for π0 + π -> π0 + π + γ
const std::initializer_list< double > BREMS_PIPI_PIPI_SAME_DIFF_SIG_THETA
dSigma/dtheta for π+ + π+ -> π+ + π+ + γ or π- + π- -> π- + π- + γ