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

Built-in digitization routine for dosimeters with NIEL weighting. More...

#include <ginternalDigitization.h>

Public Member Functions

bool defineReadoutSpecsImpl () override
 Defines readout specifications for dosimeter digitization.
 
std::unique_ptr< GDigitizedDatadigitizeHitImpl (GHit *ghit, size_t hitn) override
 Digitizes a hit for dosimeter detectors.
 
bool loadConstantsImpl (int runno, std::string const &variation) override
 Loads digitization constants for dosimeter digitization.
 
 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).
 
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 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 digitization routine computes a NIEL-weight-like quantity by iterating over the per-step particle IDs and energies stored in the input hit, and summing an interpolated NIEL factor from calibration tables on disk.

The calibration tables are loaded by loadConstants() and stored in internal maps keyed by particle id.

Digitized output variables include (at minimum):

  • detector identity (the name/value of the first GIdentifier)
  • total deposited energy ("eTot")
  • computed NIEL sum ("nielWeight")
Warning
This routine assumes that the dosimeter data files exist in the expected installation paths. If a file cannot be opened, an error is logged.

Definition at line 131 of file ginternalDigitization.h.

Member Function Documentation

◆ defineReadoutSpecsImpl()

bool GDosimeterDigitization::defineReadoutSpecsImpl ( )
overridevirtual
Returns
true if readout specifications are successfully defined.

Implements GDynamicDigitization.

Definition at line 15 of file gDosimeterDigitization.cc.

◆ digitizeHitImpl()

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

This routine:

  1. Stores identity and hit-level totals (energy).
  2. Walks the per-step arrays (pid and energy) stored in the hit.
  3. For supported particle species, computes an effective energy (MeV) as: effectiveEnergy = stepEnergy - particleRestMass
  4. Sums the interpolated NIEL factor evaluated at that effective energy.
Parameters
ghitPointer to the hit to digitize. Ownership stays with the caller.
hitnSequential hit index within the detector collection (unused).
Returns
A newly allocated digitized record for this hit.

Reimplemented from GDynamicDigitization.

Definition at line 29 of file gDosimeterDigitization.cc.

◆ GDynamicDigitization()

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

Definition at line 167 of file gdynamicdigitization.h.

◆ loadConstantsImpl()

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

This routine loads:

  • NIEL factor tables from text files (two columns: factor and energy in MeV).
  • Particle rest masses in MeV used to compute effective energy.

File locations are resolved relative to the GEMC installation root.

Parameters
runnoRun number (unused by this routine).
variationVariation string (unused by this routine).
Returns
true if constants are successfully loaded (file failures are logged).

Reimplemented from GDynamicDigitization.

Definition at line 68 of file gDosimeterDigitization.cc.


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