Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-15 07:41:49

0001 #pragma once
0002 
0003 #include <DDG4/Geant4Action.h>
0004 #include <DDG4/Geant4RunAction.h>
0005 #include <string>
0006 
0007 namespace ddeicopticks
0008 {
0009 //---------------------------------------------------------------------------//
0010 /*!
0011  * DDG4 action plugin for eic-opticks run-level lifecycle.
0012  *
0013  * At begin-of-run: initializes G4CXOpticks geometry from the Geant4 world
0014  * volume, translating the geometry to OptiX acceleration structures on GPU.
0015  *
0016  * At end-of-run: finalizes G4CXOpticks, releasing GPU resources.
0017  *
0018  * Properties:
0019  *   - SaveGeometry (default: false) -- save Opticks geometry to disk
0020  */
0021 class OpticsRun final : public dd4hep::sim::Geant4RunAction
0022 {
0023   public:
0024     OpticsRun(dd4hep::sim::Geant4Context *ctxt, std::string const &name);
0025 
0026     void begin(G4Run const *run) final;
0027     void end(G4Run const *run) final;
0028 
0029   protected:
0030     DDG4_DEFINE_ACTION_CONSTRUCTORS(OpticsRun);
0031     ~OpticsRun() final;
0032 
0033   private:
0034     bool save_geometry_{false};
0035 };
0036 
0037 //---------------------------------------------------------------------------//
0038 } // namespace ddeicopticks