Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4MolecularConfiguration Class Reference

#include <G4MolecularConfiguration.hh>

Classes

struct  G4MolecularConfigurationManager
 

Public Member Functions

const G4MoleculeDefinitionGetDefinition () const
 
const G4StringGetName () const
 
G4int GetAtomsNumber () const
 
G4MolecularConfigurationExciteMolecule (G4int)
 
G4MolecularConfigurationIonizeMolecule (G4int)
 
G4MolecularConfigurationAddElectron (G4int orbit, G4int n=1)
 
G4MolecularConfigurationRemoveElectron (G4int, G4int number=1)
 
G4MolecularConfigurationMoveOneElectron (G4int, G4int)
 
G4double GetNbElectrons () const
 
void PrintState () const
 
const std::vector< const G4MolecularDecayChannel * > * GetDecayChannel () const
 
G4int GetMoleculeID () const
 
void SetDiffusionCoefficient (G4double)
 
G4double GetDiffusionCoefficient () const
 
void SetDecayTime (G4double)
 
G4double GetDecayTime () const
 
void SetVanDerVaalsRadius (G4double)
 
G4double GetVanDerVaalsRadius () const
 
const G4ElectronOccupancyGetElectronOccupancy () const
 
G4int GetCharge () const
 
void SetMass (G4double)
 
G4double GetMass () const
 

Static Public Member Functions

static G4MolecularConfigurationGetMolecularConfiguration (const G4MoleculeDefinition *, const G4ElectronOccupancy &electronOccupancy)
 
static G4MolecularConfigurationGetMolecularConfiguration (const G4MoleculeDefinition *)
 
static void DeleteManager ()
 

Protected Member Functions

 G4MolecularConfiguration (const G4MoleculeDefinition *, const G4ElectronOccupancy &)
 
 G4MolecularConfiguration (const G4MolecularConfiguration &)
 
G4MolecularConfigurationoperator= (G4MolecularConfiguration &right)
 
 ~G4MolecularConfiguration ()
 
G4MolecularConfigurationChangeConfiguration (const G4ElectronOccupancy &newElectronOccupancy)
 

Static Protected Member Functions

static G4MolecularConfigurationManagerGetManager ()
 

Protected Attributes

const G4MoleculeDefinitionfMoleculeDefinition
 
const G4ElectronOccupancyfElectronOccupancy
 
G4double fDynDiffusionCoefficient
 
G4double fDynVanDerVaalsRadius
 
G4double fDynDecayTime
 
G4double fDynMass
 
G4int fDynCharge
 
G4String fName
 

Static Protected Attributes

static G4MolecularConfigurationManagerfgManager = 0
 

Detailed Description

The pointer G4MolecularConfiguration will be shared by all the molecules having the same molecule definition and the same electron occupancy BE CAREFUlL !!! : If you change the mass for instance of a OH^-, this will affect all the OH^- molecule diffusing around

Definition at line 59 of file G4MolecularConfiguration.hh.

Constructor & Destructor Documentation

◆ G4MolecularConfiguration() [1/2]

G4MolecularConfiguration::G4MolecularConfiguration ( const G4MoleculeDefinition moleculeDef,
const G4ElectronOccupancy elecOcc 
)
protected

Definition at line 111 of file G4MolecularConfiguration.cc.

113{
114 fMoleculeDefinition = moleculeDef ;
115 fgManager->fTable[fMoleculeDefinition][elecOcc] = this;
116 std::map<G4ElectronOccupancy, G4MolecularConfiguration*, comparator>::iterator it ;
117 it = fgManager->fTable[moleculeDef].find(elecOcc);
118 fElectronOccupancy = &(it->first);
119
122
126}
G4int GetTotalOccupancy() const
const G4ElectronOccupancy * fElectronOccupancy
static G4MolecularConfigurationManager * fgManager
const G4MoleculeDefinition * fMoleculeDefinition
G4double GetVanDerVaalsRadius() const
G4double GetDecayTime() const
G4double GetDiffusionCoefficient() const

