File indexing completed on 2025-02-22 09:37:34
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #include <DDG4/Factories.h>
0017 #include <DDG4/Python/Geant4PythonAction.h>
0018 #include <DDG4/Python/Geant4PythonCall.h>
0019 #include <DDG4/Python/DDPython.h>
0020
0021 using namespace dd4hep::sim;
0022
0023 DECLARE_GEANT4ACTION(Geant4PythonAction)
0024
0025
0026 Geant4PythonAction::Geant4PythonAction(Geant4Context* ctxt, const std::string& nam)
0027 : Geant4Action(ctxt,nam)
0028 {
0029 m_needsControl = true;
0030 }
0031
0032
0033 int Geant4PythonAction::exec(const std::string& cmd) {
0034 return DDPython::instance().execute(cmd);
0035 }
0036
0037
0038 int Geant4PythonAction::eval(const std::string& cmd) {
0039 return DDPython::instance().evaluate(cmd);
0040 }
0041
0042
0043 int Geant4PythonAction::runFile(const std::string& cmd) {
0044 return DDPython::instance().runFile(cmd);
0045 }
0046
0047
0048 int Geant4PythonAction::call(PyObject* method, PyObject* args) {
0049 return Geant4PythonCall().execute<int>(method,args);
0050 }
0051
0052
0053 void Geant4PythonAction::prompt() {
0054 DDPython::instance().prompt();
0055 }