k4SimGeant4
Loading...
Searching...
No Matches
SimG4SaveParticleHistory.h
Go to the documentation of this file.
1#ifndef SIMG4COMPONENTS_SIMG4SAVEPARTICLEHISTORY_H
2#define SIMG4COMPONENTS_SIMG4SAVEPARTICLEHISTORY_H
3
4// Gaudi
5#include "GaudiKernel/AlgTool.h"
6
7// FCCSW
8#include "k4FWCore/DataHandle.h"
11
12class IGeoSvc;
13
14// datamodel
15namespace edm4hep {
16class MCParticleCollection;
17}
18
19namespace sim {
20class EventInformation;
21}
22
31class SimG4SaveParticleHistory : public AlgTool, virtual public ISimG4SaveOutputTool {
32public:
33 explicit SimG4SaveParticleHistory(const std::string& aType, const std::string& aName, const IInterface* aParent);
34 virtual ~SimG4SaveParticleHistory() = default;
35
41 StatusCode saveOutput(const G4Event& aEvent) override final;
42
43private:
45 mutable DataHandle<edm4hep::MCParticleCollection> m_mcParticles{"SimParticleSecondaries", Gaudi::DataHandle::Writer, this};
47 edm4hep::MCParticleCollection* m_mcParticleColl;
48};
49
50#endif /* SIMG4COMPONENTS_SIMG4SAVEPARTICLEHISTORY_H */
Interface to the output saving tool.
Definition ISimG4SaveOutputTool.h:17
This tool allows to save the particle history of particles decaying during the simulation.
Definition SimG4SaveParticleHistory.h:31
virtual ~SimG4SaveParticleHistory()=default
DataHandle< edm4hep::MCParticleCollection > m_mcParticles
Handle for collection of MC particles to create.
Definition SimG4SaveParticleHistory.h:45
edm4hep::MCParticleCollection * m_mcParticleColl
Pointer to the particle collection, ownership should be handled in a algorithm / tool.
Definition SimG4SaveParticleHistory.h:47
StatusCode saveOutput(const G4Event &aEvent) override final
Save the history Creates particles and gen vertices that allow association of parents and children.
Definition SimG4SaveParticleHistory.cpp:26
SimG4SaveParticleHistory(const std::string &aType, const std::string &aName, const IInterface *aParent)
Definition SimG4SaveParticleHistory.cpp:18
Definition EventInformation.h:10
Conversion between units.
Definition ConstantField.h:14