LDMX Software
TrackerSD.h
1#ifndef SIMCORE_TRACKERSD_H
2#define SIMCORE_TRACKERSD_H
3
6#include "SimCore/SensitiveDetector.h"
7
8namespace simcore {
9
15 public:
22 TrackerSD(const std::string& name, simcore::ConditionsInterface& ci,
24
26 virtual ~TrackerSD() = default;
27
34 virtual bool isSensDet(G4LogicalVolume* volume) const override {
35 return (volume->GetName().contains("Sensor") and
36 volume->GetName().contains(subsystem_));
37 }
38
45 G4bool ProcessHits(G4Step* step, G4TouchableHistory* history) override;
46
50 virtual void saveHits(framework::Event& event) override {
51 event.add(collection_name_, hits_);
52 }
53
54 virtual void OnFinishedEvent() override { hits_.clear(); }
55
56 private:
58 std::string subsystem_;
59
61 std::string collection_name_;
62
64 std::vector<ldmx::SimTrackerHit> hits_;
65
67 ldmx::SubdetectorIDType subDetID_;
68
69}; // TrackerID
70
71} // namespace simcore
72
73#endif // SIMCORE_TRACKERSD_H
Class which encapsulates information from a hit in a simulated tracking detector.
Class that defines a Tracker detector ID with a module number.
Implements an event buffer system for storing event data.
Definition Event.h:41
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
Handle to the conditions system, provided at construction to classes which require it.
Dynamically loaded Geant4 SensitiveDetector for saving hits in specific volumes within the simulation...
Basic sensitive detector for trackers.
Definition TrackerSD.h:14
virtual ~TrackerSD()=default
Destructor.
G4bool ProcessHits(G4Step *step, G4TouchableHistory *history) override
Process a step by creating a hit.
Definition TrackerSD.cxx:20
std::string subsystem_
The name of the subsystem we are apart of.
Definition TrackerSD.h:58
std::string collection_name_
The name of the output collection.
Definition TrackerSD.h:61
virtual void OnFinishedEvent() override
Cleanup SD and prepare a new-event state.
Definition TrackerSD.h:54
ldmx::SubdetectorIDType subDetID_
The detector ID.
Definition TrackerSD.h:67
virtual void saveHits(framework::Event &event) override
Add the hits to the event and then reset the container.
Definition TrackerSD.h:50
virtual bool isSensDet(G4LogicalVolume *volume) const override
Should the input logical volume be attached to this sensitive detector?
Definition TrackerSD.h:34
std::vector< ldmx::SimTrackerHit > hits_
The collection of hits.
Definition TrackerSD.h:64