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

#include <G4MoleculeTable.hh>

Public Member Functions

virtual ~G4MoleculeTable ()
 
G4MoleculeDefinitionCreateMoleculeDefinition (const G4String &userIdentifier, double diffusion_coefficient)
 
G4MolecularConfigurationCreateConfiguration (const G4String &userIdentifier, const G4MoleculeDefinition *molDef, const G4String &configurationLabel, const G4ElectronOccupancy &eOcc)
 
G4MolecularConfigurationCreateConfiguration (const G4String &userIdentifier, G4MoleculeDefinition *, int charge, double diffusion_coefficient=-1)
 
G4MolecularConfigurationCreateConfiguration (const G4String &userIdentifier, G4MoleculeDefinition *)
 
G4MolecularConfigurationCreateConfiguration (const G4String &userIdentifier, G4MoleculeDefinition *, const G4String &configurationLabel, int charge=0)
 
G4MoleculeDefinitionGetMoleculeDefinition (const G4String &, bool mustExist=true)
 
G4MolecularConfigurationGetConfiguration (const G4String &, bool mustExist=true)
 
G4MolecularConfigurationGetConfiguration (G4int id)
 
void Insert (G4MoleculeDefinition *)
 
void Finalize (G4MoleculeDefinition *)
 
void Finalize ()
 
G4MoleculeDefinitionIterator GetDefintionIterator ()
 
G4ConfigurationIterator GetConfigurationIterator ()
 
void PrepareMolecularConfiguration ()
 
int GetNumberOfDefinedSpecies ()
 

Static Public Member Functions

static G4MoleculeTableInstance ()
 
static G4MoleculeTableGetMoleculeTable ()
 

Protected Types

using MoleculeDefTable = std::map<G4String, G4MoleculeDefinition *>
 

Protected Member Functions

 G4MoleculeTable ()
 

Protected Attributes

MoleculeDefTable fMoleculeDefTable
 
std::unique_ptr< G4MoleculeTableMessengerfMoleculeDefTableMessenger
 

Static Protected Attributes

static G4MoleculeTablefpgMoleculeTable
 

Detailed Description

Definition at line 61 of file G4MoleculeTable.hh.

Member Typedef Documentation

◆ MoleculeDefTable

Definition at line 134 of file G4MoleculeTable.hh.

Constructor & Destructor Documentation

◆ ~G4MoleculeTable()

G4MoleculeTable::~G4MoleculeTable ( )
virtualdefault

◆ G4MoleculeTable()

G4MoleculeTable::G4MoleculeTable ( )
protected

Definition at line 42 of file G4MoleculeTable.cc.

44{
45}
std::unique_ptr< G4MoleculeTableMessenger > fMoleculeDefTableMessenger

Referenced by Instance().

Member Function Documentation

◆ CreateConfiguration() [1/4]

G4MolecularConfiguration * G4MoleculeTable::CreateConfiguration ( const G4String & userIdentifier,
const G4MoleculeDefinition * molDef,
const G4String & configurationLabel,
const G4ElectronOccupancy & eOcc )

Definition at line 234 of file G4MoleculeTable.cc.

238{
239 bool alreadyCreated(false);
240
241 G4MolecularConfiguration* molConf =
243 molDef,
244 configurationLabel,
245 eOcc,
246 alreadyCreated);
247
248 return molConf;
249}
static G4MolecularConfiguration * CreateMolecularConfiguration(const G4String &userIdentifier, const G4MoleculeDefinition *, bool &wasAlreadyCreated)

◆ CreateConfiguration() [2/4]

G4MolecularConfiguration * G4MoleculeTable::CreateConfiguration ( const G4String & userIdentifier,
G4MoleculeDefinition * molDef )

Definition at line 174 of file G4MoleculeTable.cc.

176{
177 bool alreadyCreated(false);
178
179 G4MolecularConfiguration* molConf =
181 molDef,
182 alreadyCreated);
183
184 return molConf;
185}

◆ CreateConfiguration() [3/4]

G4MolecularConfiguration * G4MoleculeTable::CreateConfiguration ( const G4String & userIdentifier,
G4MoleculeDefinition * molDef,
const G4String & configurationLabel,
int charge = 0 )

Definition at line 190 of file G4MoleculeTable.cc.

194{
195 bool alreadyCreated(false);
196
197 G4MolecularConfiguration* molConf =
199 molDef,
200 charge,
201 configurationLabel,
202 alreadyCreated);
203
204 return molConf;
205}

◆ CreateConfiguration() [4/4]

