LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lariov::CalibrationExtraInfo Class Reference

#include "CalibrationExtraInfo.h"

Public Member Functions

 CalibrationExtraInfo (std::string const &name)
 
virtual ~CalibrationExtraInfo ()=default
 
std::string const & GetName () const
 
void AddOrReplaceBoolData (std::string const &label, bool const data)
 
void AddOrReplaceIntData (std::string const &label, int const data)
 
void AddOrReplaceVecIntData (std::string const &label, std::vector< int > const &data)
 
void AddOrReplaceFloatData (std::string const &label, float const data)
 
void AddOrReplaceVecFloatData (std::string const &label, std::vector< float > const &data)
 
void AddOrReplaceStringData (std::string const &label, std::string const &data)
 
bool GetBoolData (std::string const &label) const
 
int GetIntData (std::string const &label) const
 
std::vector< int > const & GetVecIntData (std::string const &label) const
 
float GetFloatData (std::string const &label) const
 
std::vector< float > const & GetVecFloatData (std::string const &label) const
 
std::string const & GetStringData (std::string const &label) const
 
void ClearDataByLabel (std::string const &label)
 
void ClearAllData ()
 

Private Attributes

std::string fName
 
std::map< std::string, bool > fBoolData
 
std::map< std::string, int > fIntData
 
std::map< std::string, std::vector< int > > fVecIntData
 
std::map< std::string, float > fFloatData
 
std::map< std::string, std::vector< float > > fVecFloatData
 
std::map< std::string, std::string > fStringData
 

Detailed Description

Definition at line 10 of file CalibrationExtraInfo.h.

Constructor & Destructor Documentation

lariov::CalibrationExtraInfo::CalibrationExtraInfo ( std::string const &  name)
inline

Definition at line 13 of file CalibrationExtraInfo.h.

References ~CalibrationExtraInfo().

13 : fName(name) {}
virtual lariov::CalibrationExtraInfo::~CalibrationExtraInfo ( )
virtualdefault

Referenced by CalibrationExtraInfo().

Member Function Documentation

void lariov::CalibrationExtraInfo::AddOrReplaceBoolData ( std::string const &  label,
bool const  data 
)

Definition at line 6 of file CalibrationExtraInfo.cxx.

References fBoolData.

Referenced by GetName().

7  {
8  fBoolData[label] = data;
9  }
std::map< std::string, bool > fBoolData
void lariov::CalibrationExtraInfo::AddOrReplaceFloatData ( std::string const &  label,
float const  data 
)

Definition at line 22 of file CalibrationExtraInfo.cxx.

References fFloatData.

Referenced by GetName().

23  {
24  fFloatData[label] = data;
25  }
std::map< std::string, float > fFloatData
void lariov::CalibrationExtraInfo::AddOrReplaceIntData ( std::string const &  label,
int const  data 
)

Definition at line 11 of file CalibrationExtraInfo.cxx.

References fIntData.

Referenced by GetName().

12  {
13  fIntData[label] = data;
14  }
std::map< std::string, int > fIntData
void lariov::CalibrationExtraInfo::AddOrReplaceStringData ( std::string const &  label,
std::string const &  data 
)

Definition at line 33 of file CalibrationExtraInfo.cxx.

References fStringData.

Referenced by GetName().

35  {
36  fStringData[label] = data;
37  }
std::map< std::string, std::string > fStringData
void lariov::CalibrationExtraInfo::AddOrReplaceVecFloatData ( std::string const &  label,
std::vector< float > const &  data 
)

Definition at line 27 of file CalibrationExtraInfo.cxx.

References fVecFloatData.

Referenced by GetName().

29  {
30  fVecFloatData[label] = data;
31  }
std::map< std::string, std::vector< float > > fVecFloatData
void lariov::CalibrationExtraInfo::AddOrReplaceVecIntData ( std::string const &  label,
std::vector< int > const &  data 
)

Definition at line 16 of file CalibrationExtraInfo.cxx.

References fVecIntData.

Referenced by GetName().

18  {
19  fVecIntData[label] = data;
20  }
std::map< std::string, std::vector< int > > fVecIntData
void lariov::CalibrationExtraInfo::ClearAllData ( )

Definition at line 56 of file CalibrationExtraInfo.cxx.

References fBoolData, fFloatData, fIntData, fStringData, fVecFloatData, and fVecIntData.

Referenced by GetName().

57  {
58  fBoolData.clear();
59  fIntData.clear();
60  fVecIntData.clear();
61  fFloatData.clear();
62  fVecFloatData.clear();
63  fStringData.clear();
64  }
std::map< std::string, std::vector< float > > fVecFloatData
std::map< std::string, std::string > fStringData
std::map< std::string, int > fIntData
std::map< std::string, bool > fBoolData
std::map< std::string, std::vector< int > > fVecIntData
std::map< std::string, float > fFloatData
void lariov::CalibrationExtraInfo::ClearDataByLabel ( std::string const &  label)

