00001 #include "otsdaq-core/ConfigurationPluginDataFormats/DQMHistosConsumerConfiguration.h"
00002 #include "otsdaq-core/Macros/ConfigurationPluginMacros.h"
00003
00004 #include <iostream>
00005
00006 using namespace ots;
00007
00008
00009 DQMHistosConsumerConfiguration::DQMHistosConsumerConfiguration(void)
00010 : ConfigurationBase("DQMHistosConsumerConfiguration")
00011 {
00013
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 }
00029
00030
00031 DQMHistosConsumerConfiguration::~DQMHistosConsumerConfiguration(void)
00032 {}
00033
00034
00035 void DQMHistosConsumerConfiguration::init(ConfigurationManager *configManager)
00036 {
00037 std::string processorUID;
00038 for(unsigned int row = 0; row < ConfigurationBase::activeConfigurationView_->getNumberOfRows(); row++)
00039 {
00040 ConfigurationBase::activeConfigurationView_->getValue(processorUID, row, ProcessorID);
00041 processorIDToRowMap_[processorUID] = row;
00042 }
00043 }
00044
00045
00046 std::vector<std::string> DQMHistosConsumerConfiguration::getProcessorIDList(void) const
00047 {
00048 std::vector<std::string> list;
00049 for(auto& it: processorIDToRowMap_)
00050 list.push_back(it.first);
00051 return list;
00052 }
00053
00054
00055 std::string DQMHistosConsumerConfiguration::getFilePath(std::string processorUID) const
00056 {
00057 check(processorUID);
00058 std::string val;
00059 ConfigurationBase::activeConfigurationView_->getValue(val, processorIDToRowMap_.find(processorUID)->second, FilePath);
00060 return val;
00061 }
00062
00063
00064 std::string DQMHistosConsumerConfiguration::getRadixFileName (std::string processorUID) const
00065 {
00066 check(processorUID);
00067 std::string val;
00068 ConfigurationBase::activeConfigurationView_->getValue(val, processorIDToRowMap_.find(processorUID)->second, RadixFileName);
00069 return val;
00070 }
00071
00072
00073 bool DQMHistosConsumerConfiguration::getSaveFile (std::string processorUID) const
00074 {
00075 check(processorUID);
00076 bool val;
00077 ConfigurationBase::activeConfigurationView_->getValue(val, processorIDToRowMap_.find(processorUID)->second, SaveFile);
00078 return val;
00079 }
00080
00081
00082 void DQMHistosConsumerConfiguration::check(std::string processorUID) const
00083 {
00084 if(processorIDToRowMap_.find(processorUID) == processorIDToRowMap_.end())
00085 {
00086 std::cout << __COUT_HDR_FL__ << "Couldn't find processor " << processorUID << " in the UDPDataStreamerConsumerConfiguration!" << std::endl;
00087 assert(0);
00088 }
00089 }
00090
00091 DEFINE_OTS_CONFIGURATION(DQMHistosConsumerConfiguration)