CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
L1SubsystemKeysOnlineProdExt Class Reference

#include <L1SubsystemKeysOnlineProdExt.h>

Inheritance diagram for L1SubsystemKeysOnlineProdExt:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

using ReturnType = std::unique_ptr< L1TriggerKeyExt >
 

Public Member Functions

 L1SubsystemKeysOnlineProdExt (const edm::ParameterSet &)
 
ReturnType produce (const L1TriggerKeyExtRcd &)
 
 ~L1SubsystemKeysOnlineProdExt () 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

bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 
std::string m_rsKey
 
std::string m_tscKey
 

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 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)
 

Detailed Description

Definition at line 15 of file L1SubsystemKeysOnlineProdExt.h.

Member Typedef Documentation

◆ ReturnType

Definition at line 20 of file L1SubsystemKeysOnlineProdExt.h.

Constructor & Destructor Documentation

◆ L1SubsystemKeysOnlineProdExt()

L1SubsystemKeysOnlineProdExt::L1SubsystemKeysOnlineProdExt ( const edm::ParameterSet iConfig)

Definition at line 13 of file L1SubsystemKeysOnlineProdExt.cc.

14  : m_tscKey(iConfig.getParameter<std::string>("tscKey")),
15  m_rsKey(iConfig.getParameter<std::string>("rsKey")),
16  m_omdsReader(iConfig.getParameter<std::string>("onlineDB"),
17  iConfig.getParameter<std::string>("onlineAuthentication")),
18  m_forceGeneration(iConfig.getParameter<bool>("forceGeneration")) {
19  //the following line is needed to tell the framework what
20  // data is being produced
21  setWhatProduced(this, "SubsystemKeysOnly");
22 
23  //now do what ever other initialization is needed
24 }

References edm::ESProducer::setWhatProduced().

◆ ~L1SubsystemKeysOnlineProdExt()

L1SubsystemKeysOnlineProdExt::~L1SubsystemKeysOnlineProdExt ( )
override

Definition at line 26 of file L1SubsystemKeysOnlineProdExt.cc.

26  {
27  // do anything here that needs to be done at desctruction time
28  // (e.g. close files, deallocate resources etc.)
29 }

Member Function Documentation

◆ produce()

L1SubsystemKeysOnlineProdExt::ReturnType L1SubsystemKeysOnlineProdExt::produce ( const L1TriggerKeyExtRcd iRecord)

Definition at line 36 of file L1SubsystemKeysOnlineProdExt.cc.

