CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
L1MuGMTParametersOnlineProducer Class Reference

#include <L1MuGMTParametersOnlineProducer.h>

Inheritance diagram for L1MuGMTParametersOnlineProducer:
L1ConfigOnlineProdBase< L1MuGMTParametersRcd, L1MuGMTParameters > edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 L1MuGMTParametersOnlineProducer (const edm::ParameterSet &)
 
std::shared_ptr< L1MuGMTParametersnewObject (const std::string &objectKey) override
 The method that actually implements the production of the parameter objects. More...
 
 ~L1MuGMTParametersOnlineProducer () override
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1MuGMTParametersRcd, L1MuGMTParameters >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
virtual std::shared_ptr< L1MuGMTParametersproduce (const L1MuGMTParametersRcd &iRecord)
 
 ~L1ConfigOnlineProdBase () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ~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)
 

Protected Member Functions

void checkCMSSWVersion (const coral::AttributeList &configRecord)
 
- Protected Member Functions inherited from L1ConfigOnlineProdBase< L1MuGMTParametersRcd, L1MuGMTParameters >
bool getObjectKey (const L1MuGMTParametersRcd &record, std::shared_ptr< L1MuGMTParameters > data, std::string &objectKey)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- 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 &)
 

Private Member Functions

std::string lookupSoftwareConfigKey (const std::string &globalKey)
 

Private Attributes

bool ignoreVersionMismatch_
 

Additional Inherited Members

- 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
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Attributes inherited from L1ConfigOnlineProdBase< L1MuGMTParametersRcd, L1MuGMTParameters >
bool m_copyFromCondDB
 
cond::persistency::Session m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Definition at line 30 of file L1MuGMTParametersOnlineProducer.h.

Constructor & Destructor Documentation

L1MuGMTParametersOnlineProducer::L1MuGMTParametersOnlineProducer ( const edm::ParameterSet ps)
L1MuGMTParametersOnlineProducer::~L1MuGMTParametersOnlineProducer ( )
override

Definition at line 147 of file L1MuGMTParametersOnlineProducer.cc.

References DEFINE_FWK_EVENTSETUP_MODULE.

147 {}

Member Function Documentation

void L1MuGMTParametersOnlineProducer::checkCMSSWVersion ( const coral::AttributeList &  configRecord)
protected

Definition at line 114 of file L1MuGMTParametersOnlineProducer.cc.

References AlCaHLTBitMon_QueryRunRegistry::string, and jets_cff::version.

115 {
116  const coral::Attribute& version = configRecord["CMSSW_VERSION"];
117 
118  /* If the DB field is unset, take any. */
119  if(version.isNull()) {
120  edm::LogInfo("No CMSSW version set in database, accepting " PROJECT_VERSION);
121  return;
122  }
123 
124  /* Else make sure we have the correct version. */
125  const std::string& versionString = version.data<string>();
126 
127  /* PROJECT_VERSION is passed as a -D #define from scramv1 (eg CMSSW_2_1_0) */
128  if(versionString != PROJECT_VERSION) {
129  std::string errMsg = "CMSSW version mismatch: Configuration requires " +
130  versionString + ", but this is " + PROJECT_VERSION + "!";
131 
133  edm::LogWarning(errMsg + " (will continue because ignoreVersionMismatch is set)");
134  } else {
135  throw cond::Exception(errMsg);
136  }
137  }
138 }
persistency::Exception Exception
Definition: Exception.h:25
std::string L1MuGMTParametersOnlineProducer::lookupSoftwareConfigKey ( const std::string &  globalKey)
private
std::shared_ptr< L1MuGMTParameters > L1MuGMTParametersOnlineProducer::newObject ( const std::string &  objectKey)
overridevirtual

The method that actually implements the production of the parameter objects.

---------— method called to produce the data ---------— Query the CMS_GMT.GMT_SOFTWARE_CONFIG table with a key determined by the "master" config table and return the matching record.

Implements L1ConfigOnlineProdBase< L1MuGMTParametersRcd, L1MuGMTParameters >.

Definition at line 34 of file L1MuGMTParametersOnlineProducer.cc.

References ADD_FIELD, l1t::OMDSReader::QueryResults::attributeLists(), RecordHelper< TOutput >::extractRecord(), RecordHelper< TOutput >::getColumnList(), and l1t::OMDSReader::QueryResults::numberRows().

