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 return boost::shared_ptr< L1TMuonBarrelParams > (
new L1TMuonBarrelParams( *(baseSettings.product()) ) );
38 std::string tscKey = objectKey.substr(0, objectKey.find(
":") );
39 std::string rsKey = objectKey.substr( objectKey.find(
":")+1, std::string::npos );
43 edm::LogInfo(
"L1-O2O: L1TMuonBarrelParamsOnlineProd" ) <<
"Producing L1TMuonBarrelParams with TSC key =" << tscKey <<
" and RS key = " << rsKey ;
48 std::vector< std::string > queryStrings ;
49 queryStrings.push_back(
"ALGO" ) ;
50 queryStrings.push_back(
"HW" ) ;
63 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
64 edm::LogError(
"L1-O2O" ) <<
"Cannot get BMTF_KEYS.{ALGO,HW}" ;
65 return boost::shared_ptr< L1TMuonBarrelParams > (
new L1TMuonBarrelParams( *(baseSettings.product()) ) );
68 if( !queryResult.fillVariable(
"ALGO", algo_key) ) algo_key =
"";
69 if( !queryResult.fillVariable(
"HW", hw_key ) ) hw_key =
"";
73 queryStrings.clear() ;
74 queryStrings.push_back(
"MP7" ) ;
75 queryStrings.push_back(
"DAQTTC" ) ;
88 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
89 edm::LogError(
"L1-O2O" ) <<
"Cannot get BMTF_RS_KEYS.{MP7,DAQTTC}" ;
90 return boost::shared_ptr< L1TMuonBarrelParams > (
new L1TMuonBarrelParams( *(baseSettings.product()) ) );
93 if( !queryResult.fillVariable(
"MP7", rs_mp7_key ) ) rs_mp7_key =
"";
94 if( !queryResult.fillVariable(
"DAQTTC", rs_amc13_key) ) rs_amc13_key =
"";
99 enum {kALGO=0, kRS, kHW, NUM_TYPES};
100 std::map<std::string,std::string>
payloads[NUM_TYPES];
103 queryStrings.clear();
104 queryStrings.push_back(
"CONF" );
115 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
116 edm::LogError(
"L1-O2O: L1TMuonBarrelParamsOnlineProd" ) <<
"Cannot get BMTF_ALGO.CONF for ID="<<algo_key;
117 return boost::shared_ptr< L1TMuonBarrelParams >(
new L1TMuonBarrelParams( *(baseSettings.product()) ) ) ;
120 if( !queryResult.fillVariable(
"CONF", xmlPayload ) ) xmlPayload =
"";
122 payloads[kALGO][algo_key] = xmlPayload;
133 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
134 edm::LogError(
"L1-O2O: L1TMuonBarrelParamsOnlineProd" ) <<
"Cannot get BMTF_HW.CONF for ID="<<hw_key;
135 return boost::shared_ptr< L1TMuonBarrelParams >(
new L1TMuonBarrelParams( *(baseSettings.product()) ) ) ;
138 if( !queryResult.fillVariable(
"CONF", xmlPayload ) ) xmlPayload =
"";
151 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
152 edm::LogError(
"L1-O2O: L1TMuonBarrelParamsOnlineProd" ) <<
"Cannot get BMTF_RS.CONF for ID="<<rs_mp7_key;
153 return boost::shared_ptr< L1TMuonBarrelParams >(
new L1TMuonBarrelParams( *(baseSettings.product()) ) ) ;
156 if( !queryResult.fillVariable(
"CONF", xmlPayload ) ) xmlPayload =
"";
158 payloads[kRS][rs_mp7_key] = xmlPayload;
169 if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
170 edm::LogError(
"L1-O2O: L1TMuonBarrelParamsOnlineProd" ) <<
"Cannot get BMTF_RS.CONF for ID="<<rs_amc13_key;
171 return boost::shared_ptr< L1TMuonBarrelParams >(
new L1TMuonBarrelParams( *(baseSettings.product()) ) ) ;
174 if( !queryResult.fillVariable(
"CONF", xmlPayload ) ) xmlPayload =
"";
176 payloads[kRS][rs_amc13_key] = xmlPayload;
201 xmlRdr.readDOMFromString( conf.second );
202 xmlRdr.readRootElement ( parsedXMLs );
205 for(
auto &conf :
payloads[ kALGO ]){
206 xmlRdr.readDOMFromString( conf.second );
207 xmlRdr.readRootElement ( parsedXMLs );
210 xmlRdr.readDOMFromString( conf.second );
211 xmlRdr.readRootElement ( parsedXMLs );
225 boost::shared_ptr< L1TMuonBarrelParams > retval(
new 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
virtual boost::shared_ptr< L1TMuonBarrelParams > newObject(const std::string &objectKey, const L1TMuonBarrelParamsO2ORcd &record) override
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)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
~L1TMuonBarrelParamsOnlineProd(void)
L1TMuonBarrelParamsOnlineProd(const edm::ParameterSet &)