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

#include <MCGIDI.hpp>

Public Member Functions

LUPI_HOST_DEVICE MultiGroupGain ()
LUPI_HOST MultiGroupGain (int a_particleIntid, int a_particleIndex, GIDI::Vector const &a_gain)
LUPI_HOST MultiGroupGainoperator= (MultiGroupGain const &a_multiGroupGain)
LUPI_HOST_DEVICE int particleIntid () const
LUPI_HOST_DEVICE int particleIndex () const
LUPI_HOST_DEVICE int userParticleIndex () const
LUPI_HOST void setUserParticleIndex (int a_particleIndex, int a_userParticleIndex)
LUPI_HOST void setUserParticleIndexViaIntid (int a_particleIntid, int a_userParticleIndex)
LUPI_HOST_DEVICE Vector< double > const & gain () const
LUPI_HOST_DEVICE double gain (std::size_t a_hashIndex) const
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST void write (FILE *a_file) const

Detailed Description

This class store a particles index and gain for a protare.

Definition at line 753 of file MCGIDI.hpp.

Constructor & Destructor Documentation

◆ MultiGroupGain() [1/2]

LUPI_HOST_DEVICE MCGIDI::MultiGroupGain::MultiGroupGain ( )

Definition at line 1506 of file MCGIDI_heatedCrossSections.cc.

1506 :
1507 m_particleIntid( -1 ),
1508 m_particleIndex( -1 ),
1509 m_userParticleIndex( -1 ) {
1510
1511}

Referenced by operator=().

◆ MultiGroupGain() [2/2]

LUPI_HOST MCGIDI::MultiGroupGain::MultiGroupGain ( int a_particleIntid,
int a_particleIndex,
GIDI::Vector const & a_gain )

Definition at line 1516 of file MCGIDI_heatedCrossSections.cc.

1516 :
1517 m_particleIntid( a_particleIntid ),
1518 m_particleIndex( a_particleIndex ),
1519 m_userParticleIndex( -1 ),
1520 m_gain( GIDI_VectorDoublesToMCGIDI_VectorDoubles( a_gain ) ) {
1521
1522}
LUPI_HOST Vector< double > GIDI_VectorDoublesToMCGIDI_VectorDoubles(GIDI::Vector a_vector)

Member Function Documentation

◆ gain() [1/2]

LUPI_HOST_DEVICE Vector< double > const & MCGIDI::MultiGroupGain::gain ( ) const
inline

Definition at line 776 of file MCGIDI.hpp.

776{ return( m_gain ); }

Referenced by operator=().

◆ gain() [2/2]

LUPI_HOST_DEVICE double MCGIDI::MultiGroupGain::gain ( std::size_t a_hashIndex) const
inline

Definition at line 777 of file MCGIDI.hpp.

777{ return( m_gain[a_hashIndex] ); }

◆ operator=()

LUPI_HOST MultiGroupGain & MCGIDI::MultiGroupGain::operator= ( MultiGroupGain const & a_multiGroupGain)
Parameters
a_multiGroupGain[in] The MultiGroupGain whose contents are to be copied.

Definition at line 1528 of file MCGIDI_heatedCrossSections.cc.

1528 {
1529
1530 m_particleIntid = a_multiGroupGain.particleIntid( );
1531 m_particleIndex = a_multiGroupGain.particleIndex( );
1532 m_userParticleIndex = a_multiGroupGain.userParticleIndex( );
1533 m_gain = a_multiGroupGain.gain( );
1534
1535 return( *this );
1536}

◆ particleIndex()

LUPI_HOST_DEVICE int MCGIDI::MultiGroupGain::particleIndex ( ) const
inline

Returns the value of the m_particleIndex member of this.

Definition at line 768 of file MCGIDI.hpp.

Referenced by operator=().

◆ particleIntid()

LUPI_HOST_DEVICE int MCGIDI::MultiGroupGain::particleIntid ( ) const
inline

Returns the value of the m_particleIntid member of this.

Definition at line 767 of file MCGIDI.hpp.

Referenced by operator=().

◆ serialize()

LUPI_HOST_DEVICE void MCGIDI::MultiGroupGain::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 1546 of file MCGIDI_heatedCrossSections.cc.

1546 {
1547
1548 DATA_MEMBER_INT( m_particleIntid, a_buffer, a_mode );
1549 DATA_MEMBER_INT( m_particleIndex, a_buffer, a_mode );
1550 DATA_MEMBER_INT( m_userParticleIndex, a_buffer, a_mode );
1551 DATA_MEMBER_VECTOR_DOUBLE( m_gain, a_buffer, a_mode );
1552}
#define DATA_MEMBER_VECTOR_DOUBLE(member, buf, mode)
#define DATA_MEMBER_INT( member, buf, mode)

◆ setUserParticleIndex()

LUPI_HOST void MCGIDI::MultiGroupGain::setUserParticleIndex ( int a_particleIndex,
int a_userParticleIndex )
inline

Sets member m_userParticleIndex to a_userParticleIndex if particle's index matchs m_particleIndex.

Definition at line 770 of file MCGIDI.hpp.

◆ setUserParticleIndexViaIntid()

LUPI_HOST void MCGIDI::MultiGroupGain::setUserParticleIndexViaIntid ( int a_particleIntid,
int a_userParticleIndex )
inline

Sets member m_userParticleIntid to a_userParticleIndex if particle's intid matchs m_particleIntid.

Definition at line 773 of file MCGIDI.hpp.

◆ userParticleIndex()

LUPI_HOST_DEVICE int MCGIDI::MultiGroupGain::userParticleIndex ( ) const
inline

Returns the value of the m_userParticleIndex member of this.

Definition at line 769 of file MCGIDI.hpp.

Referenced by operator=().

◆ write()

LUPI_HOST void MCGIDI::MultiGroupGain::write ( FILE * a_file) const

This method writes the multi-group data.

Parameters
a_file[in] The buffer to read or write data to depending on a_mode.

Definition at line 1560 of file MCGIDI_heatedCrossSections.cc.

1560 {
1561
1562 std::string buffer = LUPI::Misc::argumentsToString( "Gain for particle %d (%d, %d)", m_particleIntid, m_particleIndex, m_userParticleIndex );
1563 writeVector( a_file, buffer, 0, m_gain );
1564}
std::string argumentsToString(char const *a_format,...)
Definition LUPI_misc.cc:305

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