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"
15#include "SimCore/SensitiveDetector.h"
16#include "SimCore/TrackMap.h"
17
18// ROOT
19#include "TMath.h"
20
21// Geant4
22#include "G4Polyhedra.hh"
23
24namespace simcore {
25
30class EcalSD : public SensitiveDetector {
31 public:
33 static const std::string COLLECTION_NAME;
34
41 EcalSD(const std::string& name, simcore::ConditionsInterface& ci,
43
47 virtual ~EcalSD() = default;
48
54 virtual bool isSensDet(G4LogicalVolume* vol) const override {
55 auto region = vol->GetRegion();
56 if (region and region->GetName().contains("CalorimeterRegion")) {
57 return vol->GetName().contains("Si");
58 }
59 return false;
60 }
61
67 G4bool ProcessHits(G4Step* aStep, G4TouchableHistory* ROhist) override;
68
72 virtual void saveHits(framework::Event& event) override;
73
77 virtual void OnFinishedEvent() override { hits_.clear(); }
78
79 private:
81 std::map<ldmx::EcalID, ldmx::SimCalorimeterHit> hits_;
86};
87
88} // namespace simcore
89
90#endif
Class that defines an ECal detector ID with a cell number.
Class which stores simulated calorimeter hit information.
Class which implements the user tracking action.
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.
ECal sensitive detector that uses an EcalHexReadout to create the hits.
Definition EcalSD.h:30
static const std::string COLLECTION_NAME
Name of output collection of hits.
Definition EcalSD.h:33
bool compressHitContribs_
compress hit contribs
Definition EcalSD.h:85
std::map< ldmx::EcalID, ldmx::SimCalorimeterHit > hits_
map of hits to add to the event (will be squashed)
Definition EcalSD.h:81
virtual bool isSensDet(G4LogicalVolume *vol) const override
Should the input volume be consider apart of this sensitive detector?
Definition EcalSD.h:54
virtual void saveHits(framework::Event &event) override
Add our hits to the event bus.
Definition EcalSD.cxx:139
bool enableHitContribs_
enable hit contribs
Definition EcalSD.h:83
G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist) override
Process steps to create hits.
Definition EcalSD.cxx:26
virtual ~EcalSD()=default
Class destructor.
virtual void OnFinishedEvent() override
Clear the map of hits we have accumulated.
Definition EcalSD.h:77
Dynamically loaded Geant4 SensitiveDetector for saving hits in specific volumes within the simulation...