22std::atomic<int> GTrueInfoData::globalTrueInfoDataCounter{0};
33 gidentity = ghit->
getGID();
41 doubleObservablesMap[varName] = value;
42 log->
info(2,
FUNCTION_NAME,
" including ", varName,
" in trueInfoDoublesVariablesMap with value: ", value);
53 log->
info(2,
FUNCTION_NAME,
" including ", varName,
" in trueInfoStringVariablesMap with value:", value);
54 stringVariablesMap[varName] = std::move(value);
63 if (doubleObservablesMap.find(vname) == doubleObservablesMap.end()) {
64 doubleObservablesMap[vname] = value;
65 log->
info(2,
FUNCTION_NAME,
"Creating double variable ", vname,
" with value ", value,
", sum is now:",
66 doubleObservablesMap[vname]);
69 doubleObservablesMap[vname] += value;
70 log->
info(2,
FUNCTION_NAME,
"Accumulating double variable ", vname,
" with value ", value,
", sum is now:",
71 doubleObservablesMap[vname]);
80 std::string identifierString;
81 for (
size_t i = 0; i < gidentity.size() - 1; i++) {
82 identifierString += gidentity[i].getName() +
"->" + std::to_string(gidentity[i].getValue()) +
", ";
84 identifierString += gidentity.back().getName() +
"->" + std::to_string(gidentity.back().getValue());
85 return identifierString;
std::shared_ptr< GLogger > log
std::vector< GIdentifier > getGID() const
void info(int level, Args &&... args) const
void includeVariable(const std::string &varName, double var)
Store/overwrite a numeric "true" observable for this hit.
void accumulateVariable(const std::string &vname, double value)
Accumulate a numeric observable into this object (run-level integration).
GTrueInfoData(const std::shared_ptr< GOptions > &gopts, const GHit *ghit)
Construct true-hit data by copying identity from a hit.
std::string getIdentityString() const
Return a human-readable identity string for debugging and labeling.
Container for "true" (simulation-level) observables associated with one hit.
constexpr const char * GTRUEDATA_LOGGER
Logger domain name used by GTrueInfoData (controls verbosity/category in GLogger).