◆ G4MolecularConfiguration() [2/2]

G4MolecularConfiguration::G4MolecularConfiguration ( const G4MolecularConfiguration )
protected

◆ ~G4MolecularConfiguration()

G4MolecularConfiguration::~G4MolecularConfiguration ( )
protected

Definition at line 128 of file G4MolecularConfiguration.cc.

129{
131 {
132 delete fElectronOccupancy;
134 }
135}

Member Function Documentation

◆ AddElectron()

G4MolecularConfiguration * G4MolecularConfiguration::AddElectron ( G4int  orbit,
G4int  n = 1 
)

Add n electrons to a given orbit. Note : You can add as many electrons to a given orbit, the result may be unrealist.

Definition at line 189 of file G4MolecularConfiguration.cc.

190{
191 G4ElectronOccupancy newElectronOccupancy(*fElectronOccupancy);
192 newElectronOccupancy.AddElectron(orbit, number);
193 return ChangeConfiguration(newElectronOccupancy);
194}
G4MolecularConfiguration * ChangeConfiguration(const G4ElectronOccupancy &newElectronOccupancy)

Referenced by G4Molecule::AddElectron(), and MoveOneElectron().

◆ ChangeConfiguration()

G4MolecularConfiguration * G4MolecularConfiguration::ChangeConfiguration ( const G4ElectronOccupancy newElectronOccupancy)
protected

Definition at line 137 of file G4MolecularConfiguration.cc.

138{
139 G4MolecularConfiguration* output = fgManager->fTable[fMoleculeDefinition][newElectronOccupancy] ;
140 if(! output)
141 {
142 output = new G4MolecularConfiguration(fMoleculeDefinition, newElectronOccupancy);
143 }
144 return output ;
145}

Referenced by AddElectron(), ExciteMolecule(), IonizeMolecule(), MoveOneElectron(), and RemoveElectron().

◆ DeleteManager()

void G4MolecularConfiguration::DeleteManager ( )
static

Definition at line 103 of file G4MolecularConfiguration.cc.

104{
105 if(fgManager) delete fgManager;
106 fgManager = 0;
107}

◆ ExciteMolecule()

G4MolecularConfiguration * G4MolecularConfiguration::ExciteMolecule ( G4int  ExcitedLevel)

Method used in Geant4-DNA to excite water molecules

Definition at line 156 of file G4MolecularConfiguration.cc.

157{
158 G4ElectronOccupancy newElectronOccupancy (*fElectronOccupancy);
159
160 newElectronOccupancy.RemoveElectron(ExcitedLevel,1);
161 newElectronOccupancy.AddElectron(5,1);
162
163 return ChangeConfiguration(newElectronOccupancy);
164}

Referenced by G4Molecule::ExciteMolecule().

◆ GetAtomsNumber()

G4int G4MolecularConfiguration::GetAtomsNumber ( ) const

Returns the nomber of atoms compouning the molecule

Definition at line 248 of file G4MolecularConfiguration.cc.

249{
251}

Referenced by G4Molecule::GetAtomsNumber().

◆ GetCharge()

G4int G4MolecularConfiguration::GetCharge ( ) const
inline

Returns the charge of molecule.

Definition at line 275 of file G4MolecularConfiguration.hh.

276{
277 return fDynCharge ;
278}

Referenced by G4Molecule::GetCharge().

◆ GetDecayChannel()

const vector< const G4MolecularDecayChannel * > * G4MolecularConfiguration::GetDecayChannel ( ) const

Definition at line 274 of file G4MolecularConfiguration.cc.

275{
276 return fMoleculeDefinition-> GetDecayChannels(fElectronOccupancy);
277}

Referenced by G4Molecule::GetDecayChannel().

◆ GetDecayTime()

G4double G4MolecularConfiguration::GetDecayTime ( ) const
inline

Returns the decay time of the molecule.

Definition at line 260 of file G4MolecularConfiguration.hh.

261{
262 return fDynDecayTime;
263}

