$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #include <iostream> 00002 #include "otsdaq-core/ConfigurationPluginDataFormats/DQMHistosConsumerTable.h" 00003 #include "otsdaq-coreMacros/TablePluginMacros.h" 00004 00005 using namespace ots; 00006 00007 //============================================================================== 00008 DQMHistosConsumerConfiguration::DQMHistosConsumerConfiguration(void) 00009 : TableBase("DQMHistosConsumerConfiguration") 00010 { 00012 // WARNING: the names and the order MUST match the ones in the enum // 00014 // <?xml version="1.0" encoding="UTF-8" standalone="no" ?> 00015 // <ROOT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 00016 // xsi:noNamespaceSchemaLocation="TableInfo.xsd"> <CONFIGURATION 00017 // Name="DQMHistosConsumerConfiguration"> <VIEW 00018 // Name="DQM_HISTOS_CONSUMER_CONFIGURATION" Type="File,Database,DatabaseTest"> 00019 // <COLUMN Name="ProcessorID" StorageName="PROCESSOR_ID" 00020 // DataType="VARCHAR2"/> <COLUMN Name="FilePath" StorageName="FILE_PATH" 00021 // DataType="VARCHAR2"/> <COLUMN Name="RadixFileName" 00022 // StorageName="RADIX_FILE_NAME" DataType="VARCHAR2"/> 00023 // <COLUMN Name="SaveFile" StorageName="SAVE_FILE" DataType="VARCHAR2"/> 00024 // </VIEW> 00025 // </CONFIGURATION> 00026 // </ROOT> 00027 } 00028 00029 //============================================================================== 00030 DQMHistosConsumerConfiguration::~DQMHistosConsumerConfiguration(void) {} 00031 00032 //============================================================================== 00033 void DQMHistosConsumerConfiguration::init(ConfigurationManager* configManager) 00034 { 00035 std::string processorUID; 00036 for(unsigned int row = 0; row < TableBase::activeTableView_->getNumberOfRows(); row++) 00037 { 00038 TableBase::activeTableView_->getValue(processorUID, row, ProcessorID); 00039 processorIDToRowMap_[processorUID] = row; 00040 } 00041 } 00042 00043 //============================================================================== 00044 std::vector<std::string> DQMHistosConsumerConfiguration::getProcessorIDList(void) const 00045 { 00046 std::vector<std::string> list; 00047 for(auto& it : processorIDToRowMap_) 00048 list.push_back(it.first); 00049 return list; 00050 } 00051 00052 //============================================================================== 00053 std::string DQMHistosConsumerConfiguration::getFilePath(std::string processorUID) const 00054 { 00055 check(processorUID); 00056 std::string val; 00057 TableBase::activeTableView_->getValue( 00058 val, processorIDToRowMap_.find(processorUID)->second, FilePath); 00059 return val; 00060 } 00061 00062 //============================================================================== 00063 std::string DQMHistosConsumerConfiguration::getRadixFileName( 00064 std::string processorUID) const 00065 { 00066 check(processorUID); 00067 std::string val; 00068 TableBase::activeTableView_->getValue( 00069 val, processorIDToRowMap_.find(processorUID)->second, RadixFileName); 00070 return val; 00071 } 00072 00073 //============================================================================== 00074 bool DQMHistosConsumerConfiguration::getSaveFile(std::string processorUID) const 00075 { 00076 check(processorUID); 00077 bool val; 00078 TableBase::activeTableView_->getValue( 00079 val, processorIDToRowMap_.find(processorUID)->second, SaveFile); 00080 return val; 00081 } 00082 00083 //============================================================================== 00084 void DQMHistosConsumerConfiguration::check(std::string processorUID) const 00085 { 00086 if(processorIDToRowMap_.find(processorUID) == processorIDToRowMap_.end()) 00087 { 00088 std::cout << __COUT_HDR_FL__ << "Couldn't find processor " << processorUID 00089 << " in the UDPDataStreamerConsumerConfiguration!" << std::endl; 00090 assert(0); 00091 } 00092 } 00093 00094 DEFINE_OTS_CONFIGURATION(DQMHistosConsumerConfiguration)