40 #include "nutools/G4Base/G4PhysListFactorySingleton.hh" 43 #include "nutools/G4Base/G4PhysicsProcessFactorySingleton.hh" 86 char* path =
getenv(
"PHYSLIST");
88 name = G4String(path);
91 G4cout <<
"### G4PhysListFactorySingleton WARNING: " 92 <<
" environment variable PHYSLIST is not defined" 94 <<
" Default Physics Lists " << name
101 G4VModularPhysicsList*
104 G4VModularPhysicsList*
p = 0;
138 std::vector<G4String> physicsReplacements;
140 G4String nameNoReplace =
GetBaseName(name,physicsReplacements,allKnown);
152 G4cout <<
"### G4PhysListFactorySingleton WARNING: " 153 <<
"PhysicsList " << nameNoReplace
154 <<
"(originally=\"" << name <<
"\")" 157 }
else if ( physicsReplacements.size() != 0 ) {
163 for (
size_t k=0;
k<physicsReplacements.size(); ++
k) {
164 G4String procName = physicsReplacements[
k];
166 G4cout <<
"### G4PhysListFactorySingleton WARNING: " 167 <<
"G4PhysicsProcesFactorySingleton had no process \"" 168 << procName <<
"\" registered" << G4endl;
170 G4cout <<
"### G4PhysListFactorySingleton: ReplacePhysics(" 171 << procName <<
")" << G4endl;
173 p->ReplacePhysics(pctor);
184 std::vector<G4String> physicsReplacements;
186 G4String nameNoReplace =
GetBaseName(name,physicsReplacements,allKnown);
191 const std::vector<G4String>&
209 G4cout <<
"G4VModularPhysicsLists in " 210 <<
"G4PhysicsProcessFactorySingleton are: " 212 if ( list.empty() ) G4cout <<
" ... no registered lists" << G4endl;
214 for (
size_t indx=0; indx < list.size(); ++indx ) {
215 G4cout <<
" [" <<
std::setw(2) << indx <<
"] " 216 <<
"\"" << list[indx] <<
"\"" << G4endl;
219 G4cout <<
"G4PhysicsProcessFactorySingleton supports variants of the above" 220 << G4endl <<
"with physics process replacements:" << G4endl;
222 G4cout <<
" ... no registered replacements" << G4endl;
224 G4bool printPhysicsProcesses =
false;
230 G4String
key = repitr->first;
231 G4String procName = repitr->second;
233 if ( ! known ) printPhysicsProcesses =
true;
234 G4cout <<
" " <<
std::setw(10) << key <<
" ==> " 236 << ( (known)?
"known":
"*** unknown ***" ) << G4endl;
261 std::vector<G4String>& physicsReplace,
265 G4String nameNoReplace =
name;
266 physicsReplace.clear();
272 G4String
key = repitr->first;
273 size_t i = nameNoReplace.find(key);
274 if ( i != std::string::npos ) {
276 nameNoReplace.erase(i,key.size());
279 G4String procName = repitr->second;
280 physicsReplace.push_back(procName);
282 G4cout <<
"G4PhysListFactorySingleton::GetBaseName " 283 <<
"\"" << key <<
"\" ==> \"" << procName <<
"\" not found" 295 return nameNoReplace;
299 #include "nutools/G4Base/G4PhysListRegisterOld.icc" 302 #include "nutools/G4Base/G4PhysicsProcessRegisterOld.icc"
static G4PhysListFactorySingleton * fgTheInstance
std::map< G4String, PhysListCtorFuncPtr_t > fFunctionMap
std::map< G4String, G4String > fPhysicsReplaceList
G4String GetBaseName(G4String name, std::vector< G4String > &physicsReplacements, G4bool &allKnown)
const std::vector< G4String > & AvailablePhysLists() const
std::vector< G4String > listnames
static G4PhysicsProcessFactorySingleton & Instance()
std::string getenv(std::string const &name)
G4bool RegisterPhysicsReplacement(G4String key, G4String physics)
G4PhysListFactorySingleton()
Q_EXPORT QTSManip setw(int w)
G4bool IsKnownPhysicsProcess(const G4String &)
G4VModularPhysicsList *(* PhysListCtorFuncPtr_t)()
virtual ~G4PhysListFactorySingleton()
G4bool IsReferencePhysList(const G4String &)
G4bool RegisterCreator(G4String name, PhysListCtorFuncPtr_t ctorptr, G4bool *ptr)
G4VPhysicsConstructor * GetPhysicsProcess(const G4String &)
void PrintAvailablePhysLists() const
static G4PhysListFactorySingleton & Instance()
G4VModularPhysicsList * ReferencePhysList()
G4VModularPhysicsList * GetReferencePhysList(const G4String &)
void PrintAvailablePhysicsProcesses() const
std::map< G4String, G4bool * > fBoolPtrMap