181 return doubleObservablesMap;
194 return stringVariablesMap;
217 static std::unique_ptr<GTrueInfoData>
create(
const std::shared_ptr<GOptions>& gopts) {
219 auto true_info_data = std::make_unique<GTrueInfoData>(gopts, hit);
220 auto counter = globalTrueInfoDataCounter.fetch_add(1, std::memory_order_relaxed);
222 true_info_data->includeVariable(
"totalEDeposited", counter * 0.1);
223 true_info_data->includeVariable(
"avgTime", counter * 1.0);
224 true_info_data->includeVariable(
"avgx", counter * 0.01);
225 true_info_data->includeVariable(
"avgy", counter * 0.02);
226 true_info_data->includeVariable(
"avgz", counter * 0.03);
227 true_info_data->includeVariable(
"hitn", counter);
229 return true_info_data;
238 [[nodiscard]]
inline const std::vector<GIdentifier>&
getIdentity()
const {
return gidentity; }
251 std::map<std::string, double> doubleObservablesMap;
259 std::map<std::string, std::string> stringVariablesMap;
268 std::vector<GIdentifier> gidentity;
276 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.
const std::vector< GIdentifier > & getIdentity() const
Returns the identifier vectory.
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)
constexpr const char * GTRUEDATA_LOGGER
Logger domain name used by GTrueInfoData.
GOptions defineOptions()
Defines the options subtree used by the true-data logger domain.