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

#include <G4Molecule.hh>

+ Inheritance diagram for G4Molecule:

Public Member Functions

 ITDef (G4Molecule) void Print() const
 
void * operator new (size_t)
 
void operator delete (void *aVUserTrackInformation)
 
 G4Molecule (const G4Molecule &)
 
G4Moleculeoperator= (const G4Molecule &right)
 
G4bool operator== (const G4Molecule &right) const
 
G4bool operator!= (const G4Molecule &right) const
 
G4bool operator< (const G4Molecule &right) const
 
 G4Molecule (G4MoleculeDefinition *molecule)
 
 G4Molecule (G4MoleculeDefinition *molecule, G4int, G4int)
 
 G4Molecule (G4MoleculeDefinition *molecule, G4int, G4bool)
 
virtual ~G4Molecule ()
 
const G4StringGetName () const
 
G4int GetAtomsNumber () const
 
void SetElectronOccupancy (const G4ElectronOccupancy *)
 
void ExciteMolecule (G4int)
 
void IonizeMolecule (G4int)
 
void AddElectron (G4int orbit, G4int n=1)
 
void RemoveElectron (G4int, G4int number=1)
 
void MoveOneElectron (G4int, G4int)
 
G4double GetNbElectrons () const
 
void PrintState () const
 
G4TrackBuildTrack (G4double globalTime, const G4ThreeVector &Position)
 
G4double GetKineticEnergy () const
 
G4double GetDiffusionVelocity () const
 
const std::vector< const G4MolecularDecayChannel * > * GetDecayChannel () const
 
G4int GetMoleculeID () const
 
const G4MoleculeDefinitionGetDefinition () 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
 
G4MolecularConfigurationGetMolecularConfiguration ()
 
- Public Member Functions inherited from G4IT
 G4IT ()
 
 G4IT (G4Track *)
 
virtual ~G4IT ()
 
void * operator new (size_t)
 
void operator delete (void *aIT)
 
virtual void Print () const
 
virtual const G4StringGetName () const =0
 
virtual G4bool diff (const G4IT &right) const =0
 
virtual G4bool equal (const G4IT &right) const =0
 
G4bool operator< (const G4IT &right) const
 
G4bool operator== (const G4IT &right) const
 
G4bool operator!= (const G4IT &right) const
 
void SetTrack (G4Track *)
 
G4TrackGetTrack ()
 
const G4TrackGetTrack () const
 
void RecordCurrentPositionNTime ()
 
void SetPrevious (G4IT *)
 
void SetNext (G4IT *)
 
G4ITGetPrevious ()
 
G4ITGetNext ()
 
const G4ITGetPrevious () const
 
const G4ITGetNext () const
 
void SetITBox (G4ITBox *)
 
const G4ITBoxGetITBox () const
 
void TakeOutBox ()
 
void SetNode (G4KDNode *)
 
void SetParentID (int, int)
 
void GetParentID (int &, int &)
 
const G4ThreeVectorGetPreStepPosition () const
 
G4double GetPreStepLocalTime () const
 
G4double GetPreStepGlobalTime () const
 
G4KDNodeGetNode () const
 
G4TrackingInformationGetTrackingInfo ()
 
G4TrackListNodeGetTrackListNode ()
 
void SetTrackListNode (G4TrackListNode *node)
 
virtual const G4ITType GetITType () const =0
 
- Public Member Functions inherited from G4VUserTrackInformation
 G4VUserTrackInformation ()
 
 G4VUserTrackInformation (const G4String &infoType)
 
 G4VUserTrackInformation (const G4VUserTrackInformation &)
 
G4VUserTrackInformationoperator= (const G4VUserTrackInformation &)
 
virtual ~G4VUserTrackInformation ()
 
virtual void Print () const
 
const G4StringGetType () const
 

Static Public Member Functions

static void SetGlobalTemperature (double)
 
static double GetGlobalTemperature ()
 

Additional Inherited Members

- Protected Member Functions inherited from G4IT
 G4IT (const G4IT &)
 
G4IToperator= (const G4IT &)
 
- Protected Attributes inherited from G4IT
G4TrackfpTrack
 
- Protected Attributes inherited from G4VUserTrackInformation
G4StringpType
 

Detailed Description

Class Description The dynamic molecule holds all the data that change for a molecule It has a pointer to G4MoleculeDefinition object, which holds all the "ground level" information.

Definition at line 76 of file G4Molecule.hh.

Constructor & Destructor Documentation

◆ G4Molecule() [1/4]

G4Molecule::G4Molecule ( const G4Molecule right)

