k4SimGeant4
Loading...
Searching...
No Matches
SimG4SaveTrajectory.h
Go to the documentation of this file.
1#ifndef SIMG4COMPONENTS_G4SAVETRAJECTORY
2#define SIMG4COMPONENTS_G4SAVETRAJECTORY
3
4// Gaudi
5#include "GaudiKernel/AlgTool.h"
6
7// FCCSW
8#include "k4FWCore/DataHandle.h"
10class IGeoSvc;
11
12#if __has_include("edm4hep/TrackerHit3DCollection.h")
13#include "edm4hep/TrackerHit3DCollection.h"
14#else
15#include "edm4hep/TrackerHitCollection.h"
16namespace edm4hep {
17 using TrackerHit3DCollection = edm4hep::TrackerHitCollection;
18}
19#endif
20
28class SimG4SaveTrajectory : public AlgTool, virtual public ISimG4SaveOutputTool {
29public:
30 explicit SimG4SaveTrajectory(const std::string& aType, const std::string& aName, const IInterface* aParent);
31 virtual ~SimG4SaveTrajectory();
35 virtual StatusCode initialize();
39 virtual StatusCode finalize();
44 virtual StatusCode saveOutput(const G4Event& aEvent) final;
45
46private:
48 ServiceHandle<IGeoSvc> m_geoSvc;
50 mutable DataHandle<edm4hep::TrackerHit3DCollection> m_trackHits{"Hits/Trajectory",
51 Gaudi::DataHandle::Writer, this};
52};
53
54#endif /* SIMG4COMPONENTS_G4SAVETRAJECTORY */
Interface to the output saving tool.
Definition ISimG4SaveOutputTool.h:17
Tool to save Geant4 Trajectory data.
Definition SimG4SaveTrajectory.h:28
virtual StatusCode finalize()
Finalize.
Definition SimG4SaveTrajectory.cpp:33
SimG4SaveTrajectory(const std::string &aType, const std::string &aName, const IInterface *aParent)
Definition SimG4SaveTrajectory.cpp:17
virtual StatusCode saveOutput(const G4Event &aEvent) final
Save the data output.
Definition SimG4SaveTrajectory.cpp:35
DataHandle< edm4hep::TrackerHit3DCollection > m_trackHits
Handle for trajectory hits including position information.
Definition SimG4SaveTrajectory.h:50
virtual StatusCode initialize()
Initialize.
Definition SimG4SaveTrajectory.cpp:26
virtual ~SimG4SaveTrajectory()
Definition SimG4SaveTrajectory.cpp:24
ServiceHandle< IGeoSvc > m_geoSvc
Pointer to the geometry service.
Definition SimG4SaveTrajectory.h:48
Definition EventInformation.h:10
edm4hep::TrackerHitCollection TrackerHit3DCollection
Definition SimG4SaveTrajectory.h:17