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

#include <MCGIDI_functions.hpp>

Inheritance diagram for MCGIDI::Probabilities::ProbabilityBase2d_d1:

Public Member Functions

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 420 of file MCGIDI_functions.hpp.

Constructor & Destructor Documentation

◆ ProbabilityBase2d_d1() [1/3]

◆ ProbabilityBase2d_d1() [2/3]

LUPI_HOST MCGIDI::Probabilities::ProbabilityBase2d_d1::ProbabilityBase2d_d1 ( GIDI::Functions::FunctionForm const & a_probabilty)
inline

Definition at line 425 of file MCGIDI_functions.hpp.

425 :
426 ProbabilityBase2d( a_probabilty ) { }

◆ ProbabilityBase2d_d1() [3/3]

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

Definition at line 427 of file MCGIDI_functions.hpp.

427 :
428 ProbabilityBase2d( a_probabilty, a_Xs ) { }

Member Function Documentation

◆ evaluate()

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

Returns the value of the function evaluated at the point (a_x2, a_x1).

Parameters
a_x2[in] Value of the outer most independent variable (i.e., x2).
a_x1[in] Value of the inner most independent variable (i.e., x1).
Returns
The value of the function at a_x2 and a_x1.

Definition at line 1522 of file MCGIDI_functions.cc.

1522 {
1523
1524 double value = 0.0;
1525
1526 switch( type( ) ) {
1537 value = static_cast<ProbabilityBase2d_d2 const *>( this )->evaluate( a_x2, a_x1 );
1538 break;
1540 value = static_cast<Regions2d const *>( this )->evaluate( a_x2, a_x1 );
1541 break;
1544 LUPI_THROW( "ProbabilityBase2d_d1::evaluate: This should never happen." );
1545 }
1546
1547 return( value );
1548}
#define LUPI_THROW(arg)
LUPI_HOST_DEVICE double evaluate(double a_x2, double a_x1) const
LUPI_HOST_DEVICE ProbabilityBase2dType type() const

Referenced by evaluate().

◆ sample()

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

Returns the value of x1, given x2 and the cumulative probability a_rngValue.

Parameters
a_x2[in] Value of the outer most independent variable (i.e., x2).
a_rngValue[in] The value of the cumulative probability used to determine the x1 value.
a_rng[in] The random number generator function that returns a double in the range [0, 1.0).
Returns
The value x1 where the cumulative probability is a_rngValue for x2 = a_x2.

Definition at line 1732 of file MCGIDI_headerSource.hpp.

1732 {
1733
1734 double value = 0.0;
1735
1736 switch( type( ) ) {
1747 value = static_cast<ProbabilityBase2d_d2 const *>( this )->sample( a_x2, a_rngValue, a_rng );
1748 break;
1750 value = static_cast<Regions2d const *>( this )->sample( a_x2, a_rngValue, a_rng );
1751 break;
1754 LUPI_THROW( "ProbabilityBase2d_d1::sample: This should never happen." );
1755 }
1756
1757 return( value );
1758}
LUPI_HOST_DEVICE double sample(double a_x2, double a_rngValue, RNG &&a_rng) const

Referenced by sample().

◆ sample2dOf3d()

template<typename RNG>
LUPI_HOST_DEVICE double MCGIDI::Probabilities::ProbabilityBase2d_d1::sample2dOf3d ( double a_x2,
double a_rngValue,
RNG && a_rng,
double * a_x1_1,
double * a_x1_2 ) const

This method returns two x1 values for use with ProbabilityBase3d functions.

Parameters
a_x2[in] The value of x2.
a_rngValue[in] The value of the cumulative value used to determine the x1 value.
a_rng[in] The random number generator function that returns a double in the range [0, 1.0).
a_x1_1[in] The lower value of the x1 value.
a_x1_2[in] The upper value of the x1 value.

Definition at line 1771 of file MCGIDI_headerSource.hpp.

1772 {
1773
1774 double value = 0.0;
1775
1776 switch( type( ) ) {
1778 value = static_cast<XYs2d const *>( this )->sample2dOf3d( a_x2, a_rngValue, a_rng, a_x1_1, a_x1_2 );
1779 break;
1780 default:
1781 LUPI_THROW( "ProbabilityBase2d_d1::sample2dOf3d: not implemented." );
1782 }
1783
1784 return( value );
1785}
LUPI_HOST_DEVICE double sample2dOf3d(double a_x2, double a_rngValue, RNG &&a_rng, double *a_x1_1, double *a_x1_2) const

Referenced by sample2dOf3d().


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