96 std::vector<G4String> physExt;
97 std::vector<G4int> physReplace;
105 ED <<
"The factory for the physicslist ["<< name <<
"] does not exist!" <<
G4endl;
106 if ( plBase ==
"" ) {
107 ED <<
"Could determine no sensible base physics list" <<
G4endl;
109 ED <<
"One or more of the extensions does not exist [ ";
110 for (
size_t ipc = 0; ipc < physExt.size(); ++ipc ) {
111 ED << physExt[ipc] <<
" ";
123 size_t npc = physExt.size();
124 for (
size_t ipc = 0; ipc < npc; ++ipc ) {
129 if ( physReplace[ipc] > 0 ) {
141 std::vector<G4String> physExt;
142 std::vector<G4int> physReplace;
149 std::vector<G4String>& physExt,
150 std::vector<G4int>& replace,
164 bool allKnown =
false;
173 size_t nb = availBases.size();
174 for (
size_t ib=0; ib<nb; ++ib) {
175 const G4String& testBase = availBases[ib];
176 size_t ipos = workingName.find(testBase);
178 if ( testBase.size() > plBase.size() ) {
181 if ( verb > 3 ) {
G4cout <<
" physlist current best guess: " << testBase <<
G4endl; }
183 if ( verb > 3 ) {
G4cout <<
" physlist match but shorter: " << testBase <<
G4endl; }
186 if ( verb > 3 ) {
G4cout <<
" physlist reject: " << testBase <<
G4endl; }
190 G4cout <<
" physlist " << name <<
", base known " << allKnown
191 <<
" chosen plBase \"" << plBase <<
"\"" <<
G4endl;
199 workingName.erase(0,plBase.size());
204 size_t ne = availExtras.size();
205 while ( ! workingName.empty() ) {
206 char c = workingName.
data()[0];
207 if (
'_' == c ||
'+' == c ) workingName.erase(0,1);
208 G4int replaceExtra = ( c !=
'+' );
210 G4bool extraKnown =
false;
211 for (
size_t ie=0; ie<ne; ++ie) {
212 const G4String& testExtra = availExtras[ie];
213 size_t ipos = workingName.find(testExtra);
215 if ( testExtra.size() > extraName.size() ) {
216 extraName = testExtra;
219 if ( verb > 3 ) {
G4cout <<
" physextra current best guess: " << testExtra <<
G4endl; }
221 if ( verb > 3 ) {
G4cout <<
" physextra match but shorter: " << testExtra <<
G4endl; }
226 if ( verb > 3 ) {
G4cout <<
" physextra reject: " << testExtra <<
G4endl; }
232 G4cout <<
" physextra " << name <<
" [" << workingName <<
"]"
233 <<
", extra known " << extraKnown
234 <<
" chosen extra \"" << extraName <<
"\""
235 <<
" replace " << replaceExtra <<
G4endl;
239 physExt.push_back(extraName);
240 replace.push_back(replaceExtra);
242 workingName.erase(0,extraName.size());
254 std::map<G4String,G4VBasePhysListStamper*>::const_iterator itr;
265 std::map<G4String,G4String>::const_iterator itr;
283 G4cout <<
"Base G4VModularPhysicsLists in G4PhysListRegistry are:"
285 if ( avail.empty() )
G4cout <<
"... no registered lists" << G4endl;
287 size_t n = avail.size();
288 for (
size_t i=0; i<
n; ++i ) {
289 G4cout <<
" [" << std::setw(3) << i <<
"] "
290 <<
" \"" << avail[i] <<
"\"" <<
G4endl;
297 std::map<G4String,G4String>::const_iterator itr;
298 G4cout <<
"Replacement mappings in G4PhysListRegistry are:"
304 G4cout <<
" " << std::setw(10) << itr->first <<
" => "
305 << std::setw(30) << itr->second <<
" "
306 << ( (known)?
"":
"[unregistered physics]")
std::vector< G4String > availExtensions
void RegisterPhysics(G4VPhysicsConstructor *)
std::ostringstream G4ExceptionDescription
G4bool IsKnownPhysicsConstructor(const G4String &name)
void AddFactory(G4String name, G4VBasePhysListStamper *)
std::map< G4String, G4VBasePhysListStamper * > factories
G4GLOB_DLL std::ostream G4cout
G4VPhysicsConstructor * GetPhysicsConstructor(const G4String &name)
std::vector< G4String > availBasePhysLists
static G4PhysListRegistry * Instance()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
const char * data() const
const std::vector< G4String > & AvailablePhysListsEM() const
void ReplacePhysics(G4VPhysicsConstructor *)
static G4PhysicsConstructorRegistry * Instance()
static G4ThreadLocal G4PhysListRegistry * theInstance
const std::vector< G4String > & AvailablePhysicsExtensions() const
G4bool DeconstructPhysListName(const G4String &name, G4String &plBase, std::vector< G4String > &physExt, std::vector< G4int > &replace, G4int verbose=0) const
void PrintAvailablePhysLists() const
std::map< G4String, G4String > physicsExtensions
G4bool IsReferencePhysList(G4String nam) const
const std::vector< G4String > & AvailablePhysLists() const
G4VModularPhysicsList * GetModularPhysicsList(const G4String &name)
void AddPhysicsExtension(G4String name, G4String procname)