|
gdynamicDigitization
|
Abstract base class for dynamically loaded digitization plugins. More...
#include <gdynamicdigitization.h>
Public Member Functions | |
| GDynamicDigitization (const std::shared_ptr< GOptions > &g) | |
| Constructs the digitization base object. | |
| virtual | ~GDynamicDigitization ()=default |
| Virtual destructor. | |
| double | processStepTime (const std::shared_ptr< GTouchable > &gTouchID, G4Step *thisStep) |
| Computes the time associated with a simulation step for electronics binning. | |
| virtual double | processStepTimeImpl (const std::shared_ptr< GTouchable > &gTouchID, G4Step *thisStep) |
| Implementation hook for step time computation. | |
| std::vector< std::shared_ptr< GTouchable > > | processTouchable (std::shared_ptr< GTouchable > gtouchable, G4Step *thisStep) |
| Processes a touchable based on the current step and readout specs. | |
| virtual std::vector< std::shared_ptr< GTouchable > > | processTouchableImpl (std::shared_ptr< GTouchable > gtouchable, G4Step *thisStep) |
| Implementation hook for touchable processing. | |
| std::vector< std::shared_ptr< GTouchable > > | processGTouchableModifiers (const std::shared_ptr< GTouchable > &gTouchID, const GTouchableModifiers &gmods) |
| Applies touchable modifiers. | |
| virtual std::vector< std::shared_ptr< GTouchable > > | processGTouchableModifiersImpl (const std::shared_ptr< GTouchable > &gTouchID, const GTouchableModifiers &gmods) |
| Implementation hook for touchable modifier application. | |
| std::unique_ptr< GTrueInfoData > | collectTrueInformation (GHit *ghit, size_t hitn) |
| Collects standardized “true hit information” into a GTrueInfoData record. | |
| virtual std::unique_ptr< GTrueInfoData > | collectTrueInformationImpl (GHit *ghit, size_t hitn) |
| Implementation hook for true-information collection. | |
| std::unique_ptr< GDigitizedData > | digitizeHit (GHit *ghit, size_t hitn) |
| Digitizes a hit into a GDigitizedData record. | |
| virtual std::unique_ptr< GDigitizedData > | digitizeHitImpl (GHit *ghit, size_t hitn) |
| Implementation hook for hit digitization. | |
| bool | loadConstants (int runno, std::string const &variation) |
| Loads digitization constants (calibration/configuration). | |
| virtual bool | loadConstantsImpl (int runno, std::string const &variation) |
| Implementation hook for constant loading. | |
| bool | loadTT (int runno, std::string const &variation) |
| Loads the translation table (identity -> electronics address). | |
| virtual bool | loadTTImpl (int runno, std::string const &variation) |
| Implementation hook for translation table loading. | |
| void | chargeAndTimeAtHardware (int time, int q, const GHit *ghit, GDigitizedData &gdata) |
| Adds hardware-level time/charge and address fields to a digitized record. | |
| bool | defineReadoutSpecs () |
| Initializes readout specifications. | |
| virtual bool | defineReadoutSpecsImpl ()=0 |
| Implementation hook to define readout specs. | |
| virtual bool | decisionToSkipHit (double energy) |
| Decides whether a hit should be skipped based on deposited energy. | |
| void | set_loggers (const std::shared_ptr< GOptions > &g) |
| Sets the options pointer required by the digitization base. | |
Public Member Functions inherited from GBase< GDynamicDigitization > | |
| GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="") | |
| GBase (const std::shared_ptr< GLogger > &logger) | |
| GBase (const GBase &)=default | |
| GBase (GBase &&) noexcept=default | |
| virtual | ~GBase () |
| GBase & | operator= (const GBase &)=default |
| GBase & | operator= (GBase &&) noexcept=default |
Static Public Member Functions | |
| static GDynamicDigitization * | instantiate (const dlhandle h, std::shared_ptr< GOptions > g) |
| Dynamically instantiates a plugin instance from a dynamic library. | |
Data Fields | |
| std::shared_ptr< const GReadoutSpecs > | readoutSpecs |
| Readout specs are created during initialization and treated as immutable. | |
| std::shared_ptr< const GTranslationTable > | translationTable |
| Translation table is typically loaded during initialization and treated as immutable. | |
Protected Member Functions | |
| void | check_if_log_defined () const |
| Ensures options/logging are configured before plugin methods run. | |
Protected Attributes | |
| std::shared_ptr< GOptions > | gopts |
| Options used by the digitization plugin instance. | |
Protected Attributes inherited from GBase< GDynamicDigitization > | |
| std::shared_ptr< GLogger > | log |
Plugins typically implement:
They may additionally override:
Definition at line 159 of file gdynamicdigitization.h.
|
inlineexplicit |
| g | Options used by this plugin instance. |
Definition at line 167 of file gdynamicdigitization.h.
|
virtualdefault |
| void GDynamicDigitization::chargeAndTimeAtHardware | ( | int | time, |
| int | q, | ||
| const GHit * | ghit, | ||
| GDigitizedData & | gdata ) |
This routine inserts:
| time | Time value (time unit follows project conventions; often ns). |
| q | Charge value (ADC-like integer). |
| ghit | Input hit providing the translation-table id. |
| gdata | Digitized record to augment (caller retains ownership). |
Definition at line 58 of file gdynamicdigitization.cc.
|
inlineprotected |
If options are not set, prints an error message and exits.
Definition at line 468 of file gdynamicdigitization.h.
|
inline |
Wrapper that logs/checks and delegates to collectTrueInformationImpl().
| ghit | Input hit from the sensitive detector. |
| hitn | Sequential hit index. |
Definition at line 268 of file gdynamicdigitization.h.
|
virtual |
| ghit | Input hit. |
| hitn | Sequential hit index. |
Definition at line 24 of file gdynamicdigitization.cc.
|
inlinevirtual |
Default behavior skips hits with exactly zero energy if the recordZeroEdep option is disabled.
| energy | Total deposited energy for the hit. |
Definition at line 437 of file gdynamicdigitization.h.
|
inline |
Wrapper that logs/checks and delegates to defineReadoutSpecsImpl().
Definition at line 387 of file gdynamicdigitization.h.
|
pure virtual |
Must be implemented by derived classes.
Implemented in GPlugin_test_example, GFluxDigitization, GParticleCounterDigitization, and GDosimeterDigitization.
|
inline |
Wrapper that logs/checks and delegates to digitizeHitImpl().
| ghit | Input hit from the sensitive detector. |
| hitn | Sequential hit index. |
Definition at line 293 of file gdynamicdigitization.h.
|
inlinevirtual |
Default implementation returns nullptr to indicate "not implemented".
| ghit | Input hit. |
| hitn | Sequential hit index. |
Reimplemented in GPlugin_test_example, GFluxDigitization, GParticleCounterDigitization, and GDosimeterDigitization.
Definition at line 308 of file gdynamicdigitization.h.
|
inlinestatic |
This function looks up the GDynamicDigitizationFactory symbol and calls it.
| h | Dynamic library handle. |
| g | Options to pass to the plugin instance. |
Definition at line 417 of file gdynamicdigitization.h.
|
inline |
Wrapper that logs/checks and delegates to loadConstantsImpl().
| runno | Run number. |
| variation | Variation string. |
Definition at line 320 of file gdynamicdigitization.h.
|
inlinevirtual |
Default implementation does nothing and returns true.
| runno | Run number. |
| variation | Variation string. |
Reimplemented in GPlugin_test_example, and GDosimeterDigitization.
Definition at line 335 of file gdynamicdigitization.h.
|
inline |
Wrapper that logs/checks and delegates to loadTTImpl().
| runno | Run number. |
| variation | Variation string. |
Definition at line 348 of file gdynamicdigitization.h.
|
inlinevirtual |
Default implementation does nothing and returns true.
| runno | Run number. |
| variation | Variation string. |
Reimplemented in GPlugin_test_example.
Definition at line 364 of file gdynamicdigitization.h.
|
inline |
Wrapper that logs/checks and delegates to processGTouchableModifiersImpl().
| gTouchID | Input touchable to modify. |
| gmods | Modifier container describing how to modify touchables. |
Definition at line 239 of file gdynamicdigitization.h.
|
virtual |
Default implementation returns an empty vector (no modifiers applied).
| gTouchID | Input touchable. |
| gmods | Modifier container. |
Definition at line 156 of file gdynamicdigitization.cc.
|
inline |
This wrapper logs, checks that options are configured, and delegates to processStepTimeImpl().
| gTouchID | Touchable associated with the current step. |
| thisStep | Pointer to the current G4Step. |
Definition at line 183 of file gdynamicdigitization.h.
|
virtual |
Default behavior returns the post-step global time from G4Step.
| gTouchID | Touchable associated with the current step. |
| thisStep | Pointer to the current G4Step. |
Definition at line 122 of file gdynamicdigitization.cc.
|
inline |
The default behavior bins the step time into an electronics time-cell index using readoutSpecs->timeCellIndex(). If the index changes relative to the current touchable, a second touchable instance is created.
| gtouchable | Input touchable for this step. |
| thisStep | Pointer to the current G4Step. |
Definition at line 213 of file gdynamicdigitization.h.
|
virtual |
| gtouchable | Input touchable for this step. |
| thisStep | Pointer to the current G4Step. |
Definition at line 129 of file gdynamicdigitization.cc.
|
inline |
| g | Options object to store for later use. |
Definition at line 453 of file gdynamicdigitization.h.
|
protected |
Definition at line 461 of file gdynamicdigitization.h.
| std::shared_ptr<const GReadoutSpecs> GDynamicDigitization::readoutSpecs |
Definition at line 403 of file gdynamicdigitization.h.
| std::shared_ptr<const GTranslationTable> GDynamicDigitization::translationTable |
Definition at line 406 of file gdynamicdigitization.h.