35 {
36  using namespace edm::es;
37 
39 
40  // Copy data members from L1MuGMTParameters,
41  // and M-x replace-regexp RET .*m_\([a-z:_]*\) RET ADD_FIELD(helper, L1MuGMTParameters, \1) RET
42 
43  ADD_FIELD(helper, L1MuGMTParameters, EtaWeight_barrel);
44  ADD_FIELD(helper, L1MuGMTParameters, PhiWeight_barrel);
45  ADD_FIELD(helper, L1MuGMTParameters, EtaPhiThreshold_barrel);
46  ADD_FIELD(helper, L1MuGMTParameters, EtaWeight_endcap);
47  ADD_FIELD(helper, L1MuGMTParameters, PhiWeight_endcap);
48  ADD_FIELD(helper, L1MuGMTParameters, EtaPhiThreshold_endcap);
49  ADD_FIELD(helper, L1MuGMTParameters, EtaWeight_COU);
50  ADD_FIELD(helper, L1MuGMTParameters, PhiWeight_COU);
51  ADD_FIELD(helper, L1MuGMTParameters, EtaPhiThreshold_COU);
52  ADD_FIELD(helper, L1MuGMTParameters, CaloTrigger);
53  ADD_FIELD(helper, L1MuGMTParameters, IsolationCellSizeEta);
54  ADD_FIELD(helper, L1MuGMTParameters, IsolationCellSizePhi);
55  ADD_FIELD(helper, L1MuGMTParameters, DoOvlRpcAnd);
56  ADD_FIELD(helper, L1MuGMTParameters, PropagatePhi);
57  ADD_FIELD(helper, L1MuGMTParameters, MergeMethodPhiBrl);
58  ADD_FIELD(helper, L1MuGMTParameters, MergeMethodPhiFwd);
59  ADD_FIELD(helper, L1MuGMTParameters, MergeMethodEtaBrl);
60  ADD_FIELD(helper, L1MuGMTParameters, MergeMethodEtaFwd);
61  ADD_FIELD(helper, L1MuGMTParameters, MergeMethodPtBrl);
62  ADD_FIELD(helper, L1MuGMTParameters, MergeMethodPtFwd);
63  ADD_FIELD(helper, L1MuGMTParameters, MergeMethodChargeBrl);
64  ADD_FIELD(helper, L1MuGMTParameters, MergeMethodChargeFwd);
65  ADD_FIELD(helper, L1MuGMTParameters, MergeMethodMIPBrl);
66  ADD_FIELD(helper, L1MuGMTParameters, MergeMethodMIPFwd);
67  ADD_FIELD(helper, L1MuGMTParameters, MergeMethodMIPSpecialUseANDBrl);
68  ADD_FIELD(helper, L1MuGMTParameters, MergeMethodMIPSpecialUseANDFwd);
69  ADD_FIELD(helper, L1MuGMTParameters, MergeMethodISOBrl);
70  ADD_FIELD(helper, L1MuGMTParameters, MergeMethodISOFwd);
71  ADD_FIELD(helper, L1MuGMTParameters, MergeMethodISOSpecialUseANDBrl);
72  ADD_FIELD(helper, L1MuGMTParameters, MergeMethodISOSpecialUseANDFwd);
73  ADD_FIELD(helper, L1MuGMTParameters, MergeMethodSRKBrl);
74  ADD_FIELD(helper, L1MuGMTParameters, MergeMethodSRKFwd);
75  ADD_FIELD(helper, L1MuGMTParameters, HaloOverwritesMatchedBrl);
76  ADD_FIELD(helper, L1MuGMTParameters, HaloOverwritesMatchedFwd);
77  ADD_FIELD(helper, L1MuGMTParameters, SortRankOffsetBrl);
78  ADD_FIELD(helper, L1MuGMTParameters, SortRankOffsetFwd);
79  ADD_FIELD(helper, L1MuGMTParameters, CDLConfigWordDTCSC);
80  ADD_FIELD(helper, L1MuGMTParameters, CDLConfigWordCSCDT);
81  ADD_FIELD(helper, L1MuGMTParameters, CDLConfigWordbRPCCSC);
82  ADD_FIELD(helper, L1MuGMTParameters, CDLConfigWordfRPCDT);
83  ADD_FIELD(helper, L1MuGMTParameters, VersionSortRankEtaQLUT);
84  ADD_FIELD(helper, L1MuGMTParameters, VersionLUTs);
85 
86  auto ptrResult = std::make_shared<L1MuGMTParameters>();
87 
88  std::vector<std::string> resultColumns = helper.getColumnList();
89  resultColumns.push_back("CMSSW_VERSION");
90 
91  l1t::OMDSReader::QueryResults resultLines =
93  // SELECTed columns
94  resultColumns,
95  // schema name
96  "CMS_GMT",
97  // table name
98  "GMT_SOFTWARE_CONFIG",
99  // WHERE lhs
100  "GMT_SOFTWARE_CONFIG.KEY",
101  // WHERE rhs
102  m_omdsReader.singleAttribute(objectKey) );
103 
104  if(resultLines.numberRows() == 1) {
105  const AttributeList& resultRecord = resultLines.attributeLists().front();
106  checkCMSSWVersion(resultRecord);
107  helper.extractRecord(resultRecord, *ptrResult);
108  return ptrResult;
109  }
110 
111  throw cond::Exception("Couldn't find GMT_SOFTWARE_CONFIG record for GMT key `" + objectKey + "'") ;
112 }
persistency::Exception Exception
Definition: Exception.h:25
virtual void extractRecord(const AttributeList &source, TOutput &dest)
Definition: RecordHelper.h:168
Definition: helper.py:1
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:295
const std::vector< coral::AttributeList > & attributeLists() const
Definition: OMDSReader.h:64
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
#define ADD_FIELD(HELPER, OUTPUT_NAME, FIELD_NAME)
Definition: RecordHelper.h:200
virtual std::vector< std::string > getColumnList()
Definition: RecordHelper.h:176
void checkCMSSWVersion(const coral::AttributeList &configRecord)

Member Data Documentation

bool L1MuGMTParametersOnlineProducer::ignoreVersionMismatch_
private

Definition at line 42 of file L1MuGMTParametersOnlineProducer.h.

Referenced by L1MuGMTParametersOnlineProducer().