DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Geant4GeneratorActionInit.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 
14 #ifndef DDG4_GEANT4GENERATORACTIONINIT_H
15 #define DDG4_GEANT4GENERATORACTIONINIT_H
16 
17 // Framework include files
19 
20 // Forward declarations
21 class G4Event;
22 class G4Run;
23 
25 namespace dd4hep {
26 
28  namespace sim {
29 
31 
55  protected:
57  int m_run { 0 };
59  int m_evtTotal { 0 };
61  int m_evtRun { 0 };
62  public:
64  Geant4GeneratorActionInit(Geant4Context* context, const std::string& nam);
68  virtual void operator()(G4Event* event);
70  void begin(const G4Run* run);
72  void end(const G4Run* run);
73 
74  };
75  } // End namespace sim
76 } // End namespace dd4hep
77 
78 #endif // DDG4_GEANT4GENERATORACTIONINIT_H
dd4hep::sim::Geant4GeneratorActionInit::operator()
virtual void operator()(G4Event *event)
Event generation action callback.
Definition: Geant4GeneratorActionInit.cpp:56
dd4hep::sim::Geant4GeneratorActionInit::Geant4GeneratorActionInit
Geant4GeneratorActionInit(Geant4Context *context, const std::string &nam)
Standard constructor.
Definition: Geant4GeneratorActionInit.cpp:27
dd4hep::sim::Geant4GeneratorActionInit::end
void end(const G4Run *run)
End-run action callback.
Definition: Geant4GeneratorActionInit.cpp:49
dd4hep::sim::Geant4GeneratorActionInit::m_evtTotal
int m_evtTotal
Counter for total number of events.
Definition: Geant4GeneratorActionInit.h:59
dd4hep::sim::Geant4GeneratorActionInit::m_evtRun
int m_evtRun
Counter for total number of events in current run.
Definition: Geant4GeneratorActionInit.h:61
dd4hep::sim::Geant4GeneratorActionInit::~Geant4GeneratorActionInit
virtual ~Geant4GeneratorActionInit()
Default destructor.
Definition: Geant4GeneratorActionInit.cpp:38
Geant4GeneratorAction.h
dd4hep::sim::Geant4GeneratorAction
Concrete implementation of the Geant4 generator action base class.
Definition: Geant4GeneratorAction.h:47
dd4hep::sim::Geant4GeneratorActionInit
Initialize the Geant4Event objects to host generator and MC truth related information.
Definition: Geant4GeneratorActionInit.h:54
dd4hep::sim::Geant4GeneratorActionInit::m_run
int m_run
Current run identifier.
Definition: Geant4GeneratorActionInit.h:57
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::sim::Geant4GeneratorActionInit::begin
void begin(const G4Run *run)
Begin-run action callback.
Definition: Geant4GeneratorActionInit.cpp:43
dd4hep::sim::Geant4Context
Generic context to extend user, run and event information.
Definition: Geant4Context.h:201
dd4hep::sim::Geant4Action::context
Geant4Context * context() const
Access the context.
Definition: Geant4Action.h:270