Definition at line 82 of file G4Molecule.cc.

82 :
83 G4VUserTrackInformation("G4Molecule"), G4IT(right)
84{
85 Init();
86 fMolecularConfiguration = right . fMolecularConfiguration;
87}
G4IT()
Definition: G4IT.cc:61

Referenced by G4Molecule().

◆ G4Molecule() [2/4]

G4Molecule::G4Molecule ( G4MoleculeDefinition moleculeDefinition)

To build a molecule at ground state according to a given G4MoleculeDefinition that can be obtained from G4GenericMoleculeManager

Build a molecule at ground state according to a given G4MoleculeDefinition that can be obtained from G4GenericMoleculeManager

Definition at line 160 of file G4Molecule.cc.

160 :
161 G4VUserTrackInformation("G4Molecule"), G4IT()
162 //////////////////////////
163{
164 Init();
165 fMolecularConfiguration = G4MolecularConfiguration::GetMolecularConfiguration(moleculeDefinition);
166}
static G4MolecularConfiguration * GetMolecularConfiguration(const G4MoleculeDefinition *, const G4ElectronOccupancy &electronOccupancy)

◆ G4Molecule() [3/4]

G4Molecule::G4Molecule ( G4MoleculeDefinition moleculeDefinition,
G4int  OrbitalToFree,
G4int  OrbitalToFill 
)

To build a molecule at a specific excitation/ionisation state according to a ground state that can be obtained from G4GenericMoleculeManager

Build a molecule at a specific excitation/ionisation state according to a ground state that can be obtained from G4GenericMoleculeManager. Put 0 in the second option if this is a ionisation.

Definition at line 173 of file G4Molecule.cc.

173 :
174 G4VUserTrackInformation("G4Molecule"), G4IT()
175 //////////////////////////
176{
177 Init();
178
179 G4ElectronOccupancy dynElectronOccupancy (*moleculeDefinition->GetGroundStateElectronOccupancy());
180
181 if (OrbitalToFill != 0)
182 {
183 dynElectronOccupancy.RemoveElectron(OrbitalToFree-1,1);
184 dynElectronOccupancy.AddElectron(OrbitalToFill-1,1);
185 // dynElectronOccupancy.DumpInfo(); // DEBUG
186 }
187
188 if (OrbitalToFill == 0)
189 {
190 dynElectronOccupancy.RemoveElectron(OrbitalToFree-1,1);
191 // dynElectronOccupancy.DumpInfo(); // DEBUG
192 }
193
194 fMolecularConfiguration = G4MolecularConfiguration::GetMolecularConfiguration(moleculeDefinition, dynElectronOccupancy);
195}
const G4ElectronOccupancy * GetGroundStateElectronOccupancy() const

◆ G4Molecule() [4/4]

G4Molecule::G4Molecule ( G4MoleculeDefinition moleculeDefinition,
G4int  Level,
G4bool  Excitation 
)

Specific builder for water molecules to be used in Geant4-DNA, the last option Excitation is true if the molecule is excited, is false is the molecule is ionized.

Definition at line 202 of file G4Molecule.cc.

202 :
203 G4VUserTrackInformation("G4Molecule"), G4IT()
204{
205 Init();
206
207 G4ElectronOccupancy dynElectronOccupancy (*moleculeDefinition->GetGroundStateElectronOccupancy());
208
209 if (Excitation == true)
210 {
211 dynElectronOccupancy.RemoveElectron(Level,1);
212 dynElectronOccupancy.AddElectron(5,1);
213 // dynElectronOccupancy.DumpInfo(); // DEBUG
214 }
215
216 if (Excitation == false)
217 {
218 dynElectronOccupancy.RemoveElectron(Level,1);
219 // dynElectronOccupancy.DumpInfo(); // DEBUG
220 }
221
222 fMolecularConfiguration = G4MolecularConfiguration::GetMolecularConfiguration(moleculeDefinition, dynElectronOccupancy);
223}

◆ ~G4Molecule()

G4Molecule::~G4Molecule ( )
virtual

Definition at line 138 of file G4Molecule.cc.

140{
141 if(fpTrack!=NULL)
142 {
144 {
147 }
148 fpTrack = 0;
149 }
150 fMolecularConfiguration = 0;
151 fDynamicParticle = 0;
152 // DEBUG
153 // G4cout<<"Molecule killed"<<G4endl;
154}
G4Track * fpTrack
Definition: G4IT.hh:144
static G4MoleculeCounter * GetMoleculeCounter()
virtual void RemoveAMoleculeAtTime(const G4Molecule &, G4double)
G4double GetGlobalTime() const

