Geant4  10.01.p03
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 // $Id: G4DNAMolecularReactionTable.hh 90769 2015-06-09 10:33:41Z gcosmo $
27 //
28 // Author: Mathieu Karamitros, kara@cenbg.in2p3.fr
29 
30 // The code is developed in the framework of the ESA AO7146
31 //
32 // We would be very happy hearing from you, send us your feedback! :)
33 //
34 // In order for Geant4-DNA to be maintained and still open-source,
35 // article citations are crucial.
36 // If you use Geant4-DNA chemistry and you publish papers about your software,
37 // in addition to the general paper on Geant4-DNA:
38 //
39 // Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
40 //
41 // we would be very happy if you could please also cite the following
42 // reference papers on chemistry:
43 //
44 // J. Comput. Phys. 274 (2014) 841-882
45 // Prog. Nucl. Sci. Tec. 2 (2011) 503-508
46 
47 
48 #ifndef G4MolecularReactionTable_h
49 #define G4MolecularReactionTable_h 1
50 
51 #include "G4ITReactionTable.hh"
52 #include "G4Molecule.hh"
53 #include <vector>
54 #include <map>
55 #include "G4ReferenceCast.hh"
56 
57 class G4VDNAReactionModel ;
59 
66 {
67  public :
69  const G4Molecule* reactive1,
70  const G4Molecule* reactive2);
71 
73  const G4String& reactive1,
74  const G4String& reactive2);
76 
77  const G4Molecule* GetReactive1() const { return fReactive1; }
78  const G4Molecule* GetReactive2() const { return fReactive2; }
79 
82 
83  //_____________________________________________________
84  void SetReactive1(const G4Molecule* reactive) ;
85  void SetReactive2(const G4Molecule* reactive) ;
86  void SetReactive(const G4Molecule* reactive1, const G4Molecule* reactive2);
87  void AddProduct(const G4Molecule* molecule);
88 
89  void SetReactive1(const G4String& reactive) ;
90  void SetReactive2(const G4String& reactive) ;
91  void SetReactive(const G4String& reactive1, const G4String& reactive2);
92  void AddProduct(const G4String& molecule);
93 
95  {
96  if(fProducts) return fProducts->size();
97  return 0;
98  }
99 
100  const G4Molecule* GetProduct(G4int i) const
101  {
102  if(fProducts) return (*fProducts)[i];
103  return 0;
104  }
105 
106  protected :
112 
113  std::vector<const G4Molecule*>* fProducts;
114 };
115 
117 {
118  bool operator () (const G4Molecule* molecule1, const G4Molecule* molecule2) const
119  {
120  return *molecule1<*molecule2;
121  }
122 };
123 
130 {
131 protected:
134  // static G4ThreadLocal G4DNAMolecularReactionTable* fInstance;
135 
136  public :
138  static void DeleteInstance();
140 
150  void SetReaction(G4double observedReactionRate,
151  const G4Molecule* reactive1, const G4Molecule* reactive2);
152 
154 
156  const G4Molecule*) const;
157 
158  //_________________________________________________________________
162  const std::vector<const G4Molecule*>* CanReactWith(const G4Molecule*) const ;
163  const std::map<const G4Molecule*,
165  compMoleculeP>* GetReativesNData(const G4Molecule*) const ;
166  const std::vector<const G4DNAMolecularReactionData*>*
167  GetReactionData(const G4Molecule*) const ;
168 
169  //_________________________________________________________________
170  void PrintTable(G4VDNAReactionModel* = 0);
171 
172  protected :
175 
176  //_________________________________________________
177  typedef std::map<const G4Molecule*,
178  std::map<const G4Molecule*,
179  const G4DNAMolecularReactionData*,
180  compMoleculeP>,
181  compMoleculeP > ReactionDataMap;
182  typedef std::map<const G4Molecule*,
183  std::vector<const G4Molecule*>,
184  compMoleculeP> ReactivesMV ;
185  typedef std::map<const G4Molecule*,
186  std::vector<const G4DNAMolecularReactionData*>,
187  compMoleculeP> ReactionDataMV ;
188 
189  ReactionDataMap fReactionData;
190  ReactivesMV fReactivesMV;
191  ReactionDataMV fReactionDataMV;
192 };
193 #endif /*G4MolecularReactionTable_HH*/
194 
std::map< const G4Molecule *, std::vector< const G4DNAMolecularReactionData * >, compMoleculeP > ReactionDataMV
std::map< const G4Molecule *, std::map< const G4Molecule *, const G4DNAMolecularReactionData *, compMoleculeP >, compMoleculeP > ReactionDataMap
G4VDNAReactionModel is an interface used by the G4DNAMolecularReaction process.
void AddProduct(const G4Molecule *molecule)
Free interface to define reaction information.
void SetReactive1(const G4Molecule *reactive)
G4DNAMolecularReactionTable sorts out the G4DNAMolecularReactionData for bimolecular reaction...
void SetReactive(const G4Molecule *reactive1, const G4Molecule *reactive2)
int G4int
Definition: G4Types.hh:78
const G4MoleculeHandleManager * fMoleculeHandleManager
static G4DNAMolecularReactionTable * GetReactionTable()
const G4Molecule * GetProduct(G4int i) const
std::map< const G4Molecule *, std::vector< const G4Molecule * >, compMoleculeP > ReactivesMV
void SetReactive2(const G4Molecule *reactive)
const G4Molecule * GetReactive2() const
bool G4bool
Definition: G4Types.hh:79
void PrintTable(G4VDNAReactionModel *=0)
const std::vector< const G4Molecule * > * CanReactWith(const G4Molecule *) const
Given a molecule's type, it returns with which a reaction is allowed.
static G4DNAMolecularReactionTable * fInstance
G4DNAMolecularReactionData contains the information relative to a given reaction (eg : °OH + °OH -> H...
void SetReaction(G4double observedReactionRate, const G4Molecule *reactive1, const G4Molecule *reactive2)
Define a reaction : First argument : reaction rate Second argument : reactant 1 Third argument : reac...
std::vector< const G4Molecule * > * fProducts
const G4DNAMolecularReactionData * GetReactionData(const G4Molecule *, const G4Molecule *) const
bool operator()(const G4Molecule *molecule1, const G4Molecule *molecule2) const
const std::map< const G4Molecule *, const G4DNAMolecularReactionData *, compMoleculeP > * GetReativesNData(const G4Molecule *) const
Class Description The dynamic molecule holds all the data that change for a molecule It has a pointer...
Definition: G4Molecule.hh:93
double G4double
Definition: G4Types.hh:76
const G4Molecule * GetReactive1() const