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/Geant4SteppingAction.h>
0005 #include <string>
0006 
0007 namespace ddeicopticks
0008 {
0009 //---------------------------------------------------------------------------//
0010 /*!
0011  * DDG4 stepping action that intercepts standard Geant4 Cerenkov and
0012  * Scintillation processes and collects gensteps for GPU simulation.
0013  *
0014  * This follows the same approach as eic-opticks GPUCerenkov example:
0015  * use standard G4Cerenkov / G4Scintillation, then read back the photon
0016  * count via GetNumPhotons() and pack gensteps for the GPU.
0017  */
0018 class OpticsSteppingAction final : public dd4hep::sim::Geant4SteppingAction
0019 {
0020   public:
0021     OpticsSteppingAction(dd4hep::sim::Geant4Context *ctxt, std::string const &name);
0022 
0023     void operator()(const G4Step *step, G4SteppingManager *mgr) final;
0024 
0025   protected:
0026     DDG4_DEFINE_ACTION_CONSTRUCTORS(OpticsSteppingAction);
0027     ~OpticsSteppingAction() final;
0028 
0029   private:
0030     int verbose_{0};
0031 };
0032 
0033 //---------------------------------------------------------------------------//
0034 } // namespace ddeicopticks