36  {
37  std::unique_ptr<L1TriggerKeyExt> pL1TriggerKey;
38 
39  // Get L1TriggerKeyListExt
40  L1TriggerKeyListExt keyList;
41  if (!m_forceGeneration) {
42  l1t::DataWriterExt dataWriter;
43  if (!dataWriter.fillLastTriggerKeyList(keyList)) {
44  edm::LogError("L1-O2O") << "Problem getting last L1TriggerKeyListExt";
45  }
46  }
47  // For RUN II the subsystem CondFormats for ALGO and RS are merged together -> we join ALGO and RS keys
48 
49  // combine the ALGO and RS keys:
50  std::string delimeter = ":";
51  std::string m_Key = m_tscKey + delimeter + m_rsKey;
52 
53  // If L1TriggerKeyListExt does not contain TSC key, token is empty
54  if (keyList.token(m_Key).empty() || m_forceGeneration) {
55  // Instantiate new L1TriggerKey
56  pL1TriggerKey = std::make_unique<L1TriggerKeyExt>();
57 
58  pL1TriggerKey->setTSCKey(m_Key);
59 
60  edm::LogVerbatim("L1-O2O") << "TSC KEY: " << m_tscKey;
61  edm::LogVerbatim("L1-O2O") << "RS_KEY: " << m_rsKey;
62 
63  // Get subsystem keys from OMDS
64 
65  // select * from CMS_TRG_L1_CONF.L1_TRG_CONF_KEYS where ID = m_tscKey
66  std::vector<std::string> queryStrings;
67  queryStrings.push_back("UGT_KEY");
68  queryStrings.push_back("UGMT_KEY");
69  // queryStrings.push_back( "CALO_KEY" ) ;
70  queryStrings.push_back("BMTF_KEY");
71  queryStrings.push_back("OMTF_KEY");
72  queryStrings.push_back("EMTF_KEY");
73  queryStrings.push_back("TWINMUX_KEY");
74 
75  l1t::OMDSReader::QueryResults subkeyResults = m_omdsReader.basicQuery(queryStrings,
76  "CMS_TRG_L1_CONF",
77  "L1_TRG_CONF_KEYS",
78  "L1_TRG_CONF_KEYS.ID",
80 
81  if (subkeyResults.queryFailed() || subkeyResults.numberRows() != 1) // check query successful
82  {
83  edm::LogError("L1-O2O") << "Problem with subsystem TSC key: " << m_tscKey;
84  return pL1TriggerKey;
85  }
86 
87  std::string uGTKey, uGMTKey, CALOKey, BMTFKey, OMTFKey, EMTFKey, TWINMUXKey;
88 
89  subkeyResults.fillVariable("UGT_KEY", uGTKey);
90  subkeyResults.fillVariable("UGMT_KEY", uGMTKey);
91  // subkeyResults.fillVariable( "CALO_KEY", CALOKey ) ;
92  subkeyResults.fillVariable("BMTF_KEY", BMTFKey);
93  subkeyResults.fillVariable("OMTF_KEY", OMTFKey);
94  subkeyResults.fillVariable("EMTF_KEY", EMTFKey);
95  subkeyResults.fillVariable("TWINMUX_KEY", TWINMUXKey);
96 
97  // For RUN II the subsystem CondFormats for ALGO and RS are merged together -> we join ALGO and RS keys
98 
99  queryStrings.clear();
100  queryStrings.push_back("UGT_RS_KEY");
101  queryStrings.push_back("UGMT_RS_KEY");
102  // queryStrings.push_back( "CALO_RS_KEY" );
103  queryStrings.push_back("BMTF_RS_KEY");
104  queryStrings.push_back("EMTF_RS_KEY");
105  queryStrings.push_back("OMTF_RS_KEY");
106  queryStrings.push_back("TWINMUX_RS_KEY");
107 
108  subkeyResults = m_omdsReader.basicQuery(
109  queryStrings, "CMS_TRG_L1_CONF", "L1_TRG_RS_KEYS", "L1_TRG_RS_KEYS.ID", m_omdsReader.singleAttribute(m_rsKey));
110 
111  if (subkeyResults.queryFailed() || subkeyResults.numberRows() != 1) // check query successful
112  {
113  edm::LogError("L1-O2O") << "Problem with subsystem RS key: " << m_rsKey;
114  return pL1TriggerKey;
115  }
116 
117  std::string uGTrsKey, uGMTrsKey, CALOrsKey, BMTFrsKey, OMTFrsKey, EMTFrsKey, TWINMUXrsKey;
118 
119  subkeyResults.fillVariable("UGT_RS_KEY", uGTrsKey);
120  subkeyResults.fillVariable("UGMT_RS_KEY", uGMTrsKey);
121  // subkeyResults.fillVariable( "CALO_RS_KEY", CALOrsKey ) ;
122  subkeyResults.fillVariable("BMTF_RS_KEY", BMTFrsKey);
123  subkeyResults.fillVariable("OMTF_RS_KEY", OMTFrsKey);
124  subkeyResults.fillVariable("EMTF_RS_KEY", EMTFrsKey);
125  subkeyResults.fillVariable("TWINMUX_RS_KEY", TWINMUXrsKey);
126 
127  // The offline CALO folks want to have CALOL1 and CALOL2 together -> provide the top level TSC key for the kCALO payload and let them handle the rest
128  CALOKey = m_tscKey;
129  CALOrsKey = m_rsKey;
130 
131  pL1TriggerKey->setSubsystemKey(L1TriggerKeyExt::kuGT, uGTKey + delimeter + uGTrsKey);
132  pL1TriggerKey->setSubsystemKey(L1TriggerKeyExt::kuGMT, uGMTKey + delimeter + uGMTrsKey);
133  pL1TriggerKey->setSubsystemKey(L1TriggerKeyExt::kCALO, CALOKey + delimeter + CALOrsKey);
134  pL1TriggerKey->setSubsystemKey(L1TriggerKeyExt::kBMTF, BMTFKey + delimeter + BMTFrsKey);
135  pL1TriggerKey->setSubsystemKey(L1TriggerKeyExt::kOMTF, OMTFKey + delimeter + OMTFrsKey);
136  pL1TriggerKey->setSubsystemKey(L1TriggerKeyExt::kEMTF, EMTFKey + delimeter + EMTFrsKey);
137  pL1TriggerKey->setSubsystemKey(L1TriggerKeyExt::kTWINMUX, TWINMUXKey + delimeter + TWINMUXrsKey);
138 
139  edm::LogVerbatim("L1-O2O") << "UGT_KEY: " << uGTKey;
140  edm::LogVerbatim("L1-O2O") << "UGT_RS_KEY: " << uGTrsKey;
141  edm::LogVerbatim("L1-O2O") << "UGMT_KEY: " << uGMTKey;
142  edm::LogVerbatim("L1-O2O") << "UGMT_RS_KEY: " << uGMTrsKey;
143  edm::LogVerbatim("L1-O2O") << "CALO_KEY: " << CALOKey;
144  edm::LogVerbatim("L1-O2O") << "CALO_RS_KEY: " << CALOrsKey;
145  edm::LogVerbatim("L1-O2O") << "BMTF_KEY: " << BMTFKey;
146  edm::LogVerbatim("L1-O2O") << "BMTF_RS_KEY: " << BMTFrsKey;
147  edm::LogVerbatim("L1-O2O") << "OMTF_KEY: " << OMTFKey;
148  edm::LogVerbatim("L1-O2O") << "OMTF_RS_KEY: " << OMTFrsKey;
149  edm::LogVerbatim("L1-O2O") << "EMTF_KEY: " << EMTFKey;
150  edm::LogVerbatim("L1-O2O") << "EMTF_RS_KEY: " << EMTFrsKey;
151  edm::LogVerbatim("L1-O2O") << "TWINMUX_KEY: " << TWINMUXKey;
152  edm::LogVerbatim("L1-O2O") << "TWINMUX_RS_KEY: " << TWINMUXrsKey;
153 
154  } else {
155  throw l1t::DataAlreadyPresentException("L1TriggerKeyExt for TSC key " + m_tscKey + " and RS key " + m_rsKey +
156  " already in CondDB.");
157  }
158 
159  return pL1TriggerKey;
160 }

References l1t::OMDSReader::basicQuery(), l1t::DataWriterExt::fillLastTriggerKeyList(), l1t::OMDSReader::QueryResults::fillVariable(), L1TriggerKeyExt::kBMTF, L1TriggerKeyExt::kCALO, L1TriggerKeyExt::kEMTF, L1TriggerKeyExt::kOMTF, L1TriggerKeyExt::kTWINMUX, L1TriggerKeyExt::kuGMT, L1TriggerKeyExt::kuGT, m_forceGeneration, m_omdsReader, m_rsKey, m_tscKey, l1t::OMDSReader::QueryResults::numberRows(), l1t::OMDSReader::QueryResults::queryFailed(), l1t::OMDSReader::singleAttribute(), AlCaHLTBitMon_QueryRunRegistry::string, and L1TriggerKeyListExt::token().

Member Data Documentation

◆ m_forceGeneration

bool L1SubsystemKeysOnlineProdExt::m_forceGeneration
private

Definition at line 28 of file L1SubsystemKeysOnlineProdExt.h.

Referenced by produce().

◆ m_omdsReader

l1t::OMDSReader L1SubsystemKeysOnlineProdExt::m_omdsReader
private

Definition at line 27 of file L1SubsystemKeysOnlineProdExt.h.

Referenced by produce().

◆ m_rsKey

std::string L1SubsystemKeysOnlineProdExt::m_rsKey
private

Definition at line 26 of file L1SubsystemKeysOnlineProdExt.h.

Referenced by produce().

◆ m_tscKey

std::string L1SubsystemKeysOnlineProdExt::m_tscKey
private

Definition at line 26 of file L1SubsystemKeysOnlineProdExt.h.

Referenced by produce().

l1t::OMDSReader::QueryResults
Definition: OMDSReader.h:49
L1TriggerKeyExt::kuGMT
Definition: L1TriggerKeyExt.h:27
L1SubsystemKeysOnlineProdExt::m_rsKey
std::string m_rsKey
Definition: L1SubsystemKeysOnlineProdExt.h:26
L1TriggerKeyListExt
Definition: L1TriggerKeyListExt.h:10
L1TriggerKeyExt::kBMTF
Definition: L1TriggerKeyExt.h:27
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
l1t::DataAlreadyPresentException
Definition: Exception.h:32
l1t::OMDSReader::singleAttribute
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
L1SubsystemKeysOnlineProdExt::m_tscKey
std::string m_tscKey
Definition: L1SubsystemKeysOnlineProdExt.h:26
L1TriggerKeyExt::kCALO
Definition: L1TriggerKeyExt.h:27
L1TriggerKeyExt::kOMTF
Definition: L1TriggerKeyExt.h:27
l1t::OMDSReader::QueryResults::fillVariable
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:274
L1TriggerKeyExt::kTWINMUX
Definition: L1TriggerKeyExt.h:27
l1t::DataWriterExt::fillLastTriggerKeyList
bool fillLastTriggerKeyList(L1TriggerKeyListExt &output)
Definition: DataWriterExt.cc:148
L1SubsystemKeysOnlineProdExt::m_omdsReader
l1t::OMDSReader m_omdsReader
Definition: L1SubsystemKeysOnlineProdExt.h:27
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogError
Definition: MessageLogger.h:183
l1t::OMDSReader::QueryResults::numberRows
int numberRows() const
Definition: OMDSReader.h:60
edm::LogVerbatim
Definition: MessageLogger.h:297
l1t::OMDSReader::basicQuery
const QueryResults basicQuery(const std::vector< std::string > &columnNames, const std::string &schemaName, const std::string &tableName, const std::string &conditionLHS="", const QueryResults conditionRHS=QueryResults(), const std::string &conditionRHSName="")
Definition: OMDSReader.cc:75
L1SubsystemKeysOnlineProdExt::m_forceGeneration
bool m_forceGeneration
Definition: L1SubsystemKeysOnlineProdExt.h:28
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
L1TriggerKeyExt::kEMTF
Definition: L1TriggerKeyExt.h:27
l1t::OMDSReader::QueryResults::queryFailed
bool queryFailed() const
Definition: OMDSReader.h:59
L1TriggerKeyExt::kuGT
Definition: L1TriggerKeyExt.h:27
L1TriggerKeyListExt::token
std::string token(const std::string &tscKey) const
Definition: L1TriggerKeyListExt.cc:69
l1t::DataWriterExt
Definition: DataWriterExt.h:35