Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4MolecularConfiguration.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 (kara (AT) cenbg . in2p3 . fr)
28//
29// WARNING : This class is released as a prototype.
30// It might strongly evolve or even disapear in the next releases.
31//
32// History:
33// -----------
34// 10 Oct 2011 M.Karamitros created
35//
36// -------------------------------------------------------------------
37
38
39#ifndef G4MolecularConfiguration_
40#define G4MolecularConfiguration_ 1
42#include <map>
43#include <vector>
45
46struct comparator;
47
52
53/** The pointer G4MolecularConfiguration will be shared by all the
54* molecules having the same molecule definition and the same
55* electron occupancy
56* BE CAREFUlL !!! : If you change the mass for instance of a OH^-,
57* this will affect all the OH^- molecule diffusing around
58*/
60{
61public :
62
63 /////////////////
64 // Static methods
65
66 // Get for a given moleculeDefinition and a given electronic configuration, the mol conf
68 const G4ElectronOccupancy& electronOccupancy);
69
70 // Get ground state electronic configuration
72
73 // Release memory of the mol conf manager
74 static void DeleteManager();
75 ///////////////
76
77 // Methods
79
80 /** Returns the name of the molecule
81 */
82 const G4String& GetName() const;
83
84 /** Returns the nomber of atoms compouning the molecule
85 */
86 G4int GetAtomsNumber() const;
87
88 /** Method used in Geant4-DNA to excite water molecules
89 */
91
92 /** Method used in Geant4-DNA to ionize water molecules
93 */
95
96 /** Add n electrons to a given orbit.
97 * Note : You can add as many electrons to a given orbit, the result
98 * may be unrealist.
99 */
101
102 /** Remove n electrons to a given orbit.
103 */
105
106 /** Move one electron from an orbit to another.
107 */
109
110 /** Returns the number of electron.
111 */
112 G4double GetNbElectrons() const;
113
114 /** Show the electronic state of the molecule.
115 */
116 void PrintState() const;
117
118 const std::vector <const G4MolecularDecayChannel*>* GetDecayChannel() const;
119
120 G4int GetMoleculeID() const;
121
122 /** Sets the diffusion coefficient D of the molecule used in diffusion
123 * processes to calculate the mean square jump distance between two
124 * changes of direction. In three dimension : <x^2> = 6 D t where t is
125 * the mean jump time between two changes of direction.
126 */
128
129 /** Returns the diffusion coefficient D.
130 */
131 inline G4double GetDiffusionCoefficient() const;
132
133 /** Set the decay time of the molecule.
134 */
135 inline void SetDecayTime(G4double);
136
137 /** Returns the decay time of the molecule.
138 */
139 inline G4double GetDecayTime() const;
140
141 /** The Van Der Valls Radius of the molecule
142 */
143 inline void SetVanDerVaalsRadius(G4double);
144 inline G4double GetVanDerVaalsRadius() const ;
145
146 /** Returns the object ElectronOccupancy describing the electronic
147 * configuration of the molecule.
148 */
149 inline const G4ElectronOccupancy* GetElectronOccupancy() const;
150
151 /** Returns the charge of molecule.
152 */
153 inline G4int GetCharge() const;
154
155 /** Set the total mass of the molecule.
156 */
157 inline void SetMass(G4double);
158
159 /** Returns the total mass of the molecule.
160 */
161 inline G4double GetMass() const;
162
163protected :
169
172
174 {
177
178 typedef std::map<const G4MoleculeDefinition*, std::map<G4ElectronOccupancy, G4MolecularConfiguration*, comparator> > MolecularConfigurationTable;
180 };
181
183
185
191 mutable G4String fName; // mutable allowed this member to be changed in const methods
192};
193
195{
196 bool operator() (const G4ElectronOccupancy& occ1, const G4ElectronOccupancy& occ2) const
197 {
198 // Since this method is called a lot of time,
199 // we retrieve only once the totOcc
200 G4int totalOcc1 = occ1.GetTotalOccupancy() ;
201 G4int totalOcc2 = occ2.GetTotalOccupancy() ;
202 if ( totalOcc1!= totalOcc2)
203 {
204 return totalOcc1<totalOcc2;
205 }
206 else
207 {
208 G4int occupancy1 = -1 ;
209 G4int occupancy2 = -1 ;
210 const G4int sizeOrbit = occ1.GetSizeOfOrbit() ;
211 for (G4int i=0; i<occ1.GetSizeOfOrbit();)
212 {
213 // Since this method is called a lot of time,
214 // we retrieve only once the Occ
215
216 occupancy1 = occ1.GetOccupancy(i);
217 occupancy2 = occ2.GetOccupancy(i);
218
219 if (occupancy1 != occupancy2)
220 {
221 return occupancy1 < occupancy2;
222 }
223 else
224 {
225 i++;
226 if (i >= sizeOrbit) return false;
227 }
228 }
229 }
230 return false;
231 }
232};
233
234
236{
237 return fMoleculeDefinition;
238}
239
241{
242 return fElectronOccupancy ;
243}
244
246{
247 fDynDiffusionCoefficient = dynDiffusionCoefficient ;
248}
249
251{
253}
254
256{
257 fDynDecayTime = dynDecayTime;
258}
259
261{
262 return fDynDecayTime;
263}
264
266{
267 fDynVanDerVaalsRadius = dynVanDerVaalsRadius ;
268}
269
271{
273}
274
276{
277 return fDynCharge ;
278}
279
281{
282 fDynMass = aMass ;
283}
284
286{
287 return fDynMass;
288}
289#endif
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
G4int GetTotalOccupancy() const
G4int GetOccupancy(G4int orbit) const
G4MolecularConfiguration * RemoveElectron(G4int, G4int number=1)
const std::vector< const G4MolecularDecayChannel * > * GetDecayChannel() const
static G4MolecularConfigurationManager * GetManager()
const G4String & GetName() const
const G4ElectronOccupancy * fElectronOccupancy
static G4MolecularConfigurationManager * fgManager
G4MolecularConfiguration * ChangeConfiguration(const G4ElectronOccupancy &newElectronOccupancy)
static G4MolecularConfiguration * GetMolecularConfiguration(const G4MoleculeDefinition *, const G4ElectronOccupancy &electronOccupancy)
G4MolecularConfiguration & operator=(G4MolecularConfiguration &right)
const G4MoleculeDefinition * GetDefinition() const
G4MolecularConfiguration * MoveOneElectron(G4int, G4int)
G4MolecularConfiguration * IonizeMolecule(G4int)
G4MolecularConfiguration(const G4MolecularConfiguration &)
const G4MoleculeDefinition * fMoleculeDefinition
G4MolecularConfiguration * AddElectron(G4int orbit, G4int n=1)
const G4ElectronOccupancy * GetElectronOccupancy() const
G4MolecularConfiguration * ExciteMolecule(G4int)
std::map< const G4MoleculeDefinition *, std::map< G4ElectronOccupancy, G4MolecularConfiguration *, comparator > > MolecularConfigurationTable
bool operator()(const G4ElectronOccupancy &occ1, const G4ElectronOccupancy &occ2) const