Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
MCGIDI::Distributions::PairProductionGamma Class Reference

#include <MCGIDI_distributions.hpp>

Inheritance diagram for MCGIDI::Distributions::PairProductionGamma:

Public Member Functions

LUPI_HOST_DEVICE PairProductionGamma ()
LUPI_HOST PairProductionGamma (SetupInfo &a_setupInfo, bool a_firstSampled)
LUPI_HOST_DEVICE ~PairProductionGamma ()
template<typename RNG>
LUPI_HOST_DEVICE void sample (double a_X, Sampling::Input &a_input, RNG &&a_rng) const
template<typename RNG>
LUPI_HOST_DEVICE double angleBiasing (Reaction const *a_reaction, double a_temperature, double a_energy_in, double a_mu_lab, RNG &&a_rng, double &a_energy_out) const
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
template<typename RNG>
LUPI_HOST_DEVICE void sample (LUPI_maybeUnused double a_X, Sampling::Input &a_input, RNG &&a_rng) const
template<typename RNG>
LUPI_HOST_DEVICE double angleBiasing (LUPI_maybeUnused Reaction const *a_reaction, LUPI_maybeUnused double a_temperature, LUPI_maybeUnused double a_energy_in, LUPI_maybeUnused double a_mu_lab, LUPI_maybeUnused RNG &&a_rng, double &a_energy_out) const
Public Member Functions inherited from MCGIDI::Distributions::Distribution
LUPI_HOST_DEVICE Distribution ()
LUPI_HOST Distribution (Type a_type, GIDI::Distributions::Distribution const &a_distribution, SetupInfo &a_setupInfo)
LUPI_HOST Distribution (Type a_type, GIDI::Frame a_productFrame, SetupInfo &a_setupInfo)
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION ~Distribution () MCGIDI_TRUE_VIRTUAL
LUPI_HOST_DEVICE Type type () const
LUPI_HOST_DEVICE GIDI::Frame productFrame () const
LUPI_HOST_DEVICE double projectileMass () const
LUPI_HOST_DEVICE double targetMass () const
LUPI_HOST_DEVICE double productMass () const
LUPI_HOST void setModelDBRC_data (Sampling::Upscatter::ModelDBRC_data *a_modelDBRC_data)
template<typename RNG>
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION void sample (double a_X, Sampling::Input &a_input, RNG &&a_rng) const MCGIDI_TRUE_VIRTUAL
template<typename RNG>
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION double angleBiasing (Reaction const *a_reaction, double a_temperature, double a_energy_in, double a_mu_lab, RNG &&a_rng, double &a_energy_out) const MCGIDI_TRUE_VIRTUAL
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
template<typename RNG>
LUPI_HOST_DEVICE void sample (double a_X, MCGIDI::Sampling::Input &a_input, RNG &&a_rng) const
template<typename RNG>
LUPI_HOST_DEVICE double angleBiasing (Reaction const *a_reaction, double a_temperature, double a_energy_in, double a_mu_lab, RNG &&a_rng, double &a_energy_out) const

Detailed Description

This class represents the distribution for an outgoing photon the is the result of an electron annihilating with a positron.

Definition at line 359 of file MCGIDI_distributions.hpp.

Constructor & Destructor Documentation

◆ PairProductionGamma() [1/2]

LUPI_HOST_DEVICE MCGIDI::Distributions::PairProductionGamma::PairProductionGamma ( )

Basic constructor.

Definition at line 1177 of file MCGIDI_distributions.cc.

1177 :
1178 m_firstSampled( false ) {
1179
1180}

◆ PairProductionGamma() [2/2]

LUPI_HOST MCGIDI::Distributions::PairProductionGamma::PairProductionGamma ( SetupInfo & a_setupInfo,
bool a_firstSampled )
Parameters
a_setupInfo[in] Used internally when constructing a Protare to pass information to other constructors.
a_firstSampled[in] FIX ME

Definition at line 1187 of file MCGIDI_distributions.cc.

1187 :
1189 m_firstSampled( a_firstSampled ) {
1190
1191}

◆ ~PairProductionGamma()

LUPI_HOST_DEVICE MCGIDI::Distributions::PairProductionGamma::~PairProductionGamma ( )

Definition at line 1196 of file MCGIDI_distributions.cc.

1196 {
1197
1198}

Member Function Documentation