Member Function Documentation

◆ AddElectron()

void G4Molecule::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 244 of file G4Molecule.cc.

245{
246 fMolecularConfiguration = fMolecularConfiguration->AddElectron(orbit,number);
247}
G4MolecularConfiguration * AddElectron(G4int orbit, G4int n=1)

Referenced by G4EmDNAPhysicsChemistry::ConstructDecayChannels(), and G4EmDNAPhysicsChemistry::ConstructReactionTable().

◆ BuildTrack()

G4Track * G4Molecule::BuildTrack ( G4double  globalTime,
const G4ThreeVector Position 
)

Definition at line 279 of file G4Molecule.cc.

280{
281 if(fpTrack != 0)
282 {
283 G4Exception("G4Molecule::BuildTrack","Molecule001",
284 FatalErrorInArgument,"A track was already assigned to this molecule");
285 }
286
287 // Kinetic Values
288 // Set a random direction to the molecule
289 G4double costheta = (2*G4UniformRand()-1);
290 G4double theta = acos (costheta);
291 G4double phi = 2*pi*G4UniformRand();
292
293 G4double xMomentum = cos(phi)* sin(theta);
294 G4double yMomentum = sin(theta)*sin(phi);
295 G4double zMomentum = costheta;
296
297 G4ThreeVector MomentumDirection(xMomentum, yMomentum, zMomentum);
298 G4double KineticEnergy = GetKineticEnergy();
299 // G4cout << " **** KineticEnergy : " << KineticEnergy << G4endl;
300 fDynamicParticle = new G4DynamicParticle(fMolecularConfiguration->GetDefinition(),
301 MomentumDirection,
302 KineticEnergy);
303
306
307 //Set the Track
308 fpTrack = new G4Track(fDynamicParticle, globalTime, Position);
309 fpTrack -> SetUserInformation (this);
310
311 return fpTrack;
312}
@ FatalErrorInArgument
double G4double
Definition: G4Types.hh:64
#define G4UniformRand()
Definition: Randomize.hh:53
const G4MoleculeDefinition * GetDefinition() const
virtual void AddAMoleculeAtTime(const G4Molecule &, G4double)
G4double GetKineticEnergy() const
Definition: G4Molecule.cc:314
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
const G4double pi

Referenced by G4DNAChemistryManager::CreateSolvatedElectron(), G4DNAChemistryManager::CreateWaterMolecule(), G4DNAMolecularDecay::DecayIt(), G4DNAMolecularReaction::MakeReaction(), G4DNAChemistryManager::PushMolecule(), and G4DNAChemistryManager::PushMoleculeAtParentTimeAndPlace().

◆ ExciteMolecule()

void G4Molecule::ExciteMolecule ( G4int  ExcitedLevel)

Method used in Geant4-DNA to excite water molecules

Definition at line 232 of file G4Molecule.cc.

233{
234 fMolecularConfiguration = fMolecularConfiguration->ExciteMolecule(ExcitedLevel);
235}
G4MolecularConfiguration * ExciteMolecule(G4int)

◆ GetAtomsNumber()

G4int G4Molecule::GetAtomsNumber ( ) const

Returns the nomber of atoms compouning the molecule

Definition at line 264 of file G4Molecule.cc.

265{
266 return fMolecularConfiguration->GetAtomsNumber();
267}

◆ GetCharge()

G4int G4Molecule::GetCharge ( ) const

Returns the charge of molecule.

Definition at line 375 of file G4Molecule.cc.

376{
377 return fMolecularConfiguration->GetCharge() ;
378}

◆ GetDecayChannel()

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

Definition at line 345 of file G4Molecule.cc.

346{
347 return fMolecularConfiguration->GetDecayChannel();
348}
const std::vector< const G4MolecularDecayChannel * > * GetDecayChannel() const

◆ GetDecayTime()

G4double G4Molecule::GetDecayTime ( ) const

Returns the decay time of the molecule.

Definition at line 360 of file G4Molecule.cc.

361{
362 return fMolecularConfiguration->GetDecayTime();
363}

◆ GetDefinition()

const G4MoleculeDefinition * G4Molecule::GetDefinition ( ) const

Get molecule definition. This G4MoleculeDefinition has the ground electronic state of the molecule.

Definition at line 395 of file G4Molecule.cc.

396{
397 return fMolecularConfiguration->GetDefinition();
398}

Referenced by G4MoleculeCounter::AddAMoleculeAtTime(), G4DNAMolecularDecay::DecayIt(), G4DNAMolecularDecayDisplacer::GetProductsDisplacement(), and G4MoleculeCounter::RemoveAMoleculeAtTime().

