k4SimGeant4
Loading...
Searching...
No Matches
SimG4PrimariesFromEdmTool.h
Go to the documentation of this file.
1#ifndef SIMG4COMPONENTS_G4PRIMARIESFROMEDMTOOL_H
2#define SIMG4COMPONENTS_G4PRIMARIESFROMEDMTOOL_H
3
4// from Gaudi
5#include "k4FWCore/DataHandle.h"
6#include "GaudiKernel/AlgTool.h"
7
9
10#include "G4VUserPrimaryGeneratorAction.hh"
11
12// Forward declarations
13// datamodel
14namespace edm4hep {
15class MCParticleCollection;
16}
17
25class SimG4PrimariesFromEdmTool : public AlgTool, virtual public ISimG4EventProviderTool {
26public:
28 SimG4PrimariesFromEdmTool(const std::string& type, const std::string& name, const IInterface* parent);
29
31
32 StatusCode initialize() final;
33
36 virtual G4Event* g4Event() final;
37
38private:
40 mutable DataHandle<edm4hep::MCParticleCollection> m_genParticles{"GenParticles", Gaudi::DataHandle::Reader, this};
41};
42
43#endif
Abstract interface to Geant4 Primary Generator classes.
Definition ISimG4EventProviderTool.h:17
Tool to translate an EDM MCParticleCollection into a G4Event.
Definition SimG4PrimariesFromEdmTool.h:25
SimG4PrimariesFromEdmTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Definition SimG4PrimariesFromEdmTool.cpp:20
DataHandle< edm4hep::MCParticleCollection > m_genParticles
Handle for the EDM MC particles to be read.
Definition SimG4PrimariesFromEdmTool.h:40
StatusCode initialize() final
Definition SimG4PrimariesFromEdmTool.cpp:29
virtual G4Event * g4Event() final
Translates the input (edm4hep::MCParticleCollection) into a G4Event.
Definition SimG4PrimariesFromEdmTool.cpp:31
virtual ~SimG4PrimariesFromEdmTool()
Definition SimG4PrimariesFromEdmTool.cpp:27
Definition EventInformation.h:10