Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4DNAMolecularReactionTable.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//
27// Author: Mathieu Karamitros
28
29// The code is developed in the framework of the ESA AO7146
30//
31// We would be very happy hearing from you, send us your feedback! :)
32//
33// In order for Geant4-DNA to be maintained and still open-source,
34// article citations are crucial.
35// If you use Geant4-DNA chemistry and you publish papers about your software,
36// in addition to the general paper on Geant4-DNA:
37//
38// Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
39//
40// we would be very happy if you could please also cite the following
41// reference papers on chemistry:
42//
43// J. Comput. Phys. 274 (2014) 841-882
44// Prog. Nucl. Sci. Tec. 2 (2011) 503-508
45
46#pragma once
47
48#include "G4ITReactionTable.hh"
50#include "G4ReferenceCast.hh"
51#include <vector>
52#include <map>
53#include <functional>
54#include <memory>
55
59
60/**
61 * G4DNAMolecularReactionData contains the information
62 * relative to a given reaction (eg : °OH + °OH -> H2O2)
63 */
65{
66public:
67 //----------------------------------------------------------------------------
68
70 const G4MolecularConfiguration* reactive1,
71 const G4MolecularConfiguration* reactive2);
72
74 const G4String& reactive1,
75 const G4String& reactive2);
77
79 using ReactantPair = std::pair<Reactant*, Reactant*>;
80 using ReactionProducts = std::vector<Reactant*>;
81
82 int GetReactionID() const;
83 void SetReactionID(int ID);
84
86
87 Reactant* GetReactant1() const;
88 Reactant* GetReactant2() const;
89
94
95 void SetReactionRadius(G4double radius);
97
101
102 void SetProbability(G4double prob);
103 G4double GetProbability() const;
104
105 void SetReactionType(G4int type);
106 G4int GetReactionType() const;
107
108 void SetReactant1(Reactant* reactive);
109 void SetReactant2(Reactant* reactive);
110
111 void SetReactants(Reactant* reactive1,
112 Reactant* reactive2);
113
114 void AddProduct(Reactant* molecule);
115
116 void SetReactant1(const G4String& reactive);
117 void SetReactant2(const G4String& reactive);
118 void SetReactants(const G4String& reactive1, const G4String& reactive2);
119 void AddProduct(const G4String& molecule);
120
121 G4int GetNbProducts() const;
122 Reactant* GetProduct(G4int i) const;
123
124 const ReactionProducts* GetProducts() const;
125 void RemoveProducts();
126
127 //----------------------------------------------------------------------------
128 // Temperature scaling
129 typedef std::function<double(double)> RateParam;
130
131 static double PolynomialParam(double temp_K, std::vector<double> P);
132 static double ArrehniusParam(double temp_K, std::vector<double> P);
133 static double ScaledParameterization(double temp_K,
134 double temp_init,
135 double rateCste_init);
136
137 void SetPolynomialParameterization(const std::vector<double>& P);
138
139 void SetArrehniusParameterization(double A0, double E_R);
140 void SetScaledParameterization(double temperature_K,
141 double rateCste);
142
143 void ScaleForNewTemperature(double temp_K);
144
145private:
146 void ComputeEffectiveRadius();
147
148protected:
152
156
158
161
164
168};
169
170/**
171 * G4DNAMolecularReactionTable sorts out the G4DNAMolecularReactionData
172 * for bimolecular reaction
173 */
175{
176protected:
179
180public:
183 static void DeleteInstance();
185
188 using ReactantList = std::vector<Reactant*>;
189 using DataList = std::vector<Data*>;
190 using SpecificDataList = std::map<Reactant*, Data*>;
191
192 using ReactionDataMap = std::map<Reactant*, SpecificDataList>;
193 using ReactivesMV = std::map<Reactant*, ReactantList>;
194 using ReactionDataMV = std::map<Reactant*, DataList>;
195
196 /**
197 * Define a reaction :
198 * First argument : reaction rate
199 * Second argument : reactant 1
200 * Third argument : reactant 2
201 * Fourth argument : a std::vector holding the molecular products
202 * if this last argument is NULL then it will be interpreted as
203 * a reaction giving no products
204 */
205 void SetReaction(G4double observedReactionRate,
206 Reactant* reactive1,
207 Reactant* reactive2);
208
210
212
213 Data* GetReactionData(const G4String&, const G4String&) const;
214
215 Data* GetReaction(int reactionID) const;
216
217 size_t GetNReactions() const;
218
219 //_________________________________________________________________
220 /**
221 * Given a molecule's type, it returns with which a reaction is allowed
222 */
223 const ReactantList* CanReactWith(Reactant*) const;
224
226
228
230
232
233 void ScaleReactionRateForNewTemperature(double temp_K);
234
235 //_________________________________________________________________
237
238protected:
240
244 std::vector<std::unique_ptr<Data>> fVectorOfReactionData;
245 std::unique_ptr<G4ReactionTableMessenger> fpMessenger;
246};
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
Reactant * GetProduct(G4int i) const
void SetPolynomialParameterization(const std::vector< double > &P)
std::pair< Reactant *, Reactant * > ReactantPair
static double ArrehniusParam(double temp_K, std::vector< double > P)
void SetEffectiveReactionRadius(G4double radius)
void SetArrehniusParameterization(double A0, double E_R)
std::vector< Reactant * > ReactionProducts
void SetReactants(Reactant *reactive1, Reactant *reactive2)
const ReactionProducts * GetProducts() const
std::function< double(double)> RateParam
void SetObservedReactionRateConstant(G4double rate)
static double PolynomialParam(double temp_K, std::vector< double > P)
G4DNAMolecularReactionData(G4double reactionRate, const G4MolecularConfiguration *reactive1, const G4MolecularConfiguration *reactive2)
void SetScaledParameterization(double temperature_K, double rateCste)
static double ScaledParameterization(double temp_K, double temp_init, double rateCste_init)
std::map< Reactant *, Data * > SpecificDataList
static G4DNAMolecularReactionTable * GetReactionTable()
std::vector< Reactant * > ReactantList
std::map< Reactant *, ReactantList > ReactivesMV
Data * GetReactionData(Reactant *, Reactant *) const
static G4DNAMolecularReactionTable * Instance()
const ReactantList * CanReactWith(Reactant *) const
std::map< Reactant *, SpecificDataList > ReactionDataMap
Data * GetReaction(int reactionID) const
const SpecificDataList * GetReativesNData(const G4MolecularConfiguration *) const
void PrintTable(G4VDNAReactionModel *=0)
std::unique_ptr< G4ReactionTableMessenger > fpMessenger
std::vector< std::unique_ptr< Data > > fVectorOfReactionData
const ReactionDataMap & GetAllReactionData()
static G4DNAMolecularReactionTable * fpInstance
std::map< Reactant *, DataList > ReactionDataMV
void SetReaction(G4double observedReactionRate, Reactant *reactive1, Reactant *reactive2)
void ScaleReactionRateForNewTemperature(double temp_K)
virtual ~G4DNAMolecularReactionTable()