45 #define __func__ __FUNCTION__
79 G4MolecularConfigurationManager::MolecularConfigurationTable::iterator it1;
80 std::map<G4ElectronOccupancy, G4MolecularConfiguration*, comparator>::iterator it2;
82 for (it1 = fTable.begin(); it1 != fTable.end(); it1++)
84 for (it2 = it1->second.begin(); it2 != it1->second.end(); it2++)
105 fTable[molDef][eOcc] = molConf;
108 return fLastMoleculeID;
117 std::map<G4ElectronOccupancy, G4MolecularConfiguration*, comparator>::iterator it;
119 it = fTable[molDef].find(eOcc);
122 if (it == fTable[molDef].end())
148 fChargeTable[molDef][charge] = molConf;
151 return fLastMoleculeID;
189 return GetMolecularConfiguration(molDef, molDef->
GetCharge());
235 if (fgManager)
delete fgManager;
245 fMoleculeDefinition = moleculeDef;
247 fMoleculeID = GetManager()->SetMolecularConfiguration(moleculeDef, elecOcc,
249 fElectronOccupancy = GetManager()->FindCommonElectronOccupancy(moleculeDef,
260 - fElectronOccupancy->GetTotalOccupancy()
262 fDynMass = fMoleculeDefinition->GetMass();
264 fDynDiffusionCoefficient = fMoleculeDefinition->GetDiffusionCoefficient();
265 fDynVanDerVaalsRadius = fMoleculeDefinition->GetVanDerVaalsRadius();
266 fDynDecayTime = fMoleculeDefinition->GetDecayTime();
268 fName = fMoleculeDefinition->GetName();
272 fFormatedName = fMoleculeDefinition->GetFormatedName();
273 fFormatedName +=
"^";
274 fFormatedName +=
"{";
276 fFormatedName +=
"}";
282 fMoleculeDefinition = moleculeDef;
284 fMoleculeID = GetManager()->SetMolecularConfiguration(moleculeDef, charge,
286 fElectronOccupancy = 0;
289 fDynMass = fMoleculeDefinition->
GetMass();
291 fDynDiffusionCoefficient = fMoleculeDefinition->GetDiffusionCoefficient();
292 fDynVanDerVaalsRadius = fMoleculeDefinition->GetVanDerVaalsRadius();
293 fDynDecayTime = fMoleculeDefinition->GetDecayTime();
295 fName = fMoleculeDefinition->GetName();
299 fFormatedName = fMoleculeDefinition->GetFormatedName();
300 fFormatedName +=
"^";
301 fFormatedName +=
"{";
303 fFormatedName +=
"}";
308 if (fgManager) fgManager->RemoveMolecularConfigurationFromTable(
this);
323 fMoleculeDefinition, newElectronOccupancy);
328 newElectronOccupancy);
336 fMoleculeDefinition, charge);
347 if (&right ==
this)
return *
this;
355 CheckElectronOccupancy(__func__);
361 return ChangeConfiguration(newElectronOccupancy);
368 CheckElectronOccupancy(__func__);
371 if (newElectronOccupancy.
GetOccupancy(IonizedLevel) != 0)
377 G4String errMsg =
"There is no electron on the orbit "
379 +
" you want to free. The molecule's name you want to ionized is "
388 return ChangeConfiguration(newElectronOccupancy);
394 CheckElectronOccupancy(__func__);
397 return ChangeConfiguration(newElectronOccupancy);
403 CheckElectronOccupancy(__func__);
412 G4String errMsg =
"There is already no electron into the orbit "
414 +
" you want to free. The molecule's name is " + GetName();
419 return ChangeConfiguration(newElectronOccupancy);
425 CheckElectronOccupancy(__func__);
428 if (newElectronOccupancy.
GetOccupancy(orbitToFree) >= 1)
435 G4String errMsg =
"There is no electron on the orbit "
437 +
" you want to free. The molecule's name is " + GetName();
443 return ChangeConfiguration(newElectronOccupancy);
469 return fFormatedName;
474 return fMoleculeDefinition->GetAtomsNumber();
479 CheckElectronOccupancy(__func__);
480 return fElectronOccupancy->GetTotalOccupancy();
485 if (fElectronOccupancy)
487 G4cout <<
"--------------Print electronic state of " << GetName()
488 <<
"---------------" <<
G4endl;
489 fElectronOccupancy->DumpInfo();
490 if(fElectronOccupancy==fMoleculeDefinition->GetGroundStateElectronOccupancy())
496 if(fMoleculeDefinition->GetDecayTable())
497 G4cout<<
"Transition :"<<(fMoleculeDefinition->GetDecayTable())->GetExcitedState(fElectronOccupancy)<<
G4endl;
509 if (fElectronOccupancy == 0)
return 0;
510 return fMoleculeDefinition->GetDecayChannels(fElectronOccupancy);
515 if (fMoleculeDefinition)
return fMoleculeDefinition->GetPDGEncoding();
517 "You should first enter a molecule defintion");
524 const char* pDelimeter = strrchr(path,
'\\');
525 if (pDelimeter) path = pDelimeter + 1;
527 pDelimeter = strrchr(path,
'/');
528 if (pDelimeter) path = pDelimeter + 1;
535 if (fElectronOccupancy == 0)
540 <<
"No G4ElectronOccupancy was defined for molecule definition : "
541 << fMoleculeDefinition->GetName()
542 <<
". The definition was probably defined using the charge state, rather than electron state.";
551 MolecularConfigurationTable::iterator it1 = fTable.find(
553 MolecularConfigurationTable::iterator end = fTable.end();
555 if (it1 == end)
return;
557 std::map<G4ElectronOccupancy, G4MolecularConfiguration*, comparator>::iterator it2 =
560 if (it2 == it1->second.end())
return;
The pointer G4MolecularConfiguration will be shared by all the molecules having the same molecule def...
void PrintState() const
Display the electronic state of the molecule.
const G4String & GetName() const
Returns the name of the molecule.
~G4MolecularConfiguration()
std::ostringstream G4ExceptionDescription
G4MolecularConfiguration * ChangeConfiguration(const G4ElectronOccupancy &newElectronOccupancy)
G4int SetMolecularConfiguration(const G4MoleculeDefinition *molDef, const G4ElectronOccupancy &eOcc, G4MolecularConfiguration *molConf)
static G4Mutex fManagerCreationMutex
static G4String ConvertToString(G4bool boolVal)
G4double GetNbElectrons() const
Returns the number of electron.
const std::vector< const G4MolecularDissociationChannel * > * GetDecayChannel() const
const G4ElectronOccupancy * FindCommonElectronOccupancy(const G4MoleculeDefinition *molDef, const G4ElectronOccupancy &eOcc)
const G4ElectronOccupancy * GetElectronOccupancy() const
Returns the object ElectronOccupancy describing the electronic configuration of the molecule...
G4int GetFakeParticleID() const
static G4MolecularConfigurationManager * fgManager
G4GLOB_DLL std::ostream G4cout
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.
G4MolecularConfiguration::G4MolecularConfigurationManager MolecularConfigurationManager
G4int AddElectron(G4int orbit, G4int number=1)
void CheckElectronOccupancy(const char *line) const
static void DeleteManager()
G4MolecularConfiguration * MoveOneElectron(G4int, G4int)
Move one electron from an orbit to another.
G4MolecularConfiguration & operator=(G4MolecularConfiguration &right)
static G4MolecularConfiguration * GetMolecularConfiguration(const G4MoleculeDefinition *)
G4int GetNbElectrons() const
static G4MolecularConfigurationManager * GetManager()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
const char * removePath(const char *path)
const G4String & GetFormatedName() const
Returns the formated name of the molecule.
void RemoveMolecularConfigurationFromTable(G4MolecularConfiguration *)
G4int GetAtomsNumber() const
Returns the nomber of atoms compouning the molecule.
const G4MoleculeDefinition * GetDefinition() const
G4MolecularConfiguration(const G4MoleculeDefinition *, const G4ElectronOccupancy &)
G4MolecularConfiguration * GetMolecularConfiguration(const G4MoleculeDefinition *molDef, const G4ElectronOccupancy &eOcc)
const G4ElectronOccupancy * GetGroundStateElectronOccupancy() const
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.
~G4MolecularConfigurationManager()
G4int RemoveElectron(G4int orbit, G4int number=1)