33 baseRcd.
get( baseSettings ) ;
36 if (objectKey.empty()) {
37 edm::LogError(
"L1-O2O: L1TMuonEndCapParamsOnlineProd" ) <<
"Key is empty";
39 throw std::runtime_error(
"SummaryForFunctionManager: BMTF | Faulty | Empty objectKey");
41 edm::LogError(
"L1-O2O: L1TMuonEndCapParamsOnlineProd" ) <<
"returning unmodified prototype of L1TMuonEndCapParams";
42 return std::make_unique< const L1TMuonEndCapParams >( *(baseSettings.product()) ) ;
46 std::string tscKey = objectKey.substr(0, objectKey.find(
":") );
47 std::string rsKey = objectKey.substr( objectKey.find(
":")+1, std::string::npos );
49 edm::LogInfo(
"L1-O2O: L1TMuonEndCapParamsOnlineProd" ) <<
"Producing L1TMuonEndCapParams with TSC key = " << tscKey <<
" and RS key = " << rsKey ;
54 std::map<std::string,std::string>
keys =
62 algo_key = keys[
"ALGO"];
76 }
catch ( std::runtime_error &
e ) {
77 edm::LogError(
"L1-O2O: L1TMuonEndCapParamsOnlineProd" ) << e.what();
79 throw std::runtime_error(
"SummaryForFunctionManager: EMTF | Faulty | Broken key");
81 edm::LogError(
"L1-O2O: L1TMuonEndCapParamsOnlineProd" ) <<
"returning unmodified prototype of L1TMuonEndCapParams";
82 return std::make_unique< const L1TMuonEndCapParams >( *(baseSettings.product()) ) ;
109 }
catch ( std::runtime_error &e ) {
110 edm::LogError(
"L1-O2O: L1TMuonEndCapParamsOnlineProd" ) << e.what();
112 throw std::runtime_error(
"SummaryForFunctionManager: EMTF | Faulty | Cannot parse XMLs");
114 edm::LogError(
"L1-O2O: L1TMuonEndCapParamsOnlineProd" ) <<
"returning unmodified prototype of L1TMuonEndCapParams";
115 return std::make_unique< const L1TMuonEndCapParams >( *(baseSettings.product()) ) ;
120 std::map<std::string, l1t::Parameter> conf = trgSys.
getParameters(
"EMTFp1");
123 std::string core_fwv = conf[
"core_firmware_version"].getValueAsStr();
125 strptime(core_fwv.c_str(),
"%Y-%m-%d %T", &brokenTime);
126 time_t fw_sinceEpoch = timegm(&brokenTime);
132 auto retval = std::make_unique<L1TMuonEndCapParams>();
134 retval->firmwareVersion_ = fw_sinceEpoch;
135 retval->PtAssignVersion_ = conf[
"pt_lut_version"].getValue<
unsigned int>();
136 retval->PhiMatchWindowSt1_ = 1;
138 edm::LogInfo(
"L1-O2O: L1TMuonEndCapParamsOnlineProd" ) <<
"SummaryForFunctionManager: EMTF | OK | All looks good";
T getParameter(std::string const &) const
void setConfigured(bool state=true) noexcept
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
l1t::OMDSReader m_omdsReader
L1TMuonEndCapParamsOnlineProd(const edm::ParameterSet &)
void readDOMFromString(const std::string &str, xercesc::DOMDocument *&doc)
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)
const std::map< std::string, Parameter > & getParameters(const char *processor) const
void readRootElement(TriggerSystem &aTriggerSystem, const std::string &sysId="")
std::unique_ptr< const L1TMuonEndCapParams > newObject(const std::string &objectKey, const L1TMuonEndCapParamsO2ORcd &record) override
~L1TMuonEndCapParamsOnlineProd(void) override