Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:22

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 //  \author Markus Frank
0011 //  \date   2015-11-03
0012 //
0013 //==========================================================================
0014 #ifndef DDG4_PYTHON_GEANT4PYTHONACTION_H
0015 #define DDG4_PYTHON_GEANT4PYTHONACTION_H
0016 
0017 // Framework include files
0018 #include <DDG4/Geant4Action.h>
0019 #include <TPyReturn.h>
0020 
0021 /// Namespace for the AIDA detector description toolkit
0022 namespace dd4hep {
0023 
0024   /// Namespace for the Geant4 based simulation part of the AIDA detector description toolkit
0025   namespace sim {
0026 
0027     /// Base class to initialize a multi-threaded or single threaded Geant4 application
0028     /**
0029      *  \author  M.Frank
0030      *  \version 1.0
0031      *  \ingroup DD4HEP
0032      */
0033     class Geant4PythonAction : public Geant4Action   {
0034     public:
0035       /// Standard constructor
0036       Geant4PythonAction(Geant4Context* ctx, const std::string& nam);
0037       /// Default destructor
0038       virtual ~Geant4PythonAction() {}
0039 
0040       /** Public class methods  */
0041       /// Execute command in the python interpreter.
0042       static  int call(PyObject* method, PyObject* args);
0043       /// Execute command in the python interpreter.
0044       static  int exec(const std::string& cmd);
0045       /// Execute command in the python interpreter.
0046       static  int eval(const std::string& cmd);
0047       /// Execute command in the python interpreter.
0048       static  int runFile(const std::string& cmd);
0049       /// Invoke command prompt
0050       static  void prompt();
0051     };
0052   }    // End namespace sim
0053 }      // End namespace dd4hep
0054 #endif // DDG4_PYTHON_GEANT4PYTHONACTION_H