LDMX Software
TrigScintSD.h
1#ifndef SIMCORE_TRIGSD_H
2#define SIMCORE_TRIGSD_H
3
5#include "SimCore/SensitiveDetector.h"
6
7namespace simcore {
8
13 public:
21 TrigScintSD(const std::string& name, simcore::ConditionsInterface& ci,
23
25 virtual ~TrigScintSD() = default;
26
37 virtual bool isSensDet(G4LogicalVolume* vol) const override {
38 return vol->GetName().contains(vol_name_) and
39 not vol->GetName().contains("sp_");
40 }
41
48 G4bool ProcessHits(G4Step* step, G4TouchableHistory* history) override;
49
53 virtual void saveHits(framework::Event& event) override {
54 event.add(collection_name_, hits_);
55 }
56
57 virtual void OnFinishedEvent() override { hits_.clear(); }
58
59 private:
61 std::vector<ldmx::SimCalorimeterHit> hits_;
63 std::string collection_name_;
65 std::string vol_name_;
68};
69
70} // namespace simcore
71
72#endif
Class which stores simulated calorimeter hit information.
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...
Class defining a sensitive detector of type trigger scintillator.
Definition TrigScintSD.h:12
virtual bool isSensDet(G4LogicalVolume *vol) const override
Should the input logical volume be included in this sensitive detector?
Definition TrigScintSD.h:37
std::string vol_name_
name of trigger pad volume this SD is capturing
Definition TrigScintSD.h:65
G4bool ProcessHits(G4Step *step, G4TouchableHistory *history) override
Process steps to create hits.
std::string collection_name_
name of the hit collection for this SD
Definition TrigScintSD.h:63
virtual void OnFinishedEvent() override
Cleanup SD and prepare a new-event state.
Definition TrigScintSD.h:57
std::vector< ldmx::SimCalorimeterHit > hits_
our collection of hits in this SD
Definition TrigScintSD.h:61
virtual ~TrigScintSD()=default
Destructor.
virtual void saveHits(framework::Event &event) override
Save our hits collection into the event bus and reset it.
Definition TrigScintSD.h:53
int module_id_
the ID number for the module we are gathering hits from
Definition TrigScintSD.h:67