LDMX Software
ScoringPlaneSD.h
1#ifndef SIMCORE_SCORINGPLANESD_H
2#define SIMCORE_SCORINGPLANESD_H
3
4#include "DetDescr/DetectorID.h"
6#include "SimCore/SensitiveDetector.h"
7
8namespace simcore {
9
14 public:
22 ScoringPlaneSD(const std::string& name, simcore::ConditionsInterface& ci,
23 const framework::config::Parameters& params);
24
26 virtual ~ScoringPlaneSD() = default;
27
31 bool isSensDet(G4LogicalVolume* volume) const override {
32 return volume->GetName().contains(match_substr_);
33 }
34
43 virtual G4bool ProcessHits(G4Step* step, G4TouchableHistory* hist) override;
44
51 virtual void saveHits(framework::Event& event) override;
52
53 virtual void OnFinishedEvent() override { hits_.clear(); }
54
55 private:
57 std::string match_substr_;
58
60 std::string collection_name_;
61
63 std::vector<ldmx::SimTrackerHit> hits_;
64
65}; // ScoringPlaneSD
66
67} // namespace simcore
68
69#endif // SIMCORE_SCORINGPLANESD_H
Class which encapsulates information from a hit in a simulated tracking detector.
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.
Class defining a basic sensitive detector for scoring planes.
std::string collection_name_
Name of output collection to add.
std::vector< ldmx::SimTrackerHit > hits_
The actual output collection.
virtual G4bool ProcessHits(G4Step *step, G4TouchableHistory *hist) override
This is Geant4's handle to tell us that a particle has stepped through our sensitive detector and we ...
virtual void OnFinishedEvent() override
Cleanup SD and prepare a new-event state.
bool isSensDet(G4LogicalVolume *volume) const override
Check if the input logical volume is a scoring plane we should include.
virtual void saveHits(framework::Event &event) override
We are given the event bus here and we must decide now what to persist into the event.
virtual ~ScoringPlaneSD()=default
Destructor.
std::string match_substr_
Substring to match to logical volumes.
Dynamically loaded Geant4 SensitiveDetector for saving hits in specific volumes within the simulation...