◆ GetDiffusionCoefficient()

◆ GetDiffusionVelocity()

G4double G4Molecule::GetDiffusionVelocity ( ) const

Definition at line 324 of file G4Molecule.cc.

325{
326 double moleculeMass = fMolecularConfiguration->GetMass()/(c_squared);
327
328 ////
329 // Different possibilities
330 ////
331 // Ideal Gaz case : Maxwell Boltzmann Distribution
332 // double sigma = k_Boltzmann * fgTemperature / mass;
333 // return G4RandGauss::shoot( 0, sigma );
334 ////
335 // Ideal Gaz case : mean velocity from equipartition theorem
336 return sqrt(3*k_Boltzmann*fgTemperature/moleculeMass);
337 ////
338 // Using this approximation for liquid is wrong
339 // However the brownian process avoid taking
340 // care of energy consideration and plays only
341 // with positions
342}

Referenced by GetKineticEnergy().

◆ GetElectronOccupancy()

const G4ElectronOccupancy * G4Molecule::GetElectronOccupancy ( ) const

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

Definition at line 390 of file G4Molecule.cc.

391{
392 return fMolecularConfiguration->GetElectronOccupancy();
393}
const G4ElectronOccupancy * GetElectronOccupancy() const

Referenced by G4DNAMolecularDecay::DecayIt().

◆ GetGlobalTemperature()

double G4Molecule::GetGlobalTemperature ( )
inlinestatic

Definition at line 283 of file G4Molecule.hh.

284{
285 return fgTemperature;
286}

◆ GetKineticEnergy()

G4double G4Molecule::GetKineticEnergy ( ) const

Definition at line 314 of file G4Molecule.cc.

315{
316 ////
317 // Ideal Gaz case
318 double v = GetDiffusionVelocity();
319 double E = (fMolecularConfiguration->GetMass()/(c_squared))*(v*v)/2.;
320 ////
321 return E;
322}
G4double GetDiffusionVelocity() const
Definition: G4Molecule.cc:324

Referenced by BuildTrack().

◆ GetMass()

G4double G4Molecule::GetMass ( ) const

Returns the total mass of the molecule.

Definition at line 385 of file G4Molecule.cc.

386{
387 return fMolecularConfiguration->GetMass();
388}

◆ GetMolecularConfiguration()

G4MolecularConfiguration * G4Molecule::GetMolecularConfiguration ( )
inline

Definition at line 273 of file G4Molecule.hh.

274{
275 return fMolecularConfiguration ;
276}

Referenced by G4DNASecondOrderReaction::PostStepGetPhysicalInteractionLength().

◆ GetMoleculeID()

G4int G4Molecule::GetMoleculeID ( ) const

Definition at line 350 of file G4Molecule.cc.

351{
352 return fMolecularConfiguration->GetMoleculeID();
353}

◆ GetName()

◆ GetNbElectrons()

G4double G4Molecule::GetNbElectrons ( ) const

Returns the number of electron.

Definition at line 269 of file G4Molecule.cc.

270{
271 return fMolecularConfiguration->GetNbElectrons();
272}

◆ GetVanDerVaalsRadius()

G4double G4Molecule::GetVanDerVaalsRadius ( ) const

Definition at line 370 of file G4Molecule.cc.

371{
372 return fMolecularConfiguration->GetVanDerVaalsRadius();
373}

◆ IonizeMolecule()

void G4Molecule::IonizeMolecule ( G4int  IonizedLevel)

Method used in Geant4-DNA to ionize water molecules

Definition at line 239 of file G4Molecule.cc.

240{
241 fMolecularConfiguration = fMolecularConfiguration->IonizeMolecule(IonizedLevel);
242}
G4MolecularConfiguration * IonizeMolecule(G4int)

◆ ITDef()

G4Molecule::ITDef ( G4Molecule  ) const

◆ MoveOneElectron()

void G4Molecule::MoveOneElectron ( G4int  orbitToFree,
G4int  orbitToFill 
)

Move one electron from an orbit to another.

Definition at line 254 of file G4Molecule.cc.

255{
256 fMolecularConfiguration = fMolecularConfiguration->MoveOneElectron(orbitToFree,orbitToFill);
257}
G4MolecularConfiguration * MoveOneElectron(G4int, G4int)

◆ operator delete()

void G4Molecule::operator delete ( void *  aVUserTrackInformation)
inline

Definition at line 265 of file G4Molecule.hh.

