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

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

Definition at line 15 of file L1SubsystemKeysOnlineProdExt.h.

Member Typedef Documentation

Definition at line 20 of file L1SubsystemKeysOnlineProdExt.h.

Constructor & Destructor Documentation

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" ) ),
17  iConfig.getParameter< std::string >( "onlineDB" ),
18  iConfig.getParameter< std::string >( "onlineAuthentication" ) ),
19  m_forceGeneration( iConfig.getParameter< bool >( "forceGeneration" ) )
20 {
21  //the following line is needed to tell the framework what
22  // data is being produced
23  setWhatProduced(this, "SubsystemKeysOnly");
24 
25  //now do what ever other initialization is needed
26 }
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
L1SubsystemKeysOnlineProdExt::~L1SubsystemKeysOnlineProdExt ( )
override

Definition at line 29 of file L1SubsystemKeysOnlineProdExt.cc.

30 {
31 
32  // do anything here that needs to be done at desctruction time
33  // (e.g. close files, deallocate resources etc.)
34 
35 }

Member Function Documentation

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

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

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

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

Member Data Documentation

bool L1SubsystemKeysOnlineProdExt::m_forceGeneration
private

Definition at line 27 of file L1SubsystemKeysOnlineProdExt.h.

Referenced by produce().

l1t::OMDSReader L1SubsystemKeysOnlineProdExt::m_omdsReader
private

Definition at line 26 of file L1SubsystemKeysOnlineProdExt.h.

Referenced by produce().

std::string L1SubsystemKeysOnlineProdExt::m_rsKey
private

Definition at line 25 of file L1SubsystemKeysOnlineProdExt.h.

Referenced by produce().

std::string L1SubsystemKeysOnlineProdExt::m_tscKey
private

Definition at line 25 of file L1SubsystemKeysOnlineProdExt.h.

Referenced by produce().