2 #include "otsdaq-core/ConfigurationPluginDataFormats/DetectorToFETable.h"
3 #include "otsdaq-coreMacros/TablePluginMacros.h"
8 DetectorToFEConfiguration::DetectorToFEConfiguration(
void)
37 DetectorToFEConfiguration::~DetectorToFEConfiguration(
void) {}
42 std::string tmpDetectorName;
43 for(
unsigned int row = 0; row < TableBase::activeTableView_->getNumberOfRows(); row++)
45 TableBase::activeTableView_->getValue(tmpDetectorName, row, DetectorID);
46 nameToInfoMap_[tmpDetectorName] = DetectorInfo();
47 DetectorInfo& aDetectorInfo = nameToInfoMap_[tmpDetectorName];
48 TableBase::activeTableView_->getValue(
49 aDetectorInfo.theFEWriterID_, row, FEWriterID);
50 TableBase::activeTableView_->getValue(
51 aDetectorInfo.theFEWriterChannel_, row, FEWriterChannel);
52 TableBase::activeTableView_->getValue(
53 aDetectorInfo.theFEWriterDetectorAddress_, row, FEWriterDetectorAddress);
54 TableBase::activeTableView_->getValue(
55 aDetectorInfo.theFEReaderID_, row, FEReaderID);
56 TableBase::activeTableView_->getValue(
57 aDetectorInfo.theFEReaderChannel_, row, FEReaderChannel);
58 TableBase::activeTableView_->getValue(
59 aDetectorInfo.theFEReaderDetectorAddress_, row, FEReaderDetectorAddress);
64 std::vector<std::string> DetectorToFEConfiguration::getFEWriterDetectorList(
65 std::string interfaceID)
const
67 std::string tmpDetectorID;
68 std::string tmpFEWriterID;
69 std::vector<std::string> list;
70 for(
unsigned int row = 0; row < TableBase::activeTableView_->getNumberOfRows(); row++)
72 TableBase::activeTableView_->getValue(tmpFEWriterID, row, FEWriterID);
73 if(tmpFEWriterID == interfaceID)
75 TableBase::activeTableView_->getValue(tmpDetectorID, row, DetectorID);
76 list.push_back(tmpDetectorID);
83 std::vector<std::string> DetectorToFEConfiguration::getFEReaderDetectorList(
84 std::string interfaceID)
const
86 std::string tmpDetectorID;
87 std::string tmpFEReaderID;
88 std::vector<std::string> list;
89 for(
unsigned int row = 0; row < TableBase::activeTableView_->getNumberOfRows(); row++)
91 TableBase::activeTableView_->getValue(tmpFEReaderID, row, FEReaderID);
92 if(tmpFEReaderID == interfaceID)
94 TableBase::activeTableView_->getValue(tmpDetectorID, row, DetectorID);
95 list.push_back(tmpDetectorID);
102 unsigned int DetectorToFEConfiguration::getFEWriterChannel(
103 const std::string& detectorID)
const
105 return nameToInfoMap_.find(detectorID)->second.theFEWriterChannel_;
109 unsigned int DetectorToFEConfiguration::getFEWriterDetectorAddress(
110 const std::string& detectorID)
const
112 return nameToInfoMap_.find(detectorID)->second.theFEWriterDetectorAddress_;
116 unsigned int DetectorToFEConfiguration::getFEReaderChannel(
117 const std::string& detectorID)
const
119 return nameToInfoMap_.find(detectorID)->second.theFEReaderChannel_;