53 #define REGREF PhysListReg // REGREF is used to make instances unique
54 #include "G4RegisterPhysicsConstructors.icc"
57 #include "G4RegisterPhysLists.icc"
95 , systemDefault(
"FTFP_BERT")
127 std::vector<G4String> physExt;
128 std::vector<G4int> physReplace;
132 size_t npc = physExt.size();
134 G4cout <<
"G4PhysListRegistry::GetModularPhysicsList <"
136 <<
", as \"" << plBase <<
"\" with extensions \"";
137 for (
size_t ipc = 0; ipc < npc; ++ipc )
144 G4cout <<
"### G4PhysListRegistry WARNING: " << name
149 ED <<
"The factory for the physicslist ["<< name <<
"] does not exist!"
151 if ( plBase ==
"" ) {
152 ED <<
"Could determine no sensible base physics list" <<
G4endl;
154 ED <<
"One or more of the extensions does not exist [ ";
155 for (
size_t ipc = 0; ipc < physExt.size(); ++ipc ) {
156 ED << physExt[ipc] <<
" ";
160 G4Exception(
"G4PhysListRegistry::GetModularPhysicsList",
173 for (
size_t ipc = 0; ipc < npc; ++ipc ) {
185 reporreg =
"ReplacePhysics ";
188 reporreg =
"RegisterPhysics";
190 if (
verbose > 0 )
G4cout <<
"<<< " << reporreg <<
" with " << pcname
191 <<
" \"" << extName <<
"\"" <<
G4endl;
194 G4cout <<
"<<< Reference Physics List " << name <<
" is built" <<
G4endl;
207 char* path = std::getenv(
"PHYSLIST");
212 G4cout <<
"### G4PhysListRegistry WARNING: "
213 <<
" environment variable PHYSLIST is not defined"
215 <<
" Default Physics Lists " << name
216 <<
" is instantiated"
225 std::vector<G4String> physExt;
226 std::vector<G4int> physReplace;
233 std::vector<G4String>& physExt,
234 std::vector<G4int>& replace,
248 bool allKnown =
false;
258 const std::vector<G4String>& availPhysCtors =
266 G4cout <<
" " << name <<
", base known=" << ((allKnown)?
"true":
"false")
267 <<
" chosen plBase \"" << plBase <<
"\"" <<
G4endl;
275 workingName.erase(0,plBase.size());
280 while ( ! workingName.empty() ) {
281 char c = workingName.
data()[0];
282 if (
'_' == c ||
'+' == c ) workingName.erase(0,1);
285 G4bool extraKnown =
false;
287 extraKnown =
FindLongestMatch(workingName,
"extNames",availExtras,extraName);
291 std::map<G4String,G4String>::const_iterator itr =
296 if ( ! realknown ) allKnown =
false;
299 G4cout <<
" extraName \"" << extraName <<
"\" maps to physics ctor \""
300 << pcname <<
"\" which is itself realknown " << realknown
312 G4cout <<
" physextra " << name <<
" [" << workingName <<
"]"
313 <<
", extra known " << extraKnown
314 <<
" chosen extra \"" << extraName <<
"\""
315 <<
" replace " << replaceExtra <<
G4endl;
319 physExt.push_back(extraName);
320 replace.push_back(replaceExtra);
322 workingName.erase(0,extraName.size());
327 G4cout <<
" workingName \"" << workingName <<
"\""
328 <<
" couldn't be found in the extensions list"
343 const std::vector<G4String>& validNames,
350 size_t n = validNames.size();
351 for (
size_t i=0; i<
n; ++i) {
352 const G4String& testName = validNames[i];
353 size_t ipos = workingName.find(testName);
355 if ( testName.size() > bestMatch.size() ) {
356 bestMatch = testName;
359 G4cout <<
" " << searchName <<
" current best guess: "
364 G4cout <<
" " << searchName <<
" match but shorter: "
370 G4cout <<
" " << searchName <<
" reject: " << testName <<
G4endl;
381 std::map<G4String,G4VBasePhysListStamper*>::const_iterator itr;
392 std::map<G4String,G4String>::const_iterator itr;
411 G4cout <<
"Base G4VModularPhysicsLists in G4PhysListRegistry are:"
413 if ( avail.empty() )
G4cout <<
"... no registered lists" << G4endl;
415 size_t n = avail.size();
416 for (
size_t i=0; i<
n; ++i ) {
417 G4cout <<
" [" << std::setw(3) << i <<
"] "
418 <<
" \"" << avail[i] <<
"\"" <<
G4endl;
424 std::map<G4String,G4String>::const_iterator itr;
425 G4cout <<
"Replacement mappings in G4PhysListRegistry are:"
430 G4cout <<
" " << std::setw(10) << itr->first <<
" => "
431 << std::setw(30) << itr->second <<
" "
432 << ( (known)?
"":
"[unregistered physics]")
435 G4cout <<
"Use these mapping to extend physics list; append with _EXT or +EXT" << G4endl
436 <<
" to use ReplacePhysics() (\"_\") or RegisterPhysics() (\"+\")."