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 #ifndef DD4HEP_DDG4_GEANT4PYTHONDETECTORCONSTRUCTIONLAST_H
0015 #define DD4HEP_DDG4_GEANT4PYTHONDETECTORCONSTRUCTIONLAST_H
0016 
0017 // Framework include files
0018 #include <DDG4/Geant4DetectorConstruction.h>
0019 #include <DDG4/Python/DDPython.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      *  All python callbacks are supposed to return the integer '1' on success.
0030      *  Any other return code is assumed to be failure.
0031      * 
0032      *  \author  M.Frank
0033      *  \version 1.0
0034      *  \ingroup DD4HEP_SIMULATION
0035      */
0036     class Geant4PythonDetectorConstructionLast : public Geant4DetectorConstruction  {
0037     public:
0038       /// Standard constructor
0039       Geant4PythonDetectorConstructionLast(Geant4Context* ctxt, const std::string& nam)
0040         : Geant4DetectorConstruction(ctxt,nam) {}
0041       /// Default destructor
0042       virtual ~Geant4PythonDetectorConstructionLast() {}
0043       /// Geometry construction callback. Called at "Construct()"
0044       virtual void constructGeo(Geant4DetectorConstructionContext*)      {
0045         info("+++ Python setup finished. From now on THREADS ARE ALLOWED!");
0046         DDPython::allowThreads();
0047       }
0048     };
0049   }    // End namespace sim
0050 }      // End namespace dd4hep
0051 #endif // DD4HEP_DDG4_GEANT4PYTHONDETECTORCONSTRUCTIONLAST_H
0052 
0053 using namespace dd4hep::sim;
0054 
0055 #include <DDG4/Factories.h>
0056 DECLARE_GEANT4ACTION(Geant4PythonDetectorConstructionLast)