Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
GIDI::RISI::Reaction Class Reference

#include <RISI.hpp>

Public Member Functions

 Reaction (double a_effectiveThreshold, std::vector< std::string > const &a_products, std::vector< int > const &a_multiplicities, std::vector< std::string > const &a_intermediates, std::string const &a_process, std::string const &reactionLabel, std::string const &convarianceFlag)
bool isFission () const
int multiplicity (std::string const &a_productId) const
void products (double a_energyMax, std::set< std::string > &a_products) const
void printAsRIS_file (int a_labelWidth) const

Public Attributes

double m_effectiveThreshold
std::vector< std::string > m_products
std::vector< int > m_multiplicities
std::vector< std::string > m_intermediates
std::string m_process
std::string m_reactionLabel
std::string m_convarianceFlag

Detailed Description

Class to store a reaction for a reaction information summary RIS.

Definition at line 24 of file RISI.hpp.

Constructor & Destructor Documentation

◆ Reaction()

GIDI::RISI::Reaction::Reaction ( double a_effectiveThreshold,
std::vector< std::string > const & a_products,
std::vector< int > const & a_multiplicities,
std::vector< std::string > const & a_intermediates,
std::string const & a_process,
std::string const & reactionLabel,
std::string const & convarianceFlag )
Parameters
a_effectiveThreshold[in] The effective threshold for the reaction.
a_products[in] The list of final products for the reaction.
a_multiplicities[in] The multiplicities for each product in a_products.
a_intermediates[in] The list of intermediates products for the reaction.
a_process[in] The process for the reaction.

Definition at line 37 of file RISI_read.cc.

39 :
40 m_effectiveThreshold( a_effectiveThreshold ),
41 m_products( a_products ),
42 m_multiplicities( a_multiplicities ),
43 m_intermediates( a_intermediates ),
44 m_process( a_process ),
45 m_reactionLabel( reactionLabel ),
46 m_convarianceFlag( convarianceFlag ) {
47
48}
std::vector< int > m_multiplicities
Definition RISI.hpp:29
std::vector< std::string > m_products
Definition RISI.hpp:28
std::vector< std::string > m_intermediates
Definition RISI.hpp:30
std::string m_reactionLabel
Definition RISI.hpp:32
std::string m_convarianceFlag
Definition RISI.hpp:33
double m_effectiveThreshold
Definition RISI.hpp:27
std::string m_process
Definition RISI.hpp:31

Member Function Documentation

◆ isFission()

bool GIDI::RISI::Reaction::isFission ( ) const

Returns true if the reaction process contains 'fission' (case-insensitive).

Returns
True if this is a fission reaction, false otherwise.

Definition at line 56 of file RISI_read.cc.

56 {
57
58 std::string processLower = m_process;
59 std::transform(processLower.begin(), processLower.end(), processLower.begin(), ::tolower);
60 return processLower.find("fission") != std::string::npos;
61}

◆ multiplicity()

int GIDI::RISI::Reaction::multiplicity ( std::string const & a_productId) const

Returns the multiplicity for the specified product ID.

Parameters
a_productId[in] The product ID to look up.
Returns
The multiplicity of the specified product, -1 if multiplicity is energy-dependent, or 0 if not found.

Definition at line 70 of file RISI_read.cc.

70 {
71
72 for( std::size_t index = 0; index < m_products.size( ); ++index ) {
73 if( m_products[index] == a_productId ) {
74 if( m_multiplicities[index] == 0 ) {
75 return -1;
76 }
77 return m_multiplicities[index];
78 }
79 }
80 return 0;
81}

◆ printAsRIS_file()

void GIDI::RISI::Reaction::printAsRIS_file ( int a_labelWidth) const

This method attempts to print this as it appears in a file.

Definition at line 104 of file RISI_read.cc.

