9#include <G4UImanager.hh>
34 template <
typename... Args>
35 void applyCommand(
const std::string &p_command,
const Args &...p_args)
37 std::stringstream stream;
39 appendToStream(stream, p_args...);
40 log_trace(stream.str().c_str());
41 m_uiManager->ApplyCommand(stream.str());
44 void setUI(G4UImanager *p_ui);
45 void runBeamOn(G4int p_numberOfEvents = -1);
48 G4UImanager *m_uiManager;
55 void appendToStream(std::stringstream &p_stream)
69 p_stream <<
' ' << p_val;
80 template <
typename T,
typename... Args>
81 void appendToStream(std::stringstream &p_stream,
const T &p_val,
const Args &...p_args)
83 p_stream <<
' ' << p_val;
84 appendToStream(p_stream, p_args...);
Definition of the OMSimCommandArgsTable singleton class, which controls user args.
Singleton interface to Geant4's UI manager.
Definition OMSimUIinterface.hh:17
void appendToStream(std::stringstream &p_stream, const T &p_val)
Append arguments to the command string p_stream.
Definition OMSimUIinterface.hh:67
void appendToStream(std::stringstream &p_stream, const T &p_val, const Args &...p_args)
Append multiple arguments to the command string p_stream.
Definition OMSimUIinterface.hh:81
void applyCommand(const std::string &p_command, const Args &...p_args)
Apply a command to Geant4's UI manager and log it. It accept any number of arguments that are then ap...
Definition OMSimUIinterface.hh:35
void runBeamOn(G4int p_numberOfEvents=-1)
Executes a run with a given number of events.
Definition OMSimUIinterface.cc:39
static void init()
Initializes the global instance of OMSimUIinterface This method is normally called in OMSim::initiali...
Definition OMSimUIinterface.cc:7
static void shutdown()
Deletes the global instance of OMSimUIinterface This method is normally called in the destructor ~OMS...
Definition OMSimUIinterface.cc:19
void setUI(G4UImanager *p_ui)
Set the UI manager for the OMSimUIinterface class.
Definition OMSimUIinterface.cc:29