G4MolecularConfiguration * G4MoleculeTable::CreateConfiguration ( const G4String & userIdentifier,
G4MoleculeDefinition * molDef,
int charge,
double diffusion_coefficient = -1 )

Definition at line 210 of file G4MoleculeTable.cc.

214{
215 bool alreadyCreated(false);
216
217 G4MolecularConfiguration* molConf =
219 molDef,
220 charge,
221 userIdentifier,
222 alreadyCreated);
223
224 if(diffusion_coefficient!=-1) // TODO
225 {
226 molConf->SetDiffusionCoefficient(diffusion_coefficient);
227 }
228 return molConf;
229}

◆ CreateMoleculeDefinition()

G4MoleculeDefinition * G4MoleculeTable::CreateMoleculeDefinition ( const G4String & userIdentifier,
double diffusion_coefficient )

Definition at line 70 of file G4MoleculeTable.cc.

72{
73 return new G4MoleculeDefinition(name, -1 /* mass*/,
74 diffusion_coefficient);
75}

◆ Finalize() [1/2]

void G4MoleculeTable::Finalize ( )

Definition at line 253 of file G4MoleculeTable.cc.

◆ Finalize() [2/2]

void G4MoleculeTable::Finalize ( G4MoleculeDefinition * )
inline

◆ GetConfiguration() [1/2]

G4MolecularConfiguration * G4MoleculeTable::GetConfiguration ( const G4String & name,
bool mustExist = true )

Definition at line 106 of file G4MoleculeTable.cc.

107{
108 G4MolecularConfiguration* species =
110
111 if(species == nullptr && mustExist)
112 {
113 // exception
114 G4ExceptionDescription description;
115 description << "The configuration " << name
116 << " was not recorded in the table" << G4endl;
117 G4Exception("G4MoleculeTable::GetConfiguration",
118 "CONF_NOT_CREATED",
120 description);
121 }
122
123 return species;
124}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
#define G4endl
Definition G4ios.hh:67
static G4MolecularConfiguration * GetMolecularConfiguration(const G4MoleculeDefinition *, const G4String &label)
const char * name(G4int ptype)

Referenced by G4MoleculeGun::BuildAndPushTrack(), G4EmDNAChemistry_option1::ConstructMolecule(), G4EmDNAChemistry::ConstructReactionTable(), G4EmDNAChemistry_option1::ConstructReactionTable(), G4EmDNAChemistry_option2::ConstructReactionTable(), G4EmDNAChemistry_option3::ConstructReactionTable(), G4DNAMolecularReactionTable::GetReactionData(), G4ChemEquilibrium::Initialize(), G4DNAMolecularMaterial::SetMolecularConfiguration(), G4DNAMolecularReactionData::SetReactant1(), G4DNAMolecularReactionData::SetReactant2(), and G4DNAMolecularReactionData::SetReactants().

◆ GetConfiguration() [2/2]

G4MolecularConfiguration * G4MoleculeTable::GetConfiguration ( G4int id)

Definition at line 129 of file G4MoleculeTable.cc.

130{
131 G4MolecularConfiguration* species =
133
134 return species;
135}

◆ GetConfigurationIterator()

G4ConfigurationIterator G4MoleculeTable::GetConfigurationIterator ( )

Definition at line 260 of file G4MoleculeTable.cc.

261{
263}
G4MoleculeIterator< G4MolecularConfiguration > G4ConfigurationIterator
static std::map< G4String, G4MolecularConfiguration * > & GetUserIDTable()

Referenced by G4MoleculeCounter::Initialize(), and G4MolecularConfiguration::ScaleAllDiffusionCoefficientsOnWater().

◆ GetDefintionIterator()

◆ GetMoleculeDefinition()

G4MoleculeDefinition * G4MoleculeTable::GetMoleculeDefinition ( const G4String & name,
bool mustExist = true )

Definition at line 80 of file G4MoleculeTable.cc.

82{
83 auto it = fMoleculeDefTable.find(name);
84 G4MoleculeDefinition* definition(nullptr);
85 if (it != fMoleculeDefTable.end())
86 {
87 definition = it->second;
88 }
89 else if(mustExist)
90 {
91 // exception
92 G4ExceptionDescription description;
93 description << "The molecule definition " << name
94 << " was NOT recorded in the table" << G4endl;
95 G4Exception("G4MoleculeTable::CreateMoleculeModel",
96 "MOLECULE_DEFINITION_NOT_CREATED",
98 description);
99 }
100 return definition;
101}

Referenced by G4MolecularConfiguration::Unserialize().

◆ GetMoleculeTable()

