File indexing completed on 2025-12-16 09:31:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #ifndef SCAVENGER_ParserChemReaction_h
0030 #define SCAVENGER_ParserChemReaction_h 1
0031
0032 #include "globals.hh"
0033
0034 #include <array>
0035 #include <vector>
0036
0037
0038 namespace scavenger
0039 {
0040
0041
0042
0043
0044 class ParserChemReaction
0045 {
0046 public:
0047 ParserChemReaction() = default;
0048
0049 ~ParserChemReaction() = default;
0050
0051 void ReadReactionFile(const G4String& fileName);
0052
0053 inline auto GetListReactant1() { return fListReactant1; }
0054
0055 inline auto GetListReactant2() { return fListReactant2; }
0056
0057 inline auto GetListProduct() { return fListProduct; }
0058
0059 inline auto GetListRate() { return fListRate; }
0060
0061 private:
0062 void AddReaction(const G4String& reactionString, const G4String& type);
0063
0064 void ReadReservoir(const G4String& reservoirString);
0065
0066 G4double GetScavengerConcentration(const G4String& name);
0067
0068 static void ReadReaction(const G4String& reactionString, std::vector<G4String>& reactant,
0069 std::vector<G4String>& product, G4double& reactionRate);
0070
0071 void ImplementReaction(const G4String& reactant1, const G4String& reactant2,
0072 const std::vector<G4String>& product, const G4double& reactionRate,
0073 const G4String& type);
0074
0075 static void ReplaceString(G4String& aString, const G4String& from, const G4String& to);
0076
0077 std::array<std::vector<G4String>, 5> fListReactant1;
0078 std::array<std::vector<G4String>, 5> fListReactant2;
0079 std::array<std::vector<std::vector<G4String>>, 5> fListProduct;
0080 std::array<std::vector<G4double>, 5> fListRate;
0081 std::map<G4String, G4double> fReservoirConcentrationMap;
0082 };
0083
0084 }
0085
0086
0087 #endif