00001 #include "otsdaq-core/ConfigurationPluginDataFormats/MaskConfiguration.h"
00002 #include "otsdaq-core/Macros/ConfigurationPluginMacros.h"
00003
00004 #include <iostream>
00005
00006 using namespace ots;
00007
00008
00009 MaskConfiguration::MaskConfiguration(void)
00010 : ConfigurationBase("MaskConfiguration")
00011 {
00013
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 }
00026
00027
00028 MaskConfiguration::~MaskConfiguration(void)
00029 {
00030 }
00031
00032
00033 void MaskConfiguration::init(ConfigurationManager *configManager)
00034 {
00035 std::string tmpDetectorID;
00036 for(unsigned int row=0; row<ConfigurationBase::activeConfigurationView_->getNumberOfRows(); row++)
00037 {
00038 ConfigurationBase::activeConfigurationView_->getValue(tmpDetectorID,row,DetectorID);
00039 nameToRow_[tmpDetectorID] = row;
00040 }
00041 }
00042
00043
00044 const std::string& MaskConfiguration::getROCMask(std::string rocName) const
00045 {
00046
00047 if(nameToRow_.find(rocName) == nameToRow_.end())
00048 {
00049 std::cout << __COUT_HDR_FL__ << "ROC named " << rocName << " doesn't exist in the mask configuration." << std::endl;
00050 assert(0);
00051 }
00052 return ConfigurationBase::getView().getDataView()[nameToRow_.find(rocName)->second][KillMask];
00053 }
00054
00055 DEFINE_OTS_CONFIGURATION(MaskConfiguration)