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

#include <MCGIDI_functions.hpp>

Inheritance diagram for MCGIDI::Probabilities::ProbabilityBase3d:

Public Member Functions

LUPI_HOST_DEVICE ProbabilityBase3d ()
LUPI_HOST ProbabilityBase3d (GIDI::Functions::FunctionForm const &a_probabilty, Vector< double > const &a_Xs)
LUPI_HOST_DEVICE ~ProbabilityBase3d ()
LUPI_HOST_DEVICE ProbabilityBase3dType type () const
LUPI_HOST_DEVICE String typeString () const
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION double evaluate (double a_x3, double a_x2, double a_x1) const MCGIDI_TRUE_VIRTUAL
template<typename RNG>
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION double sample (double a_x3, double a_x2_1, double a_x2_2, 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_x3, double a_x2_1, double a_x2_2, 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

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

Detailed Description

Definition at line 735 of file MCGIDI_functions.hpp.

Constructor & Destructor Documentation

◆ ProbabilityBase3d() [1/2]

LUPI_HOST_DEVICE MCGIDI::Probabilities::ProbabilityBase3d::ProbabilityBase3d ( )

◆ ProbabilityBase3d() [2/2]

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

Definition at line 2363 of file MCGIDI_functions.cc.

2363 :
2364 ProbabilityBase( a_probability, a_Xs ),
2366
2367}

◆ ~ProbabilityBase3d()

LUPI_HOST_DEVICE MCGIDI::Probabilities::ProbabilityBase3d::~ProbabilityBase3d ( )

Definition at line 2372 of file MCGIDI_functions.cc.

2372 {
2373
2374}

Member Function Documentation

◆ evaluate()

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

Returns the value of the function f(x3, x2, x1) at x3 = a_x3, x2 = a_x2 and x1 = a_x1.

Parameters
a_x3[in] The x3 value.
a_x2[in] The x2 value.
a_x1[in] The x1 value.
Returns
The value of the function at a_x1.

Definition at line 2408 of file MCGIDI_functions.cc.

2408 {
2409
2410 return( static_cast<XYs3d const *>( this )->evaluate( a_x3, a_x2, a_x1 ) );
2411}
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION double evaluate(double a_x3, double a_x2, double a_x1) const MCGIDI_TRUE_VIRTUAL

Referenced by evaluate().

◆ sample() [1/2]

template<typename RNG>
LUPI_HOST_DEVICE double MCGIDI::Probabilities::ProbabilityBase3d::sample ( double a_x3,
double a_x2_1,
double a_x2_2,
double a_rngValue,
RNG && a_rng ) const

This method samples an x1 from a pdf(x1|x2) given x2 and the cumulative value of the pdf as a_rngValue.

Parameters
a_x3[in] The value of x3.
a_x2_1[in] The value of ?.
a_x2_2[in] The value of ?.
a_rngValue[in] The value of the cumulative used to determine the x1 value.
a_rng[in] The random number generator function that returns a double in the range [0, 1.0).

Definition at line 2122 of file MCGIDI_headerSource.hpp.

2122 {
2123
2124 return( static_cast<XYs3d const *>( this )->sample( a_x3, a_x2_1, a_x2_2, a_rngValue, a_rng ) );
2125}
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION double sample(double a_x3, double a_x2_1, double a_x2_2, 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::ProbabilityBase3d::sample ( double a_x3,
double a_x2_1,
double a_x2_2,
double a_rngValue,
RNG && a_rng ) const

Referenced by sample().

◆ serialize()

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

2421 {
2422
2423 ProbabilityBase::serialize( a_buffer, a_mode );
2424
2425 int type = 0;
2426 if( a_mode != LUPI::DataBuffer::Mode::Unpack ) {
2427 switch( m_type ) {
2429 break;
2431 type = 1;
2432 break;
2433 }
2434 }
2435 DATA_MEMBER_INT( type, a_buffer, a_mode );
2436 if( a_mode == LUPI::DataBuffer::Mode::Unpack ) {
2437 switch( type ) {
2438 case 0 :
2440 break;
2441 case 1 :
2443 break;
2444 }
2445 }
2446}
#define DATA_MEMBER_INT( member, buf, mode)
LUPI_HOST_DEVICE ProbabilityBase3dType type() const
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)

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

◆ type()

LUPI_HOST_DEVICE ProbabilityBase3dType MCGIDI::Probabilities::ProbabilityBase3d::type ( ) const
inline

Definition at line 745 of file MCGIDI_functions.hpp.

745{ return m_type; }

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

◆ typeString()

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

Returns a String representation of the ProbabilityBase3d type of this.

Returns
A String instance.

Definition at line 2382 of file MCGIDI_functions.cc.

2382 {
2383
2384 String typeStr( "ProbabilityBase3d::" );
2385
2386 switch( m_type ) {
2388 typeStr += "none";
2389 break;
2391 typeStr += "XYs";
2392 break;
2393 }
2394
2395 return( typeStr );
2396}

Member Data Documentation

◆ m_type


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