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

#include <MCGIDI.hpp>

Public Member Functions

LUPI_HOST_DEVICE ACE_URR_probabilityTable ()
LUPI_HOST ACE_URR_probabilityTable (double a_energy, std::vector< double > const &a_propabilities, std::vector< double > const &a_crossSection)
LUPI_HOST_DEVICE ~ACE_URR_probabilityTable ()
LUPI_HOST_DEVICE double energy () const
LUPI_HOST_DEVICE double sample (double a_rng_Value)
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)

Public Attributes

double m_energy
Vector< double > m_propabilities
Vector< double > m_crossSections

Detailed Description

Class to store ACE URR probability table at one projectile energy for one type of reaction (e.g., total, elastic).

Definition at line 477 of file MCGIDI.hpp.

Constructor & Destructor Documentation

◆ ACE_URR_probabilityTable() [1/2]

LUPI_HOST_DEVICE MCGIDI::ACE_URR_probabilityTable::ACE_URR_probabilityTable ( )

Simple constructor needed for broadcasting.

Definition at line 97 of file MCGIDI_URR.cc.

97 :
98 m_energy( 0.0 ) {
99
100}

◆ ACE_URR_probabilityTable() [2/2]

LUPI_HOST MCGIDI::ACE_URR_probabilityTable::ACE_URR_probabilityTable ( double a_energy,
std::vector< double > const & a_propabilities,
std::vector< double > const & a_crossSection )
Parameters
a_energy[in] The projectile energy where the data are specified.
a_propabilities[in] The probability for each cross section.
a_crossSection[in] The cross section for each probability.

Definition at line 108 of file MCGIDI_URR.cc.

109 :
110 m_energy( a_energy ),
111 m_propabilities( a_propabilities ),
112 m_crossSections( a_crossSection ) {
113
114 double sum = 0.0;
115 for( std::size_t index = 0; index < m_propabilities.size( ); ++index ) {
116 sum += m_propabilities[index];
117 m_propabilities[index] = sum;
118 }
119 m_propabilities[m_propabilities.size( )-1] = 1.0;
120}
Vector< double > m_propabilities
Definition MCGIDI.hpp:481
Vector< double > m_crossSections
Definition MCGIDI.hpp:482

◆ ~ACE_URR_probabilityTable()

LUPI_HOST_DEVICE MCGIDI::ACE_URR_probabilityTable::~ACE_URR_probabilityTable ( )

Simple constructor needed for broadcasting.

Definition at line 126 of file MCGIDI_URR.cc.

126 {
127
128}

Member Function Documentation

◆ energy()

LUPI_HOST_DEVICE double MCGIDI::ACE_URR_probabilityTable::energy ( ) const
inline

Definition at line 488 of file MCGIDI.hpp.

488{ return( m_energy ); }

Referenced by MCGIDI::ACE_URR_probabilityTables::push_back().

◆ sample()

LUPI_HOST_DEVICE double MCGIDI::ACE_URR_probabilityTable::sample ( double a_rng_Value)

Returns the cross section corresponding to the probability a_rng_Value.

Parameters
a_rng_Value[in] A random number in the range [0,1).
Returns
The cross section associated with probability a_rng_Value;

Definition at line 138 of file MCGIDI_URR.cc.

138 {
139
140 int intIndex = binarySearchVector( a_rng_Value, m_propabilities, true );
141 std::size_t index = static_cast<std::size_t>( intIndex );
142 if( m_propabilities[index] < a_rng_Value ) ++index;
143 return( m_crossSections[index] );
144}
LUPI_HOST_DEVICE int binarySearchVector(double a_x, Vector< double > const &a_Xs, bool a_boundIndex=false)
Definition MCGIDI.hpp:318

◆ serialize()

LUPI_HOST_DEVICE void MCGIDI::ACE_URR_probabilityTable::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 154 of file MCGIDI_URR.cc.

154 {
155
156 DATA_MEMBER_DOUBLE( m_energy, a_buffer, a_mode );
157 DATA_MEMBER_VECTOR_DOUBLE( m_propabilities, a_buffer, a_mode );
158 DATA_MEMBER_VECTOR_DOUBLE( m_crossSections, a_buffer, a_mode );
159}
#define DATA_MEMBER_VECTOR_DOUBLE(member, buf, mode)
#define DATA_MEMBER_DOUBLE(member, buf, mode)

Referenced by MCGIDI::ACE_URR_probabilityTables::serialize().

Member Data Documentation

◆ m_crossSections

Vector<double> MCGIDI::ACE_URR_probabilityTable::m_crossSections

The cross section for each probability.

Definition at line 482 of file MCGIDI.hpp.

Referenced by ACE_URR_probabilityTable(), sample(), and serialize().

◆ m_energy

double MCGIDI::ACE_URR_probabilityTable::m_energy

The projectile energy where the data are specified.

Definition at line 480 of file MCGIDI.hpp.

Referenced by ACE_URR_probabilityTable(), ACE_URR_probabilityTable(), energy(), and serialize().

◆ m_propabilities

Vector<double> MCGIDI::ACE_URR_probabilityTable::m_propabilities

The probability for each cross section.

Definition at line 481 of file MCGIDI.hpp.

Referenced by ACE_URR_probabilityTable(), sample(), and serialize().


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