CMS 3D CMS Logo

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

#include <CondTools/L1Trigger/interface/L1SubsystemKeysOnlineProd.h>

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

Public Types

typedef std::unique_ptr< L1TriggerKeyReturnType
 

Public Member Functions

 L1SubsystemKeysOnlineProd (const edm::ParameterSet &)
 
ReturnType produce (const L1TriggerKeyRcd &)
 
 ~L1SubsystemKeysOnlineProd () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESProxyIndex 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< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
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_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
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::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

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 37 of file L1SubsystemKeysOnlineProd.h.

Member Typedef Documentation

◆ ReturnType

Definition at line 42 of file L1SubsystemKeysOnlineProd.h.

Constructor & Destructor Documentation

◆ L1SubsystemKeysOnlineProd()

L1SubsystemKeysOnlineProd::L1SubsystemKeysOnlineProd ( const edm::ParameterSet iConfig)

Definition at line 50 of file L1SubsystemKeysOnlineProd.cc.

References edm::ESProducer::setWhatProduced().

51  : m_tscKey(iConfig.getParameter<std::string>("tscKey")),
52  m_omdsReader(iConfig.getParameter<std::string>("onlineDB"),
53  iConfig.getParameter<std::string>("onlineAuthentication")),
54  m_forceGeneration(iConfig.getParameter<bool>("forceGeneration")) {
55  //the following line is needed to tell the framework what
56  // data is being produced
57  setWhatProduced(this, "SubsystemKeysOnly");
58 
59  //now do what ever other initialization is needed
60 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:165
T getParameter(std::string const &) const
Definition: ParameterSet.h:303

◆ ~L1SubsystemKeysOnlineProd()

L1SubsystemKeysOnlineProd::~L1SubsystemKeysOnlineProd ( )
override

Definition at line 62 of file L1SubsystemKeysOnlineProd.cc.

62  {
63  // do anything here that needs to be done at desctruction time
64  // (e.g. close files, deallocate resources etc.)
65 }

Member Function Documentation

◆ produce()

L1SubsystemKeysOnlineProd::ReturnType L1SubsystemKeysOnlineProd::produce ( const L1TriggerKeyRcd iRecord)

Definition at line 72 of file L1SubsystemKeysOnlineProd.cc.

References l1t::OMDSReader::basicQuery(), l1t::DataWriter::fillLastTriggerKeyList(), l1t::OMDSReader::QueryResults::fillVariable(), L1TriggerKey::kCSCTF, L1TriggerKey::kDTTF, L1TriggerKey::kGCT, L1TriggerKey::kGMT, L1TriggerKey::kGT, L1TriggerKey::kRCT, L1TriggerKey::kRPC, L1TriggerKey::kTSP0, m_forceGeneration, m_omdsReader, m_tscKey, l1t::OMDSReader::QueryResults::numberRows(), l1t::OMDSReader::QueryResults::queryFailed(), l1t::OMDSReader::singleAttribute(), AlCaHLTBitMon_QueryRunRegistry::string, and L1TriggerKeyList::token().

72  {
73  std::unique_ptr<L1TriggerKey> pL1TriggerKey;
74 
75  // Get L1TriggerKeyList
76  L1TriggerKeyList keyList;
77  l1t::DataWriter dataWriter;
78  if (!dataWriter.fillLastTriggerKeyList(keyList)) {
79  edm::LogError("L1-O2O") << "Problem getting last L1TriggerKeyList";
80  }
81 
82  // If L1TriggerKeyList does not contain TSC key, token is empty
83  if (keyList.token(m_tscKey).empty() || m_forceGeneration) {
84  // Instantiate new L1TriggerKey
85  pL1TriggerKey = std::make_unique<L1TriggerKey>();
86  pL1TriggerKey->setTSCKey(m_tscKey);
87 
88  edm::LogVerbatim("L1-O2O") << "TSC KEY " << m_tscKey;
89 
90  // Get subsystem keys from OMDS
91 
92  // SELECT CSCTF_KEY, DTTF_KEY, RPC_KEY, GMT_KEY, RCT_KEY, GCT_KEY, GT_KEY FROM TRIGGERSUP_CONF WHERE TRIGGERSUP_CONF.TS_KEY = m_tscKey
93  std::vector<std::string> queryStrings;
94  queryStrings.push_back("CSCTF_KEY");
95  queryStrings.push_back("DTTF_KEY");
96  queryStrings.push_back("RPC_KEY");
97  queryStrings.push_back("GMT_KEY");
98  queryStrings.push_back("RCT_KEY");
99  queryStrings.push_back("GCT_KEY");
100  queryStrings.push_back("GT_KEY");
101  // queryStrings.push_back( "TSP0_KEY" ) ;
102 
103  l1t::OMDSReader::QueryResults subkeyResults = m_omdsReader.basicQuery(queryStrings,
104  "CMS_TRG_L1_CONF",
105  "TRIGGERSUP_CONF",
106  "TRIGGERSUP_CONF.TS_KEY",
108 
109  if (subkeyResults.queryFailed() || subkeyResults.numberRows() != 1) // check query successful
110  {
111  edm::LogError("L1-O2O") << "Problem with subsystem keys.";
112  return pL1TriggerKey;
113  }
114 
115  std::string csctfKey, dttfKey, rpcKey, gmtKey, rctKey, gctKey, gtKey;
116 
117  subkeyResults.fillVariable("CSCTF_KEY", csctfKey);
118  pL1TriggerKey->setSubsystemKey(L1TriggerKey::kCSCTF, csctfKey);
119  edm::LogVerbatim("L1-O2O") << "CSCTF_KEY " << csctfKey;
120 
121  subkeyResults.fillVariable("DTTF_KEY", dttfKey);
122  pL1TriggerKey->setSubsystemKey(L1TriggerKey::kDTTF, dttfKey);
123  edm::LogVerbatim("L1-O2O") << "DTTF_KEY " << dttfKey;
124 
125  subkeyResults.fillVariable("RPC_KEY", rpcKey);
126  pL1TriggerKey->setSubsystemKey(L1TriggerKey::kRPC, rpcKey);
127  edm::LogVerbatim("L1-O2O") << "RPC_KEY " << rpcKey;
128 
129  subkeyResults.fillVariable("GMT_KEY", gmtKey);
130  pL1TriggerKey->setSubsystemKey(L1TriggerKey::kGMT, gmtKey);
131  edm::LogVerbatim("L1-O2O") << "GMT_KEY " << gmtKey;
132 
133  subkeyResults.fillVariable("RCT_KEY", rctKey);
134  pL1TriggerKey->setSubsystemKey(L1TriggerKey::kRCT, rctKey);
135  edm::LogVerbatim("L1-O2O") << "RCT_KEY " << rctKey;
136 
137  subkeyResults.fillVariable("GCT_KEY", gctKey);
138  pL1TriggerKey->setSubsystemKey(L1TriggerKey::kGCT, gctKey);
139  edm::LogVerbatim("L1-O2O") << "GCT_KEY " << gctKey;
140 
141  subkeyResults.fillVariable("GT_KEY", gtKey);
142  pL1TriggerKey->setSubsystemKey(L1TriggerKey::kGT, gtKey);
143  edm::LogVerbatim("L1-O2O") << "GT_KEY " << gtKey;
144 
145  // std::string tsp0Key = row[ "TSP0_KEY" ].data< std::string >() ;
146  std::string tsp0Key;
147  pL1TriggerKey->setSubsystemKey(L1TriggerKey::kTSP0, tsp0Key);
148  edm::LogVerbatim("L1-O2O") << "TSP0_KEY " << tsp0Key;
149  } else {
150  throw l1t::DataAlreadyPresentException("L1TriggerKey for TSC key " + m_tscKey + " already in CondDB.");
151  }
152 
153  return pL1TriggerKey;
154 }
Log< level::Info, true > LogVerbatim
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
std::string token(const std::string &tscKey) const
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
bool fillLastTriggerKeyList(L1TriggerKeyList &output)
Definition: DataWriter.cc:147

Member Data Documentation

◆ m_forceGeneration

bool L1SubsystemKeysOnlineProd::m_forceGeneration
private

Definition at line 50 of file L1SubsystemKeysOnlineProd.h.

Referenced by produce().

◆ m_omdsReader

l1t::OMDSReader L1SubsystemKeysOnlineProd::m_omdsReader
private

Definition at line 49 of file L1SubsystemKeysOnlineProd.h.

Referenced by produce().

◆ m_tscKey

std::string L1SubsystemKeysOnlineProd::m_tscKey
private

Definition at line 48 of file L1SubsystemKeysOnlineProd.h.

Referenced by produce().