Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
RISI.hpp
Go to the documentation of this file.
1/*
2# <<BEGIN-copyright>>
3# Copyright 2019, Lawrence Livermore National Security, LLC.
4# This file is part of the gidiplus package (https://github.com/LLNL/gidiplus).
5# gidiplus is licensed under the MIT license (see https://opensource.org/licenses/MIT).
6# SPDX-License-Identifier: MIT
7# <<END-copyright>>
8*/
9
10#ifndef RISI_hpp_included
11#define RISI_hpp_included 1
12
13#include <map>
14#include <set>
15
16#include <LUPI.hpp>
17
18namespace GIDI {
19
20namespace RISI {
21
22class Projectile;
23
24class Reaction {
25
26 public:
27 double m_effectiveThreshold; /**< The effective threshold for the reaction. */
28 std::vector<std::string> m_products; /**< The list of final products for the reaction. */
29 std::vector<int> m_multiplicities; /**< The multiplicities for each product in *m_products*. */
30 std::vector<std::string> m_intermediates; /**< The list of intermediates products for the reaction. */
31 std::string m_process; /**< The process for the reaction. */
32 std::string m_reactionLabel; /**< The label of the reaction. */
33 std::string m_convarianceFlag; /**< A flag indicating if covariance data are present for the reaction. */
34
35 public:
36 Reaction( double a_effectiveThreshold, std::vector<std::string> const &a_products, std::vector<int> const &a_multiplicities,
37 std::vector<std::string> const &a_intermediates, std::string const &a_process, std::string const &reactionLabel,
38 std::string const &convarianceFlag );
39
40 bool isFission( ) const;
41 int multiplicity( std::string const &a_productId ) const;
42 void products( double a_energyMax, std::set<std::string> &a_products ) const ;
43 void printAsRIS_file( int a_labelWidth ) const ;
44};
45
46class Protare {
47
48 private:
49 int m_addMode; /**< Indicates which method **add** calls. */
50 std::string m_projectile; /**< The PoPs id for the projectile. */
51 std::string m_target; /**< The PoPs id for the target. */
52 std::string m_evaluation; /**< The evaluation for the protare. */
53 std::string m_energyUnit; /**< The energy unit in the file for the protare. */
54 double m_energyConversionFactor; /**< Factor to convert from file energy units to user energy units. */
55
56 std::vector<std::pair<std::string, std::string> > m_aliases; /**< The list of meta-stable aliases in the protare and the nuclide they alias. */
57 std::vector<Reaction *> m_reactions; /**< The list of **Reaction** instances for the protare. */
58
59 public:
60 Protare( std::string const &a_projectile, std::string const &a_target, std::string const &a_evaluation,
61 std::string const &a_protareEnergyUnit, std::string const &a_requestedEnergyUnit );
62 ~Protare();
63
64 std::string const &projectile( ) { return( m_projectile ); }
65 std::string const &target( ) { return( m_target ); }
66 std::string const &evaluation( ) { return( m_evaluation ); }
67 std::vector<Reaction *> const &reactions( ) const { return( m_reactions ); }
68
69 void Oops( std::vector<std::string> const &a_elements );
70 void addAlias( std::vector<std::string> const &a_elements );
71 bool fissionPresent( ) const;
72 void setAddingAliases( ) { m_addMode = 1; } /**< Tells **add** method to call the **addAlias** method. */
73 void addReaction( std::vector<std::string> const &a_elements );
74 void setAddingReactions( ) { m_addMode = 2; } /**< Tells **add** method to call the **addReaction** method. */
75 void add( std::vector<std::string> const &a_elements );
76
77 void products( Projectile const *a_projectile, int a_level, int a_maxLevel, double a_energyMax, std::map<std::string, int> &a_products ) const ;
78 void printAsRIS_file( ) const ;
79};
80
81class Target {
82
83 private:
84 std::string m_id;
85 std::vector<Protare *> m_protares;
86
87 public:
88 Target( std::string const &a_id ) :
89 m_id( a_id ) {
90 }
91 ~Target( );
92
93 void add( Protare *a_protare );
94 bool fissionPresent( ) const;
95 std::vector<Reaction *> const &reactions( ) const { return( m_protares[0]->reactions( ) ); }
96 void products( Projectile const *a_projectile, int a_level, int a_maxLevel, double a_energyMax, std::map<std::string, int> &a_products ) const ;
97 void print( std::string const &a_indent = "" ) const ;
98 void printAsRIS_file( ) const ;
99};
100
102
103 private:
104 std::string m_id;
105 std::map<std::string, Target *> m_targets;
106
107 public:
108 Projectile( std::string const &a_id ) :
109 m_id( a_id ) {
110 }
111 ~Projectile( );
112
113 void add( Protare *a_protare );
114 bool fissionPresent( std::vector<std::string> targetIds ) const;
115 std::vector<std::string> targetIds( ) const ;
116 void products( std::string const &a_target, int a_level, int a_maxLevel, double a_energyMax, std::map<std::string, int> &a_products ) const ;
117 std::vector<std::string> filterProducts( std::vector<std::string> const &a_productIds ) const ;
118 Target const *target( std::string const &a_targetName ) const;
119 void print( std::string const &a_indent = "" ) const ;
120 void printAsRIS_file( ) const ;
121};
122
124
125 private:
126 std::map<std::string, Projectile *> m_projectiles;
127
128 public:
130 ~Projectiles( );
131
132 void add( Protare *a_protare );
133 void clear( );
134 std::vector<std::string> projectileIds( ) const ;
135 Projectile const *projectile( std::string const &a_projectile ) const ;
136 std::vector<std::string> products( std::string const &a_projectile, std::vector<std::string> const &a_seedTargets, int a_maxLevel,
137 double a_energyMax, bool a_onlyIncludeTargets = true ) const ;
138 void print( std::string const &a_indent = "" ) const ;
139 void printAsRIS_file( ) const ;
140};
141
142void readRIS( std::string const &a_fileName, std::string const &a_energyUnit, Projectiles &a_projectiles );
143
144} // End of namespace RISI.
145
146} // End of namespace GIDI.
147
148#endif // End of RISI_hpp_included
Target const * target(std::string const &a_targetName) const
Definition RISI_read.cc:438
bool fissionPresent(std::vector< std::string > targetIds) const
Definition RISI_read.cc:419
void products(std::string const &a_target, int a_level, int a_maxLevel, double a_energyMax, std::map< std::string, int > &a_products) const
Definition RISI_read.cc:474
std::vector< std::string > filterProducts(std::vector< std::string > const &a_productIds) const
Definition RISI_read.cc:501
void printAsRIS_file() const
Definition RISI_read.cc:531
Projectile(std::string const &a_id)
Definition RISI.hpp:108
std::vector< std::string > targetIds() const
Definition RISI_read.cc:453
void print(std::string const &a_indent="") const
Definition RISI_read.cc:520
void add(Protare *a_protare)
Definition RISI_read.cc:400
std::vector< std::string > projectileIds() const
Definition RISI_read.cc:583
void print(std::string const &a_indent="") const
Definition RISI_read.cc:648
std::vector< std::string > products(std::string const &a_projectile, std::vector< std::string > const &a_seedTargets, int a_maxLevel, double a_energyMax, bool a_onlyIncludeTargets=true) const
Definition RISI_read.cc:621
void printAsRIS_file() const
Definition RISI_read.cc:658
void add(Protare *a_protare)
Definition RISI_read.cc:554
Projectile const * projectile(std::string const &a_projectile) const
Definition RISI_read.cc:601
std::string const & target()
Definition RISI.hpp:65
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)
Definition RISI_read.cc:154
void addAlias(std::vector< std::string > const &a_elements)
Definition RISI_read.cc:196
std::string const & evaluation()
Definition RISI.hpp:66
void setAddingAliases()
Definition RISI.hpp:72
std::vector< Reaction * > const & reactions() const
Definition RISI.hpp:67
std::string const & projectile()
Definition RISI.hpp:64
void printAsRIS_file() const
Definition RISI_read.cc:288
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
void Oops(std::vector< std::string > const &a_elements)
Definition RISI_read.cc:188
bool fissionPresent() const
Definition RISI_read.cc:208
void add(std::vector< std::string > const &a_elements)
Definition RISI_read.cc:253
void addReaction(std::vector< std::string > const &a_elements)
Definition RISI_read.cc:219
void setAddingReactions()
Definition RISI.hpp:74
std::vector< int > m_multiplicities
Definition RISI.hpp:29
void products(double a_energyMax, std::set< std::string > &a_products) const
Definition RISI_read.cc:93
std::vector< std::string > m_products
Definition RISI.hpp:28
bool isFission() const
Definition RISI_read.cc:56
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
int multiplicity(std::string const &a_productId) const
Definition RISI_read.cc:70
double m_effectiveThreshold
Definition RISI.hpp:27
void printAsRIS_file(int a_labelWidth) const
Definition RISI_read.cc:104
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)
Definition RISI_read.cc:37
std::string m_process
Definition RISI.hpp:31
Target(std::string const &a_id)
Definition RISI.hpp:88
void add(Protare *a_protare)
Definition RISI_read.cc:325
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:353
void print(std::string const &a_indent="") const
Definition RISI_read.cc:364
std::vector< Reaction * > const & reactions() const
Definition RISI.hpp:95
bool fissionPresent() const
Definition RISI_read.cc:336
void printAsRIS_file() const
Definition RISI_read.cc:375
void readRIS(std::string const &a_fileName, std::string const &a_energyUnit, Projectiles &a_projectiles)
Definition RISI_read.cc:667
Definition GIDI.hpp:32