1 #include "otsdaq-core/ConfigurationPluginDataFormats/DetectorConfiguration.h"
2 #include "otsdaq-core/Macros/ConfigurationPluginMacros.h"
9 DetectorConfiguration::DetectorConfiguration(
void)
30 DetectorConfiguration::~DetectorConfiguration(
void)
37 detectorIDs_ .clear();
38 detectorTypes_ .clear();
39 std::string tmpDetectorID;
40 std::map<std::string,bool> detectorTypes;
41 for(
unsigned int row=0; row<ConfigurationBase::activeConfigurationView_->getNumberOfRows(); row++)
43 ConfigurationBase::activeConfigurationView_->getValue(tmpDetectorID, row, DetectorID);
44 nameToRow_[tmpDetectorID] = row;
45 detectorTypes[ConfigurationBase::getView().getDataView()[row][DetectorType]] =
true;
46 detectorIDs_.push_back(tmpDetectorID);
48 for(
auto& it: detectorTypes)
49 detectorTypes_.push_back(it.first);
53 const std::vector<std::string>& DetectorConfiguration::getDetectorIDs()
const
59 const std::vector<std::string>& DetectorConfiguration::getDetectorTypes()
const
61 return detectorTypes_;
65 const std::string& DetectorConfiguration::getDetectorType(
const std::string& detectorID)
const
67 return ConfigurationBase::getView().getDataView()[nameToRow_.find(detectorID)->second][DetectorType];
71 const std::string& DetectorConfiguration::getDetectorStatus(
const std::string& detectorID)
const
73 return ConfigurationBase::getView().getDataView()[nameToRow_.find(detectorID)->second][DetectorStatus];