Referenced by G4Molecule::GetDecayTime().

◆ GetDefinition()

const G4MoleculeDefinition * G4MolecularConfiguration::GetDefinition ( ) const
inline

◆ GetDiffusionCoefficient()

G4double G4MolecularConfiguration::GetDiffusionCoefficient ( ) const
inline

Returns the diffusion coefficient D.

Definition at line 250 of file G4MolecularConfiguration.hh.

251{
253}

Referenced by G4Molecule::GetDiffusionCoefficient().

◆ GetElectronOccupancy()

const G4ElectronOccupancy * G4MolecularConfiguration::GetElectronOccupancy ( ) const
inline

Returns the object ElectronOccupancy describing the electronic configuration of the molecule.

Definition at line 240 of file G4MolecularConfiguration.hh.

241{
242 return fElectronOccupancy ;
243}

Referenced by G4Molecule::GetElectronOccupancy().

◆ GetManager()

◆ GetMass()

G4double G4MolecularConfiguration::GetMass ( ) const
inline

Returns the total mass of the molecule.

Definition at line 285 of file G4MolecularConfiguration.hh.

286{
287 return fDynMass;
288}

Referenced by G4Molecule::GetDiffusionVelocity(), G4Molecule::GetKineticEnergy(), and G4Molecule::GetMass().

◆ GetMolecularConfiguration() [1/2]

G4MolecularConfiguration * G4MolecularConfiguration::GetMolecularConfiguration ( const G4MoleculeDefinition molDef)
static

Definition at line 75 of file G4MolecularConfiguration.cc.

76{
77 const G4ElectronOccupancy& elecOcc = *molDef->GetGroundStateElectronOccupancy();
78 if(GetManager()->fTable[molDef][elecOcc])
79 {
80 return GetManager()->fTable[molDef][elecOcc];
81 }
82 else
83 {
84 G4MolecularConfiguration* newConf = new G4MolecularConfiguration(molDef, elecOcc);
85 return newConf ;
86 }
87}
static G4MolecularConfigurationManager * GetManager()
const G4ElectronOccupancy * GetGroundStateElectronOccupancy() const

◆ GetMolecularConfiguration() [2/2]

G4MolecularConfiguration * G4MolecularConfiguration::GetMolecularConfiguration ( const G4MoleculeDefinition molDef,
const G4ElectronOccupancy electronOccupancy 
)
static

Definition at line 89 of file G4MolecularConfiguration.cc.

91{
92 if(GetManager()->fTable[molDef][elecOcc])
93 {
94 return GetManager()->fTable[molDef][elecOcc];
95 }
96 else
97 {
98 G4MolecularConfiguration* newConf = new G4MolecularConfiguration(molDef, elecOcc);
99 return newConf ;
100 }
101}

Referenced by G4MoleculeDefinition::AddeConfToExcitedState(), G4Molecule::G4Molecule(), and G4Molecule::SetElectronOccupancy().

◆ GetMoleculeID()

G4int G4MolecularConfiguration::GetMoleculeID ( ) const

Definition at line 279 of file G4MolecularConfiguration.cc.

280{
283 else
284 G4Exception("G4Molecule::GetMoleculeID","",FatalErrorInArgument, "You should first enter a molecule defintion");
285
286 return INT_MAX;
287}
@ FatalErrorInArgument
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define INT_MAX
Definition: templates.hh:111

Referenced by G4Molecule::GetMoleculeID().

◆ GetName()

const G4String & G4MolecularConfiguration::GetName ( ) const

Returns the name of the molecule

Definition at line 235 of file G4MolecularConfiguration.cc.

236{
237 if(fName.isNull())
238 {
240 fName+= "^";
241 fName+= "{";
243 fName+= "}";
244 }
245 return fName;
246}
const G4String & GetName() const
G4bool isNull() const
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:349

Referenced by G4Molecule::GetName(), IonizeMolecule(), MoveOneElectron(), PrintState(), and RemoveElectron().

◆ GetNbElectrons()

