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

#include <RISI.hpp>

Public Member Functions

 Protare (std::string const &a_projectile, std::string const &a_target, std::string const &a_evaluation, std::string const &a_protareEnergyUnit, std::string const &a_requestedEnergyUnit)
 ~Protare ()
std::string const & projectile ()
std::string const & target ()
std::string const & evaluation ()
std::vector< Reaction * > const & reactions () const
void Oops (std::vector< std::string > const &a_elements)
void addAlias (std::vector< std::string > const &a_elements)
bool fissionPresent () const
void setAddingAliases ()
void addReaction (std::vector< std::string > const &a_elements)
void setAddingReactions ()
void add (std::vector< std::string > const &a_elements)
void products (Projectile const *a_projectile, int a_level, int a_maxLevel, double a_energyMax, std::map< std::string, int > &a_products) const
void printAsRIS_file () const

Detailed Description

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

Definition at line 46 of file RISI.hpp.

Constructor & Destructor Documentation

◆ Protare()

GIDI::RISI::Protare::Protare ( std::string const & a_projectile,
std::string const & a_target,
std::string const & a_evaluation,
std::string const & a_protareEnergyUnit,
std::string const & a_requestedEnergyUnit )
Parameters
a_projectile[in] The PoPs id for the projectile.
a_target[in] The PoPs id for the target.
a_evaluation[in] The evaluation string for the protare.
a_protareEnergyUnit[in] The unit of energy in the RIS file.
a_requestedEnergyUnit[in] The unit of energy specified by the user.

Definition at line 154 of file RISI_read.cc.

155 :
156 m_addMode( 0 ),
157 m_projectile( a_projectile ),
158 m_target( a_target ),
159 m_evaluation( a_evaluation ),
160 m_energyUnit( a_protareEnergyUnit ),
161 m_energyConversionFactor( 1.0 ) {
162
163 if( a_protareEnergyUnit != a_requestedEnergyUnit ) {
164 if( a_protareEnergyUnit == "eV" ) {
165 if( a_requestedEnergyUnit != "MeV" ) throw "RISI::Protare: supported a_requestedEnergyUnit '" + a_requestedEnergyUnit + "'.";
166 m_energyConversionFactor = 1e-6; }
167 else if( a_protareEnergyUnit == "MeV" ) {
168 if( a_requestedEnergyUnit != "eV" ) throw "RISI::Protare: supported a_requestedEnergyUnit '" + a_requestedEnergyUnit + "'.";
169 m_energyConversionFactor = 1e6; }
170 else {
171 throw "RISI::Protare: supported a_protareEnergyUnit '" + a_requestedEnergyUnit + "'.";
172 }
173 }
174}

◆ ~Protare()

GIDI::RISI::Protare::~Protare ( )

Definition at line 179 of file RISI_read.cc.

179 {
180
181 for( auto reactionIter = m_reactions.begin( ); reactionIter != m_reactions.end( ); ++reactionIter ) delete *reactionIter;
182
183}

Member Function Documentation

◆ add()

void GIDI::RISI::Protare::add ( std::vector< std::string > const & a_elements)

Definition at line 253 of file RISI_read.cc.

253 {
254
255 if( m_addMode == 0 ) {
256 Oops( a_elements ); }
257 else if( m_addMode == 1 ) {
258 addAlias( a_elements ); }
259 else if( m_addMode == 2 ) {
260 addReaction( a_elements );
261 }
262}
void addAlias(std::vector< std::string > const &a_elements)
Definition RISI_read.cc:196
void Oops(std::vector< std::string > const &a_elements)
Definition RISI_read.cc:188
void addReaction(std::vector< std::string > const &a_elements)
Definition RISI_read.cc:219

◆ addAlias()

void GIDI::RISI::Protare::addAlias ( std::vector< std::string > const & a_elements)

Definition at line 196 of file RISI_read.cc.

196 {
197
198 std::pair<std::string, std::string> keyName = { a_elements[0], a_elements[1] };
199 m_aliases.push_back( keyName );
200}

Referenced by add().

◆ addReaction()

void GIDI::RISI::Protare::addReaction ( std::vector< std::string > const & a_elements)

Definition at line 219 of file RISI_read.cc.

