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

#include <MCGIDI_functions.hpp>

Inheritance diagram for MCGIDI::Probabilities::PrimaryGamma2d:

Public Member Functions

LUPI_HOST_DEVICE PrimaryGamma2d ()
LUPI_HOST PrimaryGamma2d (GIDI::Functions::PrimaryGamma2d const &a_primaryGamma2d, SetupInfo *a_setupInfo)
LUPI_HOST_DEVICE ~PrimaryGamma2d ()
double primaryEnergy () const
double massFactor () const
String const & finalState () const
int initialStateIndex () const
LUPI_HOST_DEVICE double evaluate (double a_x2, double a_x1) const
template<typename RNG>
LUPI_HOST_DEVICE double sample (double a_x2, LUPI_maybeUnused double a_rngValue, LUPI_maybeUnused RNG &&a_rng) const
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
Public Member Functions inherited from MCGIDI::Probabilities::ProbabilityBase2d_d2
LUPI_HOST_DEVICE ProbabilityBase2d_d2 ()
LUPI_HOST ProbabilityBase2d_d2 (GIDI::Functions::FunctionForm const &a_probabilty)
LUPI_HOST ProbabilityBase2d_d2 (GIDI::Functions::FunctionForm const &a_probabilty, Vector< double > const &a_Xs)
LUPI_HOST_DEVICE double evaluate (double a_x2, double a_x1) const
template<typename RNG>
LUPI_HOST_DEVICE double sample (double a_x2, double a_rngValue, RNG &&a_rng) const
template<typename RNG>
LUPI_HOST_DEVICE double sample2dOf3d (double a_x2, double a_rngValue, RNG &&a_rng, double *a_x1_1, double *a_x1_2) const
Public Member Functions inherited from MCGIDI::Probabilities::ProbabilityBase2d_d1
LUPI_HOST_DEVICE ProbabilityBase2d_d1 ()
LUPI_HOST ProbabilityBase2d_d1 (GIDI::Functions::FunctionForm const &a_probabilty)
LUPI_HOST ProbabilityBase2d_d1 (GIDI::Functions::FunctionForm const &a_probabilty, Vector< double > const &a_Xs)
LUPI_HOST_DEVICE double evaluate (double a_x2, double a_x1) const
template<typename RNG>
LUPI_HOST_DEVICE double sample (double a_x2, double a_rngValue, RNG &&a_rng) const
template<typename RNG>
LUPI_HOST_DEVICE double sample2dOf3d (double a_x2, double a_rngValue, RNG &&a_rng, double *a_x1_1, double *a_x1_2) const
Public Member Functions inherited from MCGIDI::Probabilities::ProbabilityBase2d
LUPI_HOST_DEVICE ProbabilityBase2d ()
LUPI_HOST ProbabilityBase2d (GIDI::Functions::FunctionForm const &a_probabilty)
LUPI_HOST ProbabilityBase2d (GIDI::Functions::FunctionForm const &a_probabilty, Vector< double > const &a_Xs)
LUPI_HOST_DEVICE ~ProbabilityBase2d ()
LUPI_HOST_DEVICE ProbabilityBase2dType type () const
LUPI_HOST_DEVICE String typeString () const
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION double evaluate (double a_x2, double a_x1) const MCGIDI_TRUE_VIRTUAL
template<typename RNG>
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION double sample (double a_x2, double a_rngValue, RNG &&a_rng) const MCGIDI_TRUE_VIRTUAL
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
template<typename RNG>
LUPI_HOST_DEVICE double sample (double a_x2, double a_rngValue, RNG &&a_rng) const
Public Member Functions inherited from MCGIDI::Probabilities::ProbabilityBase
LUPI_HOST_DEVICE ProbabilityBase ()
LUPI_HOST ProbabilityBase (GIDI::Functions::FunctionForm const &a_probabilty)
LUPI_HOST ProbabilityBase (GIDI::Functions::FunctionForm const &a_probabilty, Vector< double > const &a_Xs)
LUPI_HOST_DEVICE ~ProbabilityBase ()
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
Public Member Functions inherited from MCGIDI::Functions::FunctionBase
LUPI_HOST_DEVICE FunctionBase ()
LUPI_HOST FunctionBase (GIDI::Functions::FunctionForm const &a_function)
LUPI_HOST_DEVICE FunctionBase (int a_dimension, double a_domainMin, double a_domainMax, Interpolation a_interpolation, double a_outerDomainValue=0)
virtual LUPI_HOST_DEVICE ~FunctionBase ()=0
LUPI_HOST_DEVICE Interpolation interpolation () const
LUPI_HOST_DEVICE double domainMin () const
LUPI_HOST_DEVICE double domainMax () const
LUPI_HOST_DEVICE double outerDomainValue () const
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)

Additional Inherited Members

Protected Attributes inherited from MCGIDI::Probabilities::ProbabilityBase2d
ProbabilityBase2dType m_type
Protected Attributes inherited from MCGIDI::Probabilities::ProbabilityBase
Vector< double > m_Xs

Detailed Description

Definition at line 548 of file MCGIDI_functions.hpp.

Constructor & Destructor Documentation

◆ PrimaryGamma2d() [1/2]

