Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
source
processes
electromagnetic
dna
molecules
management
include
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
41
#include <
G4MoleculeDefinition.hh
>
42
#include <map>
43
#include <vector>
44
#include <
CLHEP/Utility/memory.h
>
45
46
struct
comparator
;
47
48
class
G4MolecularConfiguration
;
49
class
G4MoleculeDefinition
;
50
class
G4ElectronOccupancy
;
51
class
G4MolecularDecayChannel
;
52
59
class
G4MolecularConfiguration
60
{
61
public
:
62
64
// Static methods
65
66
// Get for a given moleculeDefinition and a given electronic configuration, the mol conf
67
static
G4MolecularConfiguration
*
GetMolecularConfiguration
(
const
G4MoleculeDefinition
*,
68
const
G4ElectronOccupancy
& electronOccupancy);
69
70
// Get ground state electronic configuration
71
static
G4MolecularConfiguration
*
GetMolecularConfiguration
(
const
G4MoleculeDefinition
*);
72
73
// Release memory of the mol conf manager
74
static
void
DeleteManager
();
76
77
// Methods
78
const
G4MoleculeDefinition
*
GetDefinition
()
const
;
79
82
const
G4String
&
GetName
()
const
;
83
86
G4int
GetAtomsNumber
()
const
;
87
90
G4MolecularConfiguration
*
ExciteMolecule
(
G4int
);
91
94
G4MolecularConfiguration
*
IonizeMolecule
(
G4int
);
95
100
G4MolecularConfiguration
*
AddElectron
(
G4int
orbit,
G4int
n
=1);
101
104
G4MolecularConfiguration
*
RemoveElectron
(
G4int
,
G4int
number=1);
105
108
G4MolecularConfiguration
*
MoveOneElectron
(
G4int
/*orbit*/
,
G4int
/*orbit*/
);
109
112
G4double
GetNbElectrons
()
const
;
113
116
void
PrintState
()
const
;
117
118
const
std::vector <const G4MolecularDecayChannel*>*
GetDecayChannel
()
const
;
119
120
G4int
GetMoleculeID
()
const
;
121
127
inline
void
SetDiffusionCoefficient
(
G4double
);
128
131
inline
G4double
GetDiffusionCoefficient
()
const
;
132
135
inline
void
SetDecayTime
(
G4double
);
136
139
inline
G4double
GetDecayTime
()
const
;
140
143
inline
void
SetVanDerVaalsRadius
(
G4double
);
144
inline
G4double
GetVanDerVaalsRadius
()
const
;
145
149
inline
const
G4ElectronOccupancy
*
GetElectronOccupancy
()
const
;
150
153
inline
G4int
GetCharge
()
const
;
154
157
inline
void
SetMass
(
G4double
);
158
161
inline
G4double
GetMass
()
const
;
162
163
protected
:
164
G4MolecularConfiguration
(
const
G4MoleculeDefinition
*,
const
G4ElectronOccupancy
&);
165
G4MolecularConfiguration
(
const
G4MolecularConfiguration
&);
166
G4MolecularConfiguration
&
operator=
(
G4MolecularConfiguration
&
right
);
167
~G4MolecularConfiguration
();
168
G4MolecularConfiguration
*
ChangeConfiguration
(
const
G4ElectronOccupancy
& newElectronOccupancy);
169
170
const
G4MoleculeDefinition
*
fMoleculeDefinition
;
171
const
G4ElectronOccupancy
*
fElectronOccupancy
;
172
173
struct
G4MolecularConfigurationManager
174
{
175
G4MolecularConfigurationManager
(){;}
176
~G4MolecularConfigurationManager
();
177
178
typedef
std::map<const G4MoleculeDefinition*, std::map<G4ElectronOccupancy, G4MolecularConfiguration*, comparator> >
MolecularConfigurationTable
;
179
MolecularConfigurationTable
fTable
;
180
};
181
182
static
G4MolecularConfigurationManager
*
fgManager
;
183
184
static
G4MolecularConfigurationManager
*
GetManager
();
185
186
G4double
fDynDiffusionCoefficient
;
187
G4double
fDynVanDerVaalsRadius
;
188
G4double
fDynDecayTime
;
189
G4double
fDynMass
;
190
G4int
fDynCharge
;
191
mutable
G4String
fName
;
// mutable allowed this member to be changed in const methods
192
};
193
194
struct
comparator
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
235
inline
const
G4MoleculeDefinition
*
G4MolecularConfiguration::GetDefinition
()
const
236
{
237
return
fMoleculeDefinition
;
238
}
239
240
inline
const
G4ElectronOccupancy
*
G4MolecularConfiguration::GetElectronOccupancy
()
const
241
{
242
return
fElectronOccupancy
;
243
}
244
245
inline
void
G4MolecularConfiguration::SetDiffusionCoefficient
(
G4double
dynDiffusionCoefficient)
246
{
247
fDynDiffusionCoefficient
= dynDiffusionCoefficient ;
248
}
249
250
inline
G4double
G4MolecularConfiguration::GetDiffusionCoefficient
()
const
251
{
252
return
fDynDiffusionCoefficient
;
253
}
254
255
inline
void
G4MolecularConfiguration::SetDecayTime
(
G4double
dynDecayTime)
256
{
257
fDynDecayTime
= dynDecayTime;
258
}
259
260
inline
G4double
G4MolecularConfiguration::GetDecayTime
()
const
261
{
262
return
fDynDecayTime
;
263
}
264
265
inline
void
G4MolecularConfiguration::SetVanDerVaalsRadius
(
G4double
dynVanDerVaalsRadius)
266
{
267
fDynVanDerVaalsRadius
= dynVanDerVaalsRadius ;
268
}
269
270
inline
G4double
G4MolecularConfiguration::GetVanDerVaalsRadius
()
const
271
{
272
return
fDynVanDerVaalsRadius
;
273
}
274
275
inline
G4int
G4MolecularConfiguration::GetCharge
()
const
276
{
277
return
fDynCharge
;
278
}
279
280
inline
void
G4MolecularConfiguration::SetMass
(
G4double
aMass)
281
{
282
fDynMass
= aMass ;
283
}
284
285
inline
G4double
G4MolecularConfiguration::GetMass
()
const
286
{
287
return
fDynMass
;
288
}
289
#endif
Generated on Sat May 25 2013 14:33:31 for Geant4 by
1.8.4