CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L1TMuonEndCapObjectKeysOnlineProd Class Reference
Inheritance diagram for L1TMuonEndCapObjectKeysOnlineProd:
L1ObjectKeysOnlineProdBaseExt edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

void fillObjectKeys (L1TriggerKeyExt *pL1TriggerKey) override
 
 L1TMuonEndCapObjectKeysOnlineProd (const edm::ParameterSet &)
 
 ~L1TMuonEndCapObjectKeysOnlineProd (void) override
 
- Public Member Functions inherited from L1ObjectKeysOnlineProdBaseExt
 L1ObjectKeysOnlineProdBaseExt (const edm::ParameterSet &)
 
ReturnType produce (const L1TriggerKeyExtRcd &)
 
 ~L1ObjectKeysOnlineProdBaseExt () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- 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)
 

Private Attributes

bool transactionSafe
 

Additional Inherited Members

- Public Types inherited from L1ObjectKeysOnlineProdBaseExt
using ReturnType = std::unique_ptr< L1TriggerKeyExt >
 
- 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 edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- 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())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 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 L1ObjectKeysOnlineProdBaseExt
l1t::OMDSReader m_omdsReader
 

Detailed Description

Definition at line 8 of file L1TMuonEndCapObjectKeysOnlineProd.cc.

Constructor & Destructor Documentation

L1TMuonEndCapObjectKeysOnlineProd::L1TMuonEndCapObjectKeysOnlineProd ( const edm::ParameterSet iConfig)

Definition at line 18 of file L1TMuonEndCapObjectKeysOnlineProd.cc.

References edm::ParameterSet::getParameter(), and transactionSafe.

20 {
21  transactionSafe = iConfig.getParameter<bool>("transactionSafe");
22 }
T getParameter(std::string const &) const
L1ObjectKeysOnlineProdBaseExt(const edm::ParameterSet &)
L1TMuonEndCapObjectKeysOnlineProd::~L1TMuonEndCapObjectKeysOnlineProd ( void  )
inlineoverride

Definition at line 15 of file L1TMuonEndCapObjectKeysOnlineProd.cc.

15 {}

Member Function Documentation

void L1TMuonEndCapObjectKeysOnlineProd::fillObjectKeys ( L1TriggerKeyExt pL1TriggerKey)
overridevirtual

Implements L1ObjectKeysOnlineProdBaseExt.

Definition at line 25 of file L1TMuonEndCapObjectKeysOnlineProd.cc.

References L1TriggerKeyExt::add(), DEFINE_FWK_EVENTSETUP_MODULE, MillePedeFileConverter_cfg::e, l1t::OnlineDBqueryHelper::fetch(), l1t::TriggerSystem::getParameters(), L1TriggerKeyExt::kEMTF, relativeConstraints::keys, L1ObjectKeysOnlineProdBaseExt::m_omdsReader, l1t::XmlConfigParser::readDOMFromString(), l1t::XmlConfigParser::readRootElement(), l1t::TriggerSystem::setConfigured(), AlCaHLTBitMon_QueryRunRegistry::string, L1TriggerKeyExt::subsystemKey(), and transactionSafe.

25  {
26 
27  std::string EMTFKey = pL1TriggerKey->subsystemKey( L1TriggerKeyExt::kEMTF ) ;
28 
29  // simply assign the algo key to the record
30  pL1TriggerKey->add( "L1TMuonEndCapParamsO2ORcd",
31  "L1TMuonEndCapParams",
32  EMTFKey) ;
33 
34  std::string tscKey = EMTFKey.substr(0, EMTFKey.find(":") );
35 
37 // the block below reproduces L1TMuonEndCapParamsOnlineProd identically
38 
39  std::string algo_key, hw_key;
40  std::string algo_payload, hw_payload;
41  try {
42  std::map<std::string,std::string> keys =
43  l1t::OnlineDBqueryHelper::fetch( {"HW","ALGO"},
44  "EMTF_KEYS",
45  tscKey,
47  );
48 
49  hw_key = keys["HW"];
50  algo_key = keys["ALGO"];
51 
52  hw_payload = l1t::OnlineDBqueryHelper::fetch( {"CONF"},
53  "EMTF_CLOBS",
54  hw_key,
56  ) ["CONF"];
57 
58  algo_payload = l1t::OnlineDBqueryHelper::fetch( {"CONF"},
59  "EMTF_CLOBS",
60  algo_key,
62  ) ["CONF"];
63 
64  } catch ( std::runtime_error &e ) {
65  edm::LogError( "L1-O2O: L1TMuonEndCapObjectKeysOnlineProd" ) << e.what();
66  if( transactionSafe )
67  throw std::runtime_error("SummaryForFunctionManager: EMTF | Faulty | Broken key");
68  else {
69  edm::LogError( "L1-O2O: L1TMuonEndCapObjectKeysOnlineProd" ) << "forcing L1TMuonEndCapForest key to be = '7' (known to exist)";
70  pL1TriggerKey->add( "L1TMuonEndCapForestO2ORcd",
71  "L1TMuonEndCapForest",
72  "7") ;
73  return;
74  }
75  }
76 
77  l1t::XmlConfigParser xmlRdr;
78  l1t::TriggerSystem trgSys;
79 
80  try {
81  xmlRdr.readDOMFromString( hw_payload );
82  xmlRdr.readRootElement ( trgSys );
83 
84  xmlRdr.readDOMFromString( algo_payload );
85  xmlRdr.readRootElement ( trgSys );
86 
87  trgSys.setConfigured();
88  } catch ( std::runtime_error &e ) {
89  edm::LogError( "L1-O2O: L1TMuonEndCapObjectKeysOnlineProd" ) << e.what();
90  if( transactionSafe )
91  throw std::runtime_error("SummaryForFunctionManager: EMTF | Faulty | Cannot parse XMLs");
92  else {
93  edm::LogError( "L1-O2O: L1TMuonEndCapObjectKeysOnlineProd" ) << "forcing L1TMuonEndCapForest key to be = '7' (known to exist)";
94  pL1TriggerKey->add( "L1TMuonEndCapForestO2ORcd",
95  "L1TMuonEndCapForest",
96  "7") ;
97  return;
98  }
99  }
100 
101  // Changed from "EMTF-1" to "EMTFp1", but is this backwards compatible? Does it need to be? - AWB 10.04.2018
102  std::map<std::string, l1t::Parameter> conf = trgSys.getParameters("EMTFp1"); // any processor will do
103  // if (conf still empty) conf = trgSys.getParameters("EMTF+1"); // Should add some conditional for backwards-compatibility
104 
106 
107  // simply assign the algo key to the record
108  pL1TriggerKey->add( "L1TMuonEndCapForestO2ORcd",
109  "L1TMuonEndCapForest",
110  conf["pt_lut_version"].getValueAsStr()) ;
111 }
void setConfigured(bool state=true) noexcept
Definition: TriggerSystem.h:73
void add(const std::string &record, const std::string &type, const std::string &key)
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)
const std::string & subsystemKey(L1Subsystems subsystem) const
const std::map< std::string, Parameter > & getParameters(const char *processor) const
void readRootElement(TriggerSystem &aTriggerSystem, const std::string &sysId="")

Member Data Documentation

bool L1TMuonEndCapObjectKeysOnlineProd::transactionSafe
private