Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/electromagnetic/dna/utils/src/G4DNAMolecularReactionTable.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/electromagnetic/dna/utils/src/G4DNAMolecularReactionTable.cc (Version 11.3.0) and /processes/electromagnetic/dna/utils/src/G4DNAMolecularReactionTable.cc (Version 11.2.1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 //                                                 26 //
 27 // Author: Mathieu Karamitros (kara (AT) cenbg     27 // Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr) 
 28 //                                                 28 //
 29 // WARNING : This class is released as a proto     29 // WARNING : This class is released as a prototype.
 30 // It might strongly evolve or even disapear i     30 // It might strongly evolve or even disapear in the next releases.
 31 //                                                 31 //
 32 // History:                                        32 // History:
 33 // -----------                                     33 // -----------
 34 // 10 Oct 2011 M.Karamitros created                34 // 10 Oct 2011 M.Karamitros created
 35 //                                                 35 //
 36 // -------------------------------------------     36 // -------------------------------------------------------------------
 37                                                    37 
 38 #include <iomanip>                                 38 #include <iomanip>
 39                                                    39 
 40 #include "G4DNAMolecularReactionTable.hh"          40 #include "G4DNAMolecularReactionTable.hh"
 41 #include "G4PhysicalConstants.hh"                  41 #include "G4PhysicalConstants.hh"
 42 #include "G4SystemOfUnits.hh"                      42 #include "G4SystemOfUnits.hh"
 43 #include "G4UIcommand.hh"                          43 #include "G4UIcommand.hh"
 44 #include "G4VDNAReactionModel.hh"                  44 #include "G4VDNAReactionModel.hh"
 45 #include "G4MoleculeHandleManager.hh"              45 #include "G4MoleculeHandleManager.hh"
 46 #include "G4MoleculeTable.hh"                      46 #include "G4MoleculeTable.hh"
 47 #include "G4MolecularConfiguration.hh"             47 #include "G4MolecularConfiguration.hh"
 48 #include "G4ReactionTableMessenger.hh"             48 #include "G4ReactionTableMessenger.hh"
 49 #include "G4IosFlagsSaver.hh"                      49 #include "G4IosFlagsSaver.hh"
 50 #include "G4Exp.hh"                                50 #include "G4Exp.hh"
 51                                                    51 
 52 using namespace std;                               52 using namespace std;
 53                                                    53 
 54 G4DNAMolecularReactionTable* G4DNAMolecularRea     54 G4DNAMolecularReactionTable* G4DNAMolecularReactionTable::fpInstance(nullptr);
 55                                                    55 
 56 G4DNAMolecularReactionData::G4DNAMolecularReac     56 G4DNAMolecularReactionData::G4DNAMolecularReactionData()
 57     : fpReactant1(nullptr)                         57     : fpReactant1(nullptr)
 58     , fpReactant2(nullptr)                         58     , fpReactant2(nullptr)
 59     , fObservedReactionRate(0.)                    59     , fObservedReactionRate(0.)
 60     , fActivationRate(0.)                          60     , fActivationRate(0.)
 61     , fDiffusionRate(0.)                           61     , fDiffusionRate(0.)
 62     , fOnsagerRadius(0.)                           62     , fOnsagerRadius(0.)
 63     , fReactionRadius(0.)                          63     , fReactionRadius(0.)
 64     , fEffectiveReactionRadius(0.)                 64     , fEffectiveReactionRadius(0.)
 65     , fProbability(0.)                             65     , fProbability(0.)
 66     , fType(0)                                     66     , fType(0)
 67     , fReactionID(0)                               67     , fReactionID(0)
 68 {                                                  68 {
 69 }                                                  69 }
 70                                                    70 
 71 G4DNAMolecularReactionData::G4DNAMolecularReac     71 G4DNAMolecularReactionData::G4DNAMolecularReactionData(G4double reactionRate,
 72                                                    72                                                        Reactant* pReactant1,
 73                                                    73                                                        Reactant* pReactant2)
 74     : fpReactant1(pReactant1)                      74     : fpReactant1(pReactant1)
 75     , fpReactant2(pReactant2)                      75     , fpReactant2(pReactant2)
 76     , fObservedReactionRate(reactionRate)          76     , fObservedReactionRate(reactionRate)
 77     , fActivationRate(0.)                          77     , fActivationRate(0.)
 78     , fDiffusionRate(0.)                           78     , fDiffusionRate(0.)
 79     , fOnsagerRadius(0.)                           79     , fOnsagerRadius(0.)
 80     , fReactionRadius(0.)                          80     , fReactionRadius(0.)
 81     , fEffectiveReactionRadius(0.)                 81     , fEffectiveReactionRadius(0.)
 82     , fProbability(0.)                             82     , fProbability(0.)
 83     , fType(0)                                     83     , fType(0)
 84     , fReactionID(0)                               84     , fReactionID(0)
 85 {                                                  85 {
 86     ComputeEffectiveRadius();                      86     ComputeEffectiveRadius();
 87 }                                                  87 }
 88                                                    88 
 89 G4DNAMolecularReactionData::G4DNAMolecularReac     89 G4DNAMolecularReactionData::G4DNAMolecularReactionData(G4double reactionRate,
 90                                                    90                                                        const G4String& reactant1,
 91                                                    91                                                        const G4String& reactant2)
 92     : fpReactant1(nullptr)                         92     : fpReactant1(nullptr)
 93     , fpReactant2(nullptr)                         93     , fpReactant2(nullptr)
 94     , fObservedReactionRate(reactionRate)          94     , fObservedReactionRate(reactionRate)
 95     , fActivationRate(0.)                          95     , fActivationRate(0.)
 96     , fDiffusionRate(0.)                           96     , fDiffusionRate(0.)
 97     , fOnsagerRadius(0.)                           97     , fOnsagerRadius(0.)
 98     , fReactionRadius(0.)                          98     , fReactionRadius(0.)
 99     , fEffectiveReactionRadius(0.)                 99     , fEffectiveReactionRadius(0.)
100     , fProbability(0.)                            100     , fProbability(0.)
101     , fType(0)                                    101     , fType(0)
102     , fReactionID(0)                              102     , fReactionID(0)
103 {                                                 103 {
104     SetReactant1(reactant1);                      104     SetReactant1(reactant1);
105     SetReactant2(reactant2);                      105     SetReactant2(reactant2);
106     ComputeEffectiveRadius();                     106     ComputeEffectiveRadius();
107 }                                                 107 }
108                                                   108 
109 G4DNAMolecularReactionData::~G4DNAMolecularRea    109 G4DNAMolecularReactionData::~G4DNAMolecularReactionData()
110 {                                                 110 {
111      fProducts.clear();                           111      fProducts.clear();
112 }                                                 112 }
113                                                   113 
114 void G4DNAMolecularReactionData::ComputeEffect    114 void G4DNAMolecularReactionData::ComputeEffectiveRadius()
115 {                                                 115 {
116     G4double sumDiffCoeff = 0.;                   116     G4double sumDiffCoeff = 0.;
117                                                   117 
118     if (fpReactant1 == fpReactant2)               118     if (fpReactant1 == fpReactant2)
119     {                                             119     {
120         sumDiffCoeff = fpReactant1->GetDiffusi    120         sumDiffCoeff = fpReactant1->GetDiffusionCoefficient();
121         fEffectiveReactionRadius = fObservedRe    121         fEffectiveReactionRadius = fObservedReactionRate / (4. * CLHEP::pi * sumDiffCoeff * CLHEP::Avogadro);
122     }                                             122     }
123     else                                          123     else
124     {                                             124     {
125         sumDiffCoeff = fpReactant1->GetDiffusi    125         sumDiffCoeff = fpReactant1->GetDiffusionCoefficient()
126                      + fpReactant2->GetDiffusi    126                      + fpReactant2->GetDiffusionCoefficient();
127         fEffectiveReactionRadius = fObservedRe    127         fEffectiveReactionRadius = fObservedReactionRate / (4. * CLHEP::pi * sumDiffCoeff * CLHEP::Avogadro);
128     }                                             128     }
129                                                   129 
130     fReactionID = 0;                              130     fReactionID = 0;
131     fReactionRadius = fEffectiveReactionRadius    131     fReactionRadius = fEffectiveReactionRadius;
132     fOnsagerRadius = (fpReactant1->GetCharge()    132     fOnsagerRadius = (fpReactant1->GetCharge() * fpReactant2->GetCharge())/(4*pi*epsilon0*k_Boltzmann) / (293.15 * 80.1) ;
133     fProbability = 1;                             133     fProbability = 1;
134                                                   134 
135 }                                                 135 }
136                                                   136 
137 int G4DNAMolecularReactionData::GetReactionID(    137 int G4DNAMolecularReactionData::GetReactionID() const
138 {                                                 138 {
139     return fReactionID;                           139     return fReactionID;
140 }                                                 140 }
141                                                   141 
142 void G4DNAMolecularReactionData::SetReactionID    142 void G4DNAMolecularReactionData::SetReactionID(int ID)
143 {                                                 143 {
144     fReactionID = ID;                             144     fReactionID = ID;
145 }                                                 145 }
146                                                   146 
147 void G4DNAMolecularReactionData::SetReactant1(    147 void G4DNAMolecularReactionData::SetReactant1(Reactant* pReactive)
148 {                                                 148 {
149     fpReactant1 = pReactive;                      149     fpReactant1 = pReactive;
150 }                                                 150 }
151                                                   151 
152 void G4DNAMolecularReactionData::SetReactant2(    152 void G4DNAMolecularReactionData::SetReactant2(Reactant* pReactive)
153 {                                                 153 {
154     fpReactant2 = pReactive;                      154     fpReactant2 = pReactive;
155 }                                                 155 }
156                                                   156 
157 void G4DNAMolecularReactionData::SetReactants(    157 void G4DNAMolecularReactionData::SetReactants(Reactant* pReactant1,
158                                                   158                                               Reactant* pReactant2)
159 {                                                 159 {
160     fpReactant1 = pReactant1;                     160     fpReactant1 = pReactant1;
161     fpReactant2 = pReactant2;                     161     fpReactant2 = pReactant2;
162 }                                                 162 }
163                                                   163 
164 void G4DNAMolecularReactionData::AddProduct(Re    164 void G4DNAMolecularReactionData::AddProduct(Reactant* pMolecule)
165 {                                                 165 {
166     fProducts.push_back(pMolecule);               166     fProducts.push_back(pMolecule);
167 }                                                 167 }
168                                                   168 
169 G4int G4DNAMolecularReactionData::GetNbProduct    169 G4int G4DNAMolecularReactionData::GetNbProducts() const
170 {                                                 170 {
171     return (G4int)fProducts.size();               171     return (G4int)fProducts.size();
172 }                                                 172 }
173                                                   173 
174 G4DNAMolecularReactionData::Reactant* G4DNAMol    174 G4DNAMolecularReactionData::Reactant* G4DNAMolecularReactionData::GetProduct(G4int i) const
175 {                                                 175 {
176     return fProducts[i];                          176     return fProducts[i];
177 }                                                 177 }
178                                                   178 
179 const G4DNAMolecularReactionData::ReactionProd    179 const G4DNAMolecularReactionData::ReactionProducts* G4DNAMolecularReactionData::GetProducts() const
180 {                                                 180 {
181     return &fProducts;                            181     return &fProducts;
182 }                                                 182 }
183                                                   183 
184 void G4DNAMolecularReactionData::RemoveProduct    184 void G4DNAMolecularReactionData::RemoveProducts()
185 {                                                 185 {
186     fProducts.clear();                            186     fProducts.clear();
187 }                                                 187 }
188                                                   188 
189 void G4DNAMolecularReactionData::SetReactant1(    189 void G4DNAMolecularReactionData::SetReactant1(const G4String& reactive)
190 {                                                 190 {
191     fpReactant1 = G4MoleculeTable::Instance()-    191     fpReactant1 = G4MoleculeTable::Instance()->GetConfiguration(reactive);
192 }                                                 192 }
193 void G4DNAMolecularReactionData::SetReactant2(    193 void G4DNAMolecularReactionData::SetReactant2(const G4String& reactive)
194 {                                                 194 {
195     fpReactant2 = G4MoleculeTable::Instance()-    195     fpReactant2 = G4MoleculeTable::Instance()->GetConfiguration(reactive);
196 }                                                 196 }
197 void G4DNAMolecularReactionData::SetReactants(    197 void G4DNAMolecularReactionData::SetReactants(const G4String& reactant1,
198                                                   198                                               const G4String& reactant2)
199 {                                                 199 {
200     fpReactant1 = G4MoleculeTable::Instance()-    200     fpReactant1 = G4MoleculeTable::Instance()->GetConfiguration(reactant1);
201     fpReactant2 = G4MoleculeTable::Instance()-    201     fpReactant2 = G4MoleculeTable::Instance()->GetConfiguration(reactant2);
202 }                                                 202 }
203                                                   203 
204 G4DNAMolecularReactionData::ReactantPair G4DNA    204 G4DNAMolecularReactionData::ReactantPair G4DNAMolecularReactionData::GetReactants()
205 {                                                 205 {
206     return std::make_pair(fpReactant1, fpReact    206     return std::make_pair(fpReactant1, fpReactant2);
207 }                                                 207 }
208                                                   208 
209 G4DNAMolecularReactionData::Reactant* G4DNAMol    209 G4DNAMolecularReactionData::Reactant* G4DNAMolecularReactionData::GetReactant1() const
210 {                                                 210 {
211     return fpReactant1;                           211     return fpReactant1;
212 }                                                 212 }
213                                                   213 
214 G4DNAMolecularReactionData::Reactant* G4DNAMol    214 G4DNAMolecularReactionData::Reactant* G4DNAMolecularReactionData::GetReactant2() const
215 {                                                 215 {
216     return fpReactant2;                           216     return fpReactant2;
217 }                                                 217 }
218                                                   218 
219 void G4DNAMolecularReactionData::SetObservedRe    219 void G4DNAMolecularReactionData::SetObservedReactionRateConstant(G4double rate)
220 {                                                 220 {
221     fObservedReactionRate = rate;                 221     fObservedReactionRate = rate;
222 }                                                 222 }
223                                                   223 
224 G4double G4DNAMolecularReactionData::GetObserv    224 G4double G4DNAMolecularReactionData::GetObservedReactionRateConstant() const
225 {                                                 225 {
226     return fObservedReactionRate;                 226     return fObservedReactionRate;
227 }                                                 227 }
228                                                   228 
229 G4double G4DNAMolecularReactionData::GetActiva    229 G4double G4DNAMolecularReactionData::GetActivationRateConstant() const
230 {                                                 230 {
231     return fActivationRate;                       231     return fActivationRate;
232 }                                                 232 }
233                                                   233 
234 G4double G4DNAMolecularReactionData::GetDiffus    234 G4double G4DNAMolecularReactionData::GetDiffusionRateConstant() const
235 {                                                 235 {
236     return fDiffusionRate;                        236     return fDiffusionRate;
237 }                                                 237 }
238                                                   238 
239 void G4DNAMolecularReactionData::SetReactionRa    239 void G4DNAMolecularReactionData::SetReactionRadius(G4double radius)
240 {                                                 240 {
241     fReactionRadius = radius;                     241     fReactionRadius = radius;
242     fEffectiveReactionRadius = -fOnsagerRadius    242     fEffectiveReactionRadius = -fOnsagerRadius / (1-exp(fOnsagerRadius / fReactionRadius));
243 }                                                 243 }
244                                                   244 
245 G4double G4DNAMolecularReactionData::GetReacti    245 G4double G4DNAMolecularReactionData::GetReactionRadius() const
246 {                                                 246 {
247     return fReactionRadius;                       247     return fReactionRadius;
248 }                                                 248 }
249                                                   249 
250 void G4DNAMolecularReactionData::SetEffectiveR    250 void G4DNAMolecularReactionData::SetEffectiveReactionRadius(G4double radius)
251 {                                                 251 {
252     fEffectiveReactionRadius = radius;            252     fEffectiveReactionRadius = radius;
253 }                                                 253 }
254                                                   254 
255 G4double G4DNAMolecularReactionData::GetEffect    255 G4double G4DNAMolecularReactionData::GetEffectiveReactionRadius() const
256 {                                                 256 {
257     return fEffectiveReactionRadius;              257     return fEffectiveReactionRadius;
258 }                                                 258 }
259                                                   259 
260 G4double G4DNAMolecularReactionData::GetOnsage    260 G4double G4DNAMolecularReactionData::GetOnsagerRadius() const
261 {                                                 261 {
262     return fOnsagerRadius;                        262     return fOnsagerRadius;
263 }                                                 263 }
264                                                   264 
265 G4double G4DNAMolecularReactionData::GetProbab    265 G4double G4DNAMolecularReactionData::GetProbability() const
266 {                                                 266 {
267     return fProbability;                          267     return fProbability;
268 }                                                 268 }
269                                                   269 
270 void G4DNAMolecularReactionData::SetProbabilit    270 void G4DNAMolecularReactionData::SetProbability(G4double prob)
271 {                                                 271 {
272     fProbability = prob;                          272     fProbability = prob;
273 }                                                 273 }
274                                                   274 
275 void G4DNAMolecularReactionData::SetReactionTy    275 void G4DNAMolecularReactionData::SetReactionType(G4int type)
276 {                                                 276 {
277     G4double sumDiffCoeff = 0.;                   277     G4double sumDiffCoeff = 0.;
278                                                   278 
279     if(type == 1)                                 279     if(type == 1)
280     {                                             280     {
281                                                   281 
282         sumDiffCoeff = fpReactant1->GetDiffusi    282         sumDiffCoeff = fpReactant1->GetDiffusionCoefficient() + 
283                        fpReactant2->GetDiffusi    283                        fpReactant2->GetDiffusionCoefficient();
284                                                   284 
285         fReactionRadius = fpReactant1->GetVanD    285         fReactionRadius = fpReactant1->GetVanDerVaalsRadius() +
286                           fpReactant2->GetVanD    286                           fpReactant2->GetVanDerVaalsRadius();
287                                                   287 
288         G4double Rs = 0.29 * nm;                  288         G4double Rs = 0.29 * nm;
289         if(fOnsagerRadius == 0) // Type II        289         if(fOnsagerRadius == 0) // Type II
290         {                                         290         {
291             fEffectiveReactionRadius = fReacti    291             fEffectiveReactionRadius = fReactionRadius;
292             fDiffusionRate = 4 * pi * sumDiffC    292             fDiffusionRate = 4 * pi * sumDiffCoeff * fReactionRadius * Avogadro;
293             if (fpReactant1 == fpReactant2) fD    293             if (fpReactant1 == fpReactant2) fDiffusionRate/=2;
294             fActivationRate = fDiffusionRate *    294             fActivationRate = fDiffusionRate * fObservedReactionRate / (fDiffusionRate - fObservedReactionRate);
295             fProbability =  Rs / (Rs + (fDiffu    295             fProbability =  Rs / (Rs + (fDiffusionRate / fActivationRate) * (fReactionRadius + Rs));
296                                                   296 
297         }else{ // Type IV                         297         }else{ // Type IV
298             fEffectiveReactionRadius = -fOnsag    298             fEffectiveReactionRadius = -fOnsagerRadius/(1-exp(fOnsagerRadius/fReactionRadius));
299             fDiffusionRate = 4 * pi * sumDiffC    299             fDiffusionRate = 4 * pi * sumDiffCoeff * fEffectiveReactionRadius * Avogadro;
300             if (fpReactant1 == fpReactant2) fD    300             if (fpReactant1 == fpReactant2) fDiffusionRate/=2;
301                                                   301 
302             fActivationRate = fDiffusionRate *    302             fActivationRate = fDiffusionRate * fObservedReactionRate / (fDiffusionRate - fObservedReactionRate);
303             fProbability = Rs / (Rs + (fDiffus    303             fProbability = Rs / (Rs + (fDiffusionRate / fActivationRate) * (fEffectiveReactionRadius + Rs));
304         }                                         304         }
305     }                                             305     }
306                                                   306 
307     fType = type;                                 307     fType = type;
308 }                                                 308 }
309                                                   309 
310 G4int G4DNAMolecularReactionData::GetReactionT    310 G4int G4DNAMolecularReactionData::GetReactionType() const
311 {                                                 311 {
312     return fType;                                 312     return fType;
313 }                                                 313 }
314                                                   314 
315 void G4DNAMolecularReactionData::AddProduct(co    315 void G4DNAMolecularReactionData::AddProduct(const G4String& molecule)
316 {                                                 316 {
317     fProducts.push_back(G4MoleculeTable::Insta    317     fProducts.push_back(G4MoleculeTable::Instance()->GetConfiguration(molecule));
318 }                                                 318 }
319                                                   319 
320 double G4DNAMolecularReactionData::PolynomialP    320 double G4DNAMolecularReactionData::PolynomialParam(double temp_K, std::vector<double> P)
321 {                                                 321 {
322     double inv_temp = 1. / temp_K;                322     double inv_temp = 1. / temp_K;
323                                                   323 
324     return pow(10,                                324     return pow(10,
325                P[0] + P[1] * inv_temp + P[2] *    325                P[0] + P[1] * inv_temp + P[2] * pow(inv_temp, 2)
326                + P[3] * pow(inv_temp, 3) + P[4    326                + P[3] * pow(inv_temp, 3) + P[4] * pow(inv_temp, 4))
327         * (1e-3 * CLHEP::m3 / (CLHEP::mole * C    327         * (1e-3 * CLHEP::m3 / (CLHEP::mole * CLHEP::s));
328 }                                                 328 }
329                                                   329 
330 double G4DNAMolecularReactionData::ArrehniusPa    330 double G4DNAMolecularReactionData::ArrehniusParam(double temp_K, std::vector<double> P)
331 {                                                 331 {
332     return P[0] * G4Exp(P[1] / temp_K)*           332     return P[0] * G4Exp(P[1] / temp_K)*
333         (1e-3 * CLHEP::m3 / (CLHEP::mole * CLH    333         (1e-3 * CLHEP::m3 / (CLHEP::mole * CLHEP::s));
334 }                                                 334 }
335                                                   335 
336 double G4DNAMolecularReactionData::ScaledParam    336 double G4DNAMolecularReactionData::ScaledParameterization(double temp_K,
337                                                   337                                                           double temp_init,
338                                                   338                                                           double rateCste_init)
339 {                                                 339 {
340     double D0 = G4MolecularConfiguration::Diff    340     double D0 = G4MolecularConfiguration::DiffCoeffWater(temp_init);
341     double Df = G4MolecularConfiguration::Diff    341     double Df = G4MolecularConfiguration::DiffCoeffWater(temp_K);
342     return Df * rateCste_init / D0;               342     return Df * rateCste_init / D0;
343 }                                                 343 }
344                                                   344 
345 //============================================    345 //==============================================================================
346 // REACTION TABLE                                 346 // REACTION TABLE
347 //============================================    347 //==============================================================================
348                                                   348 
349 G4DNAMolecularReactionTable* G4DNAMolecularRea    349 G4DNAMolecularReactionTable* G4DNAMolecularReactionTable::GetReactionTable()
350 {                                                 350 {
351     if (fpInstance == nullptr)                    351     if (fpInstance == nullptr)
352     {                                             352     {
353         fpInstance = new G4DNAMolecularReactio    353         fpInstance = new G4DNAMolecularReactionTable();
354     }                                             354     }
355     return fpInstance;                            355     return fpInstance;
356 }                                                 356 }
357                                                   357 
358 //____________________________________________    358 //_____________________________________________________________________________________
359                                                   359 
360 G4DNAMolecularReactionTable* G4DNAMolecularRea    360 G4DNAMolecularReactionTable* G4DNAMolecularReactionTable::Instance()
361 {                                                 361 {
362     if (fpInstance == nullptr)                    362     if (fpInstance == nullptr)
363     {                                             363     {
364         fpInstance = new G4DNAMolecularReactio    364         fpInstance = new G4DNAMolecularReactionTable();
365     }                                             365     }
366     return fpInstance;                            366     return fpInstance;
367 }                                                 367 }
368                                                   368 
369 //____________________________________________    369 //_____________________________________________________________________________________
370                                                   370 
371 void G4DNAMolecularReactionTable::DeleteInstan    371 void G4DNAMolecularReactionTable::DeleteInstance()
372 {                                                 372 {
373                                                   373     
374                                                   374     
375         delete fpInstance;                        375         delete fpInstance;
376                                                   376     
377     fpInstance = nullptr;                         377     fpInstance = nullptr;
378 }                                                 378 }
379                                                   379 
380 //____________________________________________    380 //_____________________________________________________________________________________
381                                                   381 
382 G4DNAMolecularReactionTable::G4DNAMolecularRea    382 G4DNAMolecularReactionTable::G4DNAMolecularReactionTable()
383     :                                             383     : 
384      fpMessenger(new G4ReactionTableMessenger(    384      fpMessenger(new G4ReactionTableMessenger(this))
385 {                                                 385 {
386 }                                                 386 }
387                                                   387 
388 G4DNAMolecularReactionTable::~G4DNAMolecularRe    388 G4DNAMolecularReactionTable::~G4DNAMolecularReactionTable() = default;
389                                                   389 
390 void G4DNAMolecularReactionTable::SetReaction(    390 void G4DNAMolecularReactionTable::SetReaction(G4DNAMolecularReactionData* pReactionData)
391 {                                                 391 {
392     const auto pReactant1 = pReactionData->Get    392     const auto pReactant1 = pReactionData->GetReactant1();
393     const auto pReactant2 = pReactionData->Get    393     const auto pReactant2 = pReactionData->GetReactant2();
394                                                   394 
395     fReactionData[pReactant1][pReactant2] = pR    395     fReactionData[pReactant1][pReactant2] = pReactionData;
396     fReactantsMV[pReactant1].push_back(pReacta    396     fReactantsMV[pReactant1].push_back(pReactant2);
397     fReactionDataMV[pReactant1].push_back(pRea    397     fReactionDataMV[pReactant1].push_back(pReactionData);
398                                                   398 
399     if (pReactant1 != pReactant2)                 399     if (pReactant1 != pReactant2)
400     {                                             400     {
401         fReactionData[pReactant2][pReactant1]     401         fReactionData[pReactant2][pReactant1] = pReactionData;
402         fReactantsMV[pReactant2].push_back(pRe    402         fReactantsMV[pReactant2].push_back(pReactant1);
403         fReactionDataMV[pReactant2].push_back(    403         fReactionDataMV[pReactant2].push_back(pReactionData);
404     }                                             404     }
405                                                   405 
406     fVectorOfReactionData.emplace_back(pReacti    406     fVectorOfReactionData.emplace_back(pReactionData);
407     pReactionData->SetReactionID((G4int)fVecto    407     pReactionData->SetReactionID((G4int)fVectorOfReactionData.size());
408 }                                                 408 }
409                                                   409 
410 //____________________________________________    410 //_____________________________________________________________________________________
411                                                   411 
412 void G4DNAMolecularReactionTable::SetReaction(    412 void G4DNAMolecularReactionTable::SetReaction(G4double reactionRate,
413                                                   413                                               Reactant* pReactant1,
414                                                   414                                               Reactant* pReactant2)
415 {                                                 415 {
416     auto reactionData = new G4DNAMolecularReac    416     auto reactionData = new G4DNAMolecularReactionData(reactionRate, pReactant1, pReactant2);
417     SetReaction(reactionData);                    417     SetReaction(reactionData);
418 }                                                 418 }
419                                                   419 
420 //____________________________________________    420 //_____________________________________________________________________________________
421                                                   421 
422 void G4DNAMolecularReactionTable::PrintTable(G    422 void G4DNAMolecularReactionTable::PrintTable(G4VDNAReactionModel* pReactionModel)
423 {                                                 423 {
424     // Print Reactions and Interaction radius     424     // Print Reactions and Interaction radius for jump step = 3ps
425                                                   425 
426     G4IosFlagsSaver iosfs(G4cout);                426     G4IosFlagsSaver iosfs(G4cout);
427                                                   427 
428    if ((pReactionModel != nullptr) && ((pReact    428    if ((pReactionModel != nullptr) && ((pReactionModel->GetReactionTable()) == nullptr))
429    {                                              429    {
430        pReactionModel->SetReactionTable(this);    430        pReactionModel->SetReactionTable(this);
431    }                                              431    }
432                                                   432 
433     ReactivesMV::iterator itReactives;            433     ReactivesMV::iterator itReactives;
434                                                   434 
435     std::map<Reactant*, std::map<Reactant*, G4    435     std::map<Reactant*, std::map<Reactant*, G4bool>> alreadyPrint;
436                                                   436 
437     G4cout << "Number of chemical species invo    437     G4cout << "Number of chemical species involved in reactions = "
438            << fReactantsMV.size() << G4endl;      438            << fReactantsMV.size() << G4endl;
439                                                   439 
440     std::size_t nbPrintable = fReactantsMV.siz    440     std::size_t nbPrintable = fReactantsMV.size() * fReactantsMV.size();
441                                                   441 
442     auto  outputReaction = new G4String[nbPrin    442     auto  outputReaction = new G4String[nbPrintable];
443     auto  outputReactionRate = new G4String[nb    443     auto  outputReactionRate = new G4String[nbPrintable];
444     auto  outputRange = new G4String[nbPrintab    444     auto  outputRange = new G4String[nbPrintable];
445     G4int n = 0;                                  445     G4int n = 0;
446                                                   446 
447     for (itReactives = fReactantsMV.begin(); i    447     for (itReactives = fReactantsMV.begin(); itReactives != fReactantsMV.end();
448          ++itReactives)                           448          ++itReactives)
449     {                                             449     {
450         auto  moleculeA = (Reactant*)itReactiv    450         auto  moleculeA = (Reactant*)itReactives->first;
451         const vector<Reactant*>* reactivesVect    451         const vector<Reactant*>* reactivesVector = CanReactWith(moleculeA);
452                                                   452 
453         if (pReactionModel != nullptr) pReacti    453         if (pReactionModel != nullptr) pReactionModel->InitialiseToPrint(moleculeA);
454                                                   454 
455         auto  nbReactants = (G4int)fReactantsM    455         auto  nbReactants = (G4int)fReactantsMV[itReactives->first].size();
456                                                   456 
457         for (G4int iReact = 0; iReact < nbReac    457         for (G4int iReact = 0; iReact < nbReactants; iReact++)
458         {                                         458         {
459             auto moleculeB = (Reactant*)(*reac    459             auto moleculeB = (Reactant*)(*reactivesVector)[iReact];
460                                                   460 
461             Data* reactionData = fReactionData    461             Data* reactionData = fReactionData[moleculeA][moleculeB];
462                                                   462 
463             //--------------------------------    463             //-----------------------------------------------------------
464             // Name of the reaction               464             // Name of the reaction
465             if (!alreadyPrint[moleculeA][molec    465             if (!alreadyPrint[moleculeA][moleculeB])
466             {                                     466             {
467                 outputReaction[n] = moleculeA-    467                 outputReaction[n] = moleculeA->GetName() + " + " + moleculeB->GetName();
468                                                   468 
469                 G4int nbProducts = reactionDat    469                 G4int nbProducts = reactionData->GetNbProducts();
470                                                   470 
471                 if (nbProducts != 0)              471                 if (nbProducts != 0)
472                 {                                 472                 {
473                     outputReaction[n] += " ->     473                     outputReaction[n] += " -> " + reactionData->GetProduct(0)->GetName();
474                                                   474 
475                     for (G4int j = 1; j < nbPr    475                     for (G4int j = 1; j < nbProducts; j++)
476                     {                             476                     {
477                         outputReaction[n] += "    477                         outputReaction[n] += " + " + reactionData->GetProduct(j)->GetName();
478                     }                             478                     }
479                 }                                 479                 }
480                 else                              480                 else
481                 {                                 481                 {
482                     outputReaction[n] += " ->     482                     outputReaction[n] += " -> No product";
483                 }                                 483                 }
484                                                   484 
485                 //----------------------------    485                 //-----------------------------------------------------------
486                 // Interaction Rate               486                 // Interaction Rate
487                 outputReactionRate[n] = G4UIco    487                 outputReactionRate[n] = G4UIcommand::ConvertToString(
488                     reactionData->GetObservedR    488                     reactionData->GetObservedReactionRateConstant() / (1e-3 * m3 / (mole * s)));
489                                                   489 
490                 //----------------------------    490                 //-----------------------------------------------------------
491                 // Calculation of the Interact    491                 // Calculation of the Interaction Range
492                 G4double interactionRange = -1    492                 G4double interactionRange = -1;
493                 if (pReactionModel != nullptr)    493                 if (pReactionModel != nullptr) interactionRange =
494                     pReactionModel->GetReactio    494                     pReactionModel->GetReactionRadius(iReact);
495                                                   495 
496                 if (interactionRange != -1)       496                 if (interactionRange != -1)
497                 {                                 497                 {
498                     outputRange[n] = G4UIcomma    498                     outputRange[n] = G4UIcommand::ConvertToString(
499                         interactionRange / nan    499                         interactionRange / nanometer);
500                 }                                 500                 }
501                 else                              501                 else
502                 {                                 502                 {
503                     outputRange[n] = "";          503                     outputRange[n] = "";
504                 }                                 504                 }
505                                                   505 
506                 alreadyPrint[moleculeB][molecu    506                 alreadyPrint[moleculeB][moleculeA] = TRUE;
507                 n++;                              507                 n++;
508             }                                     508             }
509         }                                         509         }
510     }                                             510     }
511     // G4cout<<"Number of possible reactions:     511     // G4cout<<"Number of possible reactions: "<< n << G4endl;
512                                                   512 
513     //////////////////////////////////////////    513     ////////////////////////////////////////////////////////////////////
514     // Tableau dynamique en fonction du nombre    514     // Tableau dynamique en fonction du nombre de caractere maximal dans
515     // chaque colonne                             515     // chaque colonne
516     //////////////////////////////////////////    516     ////////////////////////////////////////////////////////////////////
517                                                   517 
518     G4int maxlengthOutputReaction = -1;           518     G4int maxlengthOutputReaction = -1;
519     G4int maxlengthOutputReactionRate = -1;       519     G4int maxlengthOutputReactionRate = -1;
520                                                   520 
521     for (G4int i = 0; i < n; ++i)                 521     for (G4int i = 0; i < n; ++i)
522     {                                             522     {
523         if (maxlengthOutputReaction < (G4int)o    523         if (maxlengthOutputReaction < (G4int)outputReaction[i].length())
524         {                                         524         {
525             maxlengthOutputReaction = (G4int)o    525             maxlengthOutputReaction = (G4int)outputReaction[i].length();
526         }                                         526         }
527         if (maxlengthOutputReactionRate < (G4i    527         if (maxlengthOutputReactionRate < (G4int)outputReactionRate[i].length())
528         {                                         528         {
529             maxlengthOutputReactionRate = (G4i    529             maxlengthOutputReactionRate = (G4int)outputReactionRate[i].length();
530         }                                         530         }
531     }                                             531     }
532                                                   532 
533     maxlengthOutputReaction += 2;                 533     maxlengthOutputReaction += 2;
534     maxlengthOutputReactionRate += 2;             534     maxlengthOutputReactionRate += 2;
535                                                   535 
536     if (maxlengthOutputReaction < 10) maxlengt    536     if (maxlengthOutputReaction < 10) maxlengthOutputReaction = 10;
537     if (maxlengthOutputReactionRate < 30) maxl    537     if (maxlengthOutputReactionRate < 30) maxlengthOutputReactionRate = 30;
538                                                   538 
539     G4String* title;                              539     G4String* title;
540                                                   540 
541     if (pReactionModel != nullptr) title = new    541     if (pReactionModel != nullptr) title = new G4String[3];
542     else title = new G4String[2];                 542     else title = new G4String[2];
543                                                   543 
544     title[0] = "Reaction";                        544     title[0] = "Reaction";
545     title[1] = "Reaction Rate [dm3/(mol*s)]";     545     title[1] = "Reaction Rate [dm3/(mol*s)]";
546                                                   546 
547     if (pReactionModel != nullptr) title[2] =     547     if (pReactionModel != nullptr) title[2] =
548         "Interaction Range for chosen reaction    548         "Interaction Range for chosen reaction model [nm]";
549                                                   549 
550     G4cout << setfill(' ') << setw(maxlengthOu    550     G4cout << setfill(' ') << setw(maxlengthOutputReaction) << left << title[0]
551         << setw(maxlengthOutputReactionRate) <    551         << setw(maxlengthOutputReactionRate) << left << title[1];
552                                                   552 
553     if (pReactionModel != nullptr) G4cout << s    553     if (pReactionModel != nullptr) G4cout << setw(2) << left << title[2];
554                                                   554 
555     G4cout << G4endl;                             555     G4cout << G4endl;
556                                                   556 
557     G4cout.fill('-');                             557     G4cout.fill('-');
558     if (pReactionModel != nullptr) G4cout.widt    558     if (pReactionModel != nullptr) G4cout.width(
559         maxlengthOutputReaction + 2 + maxlengt    559         maxlengthOutputReaction + 2 + maxlengthOutputReactionRate + 2
560         + (G4int)title[2].length());              560         + (G4int)title[2].length());
561     else G4cout.width(maxlengthOutputReaction     561     else G4cout.width(maxlengthOutputReaction + 2 + maxlengthOutputReactionRate);
562     G4cout << "-" << G4endl;                      562     G4cout << "-" << G4endl;
563     G4cout.fill(' ');                             563     G4cout.fill(' ');
564                                                   564 
565     for (G4int i = 0; i < n; i++)                 565     for (G4int i = 0; i < n; i++)
566     {                                             566     {
567         G4cout << setw(maxlengthOutputReaction    567         G4cout << setw(maxlengthOutputReaction) << left << outputReaction[i]
568                << setw(maxlengthOutputReaction    568                << setw(maxlengthOutputReactionRate) << left
569                << outputReactionRate[i];          569                << outputReactionRate[i];
570                                                   570 
571         if (pReactionModel != nullptr) G4cout     571         if (pReactionModel != nullptr) G4cout << setw(2) << left << outputRange[i];
572                                                   572 
573         G4cout << G4endl;                         573         G4cout << G4endl;
574                                                   574 
575         G4cout.fill('-');                         575         G4cout.fill('-');
576         if (pReactionModel != nullptr) G4cout.    576         if (pReactionModel != nullptr) G4cout.width(
577             maxlengthOutputReaction + 2 + maxl    577             maxlengthOutputReaction + 2 + maxlengthOutputReactionRate + 2
578             + (G4int)title[2].length());          578             + (G4int)title[2].length());
579         else G4cout.width(                        579         else G4cout.width(
580             maxlengthOutputReaction + 2 + maxl    580             maxlengthOutputReaction + 2 + maxlengthOutputReactionRate);
581         G4cout << "-" << G4endl;                  581         G4cout << "-" << G4endl;
582         G4cout.fill(' ');                         582         G4cout.fill(' ');
583     }                                             583     }
584                                                   584 
585     delete[] title;                               585     delete[] title;
586     delete[] outputReaction;                      586     delete[] outputReaction;
587     delete[] outputReactionRate;                  587     delete[] outputReactionRate;
588     delete[] outputRange;                         588     delete[] outputRange;
589 }                                                 589 }
590                                                   590 
591 //____________________________________________    591 //______________________________________________________________________________
592 // Get/Set methods                                592 // Get/Set methods
593                                                   593 
594 G4VDNAMolecularGeometry* G4DNAMolecularReactio    594 G4VDNAMolecularGeometry* G4DNAMolecularReactionTable::GetGeometry() const
595 {                                                 595 {
596   return fGeometry;                               596   return fGeometry;
597 }                                                 597 }
598                                                   598 
599 G4DNAMolecularReactionTable::Data*                599 G4DNAMolecularReactionTable::Data*
600 G4DNAMolecularReactionTable::GetReactionData(R    600 G4DNAMolecularReactionTable::GetReactionData(Reactant* pReactant1,
601                                              R    601                                              Reactant* pReactant2) const
602 {                                                 602 {
603     if (fReactionData.empty())                    603     if (fReactionData.empty())
604     {                                             604     {
605         G4String errMsg = "No reaction table w    605         G4String errMsg = "No reaction table was implemented";
606         G4Exception("G4MolecularInteractionTab    606         G4Exception("G4MolecularInteractionTable::GetReactionData", "",
607                     FatalErrorInArgument, errM    607                     FatalErrorInArgument, errMsg);
608     }                                             608     }
609                                                   609 
610     auto it1 = fReactionData.find(pReactant1);    610     auto it1 = fReactionData.find(pReactant1);
611                                                   611 
612     if (it1 == fReactionData.end())               612     if (it1 == fReactionData.end())
613     {                                             613     {
614         G4String errMsg =                         614         G4String errMsg =
615             "No reaction table was implemented    615             "No reaction table was implemented for this molecule Definition : " + pReactant1
616             ->GetName();                          616             ->GetName();
617         G4Exception("G4MolecularInteractionTab    617         G4Exception("G4MolecularInteractionTable::GetReactionData", "",
618                     FatalErrorInArgument, errM    618                     FatalErrorInArgument, errMsg);
619         // Though the above is Fatal and will     619         // Though the above is Fatal and will terminate program, put return in to quieten Coverity
620         return nullptr;                           620         return nullptr;
621     }                                             621     }
622                                                   622 
623     auto it2 = it1->second.find(pReactant2);      623     auto it2 = it1->second.find(pReactant2);
624                                                   624 
625     if (it2 == it1->second.end())                 625     if (it2 == it1->second.end())
626     {                                             626     {
627         G4cout << "Name : " << pReactant2->Get    627         G4cout << "Name : " << pReactant2->GetName() << G4endl;
628         G4String errMsg = "No reaction table w    628         G4String errMsg = "No reaction table was implemented for this molecule : "
629             + pReactant2->GetName();              629             + pReactant2->GetName();
630         G4Exception("G4MolecularInteractionTab    630         G4Exception("G4MolecularInteractionTable::GetReactionData", "", FatalErrorInArgument, errMsg);
631     }                                             631     }
632                                                   632 
633     return (it2->second);                         633     return (it2->second);
634 }                                                 634 }
635                                                   635 
636 const G4DNAMolecularReactionTable::ReactionDat    636 const G4DNAMolecularReactionTable::ReactionDataMap& G4DNAMolecularReactionTable::GetAllReactionData()
637 {                                                 637 {
638     return fReactionData;                         638     return fReactionData;
639 }                                                 639 }
640                                                   640 
641 G4DNAMolecularReactionTable::DataList G4DNAMol    641 G4DNAMolecularReactionTable::DataList G4DNAMolecularReactionTable::GetVectorOfReactionData()
642 {                                                 642 {
643     DataList dataList;                            643     DataList dataList;
644                                                   644 
645     for (const auto& pData : fVectorOfReaction    645     for (const auto& pData : fVectorOfReactionData)
646     {                                             646     {
647         dataList.emplace_back(pData.get());       647         dataList.emplace_back(pData.get());
648     }                                             648     }
649                                                   649 
650     return dataList;                              650     return dataList;
651 }                                                 651 }
652                                                   652 
653 //____________________________________________    653 //______________________________________________________________________________
654                                                   654 
655 const G4DNAMolecularReactionTable::ReactantLis    655 const G4DNAMolecularReactionTable::ReactantList*
656 G4DNAMolecularReactionTable::CanReactWith(Reac    656 G4DNAMolecularReactionTable::CanReactWith(Reactant* pMolecule) const
657 {                                                 657 {
658     if (fReactantsMV.empty())                     658     if (fReactantsMV.empty())
659     {                                             659     {
660         G4String errMsg = "No reaction table w    660         G4String errMsg = "No reaction table was implemented";
661         G4Exception("G4MolecularInteractionTab    661         G4Exception("G4MolecularInteractionTable::CanReactWith", "",
662                     FatalErrorInArgument, errM    662                     FatalErrorInArgument, errMsg);
663         return nullptr;                           663         return nullptr;
664     }                                             664     }
665                                                   665 
666     auto itReactivesMap = fReactantsMV.find(pM    666     auto itReactivesMap = fReactantsMV.find(pMolecule);
667                                                   667 
668     if (itReactivesMap == fReactantsMV.end())     668     if (itReactivesMap == fReactantsMV.end())
669     {                                             669     {
670 #ifdef G4VERBOSE                                  670 #ifdef G4VERBOSE
671         if (fVerbose)                             671         if (fVerbose)
672         {                                         672         {
673             G4String errMsg = "No reaction tab    673             G4String errMsg = "No reaction table was implemented for this molecule : "
674                 + pMolecule->GetName();           674                 + pMolecule->GetName();
675             //          G4Exception("G4Molecul    675             //          G4Exception("G4MolecularInteractionTable::CanReactWith","",FatalErrorInArgument, errMsg);
676             G4cout << "--- G4MolecularInteract    676             G4cout << "--- G4MolecularInteractionTable::GetReactionData ---" << G4endl;
677             G4cout << errMsg << G4endl;           677             G4cout << errMsg << G4endl;
678         }                                         678         }
679 #endif                                            679 #endif
680         return nullptr;                           680         return nullptr;
681     }                                             681     }
682                                                   682 
683     if (fVerbose)                                 683     if (fVerbose)
684     {                                             684     {
685         G4cout << " G4MolecularInteractionTabl    685         G4cout << " G4MolecularInteractionTable::CanReactWith :" << G4endl;
686         G4cout << "You are checking reactants     686         G4cout << "You are checking reactants for : " << pMolecule->GetName() << G4endl;
687         G4cout << " the number of reactants is    687         G4cout << " the number of reactants is : " << itReactivesMap->second.size() << G4endl;
688                                                   688 
689         auto itProductsVector = itReactivesMap    689         auto itProductsVector = itReactivesMap->second.cbegin();
690                                                   690 
691         for (; itProductsVector != itReactives    691         for (; itProductsVector != itReactivesMap->second.end(); itProductsVector++)
692         {                                         692         {
693             G4cout << (*itProductsVector)->Get    693             G4cout << (*itProductsVector)->GetName() << G4endl;
694         }                                         694         }
695     }                                             695     }
696     return &(itReactivesMap->second);             696     return &(itReactivesMap->second);
697 }                                                 697 }
698                                                   698 
699 //____________________________________________    699 //______________________________________________________________________________
700                                                   700 
701 const G4DNAMolecularReactionTable::SpecificDat    701 const G4DNAMolecularReactionTable::SpecificDataList*
702 G4DNAMolecularReactionTable::GetReativesNData(    702 G4DNAMolecularReactionTable::GetReativesNData(const G4MolecularConfiguration* molecule) const
703 {                                                 703 {
704     if (fReactionData.empty())                    704     if (fReactionData.empty())
705     {                                             705     {
706         G4String errMsg = "No reaction table w    706         G4String errMsg = "No reaction table was implemented";
707         G4Exception("G4MolecularInteractionTab    707         G4Exception("G4MolecularInteractionTable::CanInteractWith", "",
708                     FatalErrorInArgument, errM    708                     FatalErrorInArgument, errMsg);
709     }                                             709     }
710                                                   710 
711     auto itReactivesMap = fReactionData.find(m    711     auto itReactivesMap = fReactionData.find(molecule);
712                                                   712 
713     if (itReactivesMap == fReactionData.end())    713     if (itReactivesMap == fReactionData.end())
714     {                                             714     {
715         return nullptr;                           715         return nullptr;
716     }                                             716     }
717                                                   717 
718     if (fVerbose)                                 718     if (fVerbose)
719     {                                             719     {
720         G4cout << " G4MolecularInteractionTabl    720         G4cout << " G4MolecularInteractionTable::CanReactWith :" << G4endl;
721         G4cout << "You are checking reactants     721         G4cout << "You are checking reactants for : " << molecule->GetName() << G4endl;
722         G4cout << " the number of reactants is    722         G4cout << " the number of reactants is : " << itReactivesMap->second.size() << G4endl;
723                                                   723 
724         auto itProductsVector = itReactivesMap    724         auto itProductsVector = itReactivesMap->second.begin();
725                                                   725 
726         for (; itProductsVector != itReactives    726         for (; itProductsVector != itReactivesMap->second.end(); itProductsVector++)
727         {                                         727         {
728             G4cout << itProductsVector->first-    728             G4cout << itProductsVector->first->GetName() << G4endl;
729         }                                         729         }
730     }                                             730     }
731     return &(itReactivesMap->second);             731     return &(itReactivesMap->second);
732 }                                                 732 }
733                                                   733 
734 //____________________________________________    734 //______________________________________________________________________________
735                                                   735 
736 const G4DNAMolecularReactionTable::DataList*      736 const G4DNAMolecularReactionTable::DataList*
737 G4DNAMolecularReactionTable::GetReactionData(c    737 G4DNAMolecularReactionTable::GetReactionData(const G4MolecularConfiguration* molecule) const
738 {                                                 738 {
739     if (fReactionDataMV.empty())                  739     if (fReactionDataMV.empty())
740     {                                             740     {
741         G4String errMsg = "No reaction table w    741         G4String errMsg = "No reaction table was implemented";
742         G4Exception("G4MolecularInteractionTab    742         G4Exception("G4MolecularInteractionTable::CanInteractWith", "",
743                     FatalErrorInArgument, errM    743                     FatalErrorInArgument, errMsg);
744     }                                             744     }
745     auto it = fReactionDataMV.find(molecule);     745     auto it = fReactionDataMV.find(molecule);
746                                                   746 
747     if (it == fReactionDataMV.end())              747     if (it == fReactionDataMV.end())
748     {                                             748     {
749         G4String errMsg = "No reaction table w    749         G4String errMsg = "No reaction table was implemented for this molecule Definition : "
750             + molecule->GetName();                750             + molecule->GetName();
751         G4Exception("G4MolecularInteractionTab    751         G4Exception("G4MolecularInteractionTable::GetReactionData", "", FatalErrorInArgument, errMsg);
752         // Though the above is Fatal and will     752         // Though the above is Fatal and will terminate program, put return in to quieten Coverity
753         return nullptr;                           753         return nullptr;
754     }                                             754     }
755                                                   755 
756     return &(it->second);                         756     return &(it->second);
757 }                                                 757 }
758                                                   758 
759 //____________________________________________    759 //______________________________________________________________________________
760                                                   760 
761 G4DNAMolecularReactionTable::Data* G4DNAMolecu    761 G4DNAMolecularReactionTable::Data* G4DNAMolecularReactionTable::GetReactionData(const G4String& mol1,
762                                                   762                                                                                 const G4String& mol2) const
763 {                                                 763 {
764     const auto pConf1 = G4MoleculeTable::GetMo    764     const auto pConf1 = G4MoleculeTable::GetMoleculeTable()->GetConfiguration(mol1);
765     const auto pConf2 = G4MoleculeTable::GetMo    765     const auto pConf2 = G4MoleculeTable::GetMoleculeTable()->GetConfiguration(mol2);
766     return GetReactionData(pConf1, pConf2);       766     return GetReactionData(pConf1, pConf2);
767 }                                                 767 }
768                                                   768 
769 //____________________________________________    769 //______________________________________________________________________________
770                                                   770 
771 void                                              771 void
772 G4DNAMolecularReactionData::SetPolynomialParam    772 G4DNAMolecularReactionData::SetPolynomialParameterization(const std::vector<double>& P)
773 {                                                 773 {
774     fRateParam = std::bind(PolynomialParam, st    774     fRateParam = std::bind(PolynomialParam, std::placeholders::_1, P);
775 }                                                 775 }
776                                                   776 
777 //____________________________________________    777 //______________________________________________________________________________
778                                                   778 
779 void G4DNAMolecularReactionData::SetArrehniusP    779 void G4DNAMolecularReactionData::SetArrehniusParameterization(double A0,
780                                                   780                                                               double E_R)
781 {                                                 781 {
782     std::vector<double> P = { A0, E_R };          782     std::vector<double> P = { A0, E_R };
783     fRateParam = std::bind(ArrehniusParam, std    783     fRateParam = std::bind(ArrehniusParam, std::placeholders::_1, P);
784 }                                                 784 }
785                                                   785 
786 //____________________________________________    786 //______________________________________________________________________________
787                                                   787 
788 void G4DNAMolecularReactionData::SetScaledPara    788 void G4DNAMolecularReactionData::SetScaledParameterization(double temperature_K,
789                                                   789                                                            double rateCste)
790 {                                                 790 {
791     fRateParam = std::bind(ScaledParameterizat    791     fRateParam = std::bind(ScaledParameterization,
792                            std::placeholders::    792                            std::placeholders::_1,
793                            temperature_K,         793                            temperature_K,
794                            rateCste);             794                            rateCste);
795 }                                                 795 }
796                                                   796 
797 //____________________________________________    797 //______________________________________________________________________________
798                                                   798 
799 void G4DNAMolecularReactionTable::ScaleReactio    799 void G4DNAMolecularReactionTable::ScaleReactionRateForNewTemperature(double temp_K)
800 {                                                 800 {
801     for (const auto& pData : fVectorOfReaction    801     for (const auto& pData : fVectorOfReactionData)
802     {                                             802     {
803         const_cast<G4DNAMolecularReactionData*    803         const_cast<G4DNAMolecularReactionData*>(pData.get())->ScaleForNewTemperature(temp_K);
804     }                                             804     }
805 }                                                 805 }
806                                                   806 
807 //____________________________________________    807 //______________________________________________________________________________
808                                                   808 
809 void G4DNAMolecularReactionData::ScaleForNewTe    809 void G4DNAMolecularReactionData::ScaleForNewTemperature(double temp_K)
810 {                                                 810 {
811     if (fRateParam)                               811     if (fRateParam)
812     {                                             812     {
813         SetObservedReactionRateConstant(fRateP    813         SetObservedReactionRateConstant(fRateParam(temp_K));
814     }                                             814     }
815 }                                                 815 }
816                                                   816 
817 //____________________________________________    817 //______________________________________________________________________________
818                                                   818 
819 G4DNAMolecularReactionTable::Data*                819 G4DNAMolecularReactionTable::Data*
820 G4DNAMolecularReactionTable::GetReaction(int r    820 G4DNAMolecularReactionTable::GetReaction(int reactionID) const
821 {                                                 821 {
822     for (auto& pData : fVectorOfReactionData)     822     for (auto& pData : fVectorOfReactionData)
823     {                                             823     {
824         if (pData->GetReactionID() == reaction    824         if (pData->GetReactionID() == reactionID)
825         {                                         825         {
826             return pData.get();                   826             return pData.get();
827         }                                         827         }
828     }                                             828     }
829     return nullptr;                               829     return nullptr;
830 }                                                 830 }
831                                                   831 
832 size_t G4DNAMolecularReactionTable::GetNReacti    832 size_t G4DNAMolecularReactionTable::GetNReactions() const
833 {                                                 833 {
834     return fVectorOfReactionData.size();          834     return fVectorOfReactionData.size();
835 }                                                 835 }
836                                                   836 
837 void G4DNAMolecularReactionTable::Reset()         837 void G4DNAMolecularReactionTable::Reset()
838 {                                                 838 {
839     fReactionData.clear();                        839     fReactionData.clear();
840     fReactantsMV.clear();                         840     fReactantsMV.clear();
841     fReactionDataMV.clear();                      841     fReactionDataMV.clear();
842     fVectorOfReactionData.clear();                842     fVectorOfReactionData.clear();
843 }                                                 843 }
844                                                   844