$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #include <iostream> 00002 #include "otsdaq-core/ConfigurationPluginDataFormats/MaskTable.h" 00003 #include "otsdaq-coreMacros/TablePluginMacros.h" 00004 00005 using namespace ots; 00006 00007 //============================================================================== 00008 MaskConfiguration::MaskConfiguration(void) : TableBase("MaskConfiguration") 00009 { 00011 // WARNING: the names and the order MUST match the ones in the enum // 00013 // MaskConfigurationInfo.xml 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"> 00017 // <CONFIGURATION Name="MaskConfiguration"> 00018 // <VIEW Name="MASK_CONFIGURATION" Type="File,Database,DatabaseTest"> 00019 // <COLUMN Name="DetectorID" StorageName="DETECTOR_ID" DataType="VARCHAR2" /> 00020 // <COLUMN Name="KillMask" StorageName="KILL_MASK" DataType="VARCHAR2" /> 00021 // </VIEW> 00022 // </CONFIGURATION> 00023 //</ROOT> 00024 } 00025 00026 //============================================================================== 00027 MaskConfiguration::~MaskConfiguration(void) {} 00028 00029 //============================================================================== 00030 void MaskConfiguration::init(ConfigurationManager* configManager) 00031 { 00032 std::string tmpDetectorID; 00033 for(unsigned int row = 0; row < TableBase::activeTableView_->getNumberOfRows(); row++) 00034 { 00035 TableBase::activeTableView_->getValue(tmpDetectorID, row, DetectorID); 00036 nameToRow_[tmpDetectorID] = row; 00037 } 00038 } 00039 00040 //============================================================================== 00041 const std::string& MaskConfiguration::getROCMask(std::string rocName) const 00042 { 00043 // FIXME This check should be removed when you are sure you don't have inconsistencies 00044 // between configurations 00045 if(nameToRow_.find(rocName) == nameToRow_.end()) 00046 { 00047 std::cout << __COUT_HDR_FL__ << "ROC named " << rocName 00048 << " doesn't exist in the mask configuration." << std::endl; 00049 assert(0); 00050 } 00051 return TableBase::getView().getDataView()[nameToRow_.find(rocName)->second][KillMask]; 00052 } 00053 00054 DEFINE_OTS_CONFIGURATION(MaskConfiguration)