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

Public Member Functions

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

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

Definition at line 42 of file L1SubsystemKeysOnlineProd.h.

Constructor & Destructor Documentation

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

Definition at line 51 of file L1SubsystemKeysOnlineProd.cc.

References edm::ESProducer::setWhatProduced().

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

Definition at line 66 of file L1SubsystemKeysOnlineProd.cc.

67 {
68 
69  // do anything here that needs to be done at desctruction time
70  // (e.g. close files, deallocate resources etc.)
71 
72 }

Member Function Documentation

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

Definition at line 81 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().

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

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

Member Data Documentation

bool L1SubsystemKeysOnlineProd::m_forceGeneration
private

Definition at line 49 of file L1SubsystemKeysOnlineProd.h.

Referenced by produce().

l1t::OMDSReader L1SubsystemKeysOnlineProd::m_omdsReader
private

Definition at line 48 of file L1SubsystemKeysOnlineProd.h.

Referenced by produce().

std::string L1SubsystemKeysOnlineProd::m_tscKey
private

Definition at line 47 of file L1SubsystemKeysOnlineProd.h.

Referenced by produce().