LDMX Software
EcalSD.h
Go to the documentation of this file.
1
8#ifndef SIMCORE_ECALSD_H_
9#define SIMCORE_ECALSD_H_
10
11// LDMX
12#include "DetDescr/EcalID.h"
14#include "SimCore/SDs/SensitiveDetector.h"
15
16// Geant4
17// TODO: do we really need both the G4Polyhedron and G4Polyhedra includes?
18#include "G4Step.hh"
19
20// ROOT
21
22namespace simcore {
23
29class EcalSD : public SensitiveDetector {
30 public:
32 static const std::string COLLECTION_NAME;
33
40 EcalSD(const std::string& name, simcore::ConditionsInterface& ci,
42
46 virtual ~EcalSD() = default;
47
53 virtual bool isSensDet(G4LogicalVolume* vol) const override {
54 auto region = vol->GetRegion();
55 if (region and region->GetName().contains("CalorimeterRegion")) {
56 return vol->GetName().contains("Si");
57 }
58 return false;
59 }
60
66 G4bool ProcessHits(G4Step* aStep, G4TouchableHistory* ROhist) override;
67
71 virtual void saveHits(framework::Event& event) override;
72
76 virtual void onFinishedEvent() override { hits_.clear(); }
77
78 private:
80 std::map<ldmx::EcalID, ldmx::SimCalorimeterHit> hits_;
87};
88
89} // namespace simcore
90
91#endif
Class that defines an ECal detector ID with a cell number.
Class which stores simulated calorimeter hit information.
Implements an event buffer system for storing event data.
Definition Event.h:40
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:26
Handle to the conditions system, provided at construction to classes which require it.
ECal sensitive detector that uses an EcalHexReadout to create the hits_.
Definition EcalSD.h:29
static const std::string COLLECTION_NAME
Name of output collection of hits_.
Definition EcalSD.h:32
std::map< ldmx::EcalID, ldmx::SimCalorimeterHit > hits_
map of hits to add to the event (will be squashed)
Definition EcalSD.h:80
virtual void onFinishedEvent() override
Clear the map of hits we have accumulated.
Definition EcalSD.h:76
virtual bool isSensDet(G4LogicalVolume *vol) const override
Should the input volume be consider apart of this sensitive detector?
Definition EcalSD.h:53
EcalSD(const std::string &name, simcore::ConditionsInterface &ci, const framework::config::Parameters &p)
Class constructor.
Definition EcalSD.cxx:12
virtual void saveHits(framework::Event &event) override
Add our hits to the event bus.
Definition EcalSD.cxx:131
int max_origin_track_id_
maximum track ID to be considered an "origin"
Definition EcalSD.h:86
bool enable_hit_contribs_
enable hit contribs
Definition EcalSD.h:82
G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist) override
Process steps to create hits_.
Definition EcalSD.cxx:20
bool compress_hit_contribs_
compress hit contribs
Definition EcalSD.h:84
virtual ~EcalSD()=default
Class destructor.
Dynamically loaded Geant4 SensitiveDetector for saving hits in specific volumes within the simulation...
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...