104 {
105
106 std::string sep = "";
107 std::string productList;
108 for( std::size_t index = 0; index < m_products.size( ); ++index ) {
109 std::string product = m_products[index];
111 productList += sep + product;
112 sep = " + ";
113 }
114
115 sep = "";
116 std::string intermediates;
117 for( auto iterIntermediate = m_intermediates.begin( ); iterIntermediate != m_intermediates.end( ); ++iterIntermediate ) {
118 intermediates += sep + (*iterIntermediate);
119 sep = " ";
120 }
121
122 std::string effectiveThresholdStr = LUPI::Misc::doubleToShortestString( m_effectiveThreshold, 15, -3 );
123 if( effectiveThresholdStr.find( "e" ) == std::string::npos ) {
124 if( effectiveThresholdStr.find( "." ) == std::string::npos ) {
125 effectiveThresholdStr += ".0";
126 } }
127 else {
128 std::size_t eMinus = effectiveThresholdStr.find( "e-" );
129 if( ( eMinus != std::string::npos ) && ( effectiveThresholdStr.size( ) == eMinus + 3 ) ) {
130 effectiveThresholdStr = effectiveThresholdStr.replace( eMinus, 2, "e-0" );
131 }
132 }
133
134 std::cout << " " << std::left << std::setw( 31 ) << productList
135 << " : " << std::left << std::setw( 12 ) << effectiveThresholdStr
136 << " : " << std::left << std::setw( 10 ) << intermediates
137 << " : " << std::left << std::setw( 9 ) << m_process
138 << " : " << std::left << std::setw( a_labelWidth ) << m_reactionLabel
139 << " : " << m_convarianceFlag << std::endl;
140}
std::string doubleToShortestString(double a_value, int a_significantDigits=15, int a_favorEFormBy=0)
Definition LUPI_misc.cc:349
std::string argumentsToString(char const *a_format,...)
Definition LUPI_misc.cc:305

◆ products()

void GIDI::RISI::Reaction::products ( double a_energyMax,
std::set< std::string > & a_products ) const
Parameters
a_projectile[in] The Projectile instance for the requested projectile.
a_level[in] The current recursive level.
a_maxLevel[in] The maximum recursive level requested by the user.
a_energyMax[in] Only reactions with effective thresholds less than this value are processed.
a_products[in] The list to add additional products to.

Definition at line 93 of file RISI_read.cc.

93 {
94
95 if( m_effectiveThreshold >= a_energyMax ) return;
96
97 for( auto productIter = m_products.begin( ); productIter != m_products.end( ); ++productIter ) a_products.insert( *productIter );
98}

Member Data Documentation

◆ m_convarianceFlag

std::string GIDI::RISI::Reaction::m_convarianceFlag

A flag indicating if covariance data are present for the reaction.

Definition at line 33 of file RISI.hpp.

Referenced by printAsRIS_file(), and Reaction().

◆ m_effectiveThreshold

double GIDI::RISI::Reaction::m_effectiveThreshold

The effective threshold for the reaction.

Definition at line 27 of file RISI.hpp.

Referenced by printAsRIS_file(), products(), and Reaction().

◆ m_intermediates

std::vector<std::string> GIDI::RISI::Reaction::m_intermediates

The list of intermediates products for the reaction.

Definition at line 30 of file RISI.hpp.

Referenced by printAsRIS_file(), and Reaction().

◆ m_multiplicities

std::vector<int> GIDI::RISI::Reaction::m_multiplicities

The multiplicities for each product in m_products.

Definition at line 29 of file RISI.hpp.

Referenced by multiplicity(), printAsRIS_file(), and Reaction().

◆ m_process

std::string GIDI::RISI::Reaction::m_process

The process for the reaction.

Definition at line 31 of file RISI.hpp.

Referenced by isFission(), printAsRIS_file(), and Reaction().

◆ m_products

std::vector<std::string> GIDI::RISI::Reaction::m_products

The list of final products for the reaction.

Definition at line 28 of file RISI.hpp.

Referenced by multiplicity(), printAsRIS_file(), products(), and Reaction().

◆ m_reactionLabel

std::string GIDI::RISI::Reaction::m_reactionLabel

The label of the reaction.

Definition at line 32 of file RISI.hpp.

Referenced by printAsRIS_file(), and Reaction().


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