53 #include "DetectorConstruction.hh"
54 #include "ActionInitialization.hh"
55 #include "PrimaryGeneratorAction.hh"
57 #ifdef G4MULTITHREADED
102 void PrintAvailable(
G4int verbosity) {
104 G4cout <<
"extensibleFactory: here are the available physics lists:"
110 if ( verbosity > 1 ) {
112 G4cout <<
"extensibleFactory: "
113 <<
"here are the available physics ctors that can be added:"
121 void PrintUsage(
G4int verbosity) {
123 G4cerr <<
" extensibleFactory [-m macro ] [-p physList ]"
124 <<
" [-u UIsession] [-t nThreads]" << G4endl
125 <<
" [-v | --verbose] [-h | --help]" <<
G4endl;
126 G4cerr <<
" note: -t option is available only for multi-threaded mode."
128 G4cerr <<
" note: -v can be repeated to increase verbosity." <<
G4endl;
131 if (verbosity>0) PrintAvailable(verbosity);
150 char* physListNameEnv = 0;
152 #ifdef G4MULTITHREADED
153 G4int nofThreads = 0;
157 for (
G4int i=1; i<argc; i=i+2 ) {
159 if ( g4argv ==
"-m" ) macro = argv[i+1];
160 else if ( g4argv ==
"-u" ) session = argv[i+1];
161 else if ( g4argv ==
"-p" ) physListName = argv[i+1];
162 #ifdef G4MULTITHREADED
163 else if ( g4argv ==
"-t" ) {
167 else if ( g4argv ==
"-v" || g4argv ==
"--verbose" ) {
171 else if ( g4argv ==
"-h" || g4argv ==
"--help" ) {
172 PrintUsage(verbosity+1);
184 if ( ! macro.size() ) {
192 #ifdef G4MULTITHREADED
194 if ( nofThreads > 0 ) {
213 G4String defaultPhysListName =
"FTFP_BERT";
214 if ( verbosity > 0 ) {
215 G4cout <<
"extensibleFactory: SetDefaultReferencePhysList to '"
216 << defaultPhysListName <<
"' ('' = system default)"
225 if ( verbosity > 0 ) {
226 G4cout <<
"extensibleFactory: adding extensions" << G4endl
227 <<
" RADIO ===> G4RadioactiveDecayPhysics" << G4endl
228 <<
" MYPHYSICS ===> MyG4PhysicsPhysics" << G4endl
234 if ( physListName.size() ) {
235 if ( verbosity > 0 ) {
236 G4cout <<
"extensibleFactory: explicitly using '"
237 << physListName <<
"'" <<
G4endl;
241 if ( verbosity > 0 ) {
242 G4cout <<
"extensibleFactory: no -p flag;"
243 <<
" using ReferencePhysList() ($PHYSLIST or default)" <<
G4endl;
249 physListNameEnv = getenv(
"PHYSLIST");
250 if ( physListNameEnv ) {
251 G4cout <<
"extensibleFactory: $PHYSLIST="
252 << physListNameEnv <<
G4endl;
261 G4cerr <<
"extensibleFactory: PhysicsList '"
262 << ( physListNameEnv ? physListNameEnv : physListName )
263 <<
"' was not available in g4alt::PhysListFactory." << G4endl;
264 PrintAvailable(verbosity);
269 ED <<
"The factory for the physicslist ["
270 << ( physListNameEnv ? physListNameEnv : physListName )
271 <<
"] does not exist!"
296 if ( macro.size() ) {
298 G4String command =
"/control/execute ";
303 UImanager->
ApplyCommand(
"/control/execute init_vis.mac");
void SetNumberOfThreads(G4int n)
static G4UIterminal * session
std::ostringstream G4ExceptionDescription
G4int ApplyCommand(const char *aCommand)
static G4PhysicsConstructorRegistry * Instance()
static G4PhysListRegistry * Instance()
G4_DECLARE_PHYSLIST_FACTORY(MySpecialPhysList)
static G4UImanager * GetUIpointer()
static G4int ConvertToInt(const char *st)
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
Action initialization class.
void PrintAvailablePhysLists() const
void PrintAvailablePhysicsConstructors() const
int main(int argc, char **argv)
G4GLOB_DLL std::ostream G4cerr
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
G4VModularPhysicsList * ReferencePhysList()
G4VModularPhysicsList * GetReferencePhysList(const G4String &)
Simple detector construction with a box volume placed in a world.
void SetDefaultReferencePhysList(const G4String &name="")
void AddPhysicsExtension(G4String name, G4String procname)