1#ifndef SIMCORE_SENSITIVEDETECTOR_H_
2#define SIMCORE_SENSITIVEDETECTOR_H_
4#include "Framework/Configure/Parameters.h"
5#include "Framework/RunHeader.h"
6#include "SimCore/ConditionsInterface.h"
7#include "SimCore/Factory.h"
9#include "SimCore/TrackMap.h"
14#include "G4VSensitiveDetector.hh"
57 virtual bool isSensDet(G4LogicalVolume* lv)
const = 0;
68 G4TouchableHistory* hist)
override = 0;
155#define DECLARE_SENSITIVEDETECTOR(CLASS) \
157 auto v = ::simcore::SensitiveDetector::Factory::get().declare<CLASS>(); \
Class which implements the user tracking action.
Implements an event buffer system for storing event data.
Class encapsulating parameters for configuring a processor.
Handle to the conditions system, provided at construction to classes which require it.
const T & getCondition(const std::string &condition_name)
Primary request action for a conditions object If the object is in the cache and still valid (IOV),...
Factory to dynamically create objects derived from a specific prototype class.
Dynamically loaded Geant4 SensitiveDetector for saving hits in specific volumes within the simulation...
simcore::ConditionsInterface & conditions_interface_
Handle to our interface to conditions objects.
virtual G4bool ProcessHits(G4Step *step, G4TouchableHistory *hist) override=0
This is Geant4's handle to tell us that a particle has stepped through our sensitive detector and we ...
bool isGeantino(const G4Step *step) const
Check if the passed step is a step of a geantino.
const TrackMap & getTrackMap() const
Get a handle to the current track map.
virtual void saveHits(framework::Event &event)=0
We are given the event bus here and we must decide now what to persist into the event.
const T & getCondition(const std::string &condition_name)
Record the configuration of this detector into the run header.
virtual bool isSensDet(G4LogicalVolume *lv) const =0
Here, we must determine if we should be attached to the input logical volume.
virtual void EndOfEvent(G4HCofThisEvent *) override
This is Geant4's handle to tell us the event is ending.
virtual ~SensitiveDetector()=default
Destructor.
virtual void OnFinishedEvent()=0
Cleanup SD and prepare a new-event state.
Defines a map of particle ancestry and particles to be saved.
TrackMap & getTrackMap()
Get a handle to the current TrackMap for the event.
static TrackingAction * get()
Get a pointer to the current UserTrackingAction from the G4RunManager.