DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Standard UI interface implementation with configuration using property options. More...
#include <Geant4UIManager.h>
Public Member Functions | |
Geant4UIManager (Geant4Context *context, const std::string &name) | |
Initializing constructor. More... | |
virtual | ~Geant4UIManager () |
Default destructor. More... | |
void | configure () |
Configure the object. Callback registered to the Geant4Kernel. More... | |
void | initialize () |
Initialize the object. Callback registered to the Geant4Kernel. More... | |
void | terminate () |
Callback on terminate. Callback registered to the Geant4Kernel. More... | |
void | installCommandMessenger () |
Install command control messenger to write GDML file from command prompt. More... | |
G4VisManager * | startVis () |
Start visualization. More... | |
G4UIExecutive * | startUI () |
Start UI. More... | |
void | start () |
Start manager & session. More... | |
void | stop () |
Stop and release resources. More... | |
void | forceExit () |
Force exiting this process without calling atexit handlers. More... | |
void | regularExit () |
Regularly exiting this process without calling atexit handlers. More... | |
void | applyCommand (const std::string &command) |
Apply single command. More... | |
virtual void | operator() (void *param) |
Run UI. More... | |
Public Member Functions inherited from dd4hep::sim::Geant4Action | |
Geant4Action (Geant4Context *context, const std::string &nam) | |
Standard constructor. More... | |
long | addRef () |
Increase reference count. More... | |
long | release () |
Decrease reference count. Implicit destruction. More... | |
Geant4Context * | context () const |
Access the context. More... | |
virtual void | updateContext (Geant4Context *ctxt) |
Set or update client context. More... | |
virtual void | configureFiber (Geant4Context *thread_context) |
Set or update client for the use in a new thread fiber. More... | |
const std::string & | name () const |
Access name of the action. More... | |
const char * | c_name () const |
Access name of the action. More... | |
void | setName (const std::string &new_name) |
Set the object name. More... | |
PropertyManager & | properties () |
Access to the properties of the object. More... | |
PrintLevel | outputLevel () const |
Access the output level. More... | |
PrintLevel | setOutputLevel (PrintLevel new_level) |
Set the output level; returns previous value. More... | |
Geant4UIMessenger * | control () const |
Access to the UI messenger. More... | |
virtual void | enableUI () |
Enable and install UI messenger. More... | |
template<typename T > | |
Geant4Action & | declareProperty (const std::string &nam, T &val) |
Declare property. More... | |
template<typename T > | |
Geant4Action & | declareProperty (const char *nam, T &val) |
Declare property. More... | |
bool | hasProperty (const std::string &name) const |
Check property for existence. More... | |
Property & | property (const std::string &name) |
Access single property. More... | |
virtual void | installMessengers () |
Install property control messenger if wanted. More... | |
virtual void | installPropertyMessenger () |
Install property control messenger if wanted. More... | |
void | print (const char *fmt,...) const |
Support for messages with variable output level using output level. More... | |
void | printM1 (const char *fmt,...) const |
Support for messages with variable output level using output level-1. More... | |
void | printM2 (const char *fmt,...) const |
Support for messages with variable output level using output level-2. More... | |
void | printP1 (const char *fmt,...) const |
Support for messages with variable output level using output level+1. More... | |
void | printP2 (const char *fmt,...) const |
Support for messages with variable output level using output level+2. More... | |
void | always (const char *fmt,...) const |
Support of always printed messages. More... | |
void | debug (const char *fmt,...) const |
Support of debug messages. More... | |
void | info (const char *fmt,...) const |
Support of info messages. More... | |
void | warning (const char *fmt,...) const |
Support of warning messages. More... | |
void | error (const char *fmt,...) const |
Support of error messages. More... | |
bool | return_error (bool return_value, const char *fmt,...) const |
Action to support error messages. More... | |
void | fatal (const char *fmt,...) const |
Support of fatal messages. Throws exception. More... | |
void | except (const char *fmt,...) const |
Support of exceptions: Print fatal message and throw runtime_error. More... | |
void | abortRun (const std::string &exception, const char *fmt,...) const |
Abort Geant4 Run by throwing a G4Exception with type RunMustBeAborted. More... | |
Geant4RunActionSequence & | runAction () const |
Access to the main run action sequence from the kernel object. More... | |
Geant4EventActionSequence & | eventAction () const |
Access to the main event action sequence from the kernel object. More... | |
Geant4SteppingActionSequence & | steppingAction () const |
Access to the main stepping action sequence from the kernel object. More... | |
Geant4TrackingActionSequence & | trackingAction () const |
Access to the main tracking action sequence from the kernel object. More... | |
Geant4StackingActionSequence & | stackingAction () const |
Access to the main stacking action sequence from the kernel object. More... | |
Geant4GeneratorActionSequence & | generatorAction () const |
Access to the main generator action sequence from the kernel object. More... | |
Public Member Functions inherited from dd4hep::sim::Geant4Call | |
virtual | ~Geant4Call () |
Default destructor. More... | |
Protected Attributes | |
std::string | m_sessionType |
Name of the default session type (="cmd") More... | |
std::string | m_uiSetup |
Property: Name of the UI macro file. More... | |
std::string | m_visSetup |
Property: Name of the visualization macro file. More... | |
std::vector< std::string > | m_configureCommands |
Property: List of commands to be executed when the Geant4Kernel gets configured. More... | |
std::vector< std::string > | m_initializeCommands |
Property: List of commands to be executed when the Geant4Kernel gets initialized. More... | |
std::vector< std::string > | m_terminateCommands |
Property: List of commands to be executed when the Geant4Kernel gets terminated. More... | |
std::vector< std::string > | m_preRunCommands |
Property: List of commands to be executed BEFORE running. More... | |
std::vector< std::string > | m_postRunCommands |
Property: List of commands to be executed AFTER running. More... | |
std::vector< std::string > | m_macros |
Property: Array of commands to be chained. More... | |
std::string | m_prompt |
Property: New prompt if the user wants to change it. (Default is do nothing) More... | |
bool | m_haveVis |
Property: Flag to instantiate Vis manager (default=false, unless m_visSetup set) More... | |
bool | m_haveUI |
Property: Flag to instantiate UI (default=true) More... | |
G4VisManager * | m_vis |
Reference to Geant4 visualtion manager. More... | |
G4UIExecutive * | m_ui |
Reference to Geant4 UI manager. More... | |
Protected Attributes inherited from dd4hep::sim::Geant4Action | |
Geant4Context * | m_context { nullptr } |
Reference to the Geant4 context. More... | |
Geant4UIMessenger * | m_control { nullptr } |
Control directory of this action. More... | |
int | m_outputLevel { 3 } |
Default property: Output level. More... | |
bool | m_needsControl { false } |
Default property: Flag to create control instance. More... | |
std::string | m_name { } |
Action name. More... | |
PropertyManager | m_properties { } |
Property pool. More... | |
long | m_refCount { 1 } |
Reference count. Initial value: 1. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from dd4hep::sim::Geant4Action | |
DDG4_DEFINE_ACTION_CONSTRUCTORS (Geant4Action) | |
Define standard assignments and constructors. More... | |
virtual | ~Geant4Action () |
Default destructor. More... | |
Standard UI interface implementation with configuration using property options.
The {\tt{Geant4UIManager}} is a component attached to the {\tt{Geant4Kernel}} object.
All properties of all {\tt{Geant4Action}} instances may be exported to Geant4 messengers and {{may}} hence be accessible directly from the Geant4 prompt. To export properties from any action, call the {\tt{enableUI()}} method of the action.
Please note:
Any type of commands may be put together, but the overall execution order is as follows:
Definition at line 53 of file Geant4UIManager.h.
Geant4UIManager::Geant4UIManager | ( | Geant4Context * | context, |
const std::string & | name | ||
) |
Initializing constructor.
Definition at line 42 of file Geant4UIManager.cpp.
|
virtual |
Default destructor.
Definition at line 65 of file Geant4UIManager.cpp.
void Geant4UIManager::applyCommand | ( | const std::string & | command | ) |
Apply single command.
Get the pointer to the User Interface manager
Definition at line 115 of file Geant4UIManager.cpp.
void Geant4UIManager::configure | ( | ) |
Configure the object. Callback registered to the Geant4Kernel.
Configure the object.
Get the pointer to the User Interface manager
Start UI instance
Execute the chained command statements
Definition at line 69 of file Geant4UIManager.cpp.
void Geant4UIManager::forceExit | ( | ) |
Force exiting this process without calling atexit handlers.
Definition at line 138 of file Geant4UIManager.cpp.
void Geant4UIManager::initialize | ( | ) |
Initialize the object. Callback registered to the Geant4Kernel.
Initialize the object.
Get the pointer to the User Interface manager
Execute the chained command statements
Definition at line 87 of file Geant4UIManager.cpp.
|
virtual |
Install command control messenger to write GDML file from command prompt.
Reimplemented from dd4hep::sim::Geant4Action.
Definition at line 130 of file Geant4UIManager.cpp.
|
virtual |
void Geant4UIManager::regularExit | ( | ) |
Regularly exiting this process without calling atexit handlers.
Definition at line 143 of file Geant4UIManager.cpp.
void Geant4UIManager::start | ( | ) |
Start manager & session.
Get the pointer to the User Interface manager
Start visualization
If graphics setup, vis is always true
No graphics without UI!
Configure visualization instance
Configure UI instance
Execute the chained macro files
Execute the chained pre-run command statements
Start UI session if present
Execute the chained post-run command statements
Execute the chained post-run command statements
No UI. Pure batch mode: Simply execute requested number of events
Definition at line 181 of file Geant4UIManager.cpp.
G4UIExecutive * Geant4UIManager::startUI | ( | ) |
Start UI.
Definition at line 159 of file Geant4UIManager.cpp.
G4VisManager * Geant4UIManager::startVis | ( | ) |
void Geant4UIManager::stop | ( | ) |
Stop and release resources.
Definition at line 262 of file Geant4UIManager.cpp.
void Geant4UIManager::terminate | ( | ) |
Callback on terminate. Callback registered to the Geant4Kernel.
Callback on terminate.
Get the pointer to the User Interface manager
Execute the chained command statements
Definition at line 101 of file Geant4UIManager.cpp.
|
protected |
Property: List of commands to be executed when the Geant4Kernel gets configured.
Definition at line 62 of file Geant4UIManager.h.
|
protected |
Property: Flag to instantiate UI (default=true)
Definition at line 78 of file Geant4UIManager.h.
|
protected |
Property: Flag to instantiate Vis manager (default=false, unless m_visSetup set)
Definition at line 76 of file Geant4UIManager.h.
|
protected |
Property: List of commands to be executed when the Geant4Kernel gets initialized.
Definition at line 64 of file Geant4UIManager.h.
|
protected |
Property: Array of commands to be chained.
Definition at line 72 of file Geant4UIManager.h.
|
protected |
Property: List of commands to be executed AFTER running.
Definition at line 70 of file Geant4UIManager.h.
|
protected |
Property: List of commands to be executed BEFORE running.
Definition at line 68 of file Geant4UIManager.h.
|
protected |
Property: New prompt if the user wants to change it. (Default is do nothing)
Definition at line 74 of file Geant4UIManager.h.
|
protected |
Name of the default session type (="cmd")
Definition at line 56 of file Geant4UIManager.h.
|
protected |
Property: List of commands to be executed when the Geant4Kernel gets terminated.
Definition at line 66 of file Geant4UIManager.h.
|
protected |
Reference to Geant4 UI manager.
Definition at line 82 of file Geant4UIManager.h.
|
protected |
Property: Name of the UI macro file.
Definition at line 58 of file Geant4UIManager.h.
|
protected |
Reference to Geant4 visualtion manager.
Definition at line 80 of file Geant4UIManager.h.
|
protected |
Property: Name of the visualization macro file.
Definition at line 60 of file Geant4UIManager.h.