Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 09:37:34

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 
0015 // Framework include files
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     //dd4hep::DDPython::shutdown();
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 }