gdata
gDigitizedData.h
Go to the documentation of this file.
1 #ifndef GDIGITIZEDHIT_H
2 #define GDIGITIZEDHIT_H 1
3 
12 #include <string>
13 #include <map>
14 #include <vector>
15 #include "ghit.h"
16 #include "glogger.h"
17 
19 public:
25  GDigitizedData(GHit* ghit, const std::shared_ptr<GLogger>& logger);
26 
30  ~GDigitizedData() { log->debug(DESTRUCTOR, "GDigitizedData"); }
31 
36  std::string getIdentityString();
37 
38  // Public interface to add data to a hit:
39  void includeVariable(const std::string& vname, int value);
40  void includeVariable(const std::string& vname, double value);
41  // void includeVariable(std::string vname, std::vector<int> values);
42  // void includeVariable(std::string vname, std::vector<float> values);
43 
49  [[nodiscard]] std::map<std::string, int> getIntObservablesMap(int which) const;
50 
56  [[nodiscard]] std::map<std::string, float> getFltObservablesMap(int which) const;
57 
66 
67  int getIntObservable(std::string varName);
68  float getFltObservable(std::string varName);
69 
74  [[nodiscard]] inline std::map<std::string, std::vector<int>> getArrayIntObservablesMap() const {
75  return arrayIntObservablesMap;
76  }
77 
82  [[nodiscard]] inline std::map<std::string, std::vector<double>> getArrayFltObservablesMap() const {
83  return arrayDoubleObservablesMap;
84  }
85 
86 private:
87  std::map<std::string, int> intObservablesMap;
88  std::map<std::string, double> doubleObservablesMap;
89  std::map<std::string, std::vector<int>> arrayIntObservablesMap;
90  std::map<std::string, std::vector<double>> arrayDoubleObservablesMap;
91  std::vector<GIdentifier> gidentity;
92  [[nodiscard]] bool validVarName(const std::string& varName, int which) const;
93  std::shared_ptr<GLogger> log;
94 };
95 
96 #endif
GDigitizedData(GHit *ghit, const std::shared_ptr< GLogger > &logger)
Constructs a GDigitizedData object from a GHit.
std::map< std::string, std::vector< int > > getArrayIntObservablesMap() const
Returns the map of integer array observables.
std::map< std::string, float > getFltObservablesMap(int which) const
Returns the filtered map of float observables.
std::map< std::string, int > getIntObservablesMap(int which) const
Returns the filtered map of integer observables.
int getTimeAtElectronics()
Gets the time at electronics.
void includeVariable(const std::string &vname, int value)
float getFltObservable(std::string varName)
int getIntObservable(std::string varName)
std::string getIdentityString()
Returns a string representation of the hit identity.
~GDigitizedData()
Destructor for GDigitizedData.
std::map< std::string, std::vector< double > > getArrayFltObservablesMap() const
Returns the map of float array observables.