Loading...
Searching...
No Matches
ParserChemReaction.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26/// \file scavenger/include/ParserChemReaction.hh
27/// \brief Definition of the scavenger::ParserChemReaction class
28
29#ifndef SCAVENGER_ParserChemReaction_h
30#define SCAVENGER_ParserChemReaction_h 1
31
32#include "globals.hh"
33#include <vector>
34#include <array>
35
36//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
37namespace scavenger
38{
39
40/// Parser to read user files defining chemical reactions and
41/// scavengers (reaction with background)
42
43class ParserChemReaction {
44public:
45 ParserChemReaction() = default;
46
48
49 void ReadReactionFile(const G4String &fileName);
50
51 inline auto GetListReactant1() { return fListReactant1; }
52
53 inline auto GetListReactant2() { return fListReactant2; }
54
55 inline auto GetListProduct() { return fListProduct; }
56
57 inline auto GetListRate() { return fListRate; }
58
59private:
60 void AddReaction(const G4String &reactionString,
61 const G4String &type);
62
63 void ReadReservoir(const G4String &reservoirString);
64
65 G4double GetScavengerConcentration(const G4String &name);
66
67 static void ReadReaction(const G4String &reactionString,
68 std::vector<G4String> &reactant,
69 std::vector<G4String> &product,
70 G4double &reactionRate);
71
72 void ImplementReaction(const G4String &reactant1,
73 const G4String &reactant2,
74 const std::vector<G4String> &product,
75 const G4double &reactionRate,
76 const G4String &type);
77
78 static void ReplaceString(G4String &aString, const G4String &from,
79 const G4String &to);
80
81 std::array<std::vector<G4String>, 5> fListReactant1;
82 std::array<std::vector<G4String>, 5> fListReactant2;
83 std::array<std::vector<std::vector<G4String>>, 5> fListProduct;
84 std::array<std::vector<G4double>, 5> fListRate;
85 std::map<G4String, G4double> fReservoirConcentrationMap;
86};
87
88}
89//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
90
91#endif
void ReadReactionFile(const G4String &fileName)
std::array< std::vector< G4String >, 5 > fListReactant2
void ReadReservoir(const G4String &reservoirString)
static void ReadReaction(const G4String &reactionString, std::vector< G4String > &reactant, std::vector< G4String > &product, G4double &reactionRate)
void AddReaction(const G4String &reactionString, const G4String &type)
G4double GetScavengerConcentration(const G4String &name)
std::map< G4String, G4double > fReservoirConcentrationMap
std::array< std::vector< G4double >, 5 > fListRate
std::array< std::vector< G4String >, 5 > fListReactant1
static void ReplaceString(G4String &aString, const G4String &from, const G4String &to)
void ImplementReaction(const G4String &reactant1, const G4String &reactant2, const std::vector< G4String > &product, const G4double &reactionRate, const G4String &type)
std::array< std::vector< std::vector< G4String > >, 5 > fListProduct

Applications | User Support | Publications | Collaboration