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