gdynamicDigitization
Loading...
Searching...
No Matches
GPlugin_test_example Class Reference

Minimal test plugin for dynamic digitization. More...

#include <gplugin_test_example.h>

Public Member Functions

bool defineReadoutSpecsImpl () override
 Defines readout specifications for this example plugin.
 
bool loadConstantsImpl (int runno, std::string const &variation) override
 Loads example constants used by this plugin.
 
bool loadTTImpl (int runno, std::string const &variation) override
 Builds a minimal in-memory translation table for the example.
 
std::unique_ptr< GDigitizedDatadigitizeHitImpl (GHit *ghit, size_t hitn) override
 Digitizes the provided hit into a small example output record.
 
 GDynamicDigitization (const std::shared_ptr< GOptions > &g)
 Inherit the base constructor (const std::shared_ptr<GOptions>&).
 
- Public Member Functions inherited from GDynamicDigitization
 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< GTrueInfoDatacollectTrueInformation (GHit *ghit, size_t hitn)
 Collects standardized “true hit information” into a GTrueInfoData record.
 
virtual std::unique_ptr< GTrueInfoDatacollectTrueInformationImpl (GHit *ghit, size_t hitn)
 Implementation hook for true-information collection.
 
std::unique_ptr< GDigitizedDatadigitizeHit (GHit *ghit, size_t hitn)
 Digitizes a hit into a GDigitizedData record.
 
bool loadConstants (int runno, std::string const &variation)
 Loads digitization constants (calibration/configuration).
 
bool loadTT (int runno, std::string const &variation)
 Loads the translation table (identity -> electronics address).
 
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 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 ()
 
GBaseoperator= (const GBase &)=default
 
GBaseoperator= (GBase &&) noexcept=default
 

Additional Inherited Members

- Static Public Member Functions inherited from GDynamicDigitization
static GDynamicDigitizationinstantiate (const dlhandle h, std::shared_ptr< GOptions > g)
 Dynamically instantiates a plugin instance from a dynamic library.
 
- Data Fields inherited from GDynamicDigitization
std::shared_ptr< const GReadoutSpecsreadoutSpecs
 Readout specs are created during initialization and treated as immutable.
 
std::shared_ptr< const GTranslationTabletranslationTable
 Translation table is typically loaded during initialization and treated as immutable.
 
- Protected Member Functions inherited from GDynamicDigitization
void check_if_log_defined () const
 Ensures options/logging are configured before plugin methods run.
 
- Protected Attributes inherited from GDynamicDigitization
std::shared_ptr< GOptionsgopts
 Options used by the digitization plugin instance.
 
- Protected Attributes inherited from GBase< GDynamicDigitization >
std::shared_ptr< GLoggerlog
 

Detailed Description

This class is designed for:

  • demonstrating the plugin surface expected by gdynamic digitization
  • serving as a small integration test for the dynamic loader

It stores a few example configuration variables (scalar/array/vector/string) and creates a small translation table in memory.

Definition at line 36 of file gplugin_test_example.h.

Member Function Documentation

◆ defineReadoutSpecsImpl()

bool GPlugin_test_example::defineReadoutSpecsImpl ( )
overridevirtual

This is the minimal required hook that every plugin must implement. The routine demonstrates assigning:

  • a fixed electronics time window
  • a grid start time (time-grid origin)
  • a hit bitset controlling which hit fields are computed/stored
Returns
true when readout specifications are assigned.

Implements GDynamicDigitization.

Definition at line 7 of file gplugin_test_example.cc.

◆ digitizeHitImpl()

std::unique_ptr< GDigitizedData > GPlugin_test_example::digitizeHitImpl ( GHit * ghit,
size_t hitn )
overridevirtual

This example demonstrates:

  • creating a GDigitizedData record
  • computing a "voltage" from total deposited energy
  • building a synthetic "digi_time" by scaling and summing hit step times
Parameters
ghitInput hit to digitize. Ownership stays with the caller.
hitnHit index (unused in this example).
Returns
Newly allocated digitized record.

Reimplemented from GDynamicDigitization.

Definition at line 60 of file gplugin_test_example.cc.

◆ GDynamicDigitization()

GDynamicDigitization::GDynamicDigitization ( const std::shared_ptr< GOptions > & g)
inlineexplicit

Definition at line 167 of file gdynamicdigitization.h.

◆ loadConstantsImpl()

bool GPlugin_test_example::loadConstantsImpl ( int runno,
std::string const & variation )
overridevirtual

This routine demonstrates how a plugin can initialize internal configuration state (members) that later influences digitization.

It sets:

  • var1 : scalar example value
  • var2 : small fixed-size array example value
  • var3 : vector example value
  • var4 : string example value
Parameters
runnoRun number (used for logging in this example).
variationVariation string (used for logging in this example).
Returns
true to indicate success.

Reimplemented from GDynamicDigitization.

Definition at line 18 of file gplugin_test_example.cc.

◆ loadTTImpl()

bool GPlugin_test_example::loadTTImpl ( int runno,
std::string const & variation )
overridevirtual

This demonstrates how a plugin can map detector identities (vectors of ints) to electronics addresses.

Parameters
runnoUnused in this example.
variationUnused in this example.
Returns
true to indicate success.

Reimplemented from GDynamicDigitization.

Definition at line 42 of file gplugin_test_example.cc.


The documentation for this class was generated from the following files: