CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L1TMuonBarrelParamsOnlineProd Class Reference
Inheritance diagram for L1TMuonBarrelParamsOnlineProd:
L1ConfigOnlineProdBaseExt< L1TMuonBarrelParamsO2ORcd, L1TMuonBarrelParams > edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 L1TMuonBarrelParamsOnlineProd (const edm::ParameterSet &)
 
std::unique_ptr< const L1TMuonBarrelParamsnewObject (const std::string &objectKey, const L1TMuonBarrelParamsO2ORcd &record) override
 
 ~L1TMuonBarrelParamsOnlineProd (void) override
 
- Public Member Functions inherited from L1ConfigOnlineProdBaseExt< L1TMuonBarrelParamsO2ORcd, L1TMuonBarrelParams >
 L1ConfigOnlineProdBaseExt (const edm::ParameterSet &)
 
std::unique_ptr< const L1TMuonBarrelParamsproduce (const L1TMuonBarrelParamsO2ORcd &iRecord)
 
 ~L1ConfigOnlineProdBaseExt () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename Record >
void updateFromMayConsumes (unsigned int iIndex, const Record &iRecord)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Attributes

edm::ESGetToken< L1TMuonBarrelParams, L1TMuonBarrelParamsRcdbaseSettings_token
 
bool transactionSafe
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from L1ConfigOnlineProdBaseExt< L1TMuonBarrelParamsO2ORcd, L1TMuonBarrelParams >
bool getObjectKey (const L1TMuonBarrelParamsO2ORcd &record, std::string &objectKey)
 
edm::ESConsumesCollectorT< L1TMuonBarrelParamsO2ORcdwrappedSetWhatProduced (const edm::ParameterSet &)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &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 EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 
- Protected Attributes inherited from L1ConfigOnlineProdBaseExt< L1TMuonBarrelParamsO2ORcd, L1TMuonBarrelParams >
bool m_copyFromCondDB
 
cond::persistency::Session m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Definition at line 16 of file L1TMuonBarrelParamsOnlineProd.cc.

Constructor & Destructor Documentation

◆ L1TMuonBarrelParamsOnlineProd()

L1TMuonBarrelParamsOnlineProd::L1TMuonBarrelParamsOnlineProd ( const edm::ParameterSet iConfig)

◆ ~L1TMuonBarrelParamsOnlineProd()

L1TMuonBarrelParamsOnlineProd::~L1TMuonBarrelParamsOnlineProd ( void  )
inlineoverride

Definition at line 26 of file L1TMuonBarrelParamsOnlineProd.cc.

26 {}

Member Function Documentation

◆ newObject()

std::unique_ptr< const L1TMuonBarrelParams > L1TMuonBarrelParamsOnlineProd::newObject ( const std::string &  objectKey,
const L1TMuonBarrelParamsO2ORcd record 
)
overridevirtual

Implements L1ConfigOnlineProdBaseExt< L1TMuonBarrelParamsO2ORcd, L1TMuonBarrelParams >.

Definition at line 35 of file L1TMuonBarrelParamsOnlineProd.cc.

36  {
37  const L1TMuonBarrelParamsRcd& baseRcd = record.template getRecord<L1TMuonBarrelParamsRcd>();
38  auto const& baseSettings = baseRcd.get(baseSettings_token);
39 
40  if (objectKey.empty()) {
41  edm::LogError("L1-O2O: L1TMuonBarrelParamsOnlineProd") << "Key is empty, returning empty L1TMuonBarrelParams";
42  if (transactionSafe)
43  throw std::runtime_error("SummaryForFunctionManager: BMTF | Faulty | Empty objectKey");
44  else {
45  edm::LogError("L1-O2O: L1TMuonBarrelParamsOnlineProd") << "returning unmodified prototype of L1TMuonBarrelParams";
46  return std::make_unique<const L1TMuonBarrelParams>(baseSettings);
47  }
48  }
49 
50  std::string tscKey = objectKey.substr(0, objectKey.find(":"));
51  std::string rsKey = objectKey.substr(objectKey.find(":") + 1, std::string::npos);
52 
53  edm::LogInfo("L1-O2O: L1TMuonBarrelParamsOnlineProd")
54  << "Producing L1TMuonBarrelParams with TSC key = " << tscKey << " and RS key = " << rsKey;
55 
56  std::string algo_key, hw_key;
57  std::string mp7_key, amc13_key;
58  std::string hw_payload, algo_payload, mp7_payload, amc13_payload;
59  try {
60  std::map<std::string, std::string> keys =
61  l1t::OnlineDBqueryHelper::fetch({"ALGO", "HW"}, "BMTF_KEYS", tscKey, m_omdsReader);
62  algo_key = keys["ALGO"];
63  hw_key = keys["HW"];
64 
65  hw_payload = l1t::OnlineDBqueryHelper::fetch({"CONF"}, "BMTF_CLOBS", hw_key, m_omdsReader)["CONF"];
66 
67  algo_payload = l1t::OnlineDBqueryHelper::fetch({"CONF"}, "BMTF_CLOBS", algo_key, m_omdsReader)["CONF"];
68 
69  std::map<std::string, std::string> rsKeys =
70  l1t::OnlineDBqueryHelper::fetch({"MP7", "AMC13"}, "BMTF_RS_KEYS", rsKey, m_omdsReader);
71  mp7_key = rsKeys["MP7"];
72  amc13_key = rsKeys["AMC13"];
73 
74  mp7_payload = l1t::OnlineDBqueryHelper::fetch({"CONF"}, "BMTF_CLOBS", mp7_key, m_omdsReader)["CONF"];
75  amc13_payload = l1t::OnlineDBqueryHelper::fetch({"CONF"}, "BMTF_CLOBS", amc13_key, m_omdsReader)["CONF"];
76 
77  } catch (std::runtime_error& e) {
78  edm::LogError("L1-O2O: L1TMuonBarrelParamsOnlineProd") << e.what();
79  if (transactionSafe)
80  throw std::runtime_error(std::string("SummaryForFunctionManager: BMTF | Faulty | ") + e.what());
81  else {
82  edm::LogError("L1-O2O: L1TMuonBarrelParamsOnlineProd") << "returning unmodified prototype of L1TMuonBarrelParams";
83  return std::make_unique<const L1TMuonBarrelParams>(baseSettings);
84  }
85  }
86 
87  // for debugging dump the configs to local files
88  {
89  std::ofstream output(std::string("/tmp/").append(hw_key.substr(0, hw_key.find("/"))).append(".xml"));
90  output << hw_payload;
91  output.close();
92  }
93  {
94  std::ofstream output(std::string("/tmp/").append(algo_key.substr(0, algo_key.find("/"))).append(".xml"));
95  output << algo_payload;
96  output.close();
97  }
98  {
99  std::ofstream output(std::string("/tmp/").append(mp7_key.substr(0, mp7_key.find("/"))).append(".xml"));
100  output << mp7_payload;
101  output.close();
102  }
103  {
104  std::ofstream output(std::string("/tmp/").append(amc13_key.substr(0, amc13_key.find("/"))).append(".xml"));
105  output << amc13_payload;
106  output.close();
107  }
108 
109  // finally, push all payloads to the XML parser and construct the TrigSystem objects with each of those
110  l1t::XmlConfigParser xmlRdr;
111  l1t::TriggerSystem parsedXMLs;
112  try {
113  // HW settings should always go first
114  xmlRdr.readDOMFromString(hw_payload);
115  xmlRdr.readRootElement(parsedXMLs);
116 
117  // now let's parse ALGO settings
118  xmlRdr.readDOMFromString(algo_payload);
119  xmlRdr.readRootElement(parsedXMLs);
120 
121  // remaining RS settings
122  xmlRdr.readDOMFromString(mp7_payload);
123  xmlRdr.readRootElement(parsedXMLs);
124 
125  xmlRdr.readDOMFromString(amc13_payload);
126  xmlRdr.readRootElement(parsedXMLs);
127  parsedXMLs.setConfigured();
128 
129  } catch (std::runtime_error& e) {
130  edm::LogError("L1-O2O: L1TMuonBarrelParamsOnlineProd") << e.what();
131  if (transactionSafe)
132  throw std::runtime_error(std::string("SummaryForFunctionManager: BMTF | Faulty | ") + e.what());
133  else {
134  edm::LogError("L1-O2O: L1TMuonBarrelParamsOnlineProd") << "returning unmodified prototype of L1TMuonBarrelParams";
135  return std::make_unique<const L1TMuonBarrelParams>(baseSettings);
136  }
137  }
138 
139  L1TMuonBarrelParamsHelper m_params_helper(baseSettings);
140  try {
141  m_params_helper.configFromDB(parsedXMLs);
142  } catch (std::runtime_error& e) {
143  edm::LogError("L1-O2O: L1TMuonBarrelParamsOnlineProd") << e.what();
144  if (transactionSafe)
145  throw std::runtime_error(std::string("SummaryForFunctionManager: BMTF | Faulty | ") + e.what());
146  else {
147  edm::LogError("L1-O2O: L1TMuonBarrelParamsOnlineProd") << "returning unmodified prototype of L1TMuonBarrelParams";
148  return std::make_unique<const L1TMuonBarrelParams>(baseSettings);
149  }
150  }
151 
152  auto retval = std::make_unique<const L1TMuonBarrelParams>(m_params_helper);
153 
154  edm::LogInfo("L1-O2O: L1TCaloParamsOnlineProd") << "SummaryForFunctionManager: BMTF | OK | All looks good";
155  return retval;
156 }

