|
gdata
|
Stores digitized, electronics-level observables for one hit. More...
#include <gDigitizedData.h>
Public Member Functions | |
| GDigitizedData (const std::shared_ptr< GOptions > &gopts, const GHit *ghit) | |
| Constructs the object and copies the hit identity from the source hit. | |
| std::string | getIdentityString () const |
| Builds a readable identity string from the stored hit identifiers. | |
| void | includeVariable (const std::string &vname, int value) |
| Stores or overwrites one integer observable for this hit. | |
| void | includeVariable (const std::string &vname, double value) |
| Stores or overwrites one floating-point observable for this hit. | |
| void | accumulateVariable (const std::string &vname, int value) |
| Accumulates one integer observable into the current object. | |
| void | accumulateVariable (const std::string &vname, double value) |
| Accumulates one floating-point observable into the current object. | |
| std::map< std::string, int > | getIntObservablesMap (int which) const |
| Returns a filtered copy of the integer observables map. | |
| std::map< std::string, double > | getDblObservablesMap (int which) const |
| Returns a filtered copy of the floating-point observables map. | |
| int | getTimeAtElectronics () |
Returns the conventional timeAtElectronics integer observable when present. | |
| int | getIntObservable (const std::string &varName) |
| Returns one integer observable by key. | |
| double | getDblObservable (const std::string &varName) |
| Returns one floating-point observable by key. | |
| std::map< std::string, std::vector< int > > | getArrayIntObservablesMap () const |
| Returns a copy of the array-valued integer observables. | |
| std::map< std::string, std::vector< double > > | getArrayDblObservablesMap () const |
| Returns a copy of the array-valued floating-point observables. | |
Public Member Functions inherited from GBase< GDigitizedData > | |
| 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::unique_ptr< GDigitizedData > | create (const std::shared_ptr< GOptions > &gopts) |
| Creates deterministic example data for tests and examples. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const GDigitizedData &data) |
Additional Inherited Members | |
Protected Attributes inherited from GBase< GDigitizedData > | |
| std::shared_ptr< GLogger > | log |
A GDigitizedData instance models one hit after detector-response and digitization processing. It is typically attached to:
Main responsibilities:
Typical usage:
Definition at line 115 of file gDigitizedData.h.
The constructor initializes the base logging domain and copies the vector of GIdentifier entries from the provided hit so that this object becomes self-contained.
Ownership and lifetime:
ghit is not ownedghit only needs to remain valid during construction| gopts | Shared options used to configure logging and related behavior. |
| ghit | Source hit providing the identity vector. |
Definition at line 25 of file gDigitizedData.cc.
| void GDigitizedData::accumulateVariable | ( | const std::string & | vname, |
| double | value ) |
This method supports run-level or integrated accumulation.
Behavior:
value value is added to the stored entry| vname | Observable key. |
| value | Contribution to add to the running sum. |
Definition at line 93 of file gDigitizedData.cc.
| void GDigitizedData::accumulateVariable | ( | const std::string & | vname, |
| int | value ) |
This method supports run-level or integrated accumulation.
Behavior:
value value is added to the stored entry| vname | Observable key. |
| value | Contribution to add to the running sum. |
Definition at line 81 of file gDigitizedData.cc.
|
inlinestatic |
This helper is intended only for demonstrations and tests. It does not model real detector digitization.
The returned object contains:
crate, slot, channel, and timeAtElectronics adc Uniqueness across calls is derived from a static atomic counter.
| gopts | Shared options. |
Definition at line 308 of file gDigitizedData.h.
|
inline |
No SRO filtering is applied to array-valued content. Interpretation remains detector- or producer-specific.
Definition at line 288 of file gDigitizedData.h.
|
inline |
These arrays are producer-defined and may represent multi-sample or structured readout content.
Definition at line 275 of file gDigitizedData.h.
| double GDigitizedData::getDblObservable | ( | const std::string & | varName | ) |
If the key is missing, an error is reported with the stable error code ERR_VARIABLENOTFOUND.
| varName | Observable key. |
Definition at line 121 of file gDigitizedData.cc.
| std::map< std::string, double > GDigitizedData::getDblObservablesMap | ( | int | which | ) | const |
The which argument uses the same semantics as getIntObservablesMap().
| which | Filter selector. |
Definition at line 41 of file gDigitizedData.cc.
| std::string GDigitizedData::getIdentityString | ( | ) | const |
The generated format is:
gidentity vector. Definition at line 130 of file gDigitizedData.cc.
| int GDigitizedData::getIntObservable | ( | const std::string & | varName | ) |
If the key is missing, an error is reported with the stable error code ERR_VARIABLENOTFOUND.
| varName | Observable key. |
Definition at line 112 of file gDigitizedData.cc.
| std::map< std::string, int > GDigitizedData::getIntObservablesMap | ( | int | which | ) | const |
The which argument selects the filtering mode:
0 : return non-SRO variables only1 : return SRO variables onlySRO variables are the conventional readout keys defined in gdataConventions.h.
| which | Filter selector. |
Definition at line 31 of file gDigitizedData.cc.
| int GDigitizedData::getTimeAtElectronics | ( | ) |
If the key is absent, the method returns the sentinel value TIMEATELECTRONICSNOTDEFINED.
This method provides a compact accessor for a commonly used SRO quantity without forcing callers to inspect the observables map directly.
timeAtElectronics value, or TIMEATELECTRONICSNOTDEFINED if missing. Definition at line 105 of file gDigitizedData.cc.
| void GDigitizedData::includeVariable | ( | const std::string & | vname, |
| double | value ) |
This method is usually used during event-level filling. Repeated insertion with the same key replaces the previous value.
| vname | Observable key. |
| value | Floating-point value to store. |
Definition at line 75 of file gDigitizedData.cc.
| void GDigitizedData::includeVariable | ( | const std::string & | vname, |
| int | value ) |
This method is usually used during event-level filling. Repeated insertion with the same key replaces the previous value.
| vname | Observable key. |
| value | Integer value to store. |
Definition at line 69 of file gDigitizedData.cc.
|
friend |
Definition at line 140 of file gDigitizedData.cc.