|
SLIC
6.1.1
Simulation for the Linear Collider (SLIC) - Geant4 simulation application
|
Singleton class for a Geant4 application. More...
#include <SlicApplication.hh>
Public Types | |
| enum | ErrorCode { OKAY = 0 , UNKNOWN_ERROR , UNKNOWN_EXCEPTION , STD_EXCEPTION , OUTPUT_FILE_EXISTS , FAILED_DELETE_LCIO_FILE , EVENT_UNDERFLOW , INVALID_GEOMETRY_SETUP , GENERATOR_NOT_SETUP , ERROR_CODE_SIZE } |
| enum | ERunMode { eBatch = 1 , eInteractive = 2 } |
Public Types inherited from Module | |
| enum | ModuleStatus { eOkay = 0 , eNotInitialized = 1 , eBadState = 2 , eFatalError = 3 } |
Public Member Functions | |
| SlicApplication () | |
| virtual | ~SlicApplication () |
| const std::string & | getBinaryBasename () const |
| const std::string & | getBinaryName () const |
| const char * | getErrorCodeString (unsigned int errorCode) |
| ERunMode | getMode () const |
| int | getReturnCode () const |
| RunManager * | getRunManager () |
| void | initialize () |
| void | initialize (int argc, char **argv) |
| bool | isAborting () const |
| void | printEndTime () |
| void | printSplashScreen () |
| void | printStartTime () |
| void | printUsage () |
| void | printVersion () |
| void | run () |
| void | setAborting (bool a=true) |
| void | setMode (ERunMode rmode) |
| void | setReturnCode (int rc) |
Public Member Functions inherited from Singleton< SlicApplication > | |
| Singleton () | |
| ~Singleton () | |
| void | release () |
Public Member Functions inherited from Module | |
| virtual | ~Module () |
| virtual void | beginEvent (const G4Event *) |
| virtual void | beginRun (const G4Run *) |
| virtual void | cleanup () |
| bool | deleteOnExit () |
| virtual void | endEvent (const G4Event *) |
| virtual void | endRun (const G4Run *) |
| const std::string & | getName () const |
| ModuleStatus | getStatus () const |
| LogStream & | log () |
| virtual void | postTracking (const G4Track *) |
| virtual void | preTracking (const G4Track *) |
| virtual void | reset () |
| virtual void | stepping (const G4Step *) |
Protected Attributes | |
| SlicApplicationMessenger * | m_appMessenger |
| std::string | m_binarybasename |
| std::string | m_binaryname |
| FieldMessenger * | m_fieldMessenger |
| std::string * | m_geant4VersionString |
| bool | m_isInitialized |
| ERunMode | m_mode |
| int | m_returnCode |
| RunManager * | m_runManager |
| G4UIExecutive * | m_ui |
Private Member Functions | |
| void | initializeLCDD () |
| void | initializeUserActions () |
| void | initializeVis () |
| void | setBinaryBasename () |
Additional Inherited Members | |
Static Public Member Functions inherited from Singleton< SlicApplication > | |
| static SlicApplication * | instance () |
Public Attributes inherited from Module | |
| bool | m_deleteOnExit |
| LogStream * | m_log |
| std::string | m_name |
| ModuleStatus | m_status |
Protected Member Functions inherited from Module | |
| Module (const std::string &name, bool deleteOnExit=true, bool autoRegister=true) | |
Singleton class for a Geant4 application.
Definition at line 40 of file SlicApplication.hh.
| enum ErrorCode |
Error codes.
| Enumerator | |
|---|---|
| OKAY | |
| UNKNOWN_ERROR | |
| UNKNOWN_EXCEPTION | |
| STD_EXCEPTION | |
| OUTPUT_FILE_EXISTS | |
| FAILED_DELETE_LCIO_FILE | |
| EVENT_UNDERFLOW | |
| INVALID_GEOMETRY_SETUP | |
| GENERATOR_NOT_SETUP | |
| ERROR_CODE_SIZE | |
Definition at line 54 of file SlicApplication.hh.
| enum ERunMode |
Indicates the run mode: batch or interactive.
| Enumerator | |
|---|---|
| eBatch | |
| eInteractive | |
Definition at line 47 of file SlicApplication.hh.
| SlicApplication | ( | ) |
The constructor.
Definition at line 30 of file SlicApplication.cc.
References LOG::done, LOG::head, Module::log(), and LOG::okay.
|
virtual |
The destructor.
Definition at line 37 of file SlicApplication.cc.
References LOG::done, SlicApplication::getErrorCodeString(), SlicApplication::getReturnCode(), LOG::head, Module::log(), SlicApplication::m_appMessenger, and LOG::okay.
| const std::string & getBinaryBasename | ( | ) | const |
Get the base name of the binary (file name only).
Definition at line 141 of file SlicApplication.cc.
References SlicApplication::m_binarybasename.
| const std::string & getBinaryName | ( | ) | const |
Get the name of the binary, as it was invoked from the command line.
Definition at line 137 of file SlicApplication.cc.
References SlicApplication::m_binaryname.
|
inline |
Get a string representation of an error code.
| [in] | errorCode | The errorCode. |
Definition at line 182 of file SlicApplication.hh.
References LOG::done, LOG::error, SlicApplication::ERROR_CODE_SIZE, slic::ErrorCodeStrings, and Module::log().
Referenced by SlicApplication::~SlicApplication().
| SlicApplication::ERunMode getMode | ( | ) | const |
Get the run mode, interactive or batch.
Definition at line 160 of file SlicApplication.cc.
References SlicApplication::m_mode.
Referenced by SlicApplication::run().
| int getReturnCode | ( | ) | const |
Get the return code.
Definition at line 145 of file SlicApplication.cc.
References SlicApplication::m_returnCode.
Referenced by SlicApplication::~SlicApplication(), and SlicMain::main().
| RunManager * getRunManager | ( | ) |
Return SLIC's RunManager instance.
Definition at line 170 of file SlicApplication.cc.
References SlicApplication::m_runManager.
|
virtual |
Initialize the application.
Reimplemented from Module.
Definition at line 81 of file SlicApplication.cc.
References SlicApplication::initializeLCDD(), SlicApplication::initializeVis(), Singleton< MCParticleManager >::instance(), Singleton< TrackManager >::instance(), Singleton< FieldManager >::instance(), Singleton< LcioManager >::instance(), Singleton< PhysicsListManager >::instance(), Module::log(), SlicApplication::m_appMessenger, SlicApplication::m_isInitialized, SlicApplication::m_runManager, SlicApplication::printSplashScreen(), and LogStream::warning().
Referenced by SlicMain::main(), and SlicApplication::run().
| void initialize | ( | int | argc, |
| char ** | argv | ||
| ) |
Setup SLIC from command line arguments using the CommandLineProcessor.
| [in] | argc | The argument count. |
| [in] | argv | The argument values. |
Definition at line 69 of file SlicApplication.cc.
References Singleton< CommandLineProcessor >::instance(), SlicApplication::m_binaryname, SlicApplication::m_ui, CommandLineProcessor::process(), and SlicApplication::setBinaryBasename().
|
private |
Register the LCDDDetectorConstruction.
Definition at line 128 of file SlicApplication.cc.
References SlicApplication::m_runManager.
Referenced by SlicApplication::initialize().
|
private |
Register the Geant4 user action classes with the G4RunManager.
|
private |
Initialize the Geant4 visualization subsystem.
Definition at line 119 of file SlicApplication.cc.
Referenced by SlicApplication::initialize().
| bool isAborting | ( | ) | const |
Get the abort state.
| void printEndTime | ( | ) |
Print the end time.
| void printSplashScreen | ( | ) |
Print SLIC's splash screen.
Definition at line 203 of file SlicApplication.cc.
References LOG::always, LOG::done, and Module::log().
Referenced by SlicApplication::initialize().
| void printStartTime | ( | ) |
Print the start time.
| void printUsage | ( | ) |
Print the usage by calling the CommandLineProcessor.
Definition at line 211 of file SlicApplication.cc.
References Singleton< CommandLineProcessor >::instance().
Referenced by SlicApplicationMessenger::SetNewValue().
| void printVersion | ( | ) |
Print the version string.
Definition at line 199 of file SlicApplication.cc.
References Singleton< CommandLineProcessor >::instance().
Referenced by SlicApplicationMessenger::SetNewValue().
| void run | ( | ) |
Run the application.
Definition at line 174 of file SlicApplication.cc.
References CommandQueue::clear(), SlicApplication::eInteractive, CommandQueue::execute(), SlicApplication::getMode(), SlicApplication::initialize(), Singleton< CommandLineProcessor >::instance(), Module::log(), SlicApplication::m_isInitialized, SlicApplication::m_ui, CommandQueue::printOut(), and LogStream::verbose().
Referenced by SlicMain::main().
| void setAborting | ( | bool | a = true | ) |
Set abort state.
| [in] | a | The application abort state. |
Definition at line 164 of file SlicApplication.cc.
|
private |
Set the binary base name from the full name.
Definition at line 153 of file SlicApplication.cc.
References SlicApplication::m_binarybasename, and SlicApplication::m_binaryname.
Referenced by SlicApplication::initialize().
| void setMode | ( | SlicApplication::ERunMode | rmode | ) |
Set the run mode.
| [in] | rmode | The run mode, either batch or interactive. |
Definition at line 133 of file SlicApplication.cc.
References SlicApplication::m_mode.
Referenced by SlicApplicationMessenger::SetNewValue().
| void setReturnCode | ( | int | rc | ) |
Set the return code.
| [in] | rc | The return code. |
Definition at line 149 of file SlicApplication.cc.
References SlicApplication::m_returnCode.
|
protected |
app messenger
Definition at line 218 of file SlicApplication.hh.
Referenced by SlicApplication::~SlicApplication(), and SlicApplication::initialize().
|
protected |
Definition at line 236 of file SlicApplication.hh.
Referenced by SlicApplication::getBinaryBasename(), and SlicApplication::setBinaryBasename().
|
protected |
What was the name of the SLIC binary from CL? (used by LcioFileNamer)
Definition at line 235 of file SlicApplication.hh.
Referenced by SlicApplication::getBinaryName(), SlicApplication::initialize(), and SlicApplication::setBinaryBasename().
|
protected |
field messenger
Definition at line 221 of file SlicApplication.hh.
|
protected |
Version string of Geant4.
Definition at line 239 of file SlicApplication.hh.
|
protected |
Has the initialize() function been called?
Definition at line 232 of file SlicApplication.hh.
Referenced by SlicApplication::initialize(), and SlicApplication::run().
|
protected |
application run mode: batch or interactive
Definition at line 226 of file SlicApplication.hh.
Referenced by SlicApplication::getMode(), and SlicApplication::setMode().
|
protected |
return code
Definition at line 229 of file SlicApplication.hh.
Referenced by SlicApplication::getReturnCode(), and SlicApplication::setReturnCode().
|
protected |
Definition at line 223 of file SlicApplication.hh.
Referenced by SlicApplication::getRunManager(), SlicApplication::initialize(), and SlicApplication::initializeLCDD().
|
protected |
G4 UI manager.
Definition at line 215 of file SlicApplication.hh.
Referenced by SlicApplication::initialize(), and SlicApplication::run().