|
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. | |
| ~GDynamicDigitization () override=default | |
| Virtual destructor. | |
| virtual CollectionMode | collection_mode () const |
| 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::string > | variables_to_normalize () |
| virtual std::vector< std::string > | variables_to_normalizeImpl () |
| 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. | |
| virtual bool | decisionToSkipHit (double energy, const G4Step *thisStep) |
| Decides whether a step should be skipped before hit creation. | |
| bool | shouldStopTrackAfterHit (const G4Step *thisStep) const |
| Ask whether Geant4 should terminate the track after recording this step's hit. | |
| virtual bool | shouldStopTrackAfterHitImpl (const G4Step *thisStep) const |
| Plugin hook controlling post-hit track termination. | |
| void | set_loggers (const std::shared_ptr< GOptions > &g) |
| Sets the options pointer required by the digitization base. | |
| void | setDigitizationVariation (const std::string &v) |
| Sets the variation used when this routine loads constants / translation tables. | |
| std::string | getDigitizationVariation () const |
| Returns the variation passed to loadConstants() / loadTT(). | |
| void | setHitRejectionPolicies (const std::string &systemName) |
| Resolves this routine's hit-rejection policies from the global options. | |
| bool | apply_thresholds (GHit *ghit, GDigitizedData *digitizedData) |
| Applies this system's ADC-threshold rejection to a digitized hit. | |
| virtual bool | apply_thresholds_impl (GHit *ghit, GDigitizedData *digitizedData) |
| Plugin hook: is this digitized hit below the per-channel ADC threshold? | |
| virtual bool | thresholds_are_intrinsic_impl () const |
| Declares that this plugin's threshold is intrinsic to its GEMC2 digitization. | |
| bool | apply_efficiency (GHit *ghit, GDigitizedData *digitizedData) |
| Applies this system's efficiency rejection to a digitized hit. | |
| virtual bool | apply_efficiency_impl (GHit *ghit, GDigitizedData *digitizedData) |
| Plugin hook: does this digitized hit fail the per-channel efficiency draw? | |
| virtual bool | efficiencies_are_intrinsic_impl () const |
| Declares that this plugin's efficiency policy is intrinsic to GEMC2 digitization. | |
| Public Member Functions inherited from GBase< GDynamicDigitization > | |
| GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="") | |
| virtual | ~GBase () |
| GBase & | operator= (const GBase &)=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 173 of file gdynamicdigitization.h.
|
inlineexplicit |
| g | Options used by this plugin instance. |
Definition at line 180 of file gdynamicdigitization.h.
|
overridedefault |
|
inlinenodiscard |
Wrapper called automatically by the event action after digitizeHit(). It delegates to the plugin when the system is listed in -applyInefficiencies or the plugin declares its efficiency policy intrinsic. The callback may mutate the digitized record; returning true drops it and, when also_reject_true_info is set, its true-info row.
| ghit | The hit being digitized. |
| digitizedData | The digitized record produced by digitizeHit(). |
Definition at line 604 of file gdynamicdigitization.h.
|
inlinenodiscardvirtual |
Implemented by plugins that support efficiency policies. The callback can reject the whole hit or mutate part of its output, such as suppressing only a TDC value. Default: keep.
Definition at line 615 of file gdynamicdigitization.h.
|
inlinenodiscard |
Wrapper called automatically by the event action after digitizeHit(). It delegates to the plugin when the system is listed in -applyThresholds or the plugin declares its threshold intrinsic. Returning true drops the digitized hit and, when also_reject_true_info is set, its true-info row.
| ghit | The hit being digitized. |
| digitizedData | The digitized record produced by digitizeHit(). |
Definition at line 568 of file gdynamicdigitization.h.
|
inlinenodiscardvirtual |
Implemented by plugins that support threshold rejection. The mutable digitized record may contain transient decision inputs cached by digitizeHitImpl(). Default: keep the hit.
Definition at line 579 of file gdynamicdigitization.h.
| 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 104 of file gdynamicdigitization.cc.
|
inlineprotected |
If options are not set, prints an error message and exits.
Definition at line 650 of file gdynamicdigitization.h.
|
inlinenodiscardvirtual |
Reimplemented in GDosimeterDigitization.
Definition at line 187 of file gdynamicdigitization.h.
|
inlinenodiscard |
Wrapper that logs/checks and delegates to collectTrueInformationImpl().
| ghit | Input hit from the sensitive detector. |
| hitn | Sequential hit index. |
Definition at line 300 of file gdynamicdigitization.h.
|
nodiscardvirtual |
| ghit | Input hit. |
| hitn | Sequential hit index. |
Definition at line 46 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 469 of file gdynamicdigitization.h.
|
inlinevirtual |
This overload gives digitization routines access to the full Geant4 step while preserving the legacy energy-only hook for existing plugins.
| energy | Total deposited energy for the step. |
| thisStep | Geant4 step being processed. |
Reimplemented in GPhotonDetectorDigitization.
Definition at line 486 of file gdynamicdigitization.h.
|
inlinenodiscard |
Wrapper that logs/checks and delegates to defineReadoutSpecsImpl().
Definition at line 419 of file gdynamicdigitization.h.
|
pure virtual |
Must be implemented by derived classes.
Implemented in GDosimeterDigitization, GFluxDigitization, GParticleCounterDigitization, and GPlugin_test_example.
|
inlinenodiscard |
Wrapper that logs/checks and delegates to digitizeHitImpl().
| ghit | Input hit from the sensitive detector. |
| hitn | Sequential hit index. |
Definition at line 325 of file gdynamicdigitization.h.
|
inlinenodiscardvirtual |
Default implementation returns nullptr to indicate "not implemented".
| ghit | Input hit. |
| hitn | Sequential hit index. |
Reimplemented in GDosimeterDigitization, GFluxDigitization, GParticleCounterDigitization, and GPlugin_test_example.
Definition at line 340 of file gdynamicdigitization.h.
|
inlinenodiscardvirtual |
Intrinsic efficiency policies run even when the system is absent from applyInefficiencies. The default remains configuration-controlled.
Definition at line 626 of file gdynamicdigitization.h.
|
inlinenodiscard |
Definition at line 542 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 449 of file gdynamicdigitization.h.
|
inlinenodiscard |
Wrapper that logs/checks and delegates to loadConstantsImpl().
| runno | Run number. |
| variation | Variation string. |
Definition at line 352 of file gdynamicdigitization.h.
|
inlinevirtual |
Default implementation does nothing and returns true.
| runno | Run number. |
| variation | Variation string. |
Reimplemented in GDosimeterDigitization, and GPlugin_test_example.
Definition at line 367 of file gdynamicdigitization.h.
|
inlinenodiscard |
Wrapper that logs/checks and delegates to loadTTImpl().
| runno | Run number. |
| variation | Variation string. |
Definition at line 380 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 396 of file gdynamicdigitization.h.
|
inlinenodiscard |
Wrapper that logs/checks and delegates to processGTouchableModifiersImpl(). Example use: energy-sharing
| gTouchID | Input touchable to modify. |
| gmods | Modifier container describing how to modify touchables. |
Definition at line 271 of file gdynamicdigitization.h.
|
virtual |
Default implementation returns an empty vector (no modifiers applied).
| gTouchID | Input touchable. |
| gmods | Modifier container. |
Definition at line 196 of file gdynamicdigitization.cc.
|
inlinenodiscard |
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 199 of file gdynamicdigitization.h.
|
nodiscardvirtual |
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 162 of file gdynamicdigitization.cc.
|
inlinenodiscard |
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 244 of file gdynamicdigitization.h.
|
nodiscardvirtual |
| gtouchable | Input touchable for this step. |
| thisStep | Pointer to the current G4Step. |
Definition at line 169 of file gdynamicdigitization.cc.
|
inline |
| g | Options object to store for later use. |
Definition at line 525 of file gdynamicdigitization.h.
|
inline |
Resolved once per geometry load: defaults to the variation of the gsystem the routine belongs to, and is overridden by the digitization_variation option when that is set.
| v | Variation string to use. |
Definition at line 535 of file gdynamicdigitization.h.
| void GDynamicDigitization::setHitRejectionPolicies | ( | const std::string & | systemName | ) |
Reads the applyThresholds and applyInefficiencies options (each a list of system names, or "all") and records whether systemName should apply threshold and/or efficiency rejection during digitization. Called once per geometry load, alongside setDigitizationVariation().
| systemName | Name of the gsystem / digitization routine. |
Definition at line 205 of file gdynamicdigitization.cc.
|
inlinenodiscard |
The sensitive detector evaluates this hook only after all processed touchables have created or updated their GHit. Returning true therefore preserves the current hit and prevents the track from taking another step.
| thisStep | Geant4 step that was recorded. |
fStopAndKill to the track. Definition at line 500 of file gdynamicdigitization.h.
|
inlinenodiscardvirtual |
The default keeps the track alive. Detector plugins can override this for terminal sensitive elements such as optical-photon collectors.
Definition at line 511 of file gdynamicdigitization.h.
|
inlinenodiscardvirtual |
Intrinsic thresholds run even when the system is absent from applyThresholds. The default remains configuration-controlled for backward compatibility.
Definition at line 590 of file gdynamicdigitization.h.
|
inlinenodiscard |
Definition at line 218 of file gdynamicdigitization.h.
|
inlinenodiscardvirtual |
Definition at line 227 of file gdynamicdigitization.h.
|
protected |
Definition at line 643 of file gdynamicdigitization.h.
| std::shared_ptr<const GReadoutSpecs> GDynamicDigitization::readoutSpecs |
Definition at line 435 of file gdynamicdigitization.h.
| std::shared_ptr<const GTranslationTable> GDynamicDigitization::translationTable |
Definition at line 438 of file gdynamicdigitization.h.