References mps_setup::append, baseSettings_token, L1TMuonBarrelParamsHelper::configFromDB(), MillePedeFileConverter_cfg::e, l1t::OnlineDBqueryHelper::fetch(), edm::eventsetup::EventSetupRecordImplementation< T >::get(), relativeConstraints::keys, L1ConfigOnlineProdBaseExt< L1TMuonBarrelParamsO2ORcd, L1TMuonBarrelParams >::m_omdsReader, convertSQLitetoXML_cfg::output, l1t::XmlConfigParser::readDOMFromString(), l1t::XmlConfigParser::readRootElement(), GlobalPosition_Frontier_DevDB_cff::record, l1t::TriggerSystem::setConfigured(), AlCaHLTBitMon_QueryRunRegistry::string, and transactionSafe.

Member Data Documentation

◆ baseSettings_token

edm::ESGetToken<L1TMuonBarrelParams, L1TMuonBarrelParamsRcd> L1TMuonBarrelParamsOnlineProd::baseSettings_token
private

Definition at line 19 of file L1TMuonBarrelParamsOnlineProd.cc.

Referenced by L1TMuonBarrelParamsOnlineProd(), and newObject().

◆ transactionSafe

bool L1TMuonBarrelParamsOnlineProd::transactionSafe
private

Definition at line 18 of file L1TMuonBarrelParamsOnlineProd.cc.

Referenced by L1TMuonBarrelParamsOnlineProd(), and newObject().

L1TMuonBarrelParamsHelper
Definition: L1TMuonBarrelParamsHelper.h:30
L1ConfigOnlineProdBaseExt< L1TMuonBarrelParamsO2ORcd, L1TMuonBarrelParams >::m_omdsReader
l1t::OMDSReader m_omdsReader
Definition: L1ConfigOnlineProdBaseExt.h:47
l1t::OnlineDBqueryHelper::fetch
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)
Definition: OnlineDBqueryHelper.cc:3
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
l1t::XmlConfigParser::readRootElement
void readRootElement(TriggerSystem &aTriggerSystem, const std::string &sysId="")
Definition: XmlConfigParser.cc:189
edm::LogInfo
Definition: MessageLogger.h:254
GlobalPosition_Frontier_DevDB_cff.record
record
Definition: GlobalPosition_Frontier_DevDB_cff.py:10
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
L1TMuonBarrelParamsOnlineProd::transactionSafe
bool transactionSafe
Definition: L1TMuonBarrelParamsOnlineProd.cc:18
l1t::TriggerSystem
Definition: TriggerSystem.h:14
L1ConfigOnlineProdBaseExt< L1TMuonBarrelParamsO2ORcd, L1TMuonBarrelParams >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
l1t::XmlConfigParser
Definition: XmlConfigParser.h:23
edm::LogError
Definition: MessageLogger.h:183
mps_setup.append
append
Definition: mps_setup.py:85
L1TMuonBarrelParamsOnlineProd::baseSettings_token
edm::ESGetToken< L1TMuonBarrelParams, L1TMuonBarrelParamsRcd > baseSettings_token
Definition: L1TMuonBarrelParamsOnlineProd.cc:19
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
edm::eventsetup::EventSetupRecordImplementation::get
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
Definition: EventSetupRecordImplementation.h:74
l1t::XmlConfigParser::readDOMFromString
void readDOMFromString(const std::string &str, xercesc::DOMDocument *&doc)
l1t::TriggerSystem::setConfigured
void setConfigured(bool state=true) noexcept
Definition: TriggerSystem.h:74
L1ConfigOnlineProdBaseExt< L1TMuonBarrelParamsO2ORcd, L1TMuonBarrelParams >::wrappedSetWhatProduced
edm::ESConsumesCollectorT< L1TMuonBarrelParamsO2ORcd > wrappedSetWhatProduced(const edm::ParameterSet &)
Definition: L1ConfigOnlineProdBaseExt.h:93
L1TMuonBarrelParamsRcd
Definition: L1TMuonBarrelParamsRcd.h:13
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37