|
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) | |
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) | |
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. | |
| 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. | |
| 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 compares trackId particleCounter always matches once identities matchThe identity vector size mismatch is considered an exceptional situation and is logged at debug level.
Definition at line 139 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 ) |
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). |
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 ) |
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). |
Definition at line 52 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 191 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 207 of file gtouchable.h.
|
inline |
| timeIndex | Electronics time-cell index that represents the readout time window. |
Definition at line 241 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 224 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 331 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 311 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 289 of file gtouchable.h.
|
inline |
Dimensions are stored verbatim and interpreted by module-specific digitization logic.
Definition at line 278 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 234 of file gtouchable.h.
|
inline |
std::vector of GIdentifier. Definition at line 255 of file gtouchable.h.
|
inline |
The returned string is constructed by concatenating each identifier as: "<name>: <value> " (note the trailing space).
Definition at line 265 of file gtouchable.h.
|
inline |
GTOUCHABLEUNSETTIMEINDEX if not assigned yet. Definition at line 248 of file gtouchable.h.
|
default |
| bool GTouchable::operator== | ( | const GTouchable & | gtouchable | ) | const |
| gtouchable | The touchable to compare with. |
Definition at line 87 of file gtouchable.cc.
|
friend |
Definition at line 138 of file gtouchable.cc.