LUPI_HOST_DEVICE MCGIDI::Probabilities::PrimaryGamma2d::PrimaryGamma2d ( )

Definition at line 1822 of file MCGIDI_functions.cc.

1822 :
1823 m_primaryEnergy( 0.0 ),
1824 m_massFactor( 0.0 ),
1825 m_finalState( "" ),
1826 m_initialStateIndex( -1 ) {
1827
1829}

◆ PrimaryGamma2d() [2/2]

LUPI_HOST MCGIDI::Probabilities::PrimaryGamma2d::PrimaryGamma2d ( GIDI::Functions::PrimaryGamma2d const & a_primaryGamma2d,
SetupInfo * a_setupInfo )

Definition at line 1833 of file MCGIDI_functions.cc.

1833 :
1834 ProbabilityBase2d_d2( a_primaryGamma2d ),
1835 m_primaryEnergy( a_primaryGamma2d.value( ) ),
1836 m_massFactor( a_setupInfo->m_protare.targetMass( ) / ( a_setupInfo->m_protare.projectileMass( ) + a_setupInfo->m_protare.targetMass( ) ) ),
1837 m_finalState( a_primaryGamma2d.finalState( ).c_str( ) ),
1838 m_initialStateIndex( -1 ) {
1839
1840 if( m_finalState.size( ) > 0 ) a_setupInfo->m_hasFinalStatePhotons = true;
1842
1843 if( a_primaryGamma2d.finalState( ) != "" ) {
1844 std::map<std::string,int>::iterator iter = a_setupInfo->m_stateNamesToIndices.find( a_primaryGamma2d.finalState( ) );
1845 if( iter == a_setupInfo->m_stateNamesToIndices.end( ) ) {
1846 std::string message( "Branching1d: final state not found: pid = '" + a_primaryGamma2d.finalState( ) + "'." );
1847 throw std::runtime_error( message.c_str( ) );
1848 }
1849 m_initialStateIndex = iter->second;
1850
1851 a_setupInfo->m_initialStateIndex = m_initialStateIndex;
1852 }
1853}

◆ ~PrimaryGamma2d()

LUPI_HOST_DEVICE MCGIDI::Probabilities::PrimaryGamma2d::~PrimaryGamma2d ( )

Definition at line 1858 of file MCGIDI_functions.cc.

1858 {
1859
1860}

Referenced by ~PrimaryGamma2d().

Member Function Documentation

◆ evaluate()

LUPI_HOST_DEVICE double MCGIDI::Probabilities::PrimaryGamma2d::evaluate ( double a_x2,
double a_x1 ) const

Definition at line 1864 of file MCGIDI_functions.cc.

1864 {
1865
1866 double energy_out = m_primaryEnergy + a_x2 * m_massFactor;
1867
1868// FIXME. I think this is correct but is it what we want.
1869 if( energy_out == a_x1 ) return( 1.0 );
1870 return( 0.0 );
1871}

Referenced by evaluate().

◆ finalState()

String const & MCGIDI::Probabilities::PrimaryGamma2d::finalState ( ) const
inline

Returns a const reference to the m_finalState member.

Definition at line 563 of file MCGIDI_functions.hpp.

Referenced by PrimaryGamma2d().

◆ initialStateIndex()

int MCGIDI::Probabilities::PrimaryGamma2d::initialStateIndex ( ) const
inline

Returns the value of the m_initialStateIndex member.

Definition at line 564 of file MCGIDI_functions.hpp.

◆ massFactor()

double MCGIDI::Probabilities::PrimaryGamma2d::massFactor ( ) const
inline

Returns the value of the m_massFactor member.

Definition at line 562 of file MCGIDI_functions.hpp.

◆ primaryEnergy()

double MCGIDI::Probabilities::PrimaryGamma2d::primaryEnergy ( ) const
inline

Returns the value of the m_primaryEnergy member.

Definition at line 561 of file MCGIDI_functions.hpp.

◆ sample()

template<typename RNG>
LUPI_HOST_DEVICE double MCGIDI::Probabilities::PrimaryGamma2d::sample ( double a_x2,
LUPI_maybeUnused double a_rngValue,
LUPI_maybeUnused RNG && a_rng ) const
inline

Definition at line 568 of file MCGIDI_functions.hpp.

568{ return( m_primaryEnergy + a_x2 * m_massFactor ); }

◆ serialize()

LUPI_HOST_DEVICE void MCGIDI::Probabilities::PrimaryGamma2d::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 1881 of file MCGIDI_functions.cc.

1881 {
1882
1883 ProbabilityBase2d::serialize( a_buffer, a_mode );
1884 DATA_MEMBER_DOUBLE( m_primaryEnergy, a_buffer, a_mode );
1885 DATA_MEMBER_DOUBLE( m_massFactor, a_buffer, a_mode );
1886 DATA_MEMBER_STRING( m_finalState, a_buffer, a_mode );
1887 DATA_MEMBER_INT( m_initialStateIndex, a_buffer, a_mode );
1888}
#define DATA_MEMBER_STRING(member, buf, mode)
#define DATA_MEMBER_DOUBLE(member, buf, mode)
#define DATA_MEMBER_INT( member, buf, mode)
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)

Referenced by serialize().


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