52 #include "DetectorConstruction.hh"
53 #include "ActionInitialization.hh"
54 #include "PrimaryGeneratorAction.hh"
56 #ifdef G4MULTITHREADED
101 void PrintAvailable(
G4int verbosity) {
103 G4cout <<
"extensibleFactory: here are the available physics lists:"
109 if ( verbosity > 1 ) {
111 G4cout <<
"extensibleFactory: "
112 <<
"here are the available physics ctors that can be added:"
120 void PrintUsage(
G4int verbosity) {
122 G4cerr <<
" extensibleFactory [-m macro ] [-p physList ]"
123 <<
" [-u UIsession] [-t nThreads]" << G4endl
124 <<
" [-v | --verbose] [-h | --help]" <<
G4endl;
125 G4cerr <<
" note: -t option is available only for multi-threaded mode."
127 G4cerr <<
" note: -v can be repeated to increase verbosity." <<
G4endl;
130 if (verbosity>0) PrintAvailable(verbosity);
149 char* physListNameEnv = 0;
151 #ifdef G4MULTITHREADED
152 G4int nofThreads = 0;
156 for (
G4int i=1; i<argc; i=i+2 ) {
158 if ( g4argv ==
"-m" ) macro = argv[i+1];
159 else if ( g4argv ==
"-u" ) session = argv[i+1];
160 else if ( g4argv ==
"-p" ) physListName = argv[i+1];
161 #ifdef G4MULTITHREADED
162 else if ( g4argv ==
"-t" ) {
166 else if ( g4argv ==
"-v" || g4argv ==
"--verbose" ) {
170 else if ( g4argv ==
"-h" || g4argv ==
"--help" ) {
171 PrintUsage(verbosity+1);
183 if ( ! macro.size() ) {
191 #ifdef G4MULTITHREADED
193 if ( nofThreads > 0 ) {
212 G4String defaultPhysListName =
"FTFP_BERT";
213 if ( verbosity > 0 ) {
214 G4cout <<
"extensibleFactory: SetDefaultReferencePhysList to '"
215 << defaultPhysListName <<
"' ('' = system default)"
224 if ( verbosity > 0 ) {
225 G4cout <<
"extensibleFactory: adding extensions" << G4endl
226 <<
" RADIO ===> G4RadioactiveDecayPhysics" << G4endl
227 <<
" MYPHYSICS ===> MyG4PhysicsPhysics" << G4endl
233 if ( physListName.size() ) {
234 if ( verbosity > 0 ) {
235 G4cout <<
"extensibleFactory: explicitly using '"
236 << physListName <<
"'" <<
G4endl;
240 if ( verbosity > 0 ) {
241 G4cout <<
"extensibleFactory: no -p flag;"
242 <<
" using ReferencePhysList() ($PHYSLIST or default)" <<
G4endl;
248 physListNameEnv = std::getenv(
"PHYSLIST");
249 if ( physListNameEnv ) {
250 G4cout <<
"extensibleFactory: $PHYSLIST="
251 << physListNameEnv <<
G4endl;
260 G4cerr <<
"extensibleFactory: PhysicsList '"
261 << ( physListNameEnv ? physListNameEnv : physListName )
262 <<
"' was not available in g4alt::PhysListFactory." << G4endl;
263 PrintAvailable(verbosity);
268 ED <<
"The factory for the physicslist ["
269 << ( physListNameEnv ? physListNameEnv : physListName )
270 <<
"] does not exist!"
295 if ( macro.size() ) {
297 G4String command =
"/control/execute ";
302 UImanager->
ApplyCommand(
"/control/execute init_vis.mac");