|
gdata
|
Stores simulation-level observables for one hit. More...
#include <gTrueInfoData.h>
Public Member Functions | |
| GTrueInfoData (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 &varName, double var) |
| Stores or overwrites one numeric truth observable. | |
| void | includeVariable (const std::string &varName, std::string var) |
| Stores or overwrites one string truth observable. | |
| void | accumulateVariable (const std::string &vname, double value) |
| Accumulates a numeric observable into the current object. | |
| std::map< std::string, double > | getDoubleVariablesMap () const |
| Returns a copy of the numeric truth observables. | |
| std::map< std::string, std::string > | getStringVariablesMap () const |
| Returns a copy of the string truth observables. | |
Public Member Functions inherited from GBase< GTrueInfoData > | |
| 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< GTrueInfoData > | create (const std::shared_ptr< GOptions > &gopts) |
| Creates deterministic example data for tests and examples. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const GTrueInfoData &data) |
Additional Inherited Members | |
Protected Attributes inherited from GBase< GTrueInfoData > | |
| std::shared_ptr< GLogger > | log |
A GTrueInfoData object represents the truth-side data model for one hit. It is typically produced from tracking or stepping information and later attached to:
Main responsibilities:
Accumulation model:
Definition at line 105 of file gTrueInfoData.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 19 of file gTrueInfoData.cc.
| void GTrueInfoData::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 37 of file gTrueInfoData.cc.
|
inlinestatic |
This helper is intended only for demonstrations and tests. It does not model real detector truth generation.
The returned object contains a small conventional set of numeric variables:
totalEDeposited avgTime avgx avgy avgz hitn Uniqueness across calls is derived from a static atomic counter.
| gopts | Shared options. |
Definition at line 237 of file gTrueInfoData.h.
|
inline |
Returning by value preserves encapsulation and prevents external mutation of the internal map.
Definition at line 200 of file gTrueInfoData.h.
| std::string GTrueInfoData::getIdentityString | ( | ) | const |
The generated format is:
This string is intended for:
gidentity vector. Definition at line 51 of file gTrueInfoData.cc.
|
inline |
These values are usually categorical or provenance-oriented and are typically not merged during run-level integration in GDataCollection.
Definition at line 213 of file gTrueInfoData.h.
| void GTrueInfoData::includeVariable | ( | const std::string & | varName, |
| double | var ) |
This method is typically used during event-level filling. Repeated insertion with the same key replaces the previous value.
Common examples include:
| varName | Observable key. |
| var | Numeric value to store. |
Definition at line 25 of file gTrueInfoData.cc.
| void GTrueInfoData::includeVariable | ( | const std::string & | varName, |
| std::string | var ) |
This method is intended for per-hit metadata that is better represented as text, such as:
Repeated insertion with the same key replaces the previous value.
| varName | Observable key. |
| var | String value to store. |
Definition at line 31 of file gTrueInfoData.cc.
|
friend |
Definition at line 61 of file gTrueInfoData.cc.