/* # <> # Copyright 2019, Lawrence Livermore National Security, LLC. # This file is part of the gidiplus package (https://github.com/LLNL/gidiplus). # gidiplus is licensed under the MIT license (see https://opensource.org/licenses/MIT). # SPDX-License-Identifier: MIT # <> */ #ifndef RISI_hpp_included #define RISI_hpp_included 1 #include #include #include namespace GIDI { namespace RISI { class Projectile; class Reaction { public: double m_effectiveThreshold; /**< The effective threshold for the reaction. */ std::vector m_products; /**< The list of final products for the reaction. */ std::vector m_multiplicities; /**< The multiplicities for each product in *m_products*. */ std::vector m_intermediates; /**< The list of intermediates products for the reaction. */ std::string m_process; /**< The process for the reaction. */ std::string m_reactionLabel; /**< The label of the reaction. */ std::string m_convarianceFlag; /**< A flag indicating if covariance data are present for the reaction. */ public: Reaction( double a_effectiveThreshold, std::vector const &a_products, std::vector const &a_multiplicities, std::vector 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 &a_products ) const ; void printAsRIS_file( int a_labelWidth ) const ; }; class Protare { private: int m_addMode; /**< Indicates which method **add** calls. */ std::string m_projectile; /**< The PoPs id for the projectile. */ std::string m_target; /**< The PoPs id for the target. */ std::string m_evaluation; /**< The evaluation for the protare. */ std::string m_energyUnit; /**< The energy unit in the file for the protare. */ double m_energyConversionFactor; /**< Factor to convert from file energy units to user energy units. */ std::vector > m_aliases; /**< The list of meta-stable aliases in the protare and the nuclide they alias. */ std::vector m_reactions; /**< The list of **Reaction** instances for the protare. */ public: 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( ) { return( m_projectile ); } std::string const &target( ) { return( m_target ); } std::string const &evaluation( ) { return( m_evaluation ); } std::vector const &reactions( ) const { return( m_reactions ); } void Oops( std::vector const &a_elements ); void addAlias( std::vector const &a_elements ); bool fissionPresent( ) const; void setAddingAliases( ) { m_addMode = 1; } /**< Tells **add** method to call the **addAlias** method. */ void addReaction( std::vector const &a_elements ); void setAddingReactions( ) { m_addMode = 2; } /**< Tells **add** method to call the **addReaction** method. */ void add( std::vector const &a_elements ); void products( Projectile const *a_projectile, int a_level, int a_maxLevel, double a_energyMax, std::map &a_products ) const ; void printAsRIS_file( ) const ; }; class Target { private: std::string m_id; std::vector m_protares; public: Target( std::string const &a_id ) : m_id( a_id ) { } ~Target( ); void add( Protare *a_protare ); bool fissionPresent( ) const; std::vector const &reactions( ) const { return( m_protares[0]->reactions( ) ); } void products( Projectile const *a_projectile, int a_level, int a_maxLevel, double a_energyMax, std::map &a_products ) const ; void print( std::string const &a_indent = "" ) const ; void printAsRIS_file( ) const ; }; class Projectile { private: std::string m_id; std::map m_targets; public: Projectile( std::string const &a_id ) : m_id( a_id ) { } ~Projectile( ); void add( Protare *a_protare ); bool fissionPresent( std::vector targetIds ) const; std::vector targetIds( ) const ; void products( std::string const &a_target, int a_level, int a_maxLevel, double a_energyMax, std::map &a_products ) const ; std::vector filterProducts( std::vector const &a_productIds ) const ; Target const *target( std::string const &a_targetName ) const; void print( std::string const &a_indent = "" ) const ; void printAsRIS_file( ) const ; }; class Projectiles { private: std::map m_projectiles; public: Projectiles( ) {} ~Projectiles( ); void add( Protare *a_protare ); void clear( ); std::vector projectileIds( ) const ; Projectile const *projectile( std::string const &a_projectile ) const ; std::vector products( std::string const &a_projectile, std::vector const &a_seedTargets, int a_maxLevel, double a_energyMax, bool a_onlyIncludeTargets = true ) const ; void print( std::string const &a_indent = "" ) const ; void printAsRIS_file( ) const ; }; void readRIS( std::string const &a_fileName, std::string const &a_energyUnit, Projectiles &a_projectiles ); } // End of namespace RISI. } // End of namespace GIDI. #endif // End of RISI_hpp_included