219 {
220
221 std::vector<std::string> productsString = LUPI::Misc::splitString( a_elements[0], '+', true );
222 double effectiveThreshold = m_energyConversionFactor * std::stod( a_elements[1] );
223 std::vector<std::string> intermediates = LUPI::Misc::splitString( a_elements[2], ' ', true );
224
225 std::string reactionLabel;
226 std::string covarianceFlag;
227
228 if( a_elements.size( ) > 5 ) {
229 reactionLabel = a_elements[4];
230 covarianceFlag = a_elements[5];
231 }
232
233 std::vector<std::string> products;
234 std::vector<int> multiplicities;
235
236 for( auto iter = productsString.begin( ); iter != productsString.end( ); ++iter ) {
237 char *begin = const_cast<char *>( (*iter).c_str( ) ), *end = begin;
238 long multiplicity = 1;
239
240 if( isdigit( begin[0] ) ) {
241 multiplicity = strtol( begin, &end, 10 );
242 }
243 products.push_back( end );
244 multiplicities.push_back( static_cast<int>( multiplicity ) );
245 }
246
247 m_reactions.push_back( new Reaction( effectiveThreshold, products, multiplicities, intermediates, a_elements[3], reactionLabel, covarianceFlag ) );
248}
void products(Projectile const *a_projectile, int a_level, int a_maxLevel, double a_energyMax, std::map< std::string, int > &a_products) const
Definition RISI_read.cc:273
std::vector< std::string > splitString(std::string const &a_string, char a_delimiter, bool a_strip=false)
Definition LUPI_misc.cc:103

Referenced by add().

◆ evaluation()

std::string const & GIDI::RISI::Protare::evaluation ( )
inline

Definition at line 66 of file RISI.hpp.

66{ return( m_evaluation ); }

◆ fissionPresent()

bool GIDI::RISI::Protare::fissionPresent ( ) const

Returns true if any reaction in this protare is a fission reaction.

Returns
True if fission reactions are present, false otherwise.

Definition at line 208 of file RISI_read.cc.

208 {
209
210 for( auto reactionIter = m_reactions.begin( ); reactionIter != m_reactions.end( ); ++reactionIter ) {
211 if( (*reactionIter)->isFission( ) ) return true;
212 }
213 return false;
214}

◆ Oops()

void GIDI::RISI::Protare::Oops ( std::vector< std::string > const & a_elements)

Definition at line 188 of file RISI_read.cc.

188 {
189
190 throw "No mode has been set for adding to the Protare: " + m_projectile + " + " + m_target + ".";
191}

Referenced by add().

◆ printAsRIS_file()

void GIDI::RISI::Protare::printAsRIS_file ( ) const

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

Definition at line 288 of file RISI_read.cc.

288 {
289
290 std::size_t labelWidth = 0;
291 for( auto iter = m_reactions.begin( ); iter != m_reactions.end( ); ++iter ) {
292 if( labelWidth < (*iter)->m_reactionLabel.size( ) ) labelWidth = (*iter)->m_reactionLabel.size( );
293 }
294
295 std::cout << "#protare : " << m_projectile << " : " << m_target << " : " << m_evaluation << " : " << m_energyUnit << std::endl;
296 if( m_aliases.size( ) > 0 ) {
297 std::cout << "#aliases : " << m_aliases.size( ) << std::endl;
298 for( auto iter = m_aliases.begin( ); iter != m_aliases.end( ); ++iter ) {
299 std::cout << " " << iter->first << " : " << iter->second << std::endl;
300 }
301 }
302 std::cout << "#reactions : " << m_reactions.size( ) << std::endl;
303 for( auto iter = m_reactions.begin( ); iter != m_reactions.end( ); ++iter ) (*iter)->printAsRIS_file( (int) labelWidth );
304}

◆ products()

void GIDI::RISI::Protare::products ( Projectile const * a_projectile,
int a_level,
int a_maxLevel,
double a_energyMax,
std::map< std::string, int > & 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 273 of file RISI_read.cc.

273 {
274
275 std::set<std::string> productSet;
276 for( auto reactionIter = m_reactions.begin( ); reactionIter != m_reactions.end( ); ++reactionIter )
277 (*reactionIter)->products( a_energyMax, productSet );
278
279 for( auto productIter = productSet.begin( ); productIter != productSet.end( ); ++productIter ) {
280 a_projectile->products( *productIter, a_level, a_maxLevel, a_energyMax, a_products );
281 }
282}

Referenced by addReaction().

◆ projectile()

std::string const & GIDI::RISI::Protare::projectile ( )
inline

Definition at line 64 of file RISI.hpp.

64{ return( m_projectile ); }

Referenced by GIDI::RISI::Projectiles::add().

◆ reactions()

std::vector< Reaction * > const & GIDI::RISI::Protare::reactions ( ) const
inline

Definition at line 67 of file RISI.hpp.

67{ return( m_reactions ); }

◆ setAddingAliases()

void GIDI::RISI::Protare::setAddingAliases ( )
inline

Tells add method to call the addAlias method.

Definition at line 72 of file RISI.hpp.

◆ setAddingReactions()

void GIDI::RISI::Protare::setAddingReactions ( )
inline

Tells add method to call the addReaction method.

Definition at line 74 of file RISI.hpp.

◆ target()

std::string const & GIDI::RISI::Protare::target ( )
inline

Definition at line 65 of file RISI.hpp.

65{ return( m_target ); }

Referenced by GIDI::RISI::Projectile::add().


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