ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4DNAMolecularReactionTable.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4DNAMolecularReactionTable.hh
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 
65 {
66 public:
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 
92 
95 
96  void SetReactant1(Reactant* reactive);
97  void SetReactant2(Reactant* reactive);
98 
99  void SetReactants(Reactant* reactive1,
100  Reactant* reactive2);
101 
103 
104  void SetReactant1(const G4String& reactive);
105  void SetReactant2(const G4String& reactive);
106  void SetReactants(const G4String& reactive1, const G4String& reactive2);
107  void AddProduct(const G4String& molecule);
108 
109  G4int GetNbProducts() const;
110  Reactant* GetProduct(G4int i) const;
111 
112  const ReactionProducts* GetProducts() const;
113  void RemoveProducts();
114 
115  //----------------------------------------------------------------------------
116  // Temperature scaling
117  typedef std::function<double(double)> RateParam;
118 
119  static double PolynomialParam(double temp_K, std::vector<double> P);
120  static double ArrehniusParam(double temp_K, std::vector<double> P);
121  static double ScaledParameterization(double temp_K,
122  double temp_init,
123  double rateCste_init);
124 
125  void SetPolynomialParameterization(const std::vector<double>& P);
126 
127  void SetArrehniusParameterization(double A0, double E_R);
128  void SetScaledParameterization(double temperature_K,
129  double rateCste);
130 
131  void ScaleForNewTemperature(double temp_K);
132 
133 private:
134  void ComputeEffectiveRadius();
135 
136 protected:
142 
146 };
147 
153 {
154 protected:
157 
158 public:
161  static void DeleteInstance();
163 
166  using ReactantList = std::vector<Reactant*>;
167  using DataList = std::vector<Data*>;
168  using SpecificDataList = std::map<Reactant*, Data*>;
169 
170  using ReactionDataMap = std::map<Reactant*, SpecificDataList>;
171  using ReactivesMV = std::map<Reactant*, ReactantList>;
172  using ReactionDataMV = std::map<Reactant*, DataList>;
173 
183  void SetReaction(G4double observedReactionRate,
184  Reactant* reactive1,
185  Reactant* reactive2);
186 
188 
190 
191  Data* GetReactionData(const G4String&, const G4String&) const;
192 
193  Data* GetReaction(int reactionID) const;
194 
195  size_t GetNReactions() const;
196 
197  //_________________________________________________________________
201  const ReactantList* CanReactWith(Reactant*) const;
202 
204 
206 
208 
210 
211  void ScaleReactionRateForNewTemperature(double temp_K);
212 
213  //_________________________________________________________________
214  void PrintTable(G4VDNAReactionModel* = 0);
215 
216 protected:
218 
222  std::vector<std::unique_ptr<Data>> fVectorOfReactionData;
223  std::unique_ptr<G4ReactionTableMessenger> fpMessenger;
224 };