◆ angleBiasing() [1/2]

template<typename RNG>
LUPI_HOST_DEVICE double MCGIDI::Distributions::PairProductionGamma::angleBiasing ( LUPI_maybeUnused Reaction const * a_reaction,
LUPI_maybeUnused double a_temperature,
LUPI_maybeUnused double a_energy_in,
LUPI_maybeUnused double a_mu_lab,
LUPI_maybeUnused RNG && a_rng,
double & a_energy_out ) const

Returns the probability for a projectile with energy a_energy_in to cause a particle to be emitted at angle a_mu_lab as seen in the lab frame. a_energy_out is the sampled outgoing energy.

Parameters
a_reaction[in] The reaction containing the particle which this distribution describes.
a_temperature[in] The temperature of the material.
a_energy_in[in] The energy of the incident particle.
a_mu_lab[in] The desired mu in the lab frame for the emitted particle.
a_rng[in] The random number generator function that returns a double in the range [0, 1.0).
a_energy_out[in] The energy of the emitted outgoing particle.
Returns
The probability of emitting outgoing particle into lab angle a_mu_lab.

Definition at line 1407 of file MCGIDI_headerSource.hpp.

1408 {
1409
1410 a_energy_out = PoPI_electronMass_MeV_c2;
1411 return( 1.0 ); // 1.0 as there are two photons, each with 1/2 probability.
1412}
#define PoPI_electronMass_MeV_c2
Definition PoPI.hpp:31

◆ angleBiasing() [2/2]

template<typename RNG>
LUPI_HOST_DEVICE double MCGIDI::Distributions::PairProductionGamma::angleBiasing ( Reaction const * a_reaction,
double a_temperature,
double a_energy_in,
double a_mu_lab,
RNG && a_rng,
double & a_energy_out ) const

◆ sample() [1/2]

template<typename RNG>
LUPI_HOST_DEVICE void MCGIDI::Distributions::PairProductionGamma::sample ( double a_X,
Sampling::Input & a_input,
RNG && a_rng ) const

◆ sample() [2/2]

template<typename RNG>
LUPI_HOST_DEVICE void MCGIDI::Distributions::PairProductionGamma::sample ( LUPI_maybeUnused double a_X,
Sampling::Input & a_input,
RNG && a_rng ) const

This method samples the outgoing photon by assigning the electron rest mass energy as the photon's energy and, if m_firstSampled is true, randomly picking mu and phi. If m_firstSampled is false, the previous sampled particle that filled in a_input must be the other sampled photon, then, the mu and phi for the second-sampled photon is such that it is back-to-back with the other photon.

Parameters
a_X[in] The energy of the projectile.
a_input[in] Sample options requested by user.
a_rng[in] The random number generator function that returns a double in the range [0, 1.0).

Definition at line 1378 of file MCGIDI_headerSource.hpp.

1378 {
1379
1380 if( m_firstSampled ) {
1381 a_input.m_mu = 1.0 - 2.0 * a_rng( );
1382 a_input.m_phi = M_PI * a_rng( ); }
1383 else {
1384 a_input.m_mu *= -1.0;
1385 a_input.m_phi += M_PI;
1386 }
1387 a_input.setSampledType( Sampling::SampledType::uncorrelatedBody );
1388 a_input.m_energyOut1 = PoPI_electronMass_MeV_c2;
1389 a_input.m_frame = productFrame( );
1390}
#define M_PI
Definition SbMath.h:33
LUPI_HOST_DEVICE GIDI::Frame productFrame() const

◆ serialize()

LUPI_HOST_DEVICE void MCGIDI::Distributions::PairProductionGamma::serialize ( LUPI::DataBuffer & a_buffer,
LUPI::DataBuffer::Mode a_mode )

This method serializes this for broadcasting as needed for MPI and GPUs. The method can count the number of required bytes, pack this or unpack this depending on a_mode.

Parameters
a_buffer[in] The buffer to read or write data to depending on a_mode.
a_mode[in] Specifies the action of this method.

Definition at line 1209 of file MCGIDI_distributions.cc.

1209 {
1210
1211 Distribution::serialize( a_buffer, a_mode );
1212
1213 DATA_MEMBER_INT( m_firstSampled, a_buffer, a_mode );
1214}
#define DATA_MEMBER_INT( member, buf, mode)
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)

The documentation for this class was generated from the following files: