File NuclearInteraction.hpp¶
-
namespace ActsFatras
-
struct NuclearInteraction¶
- #include <ActsFatras/Physics/NuclearInteraction/NuclearInteraction.hpp>
This class provides a parametrised nuclear interaction.
The thereby required parametrisation needs to be set and is not provided by default.
Note
This class differs between two different processes labelled as nuclear interaction. Either the initial particle survives (soft) or it gets destroyed (hard) by this process.
Public Functions
-
template<typename generator_t>
inline std::pair<Scalar, Scalar> generatePathLimits(generator_t &generator, const Particle &particle) const¶ This method evaluates the nuclear interaction length L0.
- Template Parameters
generator_t – The random number generator type
- Parameters
generator – [inout] The random number generator
particle – [in] The ingoing particle
- Returns
valid X0 limit and no limit on L0
-
template<typename generator_t>
inline bool run(generator_t &generator, Particle &particle, std::vector<Particle> &generated) const¶ This method performs a nuclear interaction.
- Template Parameters
generator_t – The random number generator type
- Parameters
generator – [inout] The random number generator
particle – [inout] The ingoing particle
generated – [out] Additional generated particles
- Returns
True if the particle was killed, false otherwise
Public Members
-
detail::MultiParticleNuclearInteractionParametrisation multiParticleParameterisation¶
The storage of the parameterisation.
-
unsigned int nMatchingTrials = 100¶
The number of trials to match momenta and inveriant masses.
-
unsigned int nMatchingTrialsTotal = 1000¶
Private Functions
-
template<typename generator_t>
std::vector<Particle> convertParametersToParticles(generator_t &generator, const std::vector<int> &pdgId, const Acts::ActsDynamicVector &momenta, const Acts::ActsDynamicVector &invariantMasses, Particle &initialParticle, float parametrizedMomentum, bool soft) const¶ Converter from sampled numbers to a vector of particles.
- Template Parameters
generator_t – The random number generator type
- Parameters
generator – [inout] The random number generator
pdgId – [in] The PDG IDs
momenta – [in] The momenta
invariantMasses – [in] The invariant masses
initialParticle – [in] The initial particle
parametrizedMomentum – [in] Momentum of the parametrisation
soft – [in] Treat it as soft or hard nuclear interaction
- Returns
Vector containing the final state particles
-
unsigned int finalStateMultiplicity(double rnd, const detail::NuclearInteractionParameters::CumulativeDistribution &distribution) const¶
Evaluates the multiplicity of the final state.
- Parameters
rnd – [in] Random number
distribution – [in] The multiplicity distribution
- Returns
The final state multiplicity
-
const detail::NuclearInteractionParameters &findParameters(double rnd, const detail::NuclearInteractionParametrisation ¶metrisation, float particleMomentum) const¶
Retrieves the parametrisation for the particle.
- Parameters
rnd – [in] A random number
parametrisation – [in] The storage of parametrisations
particleMomentum – [in] The particles momentum
- Returns
The parametrisation
-
std::pair<ActsFatras::Particle::Scalar, ActsFatras::Particle::Scalar> globalAngle(ActsFatras::Particle::Scalar phi1, ActsFatras::Particle::Scalar theta1, float phi2, float theta2) const¶
Converts relative angles to absolute angles wrt the global coordinate system.
Note
It is assumed that the angles of the first particle are provided in the context of the global coordinate system whereas the angles of the second particle are provided relatively to the first particle.
- Parameters
phi1 – [in] The azimuthal angle of the first particle
theta1 – [in] The polar angle of the first particle
phi2 – [in] The azimuthal angle of the second particle
theta2 – [in] The polar angle of the second particle
- Returns
Azimuthal and polar angle of the second particle in the global coordinate system
-
bool match(const Acts::ActsDynamicVector &momenta, const Acts::ActsDynamicVector &invariantMasses, float parametrizedMomentum) const¶
Tests whether the final state momenta and invariant masses are matching to each other to allow the evaluation of particle directions.
- Parameters
momenta – [in] The final state momenta
invariantMasses – [in] The final state invariant masses
parametrizedMomentum – [in] The momentum of the parametrized particle
- Returns
Decision whether the parameters can be matched to each other or not.
-
Scalar sampleContinuousValues(double rnd, const detail::NuclearInteractionParameters::CumulativeDistribution &distribution, bool interpolate = false) const¶
This function performs an inverse sampling to provide a continuous value from a distribition.
- Parameters
rnd – [in] A random number in [0,1]
distribution – [in] The distribution to sample from
interpolate – [in] Flag to steer whether an interpolation between neighbouring bins should be performed instead of a bin lookup
- Returns
The sampled value
-
unsigned int sampleDiscreteValues(double rnd, const detail::NuclearInteractionParameters::CumulativeDistribution &distribution) const¶
This function performs an inverse sampling to provide a discrete value from a distribution.
- Parameters
rnd – [in] A random number in [0,1]
distribution – [in] The distribution to sample from
- Returns
The sampled value
-
template<typename generator_t>
Acts::ActsDynamicVector sampleInvariantMasses(generator_t &generator, const detail::NuclearInteractionParameters::ParametersWithFixedMultiplicity ¶metrisation) const¶ Evaluates the final state invariant masses.
- Template Parameters
generator_t – The random number generator type
- Parameters
generator – [inout] The random number generator
parametrisation – [in] Parametrisation of kinematic properties
- Returns
Vector containing the invariant masses
-
template<typename generator_t>
std::optional<std::pair<Acts::ActsDynamicVector, Acts::ActsDynamicVector>> sampleKinematics(generator_t &generator, const detail::NuclearInteractionParameters::ParametersWithFixedMultiplicity ¶meters, float momentum) const¶ This method samples the kinematics of the final state particles.
- Template Parameters
generator_t – The random number generator type
- Parameters
generator – [inout] The random number generator
parameters – [in] The parametrisation
momentum – [in] The momentum of the parametrisation
- Returns
The final state momenta and invariant masses
-
template<typename generator_t>
Acts::ActsDynamicVector sampleMomenta(generator_t &generator, const detail::NuclearInteractionParameters::ParametersWithFixedMultiplicity ¶metrisation, float initialMomentum) const¶ Evaluates the final state momenta.
- Template Parameters
generator_t – The random number generator type
- Parameters
generator – [inout] The random number generator
parametrisation – [in] Parametrisation of kinematic properties
initialMomentum – [in] The initial momentum
- Returns
Vector containing the momenta
-
template<typename generator_t>
std::vector<int> samplePdgIds(generator_t &generator, const detail::NuclearInteractionParameters::PdgMap &pdgMap, unsigned int multiplicity, int particlePdg, bool soft) const¶ Evaluates the final state PDG IDs.
- Template Parameters
generator_t – The random number generator type
- Parameters
generator – [inout] The random number generator
pdgMap – [in] The branching probability map
multiplicity – [in] The final state multiplicity
particlePdg – [in] The PDG ID of the initial particle
soft – [in] Treat it as soft or hard nuclear interaction
- Returns
Vector containing the PDG IDs
-
inline bool softInteraction(double rnd, float probability) const¶
Estimates the interaction type.
- Parameters
rnd – [in] Random number
probability – [in] The probability for a soft interaction
- Returns
True if a soft interaction occurs
-
template<typename generator_t>
-
struct NuclearInteraction¶