52 if(0 == theInstance) {
54 theInstance = &manager;
59 G4PhysicsConstructorRegistry::G4PhysicsConstructorRegistry()
69 size_t n = physConstr.size();
71 for (
size_t i=0; i<
n; ++i) {
85 size_t n = physConstr.size();
87 for (
size_t i=0; i<
n; ++i) {
88 if(physConstr[i] == p) {
return; }
91 physConstr.push_back(p);
97 size_t n = physConstr.size();
99 for (
size_t i=0; i<
n; ++i) {
100 if ( physConstr[i] == p ) {
110 factories[
name] = factory;
117 if (factories.find(name)!=factories.end())
123 return factories[
name]->Instantiate();
128 ED <<
"The factory for the physics constructor ["<< name <<
"] does not exist!" <<
G4endl;
136 return ( factories.find(name) != factories.end() );
142 std::vector<G4String> avail;
143 std::map<G4String,G4VBasePhysConstrFactory*>::const_iterator itr;
144 for ( itr = factories.begin(); itr != factories.end(); ++itr ) {
145 avail.push_back(itr->first);
154 G4cout <<
"G4VPhysicsConstructors in G4PhysicsConstructorRegistry are:"
156 if ( avail.empty() )
G4cout <<
"... no registered processes" << G4endl;
158 size_t n = avail.size();
159 for (
size_t i=0; i<
n; ++i ) {
160 G4cout <<
" [" << std::setw(3) << i <<
"] "
161 <<
" \"" << avail[i] <<
"\"" <<
G4endl;
~G4PhysicsConstructorRegistry()
std::ostringstream G4ExceptionDescription
void PrintAvailablePhysicsConstructors() const
G4bool IsKnownPhysicsConstructor(const G4String &name)
G4GLOB_DLL std::ostream G4cout
G4VPhysicsConstructor * GetPhysicsConstructor(const G4String &name)
void AddFactory(G4String, G4VBasePhysConstrFactory *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
#define G4_REFERENCE_PHYSCONSTR_FACTORY(physics_constructor)
static G4PhysicsConstructorRegistry * Instance()
std::vector< G4String > AvailablePhysicsConstructors() const
void DeRegister(G4VPhysicsConstructor *)
void Register(G4VPhysicsConstructor *)