gdynamicDigitization
|
Abstract base class for dynamic digitization functionality. More...
#include <gdynamicdigitization.h>
Public Member Functions | |
GDynamicDigitization (const std::shared_ptr< GOptions > &g) | |
virtual | ~GDynamicDigitization ()=default |
Virtual destructor. | |
double | processStepTime (const std::shared_ptr< GTouchable > &gTouchID, G4Step *thisStep) |
Processes the step time. | |
virtual double | processStepTimeImpl (const std::shared_ptr< GTouchable > &gTouchID, G4Step *thisStep) |
Default implementation of processStepTime. | |
std::vector< std::shared_ptr< GTouchable > > | processTouchable (std::shared_ptr< GTouchable > gtouchable, G4Step *thisStep) |
Processes a GTouchable based on a G4Step. | |
virtual std::vector< std::shared_ptr< GTouchable > > | processTouchableImpl (std::shared_ptr< GTouchable > gtouchable, G4Step *thisStep) |
Processes a GTouchable based on the current G4Step. | |
std::vector< std::shared_ptr< GTouchable > > | processGTouchableModifiers (const std::shared_ptr< GTouchable > &gTouchID, const GTouchableModifiers &gmods) |
Processes touchable modifiers. | |
virtual std::vector< std::shared_ptr< GTouchable > > | processGTouchableModifiersImpl (const std::shared_ptr< GTouchable > &gTouchID, const GTouchableModifiers &gmods) |
Default implementation for processing touchable modifiers. | |
std::unique_ptr< GTrueInfoData > | collectTrueInformation (GHit *ghit, size_t hitn) |
Collects true hit information into a GTrueInfoData object. | |
virtual std::unique_ptr< GTrueInfoData > | collectTrueInformationImpl (GHit *ghit, size_t hitn) |
Collects true hit information from a GHit. | |
std::unique_ptr< GDigitizedData > | digitizeHit (GHit *ghit, size_t hitn) |
Digitizes hit information into a GDigitizedData object. | |
virtual std::unique_ptr< GDigitizedData > | digitizeHitImpl (GHit *ghit, size_t hitn) |
bool | loadConstants (int runno, std::string const &variation) |
Loads digitization constants. | |
virtual bool | loadConstantsImpl (int runno, std::string const &variation) |
bool | loadTT (int runno, std::string const &variation) |
Loads the translation table. | |
virtual bool | loadTTImpl (int runno, std::string const &variation) |
void | chargeAndTimeAtHardware (int time, int q, const GHit *ghit, GDigitizedData &gdata) |
Sets hardware-level charge and time information in the digitized data. | |
bool | defineReadoutSpecs () |
Pure virtual function to initialize readout specifications. | |
virtual bool | defineReadoutSpecsImpl ()=0 |
virtual bool | decisionToSkipHit (double energy) |
void | set_loggers (const std::shared_ptr< GOptions > &g) |
Sets the loggers for the digitization process. | |
Static Public Member Functions | |
static GDynamicDigitization * | instantiate (const dlhandle h, std::shared_ptr< GOptions > g) |
Dynamically instantiates a GDynamicDigitization object from a dynamic library. | |
Data Fields | |
std::shared_ptr< const GReadoutSpecs > | readoutSpecs |
After init, we never mutate these: | |
std::shared_ptr< const GTranslationTable > | translationTable |
Protected Member Functions | |
void | check_if_log_defined () const |
Checks that all required loggers and options are defined. | |
Protected Attributes | |
std::shared_ptr< GOptions > | gopts |
Optional pointer to GOptions. | |
Definition at line 104 of file gdynamicdigitization.h.
|
inlineexplicit |
Definition at line 106 of file gdynamicdigitization.h.
|
virtualdefault |
void GDynamicDigitization::chargeAndTimeAtHardware | ( | int | time, |
int | q, | ||
const GHit * | ghit, | ||
GDigitizedData & | gdata ) |
Sets charge and time information at the hardware level in a GDigitizedData object.
Sets the gdata variable TIMEATELECTRONICS (used by RunAction to identify eventFrameIndex) and includes the translation table (hardware address: crate/slot/channel) in the digitized data. Exits with an error if the translation table is not defined.
time | Time value (ns). |
q | Charge value. |
ghit | Pointer to the GHit. |
gdata | Pointer to the GDigitizedData - caller keeps ownership. |
Checks that the translation table is defined and that the hardware address (from the GHit's TTID) is initialized. Then, it includes the crate, slot, channel, time, and charge in the digitized data.
time | Time value (assumed unit: ns). |
q | Charge value. |
ghit | Pointer to the GHit. |
gdata | Pointer to the GDigitizedData. |
Definition at line 73 of file gdynamicdigitization.cc.
|
inlineprotected |
If any required logger is missing, prints an error message and exits.
Definition at line 320 of file gdynamicdigitization.h.
|
inline |
Integrates all information built in GHit::addHitInfosForBitset.
ghit | Pointer to a GHit. |
hitn | Hit index. |
Definition at line 176 of file gdynamicdigitization.h.
|
virtual |
Integrates all available information built in GHit::addHitInfosForBitset (such as energy, time, and positions) into a new GTrueInfoData object.
ghit | Pointer to the GHit. |
hitn | Hit index. |
Definition at line 33 of file gdynamicdigitization.cc.
|
inlinevirtual |
Definition at line 292 of file gdynamicdigitization.h.
|
inline |
Must be implemented by derived classes.
Definition at line 250 of file gdynamicdigitization.h.
|
pure virtual |
Implemented in GPlugin_test_example, GFluxDigitization, GParticleCounterDigitization, and GDosimeterDigitization.
|
inline |
ghit | Pointer to a GHit. |
hitn | Hit index. |
Definition at line 191 of file gdynamicdigitization.h.
|
inlinevirtual |
Reimplemented in GPlugin_test_example, GFluxDigitization, GParticleCounterDigitization, and GDosimeterDigitization.
Definition at line 197 of file gdynamicdigitization.h.
|
inlinestatic |
h | Handle to the dynamic library. |
Definition at line 278 of file gdynamicdigitization.h.
|
inline |
runno | Run number. |
variation | Variation string. |
Definition at line 206 of file gdynamicdigitization.h.
|
inlinevirtual |
Reimplemented in GPlugin_test_example, and GDosimeterDigitization.
Definition at line 212 of file gdynamicdigitization.h.
|
inline |
runno | Run number. |
variation | Variation string. |
Definition at line 221 of file gdynamicdigitization.h.
|
inlinevirtual |
Reimplemented in GPlugin_test_example.
Definition at line 227 of file gdynamicdigitization.h.
|
inline |
This function applies modifiers from a GTouchableModifiers object.
gTouchID | Pointer to the original GTouchable. |
gmods | A GTouchableModifiers object. |
Definition at line 158 of file gdynamicdigitization.h.
|
virtual |
Returns an empty vector; derived classes may override to apply actual modifications.
gTouchID | Pointer to the original GTouchable. |
gmods | A GTouchableModifiers object. |
Definition at line 212 of file gdynamicdigitization.cc.
|
inline |
Returns the global time from the post-step point of the current G4Step.
gTouchID | Pointer to the GTouchable. |
thisStep | Pointer to the current G4Step. |
Definition at line 122 of file gdynamicdigitization.h.
|
virtual |
Returns the global time from the post-step point of the current G4Step.
gTouchID | Pointer to the GTouchable (unused in this default implementation). |
thisStep | Pointer to the current G4Step. |
Definition at line 161 of file gdynamicdigitization.cc.
|
inline |
If the computed time cell index matches the current one (or if it was unset), the original touchable is returned; otherwise, a new touchable is created.
gtouchable | Pointer to the original GTouchable. |
thisStep | Pointer to the current G4Step. |
Definition at line 141 of file gdynamicdigitization.h.
|
virtual |
Computes the time cell index using the readout specifications. If the computed index is equal to the current touchable's index (or if not set), assigns it and returns the original touchable. Otherwise, returns a vector with the original touchable and a new one with the updated index.
gtouchable | Pointer to the original GTouchable. |
thisStep | Pointer to the current G4Step. |
Definition at line 176 of file gdynamicdigitization.cc.
|
inline |
g | Pointer to GOptions. |
Definition at line 306 of file gdynamicdigitization.h.
|
protected |
Definition at line 313 of file gdynamicdigitization.h.
std::shared_ptr<const GReadoutSpecs> GDynamicDigitization::readoutSpecs |
Definition at line 258 of file gdynamicdigitization.h.
std::shared_ptr<const GTranslationTable> GDynamicDigitization::translationTable |
Definition at line 259 of file gdynamicdigitization.h.