25 using namespace edm::es;
29 baseRcd.get( baseSettings ) ;
31 if( objectKey.empty() ){
32 edm::LogError(
"L1-O2O: L1TMuonGlobalParamsOnlineProd" ) <<
"Key is empty";
33 throw std::runtime_error(
"Empty objectKey");
37 std::string tscKey = objectKey.substr(0, objectKey.find(
":") );
38 std::string rsKey = objectKey.substr( objectKey.find(
":")+1, std::string::npos );
41 edm::LogInfo(
"L1-O2O: L1TMuonGlobalParamsOnlineProd" ) <<
"Producing L1TMuonGlobalParams with TSC key =" << tscKey <<
" and RS key = " << rsKey ;
44 std::vector< std::string > queryStrings ;
45 queryStrings.push_back(
"ALGO" ) ;
46 queryStrings.push_back(
"HW" ) ;
59 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
60 edm::LogError(
"L1-O2O: L1TMuonGlobalParamsOnlineProd" ) <<
"Cannot get UGMT_KEYS.{ALGO,HW} for ID = " << tscKey ;
61 throw std::runtime_error(
"Broken key");
65 if( !queryResult.fillVariable(
"ALGO", algo_key) ) algo_key =
"";
66 if( !queryResult.fillVariable(
"HW", hw_key ) ) hw_key =
"";
70 queryStrings.push_back(
"MP7" );
71 queryStrings.push_back(
"MP7_MONI" );
72 queryStrings.push_back(
"AMC13_MONI");
74 std::string rs_mp7_key, rs_mp7moni_key, rs_amc13moni_key;
85 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
86 edm::LogError(
"L1-O2O: L1TMuonGlobalParamsOnlineProd" ) <<
"Cannot get UGMT_RS_KEYS.{MP7,MP7_MONI,AMC13_MONI} for ID = " << rsKey ;
87 throw std::runtime_error(
"Broken key");
91 if( !queryResult.fillVariable(
"MP7", rs_mp7_key ) ) rs_mp7_key =
"";
92 if( !queryResult.fillVariable(
"MP7_MONI", rs_mp7moni_key ) ) rs_mp7moni_key =
"";
93 if( !queryResult.fillVariable(
"AMC13_MONI", rs_amc13moni_key) ) rs_amc13moni_key =
"";
99 queryStrings.push_back(
"MP7" );
100 queryStrings.push_back(
"LUTS" );
111 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
112 edm::LogError(
"L1-O2O: L1TMuonGlobalParamsOnlineProd" ) <<
"Cannot get UGMT_ALGO.{MP7,LUTS} for ID = " << algo_key;
113 throw std::runtime_error(
"Broken key");
117 if( !queryResult.fillVariable(
"MP7", algo_mp7_key ) ) algo_mp7_key =
"";
118 if( !queryResult.fillVariable(
"LUTS", algo_luts_key ) ) algo_luts_key =
"";
123 enum {kALGO=0, kRS, kHW, NUM_TYPES};
124 std::map<std::string,std::string>
payloads[NUM_TYPES];
127 queryStrings.clear();
128 queryStrings.push_back(
"CONF" );
139 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
140 edm::LogError(
"L1-O2O: L1TMuonGlobalParamsOnlineProd" ) <<
"Cannot get UGMT_ALGO.CONF for ID = " << algo_mp7_key;
141 throw std::runtime_error(
"Broken key");
145 if( !queryResult.fillVariable(
"CONF", xmlPayload ) ) xmlPayload =
"";
147 payloads[kALGO][algo_mp7_key] = xmlPayload;
157 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
158 edm::LogError(
"L1-O2O: L1TMuonGlobalParamsOnlineProd" ) <<
"Cannot get UGMT_ALGO.CONF for ID = " << algo_luts_key;
159 throw std::runtime_error(
"Broken key");
163 if( !queryResult.fillVariable(
"CONF", xmlPayload ) ) xmlPayload =
"";
165 payloads[kALGO][algo_luts_key] = xmlPayload;
177 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
178 edm::LogError(
"L1-O2O: L1TMuonGlobalParamsOnlineProd" ) <<
"Cannot get UGMT_HW.CONF for ID = " << hw_key;
179 throw std::runtime_error(
"Broken key");
183 if( !queryResult.fillVariable(
"CONF", xmlPayload ) ) xmlPayload =
"";
196 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
197 edm::LogError(
"L1-O2O: L1TMuonGlobalParamsOnlineProd" ) <<
"Cannot get UGMT_RS.CONF for ID = " << rs_mp7_key;
198 throw std::runtime_error(
"Broken key");
202 if( !queryResult.fillVariable(
"CONF", xmlPayload ) ) xmlPayload =
"";
204 payloads[kRS][rs_mp7_key] = xmlPayload;
214 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
215 edm::LogError(
"L1-O2O: L1TMuonGlobalParamsOnlineProd" ) <<
"Cannot get UGMT_RS.CONF for ID = " << rs_mp7moni_key;
216 throw std::runtime_error(
"Broken key");
220 if( !queryResult.fillVariable(
"CONF", xmlPayload ) ) xmlPayload =
"";
222 payloads[kRS][rs_mp7moni_key] = xmlPayload;
233 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
234 edm::LogError(
"L1-O2O: L1TMuonBarrelParamsOnlineProd" ) <<
"Cannot get UGMT_RS.CONF for ID = " << rs_amc13moni_key;
235 throw std::runtime_error(
"Broken key");
239 if( !queryResult.fillVariable(
"CONF", xmlPayload ) ) xmlPayload =
"";
241 payloads[kRS][rs_amc13moni_key] = xmlPayload;
266 xmlRdr.readDOMFromString( conf.second );
267 xmlRdr.readRootElement ( trgSys );
270 for(
auto &conf :
payloads[ kALGO ]){
271 xmlRdr.readDOMFromString( conf.second );
272 xmlRdr.readRootElement ( trgSys );
275 xmlRdr.readDOMFromString( conf.second );
276 xmlRdr.readRootElement ( trgSys );
const L1TMuonGlobalParams & cast_to_L1TMuonGlobalParams(const L1TMuonGlobalParams_PUBLIC &x)
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 ...
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)
void loadFromOnline(l1t::TrigSystem &trgSys, const std::string &processorId="")
~L1TMuonGlobalParamsOnlineProd(void)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
L1TMuonGlobalParamsOnlineProd(const edm::ParameterSet &)
virtual boost::shared_ptr< L1TMuonGlobalParams > newObject(const std::string &objectKey, const L1TMuonGlobalParamsO2ORcd &record) override