267{
268 // DEBUG
269 // G4cout<<"G4Molecule::operator delete(void * aMolecule) called"<<G4endl;
270 aMoleculeAllocator.FreeSingle((G4Molecule *) aMolecule);
271}
G4DLLIMPORT G4Allocator< G4Molecule > aMoleculeAllocator

◆ operator new()

void * G4Molecule::operator new ( size_t  )
inline

Definition at line 256 of file G4Molecule.hh.

258{
259 void * aMolecule;
260 aMolecule = (void *) aMoleculeAllocator.MallocSingle();
261 return aMolecule;
262}

◆ operator!=()

G4bool G4Molecule::operator!= ( const G4Molecule right) const

Definition at line 106 of file G4Molecule.cc.

107{
108 return !(*this == right);
109}

◆ operator<()

G4bool G4Molecule::operator< ( const G4Molecule right) const

The two methods below are the most called of the simulation : compare molecules in the MoleculeStackManager or in the InteractionTable

Definition at line 116 of file G4Molecule.cc.

117{
118 return fMolecularConfiguration < right.fMolecularConfiguration ;
119}

◆ operator=()

G4Molecule & G4Molecule::operator= ( const G4Molecule right)

Definition at line 89 of file G4Molecule.cc.

90{
91 if (&right==this) return *this;
92 Init();
93 fMolecularConfiguration = right . fMolecularConfiguration;
94 return *this;
95}

◆ operator==()

G4bool G4Molecule::operator== ( const G4Molecule right) const

Definition at line 97 of file G4Molecule.cc.

98{
99 if(fMolecularConfiguration==right.fMolecularConfiguration)
100 {
101 return true;
102 }
103 return false;
104}

◆ PrintState()

void G4Molecule::PrintState ( ) const

Show the electronic state of the molecule.

Definition at line 274 of file G4Molecule.cc.

275{
276 fMolecularConfiguration->PrintState();
277}

Referenced by G4MoleculeCounter::RemoveAMoleculeAtTime().

◆ RemoveElectron()

void G4Molecule::RemoveElectron ( G4int  orbit,
G4int  number = 1 
)

Remove n electrons to a given orbit.

Definition at line 249 of file G4Molecule.cc.

250{
251 fMolecularConfiguration = fMolecularConfiguration->RemoveElectron(orbit,number);
252}
G4MolecularConfiguration * RemoveElectron(G4int, G4int number=1)

Referenced by G4EmDNAPhysicsChemistry::ConstructReactionTable().

◆ SetDecayTime()

void G4Molecule::SetDecayTime ( G4double  dynDecayTime)

Set the decay time of the molecule.

Definition at line 355 of file G4Molecule.cc.

356{
357 fMolecularConfiguration->SetDecayTime(dynDecayTime);
358}

◆ SetDiffusionCoefficient()

void G4Molecule::SetDiffusionCoefficient ( G4double  dynDiffusionCoefficient)

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 400 of file G4Molecule.cc.

401{
402 fMolecularConfiguration->SetDiffusionCoefficient(dynDiffusionCoefficient);
403}

Referenced by G4EmDNAPhysicsChemistry::ConstructDecayChannels(), and G4EmDNAPhysicsChemistry::ConstructReactionTable().

◆ SetElectronOccupancy()

void G4Molecule::SetElectronOccupancy ( const G4ElectronOccupancy occ)

Will set up the correct molecularConfiguration given an electron configuration

Definition at line 225 of file G4Molecule.cc.

226{
227 fMolecularConfiguration = G4MolecularConfiguration::GetMolecularConfiguration(fMolecularConfiguration->GetDefinition(), *occ);
228}

◆ SetGlobalTemperature()

void G4Molecule::SetGlobalTemperature ( double  temperature)
inlinestatic

Definition at line 278 of file G4Molecule.hh.

279{
280 fgTemperature = temperature;
281}

◆ SetMass()

void G4Molecule::SetMass ( G4double  aMass)

Set the total mass of the molecule.

Definition at line 380 of file G4Molecule.cc.

381{
382 fMolecularConfiguration->SetMass(aMass);
383}

Referenced by G4EmDNAPhysicsChemistry::ConstructDecayChannels(), and G4EmDNAPhysicsChemistry::ConstructReactionTable().

◆ SetVanDerVaalsRadius()

void G4Molecule::SetVanDerVaalsRadius ( G4double  dynVanDerVaalsRadius)

The Van Der Valls Radius of the molecule

Definition at line 365 of file G4Molecule.cc.

366{
367 fMolecularConfiguration->SetVanDerVaalsRadius(dynVanDerVaalsRadius);
368}

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