G4double G4MolecularConfiguration::GetNbElectrons ( ) const

Returns the number of electron.

Definition at line 253 of file G4MolecularConfiguration.cc.

254{
256}

Referenced by G4Molecule::GetNbElectrons().

◆ GetVanDerVaalsRadius()

G4double G4MolecularConfiguration::GetVanDerVaalsRadius ( ) const
inline

Definition at line 270 of file G4MolecularConfiguration.hh.

271{
273}

Referenced by G4Molecule::GetVanDerVaalsRadius().

◆ IonizeMolecule()

G4MolecularConfiguration * G4MolecularConfiguration::IonizeMolecule ( G4int  IonizedLevel)

Method used in Geant4-DNA to ionize water molecules

Definition at line 168 of file G4MolecularConfiguration.cc.

169{
170 G4ElectronOccupancy newElectronOccupancy(*fElectronOccupancy);
171
172 if(newElectronOccupancy.GetOccupancy(IonizedLevel) != 0)
173 {
174 newElectronOccupancy.RemoveElectron(IonizedLevel,1);
175 }
176 else
177 {
178 G4String errMsg = "There is no electron on the orbit " + G4UIcommand::ConvertToString(IonizedLevel) +
179 " you want to free. The molecule's name you want to ionized is "+ GetName();
180 G4Exception("G4Molecule::IonizeMolecule","",FatalErrorInArgument, errMsg);
181 PrintState();
182 }
183
184 // PrintState();
185
186 return ChangeConfiguration(newElectronOccupancy);
187}
const G4String & GetName() const

Referenced by G4Molecule::IonizeMolecule().

◆ MoveOneElectron()

G4MolecularConfiguration * G4MolecularConfiguration::MoveOneElectron ( G4int  orbitToFree,
G4int  orbitToFill 
)

Move one electron from an orbit to another.

Definition at line 215 of file G4MolecularConfiguration.cc.

216{
217 G4ElectronOccupancy newElectronOccupancy (*fElectronOccupancy);
218
219 if(newElectronOccupancy . GetOccupancy(orbitToFree)>=1)
220 {
221 newElectronOccupancy . RemoveElectron(orbitToFree,1);
222 newElectronOccupancy . AddElectron(orbitToFill,1);
223 }
224 else
225 {
226 G4String errMsg = "There is no electron on the orbit " + G4UIcommand::ConvertToString(orbitToFree) +
227 " you want to free. The molecule's name is "+ GetName();
228 G4Exception("G4Molecule::MoveOneElectron","",FatalErrorInArgument, errMsg);
229 PrintState();
230 }
231
232 return ChangeConfiguration(newElectronOccupancy);
233}
G4MolecularConfiguration * RemoveElectron(G4int, G4int number=1)
G4MolecularConfiguration * AddElectron(G4int orbit, G4int n=1)

Referenced by G4Molecule::MoveOneElectron().

◆ operator=()

G4MolecularConfiguration & G4MolecularConfiguration::operator= ( G4MolecularConfiguration right)
protected

Definition at line 147 of file G4MolecularConfiguration.cc.

148{
149 if (&right==this) return *this;
150 return *this;
151}

◆ PrintState()

void G4MolecularConfiguration::PrintState ( ) const

Show the electronic state of the molecule.

Definition at line 258 of file G4MolecularConfiguration.cc.

259{
260 G4cout<<"--------------Print electronic state of "<<GetName()<<"---------------"<<G4endl;
263 {
264 G4cout<<"At ground state"<<G4endl;
265 }
266 else
267 {
269 G4cout<<"Transition :"<<(fMoleculeDefinition->GetDecayTable())->GetExcitedState(fElectronOccupancy)<<G4endl;
270 }
271}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
const G4MolecularDecayTable * GetDecayTable() const

Referenced by IonizeMolecule(), MoveOneElectron(), G4Molecule::PrintState(), and RemoveElectron().

◆ RemoveElectron()

G4MolecularConfiguration * G4MolecularConfiguration::RemoveElectron ( G4int  orbit,
G4int  number = 1 
)

