2 #include "otsdaq-core/ConfigurationPluginDataFormats/DetectorTable.h"
3 #include "otsdaq-coreMacros/TablePluginMacros.h"
8 DetectorConfiguration::DetectorConfiguration(
void) :
TableBase(
"DetectorConfiguration")
29 DetectorConfiguration::~DetectorConfiguration(
void) {}
36 detectorTypes_.clear();
37 std::string tmpDetectorID;
38 std::map<std::string, bool> detectorTypes;
39 for(
unsigned int row = 0; row < TableBase::activeTableView_->getNumberOfRows(); row++)
41 TableBase::activeTableView_->getValue(tmpDetectorID, row, DetectorID);
42 nameToRow_[tmpDetectorID] = row;
43 detectorTypes[TableBase::getView().getDataView()[row][DetectorType]] =
true;
44 detectorIDs_.push_back(tmpDetectorID);
46 for(
auto& it : detectorTypes)
47 detectorTypes_.push_back(it.first);
51 const std::vector<std::string>& DetectorConfiguration::getDetectorIDs()
const
57 const std::vector<std::string>& DetectorConfiguration::getDetectorTypes()
const
59 return detectorTypes_;
63 const std::string& DetectorConfiguration::getDetectorType(
64 const std::string& detectorID)
const
66 return TableBase::getView()
67 .getDataView()[nameToRow_.find(detectorID)->second][DetectorType];
71 const std::string& DetectorConfiguration::getDetectorStatus(
72 const std::string& detectorID)
const
74 return TableBase::getView()
75 .getDataView()[nameToRow_.find(detectorID)->second][DetectorStatus];