gdata
Loading...
Searching...
No Matches
gTrueInfoData.cc
Go to the documentation of this file.
1
6#include "gTrueInfoData.h"
7#include <string>
8#include <utility>
9
10std::atomic<int> GTrueInfoData::globalTrueInfoDataCounter{0};
11
12GTrueInfoData::GTrueInfoData(const std::shared_ptr<GOptions>& gopts, const GHit* ghit) : GBase(gopts, GTRUEDATA_LOGGER) {
13 gidentity = ghit->getGID();
14}
15
16void GTrueInfoData::includeVariable(const std::string& varName, double var) {
17 log->info(2, " including ", varName, " in trueInfoDoublesVariablesMap.");
18 trueInfoDoublesVariablesMap[varName] = var;
19}
20
21void GTrueInfoData::includeVariable(const std::string& varName, std::string var) {
22 log->info(2, " including ", varName, " in trueInfoStringVariablesMap.");
23 trueInfoStringVariablesMap[varName] = std::move(var);
24}
25
27 std::string identifierString;
28 for (size_t i = 0; i < gidentity.size() - 1; i++) { identifierString += gidentity[i].getName() + "->" + std::to_string(gidentity[i].getValue()) + ", "; }
29 identifierString += gidentity.back().getName() + "->" + std::to_string(gidentity.back().getValue());
30 return identifierString;
31}
void includeVariable(const std::string &varName, double var)
Includes a double variable in the true hit data.
GTrueInfoData(const std::shared_ptr< GOptions > &gopts, const GHit *ghit)
Constructs a GTrueInfoData object.
std::string getIdentityString() const
Returns a string representation of the identity.
Defines the GTrueInfoData class which holds true hit data.
constexpr const char * GTRUEDATA_LOGGER