Definition at line 39 of file CalibrationExtraInfo.cxx.

References fBoolData, fFloatData, fIntData, fStringData, fVecFloatData, and fVecIntData.

Referenced by GetName().

40  {
41  unsigned int n_erased = 0;
42 
43  n_erased += fBoolData.erase(label);
44  n_erased += fIntData.erase(label);
45  n_erased += fVecIntData.erase(label);
46  n_erased += fFloatData.erase(label);
47  n_erased += fVecFloatData.erase(label);
48  n_erased += fStringData.erase(label);
49 
50  if (n_erased > 1) {
51  std::cout << "INFO(CalibrationExtraInfo): Erased more than one entry with label " << label
52  << ". Recommend that you do not use identical labels" << std::endl;
53  }
54  }
std::map< std::string, std::vector< float > > fVecFloatData
std::map< std::string, std::string > fStringData
std::map< std::string, int > fIntData
std::map< std::string, bool > fBoolData
std::map< std::string, std::vector< int > > fVecIntData
std::map< std::string, float > fFloatData
bool lariov::CalibrationExtraInfo::GetBoolData ( std::string const &  label) const

Definition at line 66 of file CalibrationExtraInfo.cxx.

References fBoolData, and fName.

Referenced by GetName().

67  {
68  if (fBoolData.find(label) != fBoolData.end()) { return fBoolData.at(label); }
69 
70  throw IOVDataError("CalibrationExtraInfo: Could not find extra bool data " + label +
71  " for calibration " + fName);
72  }
std::map< std::string, bool > fBoolData
float lariov::CalibrationExtraInfo::GetFloatData ( std::string const &  label) const

Definition at line 90 of file CalibrationExtraInfo.cxx.

References fFloatData, and fName.

Referenced by GetName().

91  {
92  if (fFloatData.find(label) != fFloatData.end()) { return fFloatData.at(label); }
93 
94  throw IOVDataError("CalibrationExtraInfo: Could not find extra float data " + label +
95  " for calibration " + fName);
96  }
std::map< std::string, float > fFloatData
int lariov::CalibrationExtraInfo::GetIntData ( std::string const &  label) const

Definition at line 74 of file CalibrationExtraInfo.cxx.

References fIntData, and fName.

Referenced by GetName().

75  {
76  if (fIntData.find(label) != fIntData.end()) { return fIntData.at(label); }
77 
78  throw IOVDataError("CalibrationExtraInfo: Could not find extra int data " + label +
79  " for calibration " + fName);
80  }
std::map< std::string, int > fIntData
std::string const & lariov::CalibrationExtraInfo::GetStringData ( std::string const &  label) const

Definition at line 106 of file CalibrationExtraInfo.cxx.

References fName, and fStringData.

Referenced by GetName().

107  {
108  if (fStringData.find(label) != fStringData.end()) { return fStringData.at(label); }
109 
110  throw IOVDataError("CalibrationExtraInfo: Could not find extra string data " + label +
111  " for calibration " + fName);
112  }
std::map< std::string, std::string > fStringData
std::vector< float > const & lariov::CalibrationExtraInfo::GetVecFloatData ( std::string const &  label) const

Definition at line 98 of file CalibrationExtraInfo.cxx.

References fName, and fVecFloatData.

Referenced by GetName().

99  {
100  if (fVecFloatData.find(label) != fVecFloatData.end()) { return fVecFloatData.at(label); }
101 
102  throw IOVDataError("CalibrationExtraInfo: Could not find extra vector float data " + label +
103  " for calibration " + fName);
104  }
std::map< std::string, std::vector< float > > fVecFloatData
std::vector< int > const & lariov::CalibrationExtraInfo::GetVecIntData ( std::string const &  label) const

Definition at line 82 of file CalibrationExtraInfo.cxx.

References fName, and fVecIntData.

Referenced by GetName().

83  {
84  if (fVecIntData.find(label) != fVecIntData.end()) { return fVecIntData.at(label); }
85 
86  throw IOVDataError("CalibrationExtraInfo: Could not find extra vector int data " + label +
87  " for calibration " + fName);
88  }
std::map< std::string, std::vector< int > > fVecIntData

Member Data Documentation

std::map<std::string, bool> lariov::CalibrationExtraInfo::fBoolData
private
std::map<std::string, float> lariov::CalibrationExtraInfo::fFloatData
private
std::map<std::string, int> lariov::CalibrationExtraInfo::fIntData
private
std::string lariov::CalibrationExtraInfo::fName
private
std::map<std::string, std::string> lariov::CalibrationExtraInfo::fStringData
private
std::map<std::string, std::vector<float> > lariov::CalibrationExtraInfo::fVecFloatData
private
std::map<std::string, std::vector<int> > lariov::CalibrationExtraInfo::fVecIntData
private

The documentation for this class was generated from the following files: