Back to home page

EIC code displayed by LXR

 
 

    


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

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     : M.Frank
0011 //
0012 //==========================================================================
0013 
0014 /** \addtogroup Geant4GeneratorAction
0015  *
0016  @{
0017    \package Geant4GeneratorWrapper
0018  * \brief Wrap native G4 particle ganerators like the generic particle source etc.
0019  *
0020  *
0021 @}
0022  */
0023 
0024 #ifndef DDG4_GEANT4GENERATORWRAPPER_H
0025 #define DDG4_GEANT4GENERATORWRAPPER_H
0026 
0027 // Framework include files
0028 #include <DDG4/Geant4GeneratorAction.h>
0029 
0030 // Forward declarations
0031 class G4VPrimaryGenerator;
0032 
0033 
0034 /// Namespace for the AIDA detector description toolkit
0035 namespace dd4hep {
0036 
0037   /// Namespace for the Geant4 based simulation part of the AIDA detector description toolkit
0038   namespace sim {
0039 
0040     /// Geant4Action to merge several independent interaction to one
0041     /** Wrap native G4 particle ganerators like the generic particle source etc.
0042      *
0043      *  \author  M.Frank
0044      *  \version 1.0
0045      *  \ingroup DD4HEP_SIMULATION
0046      */
0047     class Geant4GeneratorWrapper : public Geant4GeneratorAction    {
0048     protected:
0049       /// Property: Type name of the implementation instance. name: "Uses"
0050       std::string m_generatorType;
0051       /// Property: interaction identifier mask. name: "Mask"
0052       int m_mask { 1 };
0053 
0054       /// Reference to the implementation instance
0055       G4VPrimaryGenerator* m_generator { nullptr };
0056       
0057     public:
0058       /// Standard constructor
0059       Geant4GeneratorWrapper(Geant4Context* context, const std::string& nam);
0060       /// Default destructor
0061       virtual ~Geant4GeneratorWrapper();
0062       /// Access the G4VPrimaryGenerator instance
0063       G4VPrimaryGenerator* generator();
0064       /// Event generation action callback
0065       virtual void operator()(G4Event* event);
0066     };
0067   }    // End namespace sim
0068 }      // End namespace dd4hep
0069 
0070 #endif // DDG4_GEANT4GENERATORWRAPPER_H