k4SimGeant4
Loading...
Searching...
No Matches
SimG4SaveTrackerHits.h
Go to the documentation of this file.
1#ifndef SIMG4COMPONENTS_G4SAVETRACKERHITS_H
2#define SIMG4COMPONENTS_G4SAVETRACKERHITS_H
3
4// STL
5#include <string>
6#include <vector>
7
8// Gaudi
9#include "GaudiKernel/AlgTool.h"
10
11// k4FWCore
12#include "k4FWCore/DataHandle.h"
13#include "k4Interface/IGeoSvc.h"
15
16// EDM4hep
17#include "edm4hep/Constants.h"
18#include "edm4hep/SimTrackerHitCollection.h"
19
44
45class SimG4SaveTrackerHits : public AlgTool, virtual public ISimG4SaveOutputTool {
46public:
47 explicit SimG4SaveTrackerHits(const std::string& aType, const std::string& aName, const IInterface* aParent);
48 virtual ~SimG4SaveTrackerHits();
52 virtual StatusCode initialize();
56 virtual StatusCode finalize();
62 virtual StatusCode saveOutput(const G4Event& aEvent) final;
63
64private:
66 ServiceHandle<IGeoSvc> m_geoSvc;
68 mutable k4FWCore::DataHandle<edm4hep::SimTrackerHitCollection> m_trackHits{"TrackerHits", Gaudi::DataHandle::Writer,
69 this};
70
71 Gaudi::Property<std::vector<std::string>> m_readoutNames{
72 this, "readoutNames", {}, "[Deprecated] Name of the readouts (hits collections) to save"};
73
74 Gaudi::Property<std::string> m_readoutName{this, "readoutName", {}, "Name of the readout (hit collection) to save"};
75};
76
77#endif /* SIMG4COMPONENTS_G4SAVETRACKERHITS_H */
Interface to the output saving tool.
Definition ISimG4SaveOutputTool.h:17
Gaudi::Property< std::string > m_readoutName
Name of the readout (hits collection) to save.
Definition SimG4SaveTrackerHits.h:74
Gaudi::Property< std::vector< std::string > > m_readoutNames
Names of the readouts (hits collections) to save, deprecated.
Definition SimG4SaveTrackerHits.h:71
virtual StatusCode saveOutput(const G4Event &aEvent) final
Save the data output.
Definition SimG4SaveTrackerHits.cpp:97
k4FWCore::DataHandle< edm4hep::SimTrackerHitCollection > m_trackHits
Handle for output tracker hits.
Definition SimG4SaveTrackerHits.h:68
virtual ~SimG4SaveTrackerHits()
Definition SimG4SaveTrackerHits.cpp:32
SimG4SaveTrackerHits(const std::string &aType, const std::string &aName, const IInterface *aParent)
Definition SimG4SaveTrackerHits.cpp:24
ServiceHandle< IGeoSvc > m_geoSvc
Pointer to the geometry service.
Definition SimG4SaveTrackerHits.h:66
virtual StatusCode initialize()
Initialize.
Definition SimG4SaveTrackerHits.cpp:34
virtual StatusCode finalize()
Finalize.
Definition SimG4SaveTrackerHits.cpp:95