G4MoleculeTable * G4MoleculeTable::GetMoleculeTable ( )
static

Definition at line 62 of file G4MoleculeTable.cc.

63{
64 return Instance();
65}
static G4MoleculeTable * Instance()

Referenced by G4DNAMolecularReactionTable::GetReactionData().

◆ GetNumberOfDefinedSpecies()

int G4MoleculeTable::GetNumberOfDefinedSpecies ( )

Definition at line 267 of file G4MoleculeTable.cc.

◆ Insert()

void G4MoleculeTable::Insert ( G4MoleculeDefinition * moleculeDefinition)

Definition at line 139 of file G4MoleculeTable.cc.

140{
141
142 const G4String& name = moleculeDefinition->GetName();
143 auto it = fMoleculeDefTable.find(name);
144 if (it == fMoleculeDefTable.end())
145 {
146 fMoleculeDefTable[name] = moleculeDefinition;
147 }
148 else
149 {
150 // exception
151 G4ExceptionDescription description;
152 description << "The molecule definition " << name
153 << " was already recorded in the table" << G4endl;
154 G4Exception("G4MoleculeTable::CreateMoleculeDefinition",
155 "DEFINITION_ALREADY_CREATED", FatalException, description);
156 }
157}
const G4String & GetName() const

Referenced by G4MoleculeDefinition::G4MoleculeDefinition().

◆ Instance()

G4MoleculeTable * G4MoleculeTable::Instance ( )
static

Definition at line 54 of file G4MoleculeTable.cc.

55{
57 return fpgMoleculeTable;
58}
static G4MoleculeTable * fpgMoleculeTable

Referenced by G4DNAScavengerMaterial::AddNumberMoleculePerVolumeUnitForMaterialConf(), G4DNAMolecularReactionData::AddProduct(), G4MoleculeGun::BuildAndPushTrack(), G4VUserChemistryList::BuildPhysicsTable(), G4ChemDissociationChannels::ConstructDissociationChannels(), G4ChemDissociationChannels_option1::ConstructDissociationChannels(), G4ChemDissociationChannels::ConstructMolecule(), G4ChemDissociationChannels_option1::ConstructMolecule(), G4EmDNAChemistry_option1::ConstructMolecule(), G4EmDNAChemistry_option2::ConstructMolecule(), G4EmDNAChemistry::ConstructProcess(), G4EmDNAChemistry_option1::ConstructProcess(), G4EmDNAChemistry_option2::ConstructProcess(), G4EmDNAChemistry_option3::ConstructProcess(), G4EmDNAChemistry::ConstructReactionTable(), G4EmDNAChemistry_option1::ConstructReactionTable(), G4EmDNAChemistry_option2::ConstructReactionTable(), G4EmDNAChemistry_option3::ConstructReactionTable(), G4MoleculeDefinition::Finalize(), G4MoleculeDefinition::G4MoleculeDefinition(), GetMoleculeTable(), G4ChemEquilibrium::Initialize(), G4MoleculeCounter::Initialize(), G4DNAChemistryManager::InitializeThreadSharedData(), G4DNAChemistryManager::Run(), G4MolecularConfiguration::ScaleAllDiffusionCoefficientsOnWater(), G4DNAMolecularMaterial::SetMolecularConfiguration(), G4DNAMolecularReactionData::SetReactant1(), G4DNAMolecularReactionData::SetReactant2(), G4DNAMolecularReactionData::SetReactants(), and G4MolecularConfiguration::Unserialize().

◆ PrepareMolecularConfiguration()

void G4MoleculeTable::PrepareMolecularConfiguration ( )

Definition at line 161 of file G4MoleculeTable.cc.

162{
163 auto it = fMoleculeDefTable.begin();
164
165 for(; it != fMoleculeDefTable.end() ; ++it)
166 {
168 }
169}
static G4MolecularConfiguration * GetOrCreateMolecularConfiguration(const G4MoleculeDefinition *)

Referenced by G4DNAChemistryManager::InitializeThreadSharedData().

Member Data Documentation

◆ fMoleculeDefTable

MoleculeDefTable G4MoleculeTable::fMoleculeDefTable
protected

◆ fMoleculeDefTableMessenger

std::unique_ptr<G4MoleculeTableMessenger> G4MoleculeTable::fMoleculeDefTableMessenger
protected

Definition at line 137 of file G4MoleculeTable.hh.

◆ fpgMoleculeTable

G4MoleculeTable * G4MoleculeTable::fpgMoleculeTable
staticprotected

Definition at line 133 of file G4MoleculeTable.hh.

Referenced by Instance().


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