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::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

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
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () 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::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
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 TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
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::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
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.

References edm::ESProducer::setWhatProduced().

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 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
T getParameter(std::string const &) const
Definition: ParameterSet.h:307

◆ ~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.

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

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 }
Log< level::Info, true > LogVerbatim
bool fillLastTriggerKeyList(L1TriggerKeyListExt &output)
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
Log< level::Error, false > LogError
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
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:274
std::string token(const std::string &tscKey) const

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