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

#include <MCGIDI.hpp>

Public Member Functions

LUPI_HOST_DEVICE GRIN_captureToCompound ()
LUPI_HOST GRIN_captureToCompound (SetupInfo &a_setupInfo, PoPI::Database const &a_pops, std::string a_compoundId)
LUPI_HOST_DEVICE ~GRIN_captureToCompound ()
LUPI_HOST_DEVICE std::size_t index () const
template<typename RNG>
LUPI_HOST_DEVICE int sampleCaptureLevel (ProtareSingle const *a_protare, double a_energy, RNG &&a_rng, bool a_checkEnergy) const
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)

Detailed Description

This class represents

Definition at line 1090 of file MCGIDI.hpp.

Constructor & Destructor Documentation

◆ GRIN_captureToCompound() [1/2]

LUPI_HOST_DEVICE MCGIDI::GRIN_captureToCompound::GRIN_captureToCompound ( )

Definition at line 314 of file MCGIDI_GRIN.cc.

314 {
315
316}

◆ GRIN_captureToCompound() [2/2]

LUPI_HOST MCGIDI::GRIN_captureToCompound::GRIN_captureToCompound ( SetupInfo & a_setupInfo,
PoPI::Database const & a_pops,
std::string a_compoundId )
Parameters
a_setupInfo[in] Used internally when constructing a Protare to pass information to other constructors.
a_compoundId[in] The GNDS PoPs' id of the compound level.

Definition at line 323 of file MCGIDI_GRIN.cc.

323 :
324 m_index( static_cast<std::size_t>( a_setupInfo.m_stateNamesToIndices[a_compoundId] ) ),
325 m_continuumIndices( ) {
326
327 PoPI::Nuclide const &nuclide = a_pops.get<PoPI::Nuclide const>( a_compoundId );
328
329 PoPI::GammaDecayData const &gammaDecayData = nuclide.gammaDecayData( );
330 auto ids = gammaDecayData.ids( );
331 auto probabilities1 = gammaDecayData.probabilities( );
332
333 std::vector<int> levels;
334 levels.reserve( ids.size( ) );
335 std::vector<double> probabilities2;
336 probabilities2.reserve( ids.size( ) );
337 for( std::size_t index = 0; index < ids.size( ); ++index ) {
338 PoPI::Nuclide const &daughter = a_pops.get<PoPI::Nuclide const>( ids[index] );
339 if( daughter.kind( ) != PoPI_continuumChars ) continue;
340 levels.push_back( a_setupInfo.m_stateNamesToIndices[ids[index]] );
341 probabilities2.push_back( probabilities1[index] );
342 }
343 m_continuumIndices.set( levels, probabilities2 );
344}
#define PoPI_continuumChars
Definition PoPI.hpp:99
LUPI_HOST_DEVICE std::size_t index() const
Definition MCGIDI.hpp:1101
std::string const & kind() const
Definition PoPI.hpp:1011

◆ ~GRIN_captureToCompound()

LUPI_HOST_DEVICE MCGIDI::GRIN_captureToCompound::~GRIN_captureToCompound ( )

Definition at line 349 of file MCGIDI_GRIN.cc.

349 {
350
351}

Member Function Documentation

◆ index()

LUPI_HOST_DEVICE std::size_t MCGIDI::GRIN_captureToCompound::index ( ) const
inline

Definition at line 1101 of file MCGIDI.hpp.

1101{ return( m_index ); }

Referenced by GRIN_captureToCompound(), and sampleCaptureLevel().

◆ sampleCaptureLevel()

template<typename RNG>
LUPI_HOST_DEVICE int MCGIDI::GRIN_captureToCompound::sampleCaptureLevel ( ProtareSingle const * a_protare,
double a_energy,
RNG && a_rng,
bool a_checkEnergy ) const
inline

This method samples a capture state level and returns an index into the a_protare->m_nuclideGammaBranchStateInfos vector of the sampled state level.

Parameters
a_energy[in] The neutron separation energy plus the projectile energy.
a_rng[in] The random number generator function that returns a double in the range [0, 1.0).
Returns
An integer of the sampled state in a_protare->m_nuclideGammaBranchStateInfos.

Definition at line 3180 of file MCGIDI_headerSource.hpp.

3181 {
3182
3183 if( a_checkEnergy ) {
3184 NuclideGammaBranchStateInfo *nuclideGammaBranchStateInfo = a_protare->nuclideGammaBranchStateInfos( )[m_index];
3185 if( nuclideGammaBranchStateInfo->nuclearLevelEnergy( ) < a_energy ) return( -1 );
3186 }
3187
3188 double random = a_rng( );
3189 std::size_t index = 0;
3190 for( ; index < m_continuumIndices.m_levels.size( ) - 1; ++index ) {
3191 if( m_continuumIndices.m_summedProbabilities[index] >= random ) break;
3192 }
3193 return( m_continuumIndices.m_levels[index] );
3194}

Referenced by MCGIDI::GRIN_captureLevelProbability::sampleCaptureLevel().

◆ serialize()

LUPI_HOST_DEVICE void MCGIDI::GRIN_captureToCompound::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 361 of file MCGIDI_GRIN.cc.

361 {
362
363 DATA_MEMBER_SIZE_T( m_index, a_buffer, a_mode );
364 m_continuumIndices.serialize( a_buffer, a_mode );
365}
#define DATA_MEMBER_SIZE_T(member, buf, mode)

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