201 return doubleObservablesMap;
214 return stringVariablesMap;
237 static std::unique_ptr<GTrueInfoData>
create(
const std::shared_ptr<GOptions>& gopts) {
239 auto true_info_data = std::make_unique<GTrueInfoData>(gopts, hit);
240 auto counter = globalTrueInfoDataCounter.fetch_add(1, std::memory_order_relaxed);
242 true_info_data->includeVariable(
"totalEDeposited", counter * 0.1);
243 true_info_data->includeVariable(
"avgTime", counter * 1.0);
244 true_info_data->includeVariable(
"avgx", counter * 0.01);
245 true_info_data->includeVariable(
"avgy", counter * 0.02);
246 true_info_data->includeVariable(
"avgz", counter * 0.03);
247 true_info_data->includeVariable(
"hitn", counter);
249 return true_info_data;
263 std::map<std::string, double> doubleObservablesMap;
271 std::map<std::string, std::string> stringVariablesMap;
280 std::vector<GIdentifier> gidentity;
288 static std::atomic<int> globalTrueInfoDataCounter;
static GHit * create(const std::shared_ptr< GOptions > &gopts)
Stores simulation-level observables for one hit.
void includeVariable(const std::string &varName, double var)
Stores or overwrites one numeric 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.
GTrueInfoData(const std::shared_ptr< GOptions > &gopts, const GHit *ghit)
Constructs the object and copies the hit identity from the source hit.
static std::unique_ptr< GTrueInfoData > create(const std::shared_ptr< GOptions > &gopts)
Creates deterministic example data for tests and examples.
std::map< std::string, std::string > getStringVariablesMap() const
Returns a copy of the string truth observables.
friend std::ostream & operator<<(std::ostream &os, const GTrueInfoData &data)
std::string getIdentityString() const
Builds a readable identity string from the stored hit identifiers.
constexpr const char * GTRUEDATA_LOGGER
Logger domain name used by GTrueInfoData.
GOptions defineOptions()
Defines the options subtree used by the true-data logger domain.