CMS 3D CMS Logo

List of all members | Public Member Functions
L1TMuonEndcapParamsOnlineProd Class Reference
Inheritance diagram for L1TMuonEndcapParamsOnlineProd:
L1ConfigOnlineProdBaseExt< L1TMuonEndcapParamsO2ORcd, L1TMuonEndCapParams > edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 L1TMuonEndcapParamsOnlineProd (const edm::ParameterSet &)
 
virtual std::shared_ptr< L1TMuonEndCapParamsnewObject (const std::string &objectKey, const L1TMuonEndcapParamsO2ORcd &record) override
 
 ~L1TMuonEndcapParamsOnlineProd (void)
 
- Public Member Functions inherited from L1ConfigOnlineProdBaseExt< L1TMuonEndcapParamsO2ORcd, L1TMuonEndCapParams >
 L1ConfigOnlineProdBaseExt (const edm::ParameterSet &)
 
std::shared_ptr< L1TMuonEndCapParamsproduce (const L1TMuonEndcapParamsO2ORcd &iRecord)
 
 ~L1ConfigOnlineProdBaseExt ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()(false)
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer () noexcept(false)
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from L1ConfigOnlineProdBaseExt< L1TMuonEndcapParamsO2ORcd, L1TMuonEndCapParams >
bool getObjectKey (const L1TMuonEndcapParamsO2ORcd &record, std::shared_ptr< L1TMuonEndCapParams > data, std::string &objectKey)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 
- Protected Attributes inherited from L1ConfigOnlineProdBaseExt< L1TMuonEndcapParamsO2ORcd, L1TMuonEndCapParams >
bool m_copyFromCondDB
 
cond::persistency::Session m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Definition at line 16 of file L1TMuonEndcapParamsOnlineProd.cc.

Constructor & Destructor Documentation

L1TMuonEndcapParamsOnlineProd::L1TMuonEndcapParamsOnlineProd ( const edm::ParameterSet iConfig)
L1TMuonEndcapParamsOnlineProd::~L1TMuonEndcapParamsOnlineProd ( void  )
inline

Definition at line 22 of file L1TMuonEndcapParamsOnlineProd.cc.

22 {}

Member Function Documentation

std::shared_ptr< L1TMuonEndCapParams > L1TMuonEndcapParamsOnlineProd::newObject ( const std::string &  objectKey,
const L1TMuonEndcapParamsO2ORcd record 
)
overridevirtual

Implements L1ConfigOnlineProdBaseExt< L1TMuonEndcapParamsO2ORcd, L1TMuonEndCapParams >.

Definition at line 27 of file L1TMuonEndcapParamsOnlineProd.cc.

References data, DEFINE_FWK_EVENTSETUP_MODULE, MillePedeFileConverter_cfg::e, l1t::OnlineDBqueryHelper::fetch(), edm::eventsetup::EventSetupRecord::get(), l1t::TriggerSystem::getParameters(), l1t::EndCapParamsHelper::getWriteInstance(), relativeConstraints::keys, L1ConfigOnlineProdBaseExt< L1TMuonEndcapParamsO2ORcd, L1TMuonEndCapParams >::m_omdsReader, l1t::XmlConfigParser::readDOMFromString(), l1t::XmlConfigParser::readRootElement(), l1t::TriggerSystem::setConfigured(), l1t::EndCapParamsHelper::SetFirmwareVersion(), l1t::EndCapParamsHelper::SetPtAssignVersion(), and AlCaHLTBitMon_QueryRunRegistry::string.

27  {
28  using namespace edm::es;
29 
30  const L1TMuonEndcapParamsRcd& baseRcd = record.template getRecord< L1TMuonEndcapParamsRcd >() ;
32  baseRcd.get( baseSettings ) ;
33 
34 
35  if (objectKey.empty()) {
36  edm::LogError( "L1-O2O: L1TMuonEndcapParamsOnlineProd" ) << "Key is empty, returning empty L1TMuonEndcapParams";
37  throw std::runtime_error("Empty objectKey");
38  }
39 
40  std::string tscKey = objectKey.substr(0, objectKey.find(":") );
41  std::string rsKey = objectKey.substr( objectKey.find(":")+1, std::string::npos );
42 
43  edm::LogInfo( "L1-O2O: L1TMuonEndcapParamsOnlineProd" ) << "Producing L1TMuonEndcapParams with TSC key = " << tscKey << " and RS key = " << rsKey ;
44 
45  std::string algo_key, hw_key;
46  std::string algo_payload, hw_payload;
47  try {
48  std::map<std::string,std::string> keys =
49  l1t::OnlineDBqueryHelper::fetch( {"HW","ALGO"},
50  "EMTF_KEYS",
51  tscKey,
53  );
54 
55  hw_key = keys["HW"];
56  algo_key = keys["ALGO"];
57 
58  hw_payload = l1t::OnlineDBqueryHelper::fetch( {"CONF"},
59  "EMTF_CLOBS",
60  hw_key,
62  ) ["CONF"];
63 
64  algo_payload = l1t::OnlineDBqueryHelper::fetch( {"CONF"},
65  "EMTF_CLOBS",
66  algo_key,
68  ) ["CONF"];
69 
70  } catch ( std::runtime_error &e ) {
71  edm::LogError( "L1-O2O: L1TMuonEndcapParamsOnlineProd" ) << e.what();
72  throw std::runtime_error("Broken key");
73  }
74 
75  l1t::XmlConfigParser xmlRdr;
76  l1t::TriggerSystem trgSys;
77 
78  xmlRdr.readDOMFromString( hw_payload );
79  xmlRdr.readRootElement ( trgSys );
80 
81  xmlRdr.readDOMFromString( algo_payload );
82  xmlRdr.readRootElement ( trgSys );
83 
84  trgSys.setConfigured();
85 
86  std::map<std::string, l1t::Parameter> conf = trgSys.getParameters("EMTF-1"); // any processor will do
87 
88  std::string core_fwv = conf["core_firmware_version"].getValueAsStr();
89  tm brokenTime;
90  strptime(core_fwv.c_str(), "%Y-%m-%d %T", &brokenTime);
91  time_t sinceEpoch = timegm(&brokenTime);
92 
94 
95  data.SetFirmwareVersion( sinceEpoch );
96  data.SetPtAssignVersion( conf["pt_lut_version"].getValue<unsigned int>() );
97 
98  std::shared_ptr< L1TMuonEndCapParams > retval( data.getWriteInstance() );
99 
100  return retval;
101 }
void setConfigured(bool state=true) noexcept
Definition: TriggerSystem.h:73
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)
void get(HolderT &iHolder) const
const std::map< std::string, Parameter > & getParameters(const char *processor) const
void readRootElement(TriggerSystem &aTriggerSystem, const std::string &sysId="")
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82