$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #include <iostream> 00002 #include "otsdaq-core/Macros/TablePluginMacros.h" 00003 #include "otsdaq-core/TablePluginDataFormats/ROCToFETable.h" 00004 00005 using namespace ots; 00006 00007 const std::string ROCToFEConfiguration::staticTableName_ = "ROCToFEConfiguration"; 00008 //============================================================================== 00009 ROCToFEConfiguration::ROCToFEConfiguration(void) 00010 : TableBase(ROCToFEConfiguration::staticTableName_) 00011 { 00013 // WARNING: the names and the order MUST match the ones in the enum // 00015 // ROCToFEConfigurationInfo.xml 00016 //<?xml version="1.0" encoding="UTF-8" standalone="no" ?> 00017 //<ROOT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 00018 // xsi:noNamespaceSchemaLocation="TableInfo.xsd"> 00019 // <CONFIGURATION Name="ROCToFEConfiguration"> 00020 // <VIEW Name="ROC_TO_FE_CONFIGURATION" Type="File,Database,DatabaseTest"> 00021 // <COLUMN Name="DetectorID" StorageName="DETECTOR_ID" 00022 // DataType="VARCHAR2" /> <COLUMN Name="FEWName" StorageName="FEW_NAME" 00023 // DataType="NUMBER" /> <COLUMN Name="FEWChannel" StorageName="FEW_CHANNEL" 00024 // DataType="NUMBER" /> <COLUMN Name="FEWROCAddress" 00025 // StorageName="FEW_ROC_ADDRESS" DataType="NUMBER" /> <COLUMN Name="FERName" 00026 // StorageName="FER_NAME" DataType="NUMBER" /> <COLUMN Name="FERChannel" 00027 // StorageName="FER_CHANNEL" DataType="NUMBER" /> <COLUMN 00028 // Name="FERROCAddress" StorageName="FER_ROC_ADDRESS" DataType="NUMBER" /> 00029 // </VIEW> 00030 // </CONFIGURATION> 00031 //</ROOT> 00032 } 00033 00034 //============================================================================== 00035 ROCToFEConfiguration::~ROCToFEConfiguration(void) {} 00036 00037 //============================================================================== 00038 void ROCToFEConfiguration::init(ConfigurationManager* configManager) 00039 { 00040 std::string tmpDetectorID; 00041 for(unsigned int row = 0; row < TableBase::activeTableView_->getNumberOfRows(); row++) 00042 { 00043 TableBase::activeTableView_->getValue(tmpDetectorID, row, DetectorID); 00044 nameToInfoMap_[tmpDetectorID] = ROCInfo(); 00045 ROCInfo& aROCInfo = nameToInfoMap_[tmpDetectorID]; 00046 TableBase::activeTableView_->getValue(aROCInfo.theFEWName_, row, FEWName); 00047 TableBase::activeTableView_->getValue(aROCInfo.theFEWChannel_, row, FEWChannel); 00048 TableBase::activeTableView_->getValue( 00049 aROCInfo.theFEWROCAddress_, row, FEWROCAddress); 00050 TableBase::activeTableView_->getValue(aROCInfo.theFERName_, row, FERName); 00051 TableBase::activeTableView_->getValue(aROCInfo.theFERChannel_, row, FEWChannel); 00052 TableBase::activeTableView_->getValue( 00053 aROCInfo.theFERROCAddress_, row, FERROCAddress); 00054 } 00055 } 00056 00057 //============================================================================== 00058 std::vector<std::string> ROCToFEConfiguration::getFEWROCsList(std::string fECNumber) const 00059 { 00060 std::string tmpDetectorID; 00061 std::string tmpFEWName; 00062 std::vector<std::string> list; 00063 for(unsigned int row = 0; row < TableBase::activeTableView_->getNumberOfRows(); row++) 00064 { 00065 TableBase::activeTableView_->getValue(tmpFEWName, row, FEWName); 00066 if(tmpFEWName == fECNumber) 00067 { 00068 TableBase::activeTableView_->getValue(tmpDetectorID, row, DetectorID); 00069 list.push_back(tmpDetectorID); 00070 } 00071 } 00072 return list; 00073 } 00074 00075 //============================================================================== 00076 std::vector<std::string> ROCToFEConfiguration::getFERROCsList(std::string fEDNumber) const 00077 { 00078 std::string tmpDetectorID; 00079 std::string tmpFERName; 00080 std::vector<std::string> list; 00081 for(unsigned int row = 0; row < TableBase::activeTableView_->getNumberOfRows(); row++) 00082 { 00083 TableBase::activeTableView_->getValue(tmpFERName, row, FERName); 00084 if(tmpFERName == fEDNumber) 00085 { 00086 TableBase::activeTableView_->getValue(tmpDetectorID, row, DetectorID); 00087 list.push_back(tmpDetectorID); 00088 } 00089 } 00090 return list; 00091 } 00092 00093 //============================================================================== 00094 unsigned int ROCToFEConfiguration::getFEWChannel(const std::string& rOCName) const 00095 { 00096 return nameToInfoMap_.find(rOCName)->second.theFEWChannel_; 00097 } 00098 00099 //============================================================================== 00100 unsigned int ROCToFEConfiguration::getFEWROCAddress(const std::string& rOCName) const 00101 { 00102 return nameToInfoMap_.find(rOCName)->second.theFEWROCAddress_; 00103 } 00104 00105 //============================================================================== 00106 unsigned int ROCToFEConfiguration::getFERChannel(const std::string& rOCName) const 00107 { 00108 return nameToInfoMap_.find(rOCName)->second.theFERChannel_; 00109 } 00110 00111 DEFINE_OTS_CONFIGURATION(ROCToFEConfiguration)