11 #include "xercesc/util/PlatformUtils.hpp"
12 using namespace XERCES_CPP_NAMESPACE;
26 using namespace edm::es;
30 baseRcd.get( baseSettings ) ;
33 if (objectKey.empty()) {
34 edm::LogInfo(
"L1-O2O: L1TMuonBarrelParamsOnlineProd" ) <<
"Key is empty, returning empty L1TMuonBarrelParams";
35 throw std::runtime_error(
"Empty objectKey");
39 std::string tscKey = objectKey.substr(0, objectKey.find(
":") );
40 std::string rsKey = objectKey.substr( objectKey.find(
":")+1, std::string::npos );
44 edm::LogInfo(
"L1-O2O: L1TMuonBarrelParamsOnlineProd" ) <<
"Producing L1TMuonBarrelParams with TSC key =" << tscKey <<
" and RS key = " << rsKey ;
49 std::vector< std::string > queryStrings ;
50 queryStrings.push_back(
"ALGO" ) ;
51 queryStrings.push_back(
"HW" ) ;
64 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
65 edm::LogError(
"L1-O2O" ) <<
"Cannot get BMTF_KEYS.{ALGO,HW}" ;
66 throw std::runtime_error(
"Broken key");
70 if( !queryResult.fillVariable(
"ALGO", algo_key) ) algo_key =
"";
71 if( !queryResult.fillVariable(
"HW", hw_key ) ) hw_key =
"";
75 queryStrings.clear() ;
76 queryStrings.push_back(
"MP7" ) ;
77 queryStrings.push_back(
"DAQTTC" ) ;
90 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
91 edm::LogError(
"L1-O2O" ) <<
"Cannot get BMTF_RS_KEYS.{MP7,DAQTTC}" ;
92 throw std::runtime_error(
"Broken key");
96 if( !queryResult.fillVariable(
"MP7", rs_mp7_key ) ) rs_mp7_key =
"";
97 if( !queryResult.fillVariable(
"DAQTTC", rs_amc13_key) ) rs_amc13_key =
"";
102 enum {kALGO=0, kRS, kHW, NUM_TYPES};
103 std::map<std::string,std::string>
payloads[NUM_TYPES];
106 queryStrings.clear();
107 queryStrings.push_back(
"CONF" );
118 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
119 edm::LogError(
"L1-O2O: L1TMuonBarrelParamsOnlineProd" ) <<
"Cannot get BMTF_ALGO.CONF for ID="<<algo_key;
120 throw std::runtime_error(
"Broken key");
124 if( !queryResult.fillVariable(
"CONF", xmlPayload ) ) xmlPayload =
"";
126 payloads[kALGO][algo_key] = xmlPayload;
137 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
138 edm::LogError(
"L1-O2O: L1TMuonBarrelParamsOnlineProd" ) <<
"Cannot get BMTF_HW.CONF for ID="<<hw_key;
139 throw std::runtime_error(
"Broken key");
143 if( !queryResult.fillVariable(
"CONF", xmlPayload ) ) xmlPayload =
"";
156 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
157 edm::LogError(
"L1-O2O: L1TMuonBarrelParamsOnlineProd" ) <<
"Cannot get BMTF_RS.CONF for ID="<<rs_mp7_key;
158 throw std::runtime_error(
"Broken key");
162 if( !queryResult.fillVariable(
"CONF", xmlPayload ) ) xmlPayload =
"";
164 payloads[kRS][rs_mp7_key] = xmlPayload;
175 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
176 edm::LogError(
"L1-O2O: L1TMuonBarrelParamsOnlineProd" ) <<
"Cannot get BMTF_RS.CONF for ID="<<rs_amc13_key;
177 throw std::runtime_error(
"Broken key");
181 if( !queryResult.fillVariable(
"CONF", xmlPayload ) ) xmlPayload =
"";
183 payloads[kRS][rs_amc13_key] = xmlPayload;
208 xmlRdr.readDOMFromString( conf.second );
209 xmlRdr.readRootElement ( parsedXMLs );
212 for(
auto &conf :
payloads[ kALGO ]){
213 xmlRdr.readDOMFromString( conf.second );
214 xmlRdr.readRootElement ( parsedXMLs );
217 xmlRdr.readDOMFromString( conf.second );
218 xmlRdr.readRootElement ( parsedXMLs );
232 std::shared_ptr< L1TMuonBarrelParams > retval = std::make_shared< L1TMuonBarrelParams>(m_params_helper);
void configFromDB(l1t::TrigSystem &trgSys)
const QueryResults singleAttribute(const T &data) const
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
tuple L1TMuonBarrelParamsOnlineProd
l1t::OMDSReader m_omdsReader
const QueryResults basicQuery(const std::vector< std::string > &columnNames, const std::string &schemaName, const std::string &tableName, const std::string &conditionLHS="", const QueryResults conditionRHS=QueryResults(), const std::string &conditionRHSName="")
void setConfigured(const bool state=true)
virtual std::shared_ptr< L1TMuonBarrelParams > newObject(const std::string &objectKey, const L1TMuonBarrelParamsO2ORcd &record) override
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
~L1TMuonBarrelParamsOnlineProd(void)
L1TMuonBarrelParamsOnlineProd(const edm::ParameterSet &)