 |
Belle II Software
release-05-01-25
|
11 #ifndef VXD_SENSITIVEDETECTORBASE_H
12 #define VXD_SENSITIVEDETECTORBASE_H
18 #include <simulation/kernel/SensitiveDetectorBase.h>
19 #include <vxd/simulation/SensorTraversal.h>
20 #include <vxd/geometry/SensorInfoBase.h>
39 class SensitiveDetectorBase:
public Simulation::SensitiveDetectorBase {
62 void setOptions(
bool seeNeutrons,
bool onlyPrimaryTrueHits,
float distanceTolerance,
63 float electronTolerance,
float minimumElectrons)
92 virtual int saveTrueHit(
const SensorTraversal& traversal) = 0;
112 virtual void saveRelations(
const SensorTraversal& traversal,
int trueHitIndex,
113 std::vector<std::pair<unsigned int, float>> simHitIndices) = 0;
139 StepInformation
findMidPoint(
const SensorTraversal& traversal);
146 bool step(G4Step*
step, G4TouchableHistory*)
override;
165 SensorInfoBase*
m_info {0};
167 std::stack<SensorTraversal>
m_tracks;
float m_minimumElectrons
minimum number of electrons a track must deposit for SimHit/TrueHits to be created
SensorInfoBase * m_info
Pointer to the SensorInfo associated with this instance.
virtual ~SensitiveDetectorBase() override
Destructor freeing the sensor Info.
int getID(const std::vector< double > &breaks, double t)
get id of the time point t
std::vector< std::pair< unsigned int, float > > createSimHits()
Determine which SimHits to create.
bool finishTrack()
Process a track once all steps are known.
VxdID getSensorID() const
Return the VxdID belonging to this sensitive detector.
Base class for Sensitive Detector implementation of PXD and SVD.
Base class to provide Sensor Information for PXD and SVD.
VxdID getID() const
Return the ID of the Sensor.
SensitiveDetectorBase(SensorInfoBase *info)
Constructor.
StepInformation findMidPoint(const SensorTraversal &traversal)
Find the mid-point of the track traversal.
bool m_seeNeutrons
also create SimHit/TrueHit objects for neutrons (or charged particles which deposit less than m_minim...
float m_electronTolerance
maximum relative difference between electron density of two steps where they can be considered simila...
bool m_onlyPrimaryTrueHits
only create TrueHits for primary particles
Abstract base class for different kinds of events.
std::pair< iterator, iterator > range
Iterator pair for a set of points.
bool step(G4Step *step, G4TouchableHistory *) override
Process a single Geant4 Step.
void setOptions(bool seeNeutrons, bool onlyPrimaryTrueHits, float distanceTolerance, float electronTolerance, float minimumElectrons)
Set all common options.
virtual int saveTrueHit(const SensorTraversal &traversal)=0
Save the actual TrueHit for this sensor traversal.
SensorInfoBase * getSensorInfo()
Return a pointer to the SensorInfo associated with this instance.
std::vector< unsigned int > simplifyEnergyDeposit(const SensorTraversal::range &points)
Simplify the energy deposition profile using Douglas-Peuker-Algorithm We normally force a Geant4 step...
std::stack< SensorTraversal > m_tracks
stack of SensorTraversal information for all tracks not finished so far
virtual int saveSimHit(const SensorTraversal &traversal, const SensorTraversal::range &points)=0
Save a SimHit for this track including the given points.
This class provides a set of constants for the framework.
virtual void saveRelations(const SensorTraversal &traversal, int trueHitIndex, std::vector< std::pair< unsigned int, float >> simHitIndices)=0
Save the relations between MCParticle, TrueHit and SimHits.
float m_distanceTolerance
maximum distance between step point and linear interpolation of sensor traversal before a new simhit ...