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 <DD4hep/Detector.h>
0017 #include <DDG4/Python/PyDDG4.h>
0018 #include <DDG4/Python/DDPython.h>
0019 #include <DDG4/Geant4Kernel.h>
0020
0021 int PyDDG4::run(Kernel& kernel) {
0022 int ret;
0023 dd4hep::DDPython::AllowThreads allow(0);
0024 if ( 1 != (ret=kernel.configure()) )
0025 return ret;
0026 else if ( 1 != (ret=kernel.initialize()) )
0027 return ret;
0028 else if ( 1 != (ret=kernel.run()) )
0029 return ret;
0030 else if ( 1 != (ret=kernel.terminate()) )
0031 return ret;
0032
0033 return ret;
0034 }
0035
0036 int PyDDG4::execute() {
0037 Kernel& k = Kernel::instance(dd4hep::Detector::getInstance());
0038 return run(k);
0039 }
0040
0041 int PyDDG4::process(const char* fname) {
0042 return dd4hep::DDPython::instance().runFile(fname);
0043 }
0044
0045 int PyDDG4::run(const char* fname) {
0046 int ret = dd4hep::DDPython::instance().runFile(fname);
0047 if ( 1 != ret ) return ret;
0048 return execute();
0049 }