31 baseSettings_token(wrappedSetWhatProduced(iConfig).consumes()) {}
38 if (objectKey.empty()) {
39 edm::LogError(
"L1-O2O: L1TMuonEndCapParamsOnlineProd") <<
"Key is empty";
41 throw std::runtime_error(
"SummaryForFunctionManager: EMTF | Faulty | Empty objectKey");
43 edm::LogError(
"L1-O2O: L1TMuonEndCapParamsOnlineProd") <<
"returning unmodified prototype of L1TMuonEndCapParams";
44 return std::make_unique<const L1TMuonEndCapParams>(baseSettings);
48 std::string tscKey = objectKey.substr(0, objectKey.find(
':'));
49 std::string rsKey = objectKey.substr(objectKey.find(
':') + 1, std::string::npos);
52 <<
"Producing L1TMuonEndCapParams with TSC key = " << tscKey <<
" and RS key = " << rsKey;
57 std::map<std::string, std::string>
keys =
61 algo_key =
keys[
"ALGO"];
67 }
catch (std::runtime_error&
e) {
68 edm::LogError(
"L1-O2O: L1TMuonEndCapParamsOnlineProd") <<
e.what();
70 throw std::runtime_error(
"SummaryForFunctionManager: EMTF | Faulty | Broken key");
72 edm::LogError(
"L1-O2O: L1TMuonEndCapParamsOnlineProd") <<
"returning unmodified prototype of L1TMuonEndCapParams";
73 return std::make_unique<const L1TMuonEndCapParams>(baseSettings);
100 }
catch (std::runtime_error&
e) {
101 edm::LogError(
"L1-O2O: L1TMuonEndCapParamsOnlineProd") <<
e.what();
103 throw std::runtime_error(
"SummaryForFunctionManager: EMTF | Faulty | Cannot parse XMLs");
105 edm::LogError(
"L1-O2O: L1TMuonEndCapParamsOnlineProd") <<
"returning unmodified prototype of L1TMuonEndCapParams";
106 return std::make_unique<const L1TMuonEndCapParams>(baseSettings);
111 std::map<std::string, l1t::Parameter> conf = trgSys.
getParameters(
"EMTFp1");
114 std::string core_fwv = conf[
"core_firmware_version"].getValueAsStr();
116 strptime(core_fwv.c_str(),
"%Y-%m-%d %T", &brokenTime);
117 time_t fw_sinceEpoch = timegm(&brokenTime);
123 auto retval = std::make_unique<L1TMuonEndCapParams>();
125 retval->firmwareVersion_ = fw_sinceEpoch;
126 retval->PtAssignVersion_ = conf[
"pt_lut_version"].getValue<
unsigned int>();
127 retval->PhiMatchWindowSt1_ = 1;
130 <<
"SummaryForFunctionManager: EMTF | OK | All looks good";
void setConfigured(bool state=true) noexcept
Log< level::Error, false > LogError
l1t::OMDSReader m_omdsReader
L1TMuonEndCapParamsOnlineProd(const edm::ParameterSet &)
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
void readDOMFromString(const std::string &str, xercesc::DOMDocument *&doc)
const std::map< std::string, Parameter > & getParameters(const char *processor) const
const bool transactionSafe
static std::map< std::string, std::string > fetch(const std::vector< std::string > &queryColumns, const std::string &table, const std::string &key, l1t::OMDSReader &m_omdsReader)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Log< level::Info, false > LogInfo
void readRootElement(TriggerSystem &aTriggerSystem, const std::string &sysId="")
std::unique_ptr< const L1TMuonEndCapParams > newObject(const std::string &objectKey, const L1TMuonEndCapParamsO2ORcd &record) override
const edm::ESGetToken< L1TMuonEndCapParams, L1TMuonEndCapParamsRcd > baseSettings_token
~L1TMuonEndCapParamsOnlineProd(void) override