|
gtouchable
|
Represents a touchable sensitive detector element used as a hit-collection discriminator. More...
#include <gtouchable.h>
Public Member Functions | |
| GTouchable (const GTouchable &)=default | |
| GTouchable & | operator= (const GTouchable &)=default |
| GTouchable (const std::shared_ptr< GOptions > &gopt, const std::string &digitization, const std::string &gidentityString, const std::vector< double > &dimensions, const double &mass) | |
Constructs a GTouchable using module options. | |
| GTouchable (const std::shared_ptr< GLogger > &logger, const std::string &digitization, const std::string &gidentityString, const std::vector< double > &dimensions, const double &mass) | |
Constructs a GTouchable using an existing logger. | |
| GTouchable (const std::shared_ptr< GTouchable > &base, int newTimeIndex) | |
| Copy constructor that preserves identity but updates the electronics time-cell index. | |
| ~GTouchable () | |
| Destructor with debug trace. | |
| bool | operator== (const GTouchable >ouchable) const |
Compares two GTouchable instances using the module comparison semantics. | |
| void | assignTrackId (int tid) |
Assigns the track id used by flux and dosimeter discrimination. | |
| void | assignPId (int p) |
Assigns the particle id used by particle counter discrimination. | |
| double | getEnergyMultiplier () const |
| Returns the energy multiplier used for energy sharing. | |
| void | assignStepTimeAtElectronicsIndex (int timeIndex) |
Assigns the electronics time-cell index used by readout discrimination. | |
| int | getStepTimeAtElectronicsIndex () const |
| Returns the electronics time-cell index. | |
| std::vector< GIdentifier > | getIdentity () const |
| Returns a copy of the identity vector. | |
| std::string | getIdentityString () const |
| Builds a human-readable identity string from the stored identifiers. | |
| std::vector< double > | getDetectorDimensions () const |
| Returns the detector dimensions stored at construction time. | |
| double | getMass () const |
| Returns the mass of the sensitive g4volume. | |
| bool | exists_in_vector (const std::vector< GTouchable > &v) const |
Checks whether this touchable exists in a vector using operator== semantics. | |
Public Member Functions inherited from GBase< GTouchable > | |
| 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 std::shared_ptr< GTouchable > | create (const std::shared_ptr< GOptions > &gopt) |
Creates a synthetic readout touchable for testing (options-based). | |
| static std::shared_ptr< GTouchable > | create (const std::shared_ptr< GLogger > &logger) |
Creates a synthetic readout touchable for testing (logger-based). | |
Friends | |
| std::ostream & | operator<< (std::ostream &stream, const GTouchable >ouchable) |
| Stream output helper used in logs and diagnostics. | |
Additional Inherited Members | |
Protected Attributes inherited from GBase< GTouchable > | |
| std::shared_ptr< GLogger > | log |
A GTouchable acts as a compact “address” for sensitive detector elements during hit processing and digitization. It is commonly used as a key when deciding whether a newly produced hit should:
The equality operator implements a two-stage comparison:
readout compares stepTimeAtElectronicsIndex flux compares trackId dosimeter always matches once identities matchparticle_counter compares pid integral_counter always matches once identities matchThe identity vector size mismatch is considered an exceptional situation and is logged at debug level.
Definition at line 140 of file gtouchable.h.
|
default |
| GTouchable::GTouchable | ( | const std::shared_ptr< GOptions > & | gopt, |
| const std::string & | digitization, | ||
| const std::string & | gidentityString, | ||
| const std::vector< double > & | dimensions, | ||
| const double & | mass ) |
This constructor is used when a module options object is available and a module-scoped logger should be created/used by the base class.
Called from detector construction code when building the sensitive detector registry.
| gopt | Options container used to configure logging and module behavior. |
| digitization | Digitization type string (e.g. "readout", FLUXNAME, COUNTERNAME). |
| gidentityString | Identity specification string, e.g. "sector: 2, layer: 4, wire: 33". |
| dimensions | Physical dimensions of the detector element (module-defined convention). |
| mass | The mass of the detector element. |
Definition at line 16 of file gtouchable.cc.
| GTouchable::GTouchable | ( | const std::shared_ptr< GLogger > & | logger, |
| const std::string & | digitization, | ||
| const std::string & | gidentityString, | ||
| const std::vector< double > & | dimensions, | ||
| const double & | mass ) |
This constructor is useful when a caller already owns a configured logger instance (for example, in tests or in code that wants to share a logger across multiple objects).
| logger | Logger instance used for diagnostics. |
| digitization | Digitization type string (e.g. "readout", FLUXNAME, COUNTERNAME). |
| gidentityString | Identity specification string, e.g. "sector: 2, layer: 4, wire: 33". |
| dimensions | Physical dimensions of the detector element (module-defined convention). |
| mass | The mass of the detector element. |
Definition at line 54 of file gtouchable.cc.
|
inline |
This is used to create a new hit key when the identity matches but the time-cell differs, i.e. when a hit must be split by electronics time window.
The copy uses the base class copy constructor and then copies the data members from base, replacing only stepTimeAtElectronicsIndex with newTimeIndex.
| base | Existing touchable to copy from. |
| newTimeIndex | The updated electronics time-cell index. |
Definition at line 197 of file gtouchable.h.
|
inline |
The destructor logs the type and getIdentityString() at debug level, which can be useful when diagnosing object lifetimes.
Definition at line 213 of file gtouchable.h.
|
inline |
This value is typically set during hit processing when the simulation step is known.
| p | Particle id to store in the touchable. |
Definition at line 239 of file gtouchable.h.
|
inline |
| timeIndex | Electronics time-cell index that represents the readout time window. |
Definition at line 256 of file gtouchable.h.
|
inline |
This value is typically set during hit processing when the simulation step is known.
| tid | Track id to store in the touchable. |
Definition at line 230 of file gtouchable.h.
|
inlinestatic |
The generated identity uses a deterministic pattern based on a process-wide atomic counter:
| logger | Logger instance used for diagnostics. |
Definition at line 354 of file gtouchable.h.
|
inlinestatic |
The generated identity uses a deterministic pattern based on a process-wide atomic counter:
| gopt | Options container used to configure logging and module behavior. |
Definition at line 333 of file gtouchable.h.
|
inline |
This is a convenience helper mainly used for diagnostics and validation logic. It logs level-2 informational messages indicating whether the touchable was found.
| v | Vector of touchables to scan. |
Definition at line 311 of file gtouchable.h.
|
inline |
Dimensions are stored verbatim and interpreted by module-specific digitization logic.
Definition at line 293 of file gtouchable.h.
|
inline |
The multiplier is typically set by digitization logic (for example when distributing energy across multiple readout cells). The default is 1.
Definition at line 249 of file gtouchable.h.
|
inline |
std::vector of GIdentifier. Definition at line 270 of file gtouchable.h.
|
inline |
The returned string is constructed by concatenating each identifier as: "<name>: <value> " (note the trailing space).
Definition at line 280 of file gtouchable.h.
|
inline |
Definition at line 300 of file gtouchable.h.
|
inline |
GTOUCHABLEUNSETTIMEINDEX if not assigned yet. Definition at line 263 of file gtouchable.h.
|
default |
| bool GTouchable::operator== | ( | const GTouchable & | gtouchable | ) | const |
| gtouchable | The touchable to compare with. |
Definition at line 91 of file gtouchable.cc.
|
friend |
Definition at line 150 of file gtouchable.cc.