Geant4  10.00.p02
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 
52 
53 struct comparator
54 {
55  bool operator() (const G4ElectronOccupancy& occ1, const G4ElectronOccupancy& occ2) const
56  {
57  // Since this method is called a lot of time,
58  // we retrieve only once the totOcc
59  G4int totalOcc1 = occ1.GetTotalOccupancy() ;
60  G4int totalOcc2 = occ2.GetTotalOccupancy() ;
61  if ( totalOcc1!= totalOcc2)
62  {
63  return totalOcc1<totalOcc2;
64  }
65  else
66  {
67  G4int occupancy1 = -1 ;
68  G4int occupancy2 = -1 ;
69  const G4int sizeOrbit = occ1.GetSizeOfOrbit() ;
70  for (G4int i=0; i<occ1.GetSizeOfOrbit();)
71  {
72  // Since this method is called a lot of time,
73  // we retrieve only once the Occ
74 
75  occupancy1 = occ1.GetOccupancy(i);
76  occupancy2 = occ2.GetOccupancy(i);
77 
78  if (occupancy1 != occupancy2)
79  {
80  return occupancy1 < occupancy2;
81  }
82  else
83  {
84  i++;
85  if (i >= sizeOrbit) return false;
86  }
87  }
88  }
89  return false;
90  }
91 };
92 
100 {
101 public :
102 
104  // Static methods
105 
106  // Get for a given moleculeDefinition and a given electronic configuration, the mol conf
108  const G4ElectronOccupancy& electronOccupancy);
109 
110  // Get ground state electronic configuration
112 
113  // Release memory of the mol conf manager
114  static void DeleteManager();
116 
117  // Methods
118  const G4MoleculeDefinition* GetDefinition() const;
119 
122  const G4String& GetName() const;
123 
126  G4int GetAtomsNumber() const;
127 
131 
135 
141 
145 
148  G4MolecularConfiguration* MoveOneElectron(G4int /*orbit*/,G4int /*orbit*/);
149 
152  G4double GetNbElectrons() const;
153 
156  void PrintState() const;
157 
158  const std::vector <const G4MolecularDecayChannel*>* GetDecayChannel() const;
159 
160  G4int GetMoleculeID() const;
161 
173  inline void SetDiffusionCoefficient(G4double);
174 
177  inline G4double GetDiffusionCoefficient() const;
178 
181  inline void SetDecayTime(G4double);
182 
185  inline G4double GetDecayTime() const;
186 
189  inline void SetVanDerVaalsRadius(G4double);
190  inline G4double GetVanDerVaalsRadius() const ;
191 
195  inline const G4ElectronOccupancy* GetElectronOccupancy() const;
196 
199  inline G4int GetCharge() const;
200 
203  inline void SetMass(G4double);
204 
207  inline G4double GetMass() const;
208 
209 protected :
215 
218 
219 public:
221  {
224 
225  typedef std::map<const G4MoleculeDefinition*, std::map<G4ElectronOccupancy, G4MolecularConfiguration*, comparator> > MolecularConfigurationTable;
226  MolecularConfigurationTable fTable;
227  };
228 
229 protected:
231 
233 
239  mutable G4String fName; // mutable allowed this member to be changed in const methods
240 };
241 
243 {
244  return fMoleculeDefinition;
245 }
246 
248 {
249  return fElectronOccupancy ;
250 }
251 
253 {
254  fDynDiffusionCoefficient = dynDiffusionCoefficient ;
255 }
256 
258 {
260 }
261 
263 {
264  fDynDecayTime = dynDecayTime;
265 }
266 
268 {
269  return fDynDecayTime;
270 }
271 
273 {
274  fDynVanDerVaalsRadius = dynVanDerVaalsRadius ;
275 }
276 
278 {
279  return fDynVanDerVaalsRadius;
280 }
281 
283 {
284  return fDynCharge ;
285 }
286 
288 {
289  fDynMass = aMass ;
290 }
291 
293 {
294  return fDynMass;
295 }
296 #endif
The pointer G4MolecularConfiguration will be shared by all the molecules having the same molecule def...
G4double GetDiffusionCoefficient() const
Returns the diffusion coefficient D.
void PrintState() const
Display the electronic state of the molecule.
G4int GetCharge() const
Returns the charge of molecule.
const G4String & GetName() const
Returns the name of the molecule.
G4int GetTotalOccupancy() const
G4MolecularConfiguration * ChangeConfiguration(const G4ElectronOccupancy &newElectronOccupancy)
static G4MolecularConfiguration * GetMolecularConfiguration(const G4MoleculeDefinition *, const G4ElectronOccupancy &electronOccupancy)
G4double GetNbElectrons() const
Returns the number of electron.
G4int GetSizeOfOrbit() const
const G4ElectronOccupancy * GetElectronOccupancy() const
Returns the object ElectronOccupancy describing the electronic configuration of the molecule...
#define G4ThreadLocal
Definition: tls.hh:52
int G4int
Definition: G4Types.hh:78
const std::vector< const G4MolecularDecayChannel * > * GetDecayChannel() const
bool operator()(const G4ElectronOccupancy &occ1, const G4ElectronOccupancy &occ2) const
G4int GetOccupancy(G4int orbit) const
G4MolecularConfiguration * IonizeMolecule(G4int)
Method used in Geant4-DNA to ionize water molecules.
G4MolecularConfiguration * AddElectron(G4int orbit, G4int n=1)
Add n electrons to a given orbit.
std::map< const G4MoleculeDefinition *, std::map< G4ElectronOccupancy, G4MolecularConfiguration *, comparator > > MolecularConfigurationTable
G4MolecularConfiguration * MoveOneElectron(G4int, G4int)
Move one electron from an orbit to another.
void SetDiffusionCoefficient(G4double)
Sets the diffusion coefficient D of the molecule used in diffusion processes to calculate the mean sq...
G4MolecularConfiguration & operator=(G4MolecularConfiguration &right)
const G4int n
static G4MolecularConfigurationManager * GetManager()
G4double GetMass() const
Returns the total mass of the molecule.
static G4ThreadLocal G4MolecularConfigurationManager * fgManager
void SetMass(G4double)
Set the total mass of the molecule.
void SetDecayTime(G4double)
Set the decay time of the molecule.
void SetVanDerVaalsRadius(G4double)
The Van Der Valls Radius of the molecule.
G4int GetAtomsNumber() const
Returns the nomber of atoms compouning the molecule.
const G4MoleculeDefinition * GetDefinition() const
G4MolecularConfiguration(const G4MoleculeDefinition *, const G4ElectronOccupancy &)
G4double GetDecayTime() const
Returns the decay time of the molecule.
double G4double
Definition: G4Types.hh:76
G4MolecularConfiguration * RemoveElectron(G4int, G4int number=1)
Remove n electrons to a given orbit.
const G4ElectronOccupancy * fElectronOccupancy
G4MolecularConfiguration * ExciteMolecule(G4int)
Method used in Geant4-DNA to excite water molecules.
const G4MoleculeDefinition * fMoleculeDefinition