Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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"
52#include <vector>
53#include <map>
54#include <functional>
55#include <memory>
56
60
61/**
62 * G4DNAMolecularReactionData contains the information
63 * relative to a given reaction (eg : °OH + °OH -> H2O2)
64 */
66{
67public:
68 //----------------------------------------------------------------------------
69
71 const G4MolecularConfiguration* reactive1,
72 const G4MolecularConfiguration* reactive2);
73
75 const G4String& reactive1,
76 const G4String& reactive2);
78
80 using ReactantPair = std::pair<Reactant*, Reactant*>;
81 using ReactionProducts = std::vector<Reactant*>;
82
83 int GetReactionID() const;
84 void SetReactionID(int ID);
85
87
88 Reactant* GetReactant1() const;
89 Reactant* GetReactant2() const;
90
95
96 void SetReactionRadius(G4double radius);
98
102
103 void SetProbability(G4double prob);
104 G4double GetProbability() const;
105
106 void SetReactionType(G4int type);
107 G4int GetReactionType() const;
108
109 void SetReactant1(Reactant* reactive);
110 void SetReactant2(Reactant* reactive);
111
112 void SetReactants(Reactant* reactive1,
113 Reactant* reactive2);
114
115 void AddProduct(Reactant* molecule);
116
117 void SetReactant1(const G4String& reactive);
118 void SetReactant2(const G4String& reactive);
119 void SetReactants(const G4String& reactive1, const G4String& reactive2);
120 void AddProduct(const G4String& molecule);
121
122 G4int GetNbProducts() const;
123 Reactant* GetProduct(G4int i) const;
124
125 const ReactionProducts* GetProducts() const;
126 void RemoveProducts();
127
128 //----------------------------------------------------------------------------
129 // Temperature scaling
130 typedef std::function<double(double)> RateParam;
131
132 static double PolynomialParam(double temp_K, std::vector<double> P);
133 static double ArrehniusParam(double temp_K, std::vector<double> P);
134 static double ScaledParameterization(double temp_K,
135 double temp_init,
136 double rateCste_init);
137
138 void SetPolynomialParameterization(const std::vector<double>& P);
139
140 void SetArrehniusParameterization(double A0, double E_R);
141 void SetScaledParameterization(double temperature_K,
142 double rateCste);
143
144 void ScaleForNewTemperature(double temp_K);
145
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
211 void SetGeometry(G4VDNAMolecularGeometry* geometry){fGeometry = geometry;};
213
215
216 Data* GetReactionData(const G4String&, const G4String&) const;
217
218 Data* GetReaction(int reactionID) const;
219
220 size_t GetNReactions() const;
221
222 //_________________________________________________________________
223 /**
224 * Given a molecule's type, it returns with which a reaction is allowed
225 */
226 const ReactantList* CanReactWith(Reactant*) const;
227
229
231
233
235
236 void ScaleReactionRateForNewTemperature(double temp_K);
237
238 //_________________________________________________________________
240
241 void Reset();
242
243protected:
245
250 std::vector<std::unique_ptr<Data>> fVectorOfReactionData;
251 std::unique_ptr<G4ReactionTableMessenger> fpMessenger;
252};
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 G4MolecularConfiguration Reactant
const ReactantList * CanReactWith(Reactant *) const
std::map< Reactant *, SpecificDataList > ReactionDataMap
Data * GetReaction(int reactionID) const
const SpecificDataList * GetReativesNData(const G4MolecularConfiguration *) const
G4VDNAMolecularGeometry * GetGeometry() 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)
const G4DNAMolecularReactionData Data
void ScaleReactionRateForNewTemperature(double temp_K)
virtual ~G4DNAMolecularReactionTable()
void SetGeometry(G4VDNAMolecularGeometry *geometry)