Remove n electrons to a given orbit.

Definition at line 196 of file G4MolecularConfiguration.cc.

197{
198 G4ElectronOccupancy newElectronOccupancy (*fElectronOccupancy);
199
200 if(newElectronOccupancy.GetOccupancy(orbit) != 0)
201 {
202 newElectronOccupancy.RemoveElectron(orbit, number );
203 }
204 else
205 {
206 G4String errMsg = "There is already no electron into the orbit " + G4UIcommand::ConvertToString(orbit) +
207 " you want to free. The molecule's name is "+ GetName();
208 G4Exception("G4Molecule::RemoveElectron","",JustWarning, errMsg);
209 PrintState();
210 }
211
212 return ChangeConfiguration(newElectronOccupancy);
213}
@ JustWarning

Referenced by MoveOneElectron(), and G4Molecule::RemoveElectron().

◆ SetDecayTime()

void G4MolecularConfiguration::SetDecayTime ( G4double  dynDecayTime)
inline

Set the decay time of the molecule.

Definition at line 255 of file G4MolecularConfiguration.hh.

256{
257 fDynDecayTime = dynDecayTime;
258}

Referenced by G4MoleculeDefinition::AddeConfToExcitedState(), and G4Molecule::SetDecayTime().

◆ SetDiffusionCoefficient()

void G4MolecularConfiguration::SetDiffusionCoefficient ( G4double  dynDiffusionCoefficient)
inline

Sets the diffusion coefficient D of the molecule used in diffusion processes to calculate the mean square jump distance between two changes of direction. In three dimension : <x^2> = 6 D t where t is the mean jump time between two changes of direction.

Definition at line 245 of file G4MolecularConfiguration.hh.

246{
247 fDynDiffusionCoefficient = dynDiffusionCoefficient ;
248}

Referenced by G4Molecule::SetDiffusionCoefficient().

◆ SetMass()

void G4MolecularConfiguration::SetMass ( G4double  aMass)
inline

Set the total mass of the molecule.

Definition at line 280 of file G4MolecularConfiguration.hh.

281{
282 fDynMass = aMass ;
283}

Referenced by G4Molecule::SetMass().

◆ SetVanDerVaalsRadius()

void G4MolecularConfiguration::SetVanDerVaalsRadius ( G4double  dynVanDerVaalsRadius)
inline

The Van Der Valls Radius of the molecule

Definition at line 265 of file G4MolecularConfiguration.hh.

266{
267 fDynVanDerVaalsRadius = dynVanDerVaalsRadius ;
268}

Referenced by G4Molecule::SetVanDerVaalsRadius().

Member Data Documentation

◆ fDynCharge

G4int G4MolecularConfiguration::fDynCharge
protected

Definition at line 190 of file G4MolecularConfiguration.hh.

Referenced by G4MolecularConfiguration(), GetCharge(), and GetName().

◆ fDynDecayTime

G4double G4MolecularConfiguration::fDynDecayTime
protected

◆ fDynDiffusionCoefficient

G4double G4MolecularConfiguration::fDynDiffusionCoefficient
protected

◆ fDynMass

G4double G4MolecularConfiguration::fDynMass
protected

Definition at line 189 of file G4MolecularConfiguration.hh.

Referenced by G4MolecularConfiguration(), GetMass(), and SetMass().

◆ fDynVanDerVaalsRadius

G4double G4MolecularConfiguration::fDynVanDerVaalsRadius
protected

◆ fElectronOccupancy

◆ fgManager

G4MolecularConfiguration::G4MolecularConfigurationManager * G4MolecularConfiguration::fgManager = 0
staticprotected

◆ fMoleculeDefinition

const G4MoleculeDefinition* G4MolecularConfiguration::fMoleculeDefinition
protected

◆ fName

G4String G4MolecularConfiguration::fName
mutableprotected

Definition at line 191 of file G4MolecularConfiguration.hh.

Referenced by GetName().


The documentation for this class was generated from the following files: