Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
60 {
61 public :
62 
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();
76 
77  // Methods
78  const G4MoleculeDefinition* GetDefinition() const;
79 
82  const G4String& GetName() const;
83 
86  G4int GetAtomsNumber() const;
87 
91 
95 
101 
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 :
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 {
272  return fDynVanDerVaalsRadius;
273 }
274 
276 {
277  return fDynCharge ;
278 }
279 
281 {
282  fDynMass = aMass ;
283 }
284 
286 {
287  return fDynMass;
288 }
289 #endif