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

#include <MCGIDI_functions.hpp>

Inheritance diagram for MCGIDI::Probabilities::ProbabilityBase1d:

Public Member Functions

LUPI_HOST_DEVICE ProbabilityBase1d ()
LUPI_HOST ProbabilityBase1d (GIDI::Functions::FunctionForm const &a_probabilty, Vector< double > const &a_Xs)
LUPI_HOST_DEVICE ~ProbabilityBase1d ()
LUPI_HOST_DEVICE ProbabilityBase1dType type () const
LUPI_HOST_DEVICE String typeString () const
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION double evaluate (double a_x1) const MCGIDI_TRUE_VIRTUAL
template<typename RNG>
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION double sample (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_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)

Protected Attributes

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

Detailed Description

Definition at line 349 of file MCGIDI_functions.hpp.

Constructor & Destructor Documentation

◆ ProbabilityBase1d() [1/2]

LUPI_HOST_DEVICE MCGIDI::Probabilities::ProbabilityBase1d::ProbabilityBase1d ( )

◆ ProbabilityBase1d() [2/2]

LUPI_HOST MCGIDI::Probabilities::ProbabilityBase1d::ProbabilityBase1d ( GIDI::Functions::FunctionForm const & a_probabilty,
Vector< double > const & a_Xs )

Definition at line 1239 of file MCGIDI_functions.cc.

1239 :
1240 ProbabilityBase( a_probability, a_Xs ),
1242
1243}

◆ ~ProbabilityBase1d()

LUPI_HOST_DEVICE MCGIDI::Probabilities::ProbabilityBase1d::~ProbabilityBase1d ( )

Definition at line 1248 of file MCGIDI_functions.cc.

1248 {
1249
1250}

Member Function Documentation

◆ evaluate()

LUPI_HOST_DEVICE double MCGIDI::Probabilities::ProbabilityBase1d::evaluate ( double a_x1) const

Returns the value of the function at a_x1.

Parameters
a_x1[in] The x-value to evaluate the function at.
Returns
The value of the function at a_x1.

Definition at line 1282 of file MCGIDI_functions.cc.

1282 {
1283
1284 return( static_cast<Xs_pdf_cdf1d const *>( this )->evaluate( a_x1 ) );
1285}
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION double evaluate(double a_x1) const MCGIDI_TRUE_VIRTUAL

Referenced by evaluate().

◆ sample() [1/2]

template<typename RNG>
LUPI_HOST_DEVICE double MCGIDI::Probabilities::ProbabilityBase1d::sample ( double a_rngValue,
RNG && a_rng ) const

Returns the x-value corresponding cumulative probability a_rngValue.

Parameters
a_rngValue[in] The x-value to evaluate the function at.
a_rng[in] The random number generator function that returns a double in the range [0, 1.0).
Returns
The value of the function at a_x1.

Definition at line 1647 of file MCGIDI_headerSource.hpp.

1647 {
1648
1649 return( static_cast<Xs_pdf_cdf1d const *>( this )->sample( a_rngValue, a_rng ) );
1650}
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION double sample(double a_rngValue, RNG &&a_rng) const MCGIDI_TRUE_VIRTUAL

◆ sample() [2/2]

template<typename RNG>
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION double MCGIDI::Probabilities::ProbabilityBase1d::sample ( double a_rngValue,
RNG && a_rng ) const

Referenced by sample().

◆ serialize()

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

1295 {
1296
1297 ProbabilityBase::serialize( a_buffer, a_mode );
1298
1299 int type = 0;
1300
1301 if( a_mode != LUPI::DataBuffer::Mode::Unpack ) {
1302 switch( m_type ) {
1304 break;
1306 type = 1;
1307 break;
1308 }
1309 }
1310
1311 DATA_MEMBER_INT( type, a_buffer, a_mode );
1312
1313 if( a_mode == LUPI::DataBuffer::Mode::Unpack ) {
1314 switch( type ) {
1315 case 0 :
1317 break;
1318 case 1 :
1320 break;
1321 }
1322 }
1323}
#define DATA_MEMBER_INT( member, buf, mode)
LUPI_HOST_DEVICE ProbabilityBase1dType type() const
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)

Referenced by MCGIDI::Probabilities::Xs_pdf_cdf1d::serialize().

◆ type()

LUPI_HOST_DEVICE ProbabilityBase1dType MCGIDI::Probabilities::ProbabilityBase1d::type ( ) const
inline

Definition at line 359 of file MCGIDI_functions.hpp.

359{ return m_type; }

Referenced by MCGIDI::ProbabilityBase1dClass(), and serialize().

◆ typeString()

LUPI_HOST_DEVICE String MCGIDI::Probabilities::ProbabilityBase1d::typeString ( ) const

Returns a String representation of the ProbabilityBase1d type of this.

Returns
A String instance.

Definition at line 1258 of file MCGIDI_functions.cc.

1258 {
1259
1260 String typeStr( "ProbabilityBase1d::" );
1261
1262 switch( m_type ) {
1264 typeStr += "none";
1265 break;
1267 typeStr += "xs_pdf_cdf";
1268 break;
1269 }
1270
1271 return( typeStr );
1272}

Member Data Documentation

◆ m_type


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