#include <L1MuGMTParametersOnlineProducer.h>
Public Member Functions | |
L1MuGMTParametersOnlineProducer (const edm::ParameterSet &) | |
virtual boost::shared_ptr < L1MuGMTParameters > | newObject (const std::string &objectKey) |
The method that actually implements the production of the parameter objects. | |
~L1MuGMTParametersOnlineProducer () | |
Protected Member Functions | |
void | checkCMSSWVersion (const coral::AttributeList &configRecord) |
Private Member Functions | |
std::string | lookupSoftwareConfigKey (const std::string &globalKey) |
Private Attributes | |
bool | ignoreVersionMismatch_ |
Definition at line 33 of file L1MuGMTParametersOnlineProducer.h.
L1MuGMTParametersOnlineProducer::L1MuGMTParametersOnlineProducer | ( | const edm::ParameterSet & | ps | ) |
Definition at line 141 of file L1MuGMTParametersOnlineProducer.cc.
References edm::ParameterSet::getParameter(), and ignoreVersionMismatch_.
: L1ConfigOnlineProdBase<L1MuGMTParametersRcd, L1MuGMTParameters>(ps) { ignoreVersionMismatch_ = ps.getParameter<bool>("ignoreVersionMismatch"); }
L1MuGMTParametersOnlineProducer::~L1MuGMTParametersOnlineProducer | ( | ) |
Definition at line 148 of file L1MuGMTParametersOnlineProducer.cc.
{}
void L1MuGMTParametersOnlineProducer::checkCMSSWVersion | ( | const coral::AttributeList & | configRecord | ) | [protected] |
Definition at line 115 of file L1MuGMTParametersOnlineProducer.cc.
References Exception, and BeamSplash_cfg::version.
{ const coral::Attribute& version = configRecord["CMSSW_VERSION"]; /* If the DB field is unset, take any. */ if(version.isNull()) { edm::LogInfo("No CMSSW version set in database, accepting " PROJECT_VERSION); return; } /* Else make sure we have the correct version. */ const std::string& versionString = version.data<string>(); /* PROJECT_VERSION is passed as a -D #define from scramv1 (eg CMSSW_2_1_0) */ if(versionString != PROJECT_VERSION) { std::string errMsg = "CMSSW version mismatch: Configuration requires " + versionString + ", but this is " PROJECT_VERSION "!"; if(ignoreVersionMismatch_) { edm::LogWarning(errMsg + " (will continue because ignoreVersionMismatch is set)"); } else { throw cond::Exception(errMsg); } } }
std::string L1MuGMTParametersOnlineProducer::lookupSoftwareConfigKey | ( | const std::string & | globalKey | ) | [private] |
boost::shared_ptr< L1MuGMTParameters > L1MuGMTParametersOnlineProducer::newObject | ( | const std::string & | objectKey | ) | [virtual] |
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 36 of file L1MuGMTParametersOnlineProducer.cc.
References ADD_FIELD, l1t::OMDSReader::QueryResults::attributeLists(), and Exception.
{ using namespace edm::es; RecordHelper<L1MuGMTParameters> helper; // Copy data members from L1MuGMTParameters, // and M-x replace-regexp RET .*m_\([a-z:_]*\) RET ADD_FIELD(helper, L1MuGMTParameters, \1) RET ADD_FIELD(helper, L1MuGMTParameters, EtaWeight_barrel); ADD_FIELD(helper, L1MuGMTParameters, PhiWeight_barrel); ADD_FIELD(helper, L1MuGMTParameters, EtaPhiThreshold_barrel); ADD_FIELD(helper, L1MuGMTParameters, EtaWeight_endcap); ADD_FIELD(helper, L1MuGMTParameters, PhiWeight_endcap); ADD_FIELD(helper, L1MuGMTParameters, EtaPhiThreshold_endcap); ADD_FIELD(helper, L1MuGMTParameters, EtaWeight_COU); ADD_FIELD(helper, L1MuGMTParameters, PhiWeight_COU); ADD_FIELD(helper, L1MuGMTParameters, EtaPhiThreshold_COU); ADD_FIELD(helper, L1MuGMTParameters, CaloTrigger); ADD_FIELD(helper, L1MuGMTParameters, IsolationCellSizeEta); ADD_FIELD(helper, L1MuGMTParameters, IsolationCellSizePhi); ADD_FIELD(helper, L1MuGMTParameters, DoOvlRpcAnd); ADD_FIELD(helper, L1MuGMTParameters, PropagatePhi); ADD_FIELD(helper, L1MuGMTParameters, MergeMethodPhiBrl); ADD_FIELD(helper, L1MuGMTParameters, MergeMethodPhiFwd); ADD_FIELD(helper, L1MuGMTParameters, MergeMethodEtaBrl); ADD_FIELD(helper, L1MuGMTParameters, MergeMethodEtaFwd); ADD_FIELD(helper, L1MuGMTParameters, MergeMethodPtBrl); ADD_FIELD(helper, L1MuGMTParameters, MergeMethodPtFwd); ADD_FIELD(helper, L1MuGMTParameters, MergeMethodChargeBrl); ADD_FIELD(helper, L1MuGMTParameters, MergeMethodChargeFwd); ADD_FIELD(helper, L1MuGMTParameters, MergeMethodMIPBrl); ADD_FIELD(helper, L1MuGMTParameters, MergeMethodMIPFwd); ADD_FIELD(helper, L1MuGMTParameters, MergeMethodMIPSpecialUseANDBrl); ADD_FIELD(helper, L1MuGMTParameters, MergeMethodMIPSpecialUseANDFwd); ADD_FIELD(helper, L1MuGMTParameters, MergeMethodISOBrl); ADD_FIELD(helper, L1MuGMTParameters, MergeMethodISOFwd); ADD_FIELD(helper, L1MuGMTParameters, MergeMethodISOSpecialUseANDBrl); ADD_FIELD(helper, L1MuGMTParameters, MergeMethodISOSpecialUseANDFwd); ADD_FIELD(helper, L1MuGMTParameters, MergeMethodSRKBrl); ADD_FIELD(helper, L1MuGMTParameters, MergeMethodSRKFwd); ADD_FIELD(helper, L1MuGMTParameters, HaloOverwritesMatchedBrl); ADD_FIELD(helper, L1MuGMTParameters, HaloOverwritesMatchedFwd); ADD_FIELD(helper, L1MuGMTParameters, SortRankOffsetBrl); ADD_FIELD(helper, L1MuGMTParameters, SortRankOffsetFwd); ADD_FIELD(helper, L1MuGMTParameters, CDLConfigWordDTCSC); ADD_FIELD(helper, L1MuGMTParameters, CDLConfigWordCSCDT); ADD_FIELD(helper, L1MuGMTParameters, CDLConfigWordbRPCCSC); ADD_FIELD(helper, L1MuGMTParameters, CDLConfigWordfRPCDT); ADD_FIELD(helper, L1MuGMTParameters, VersionSortRankEtaQLUT); boost::shared_ptr<L1MuGMTParameters> ptrResult(new L1MuGMTParameters); std::vector<std::string> resultColumns = helper.getColumnList(); resultColumns.push_back("CMSSW_VERSION"); l1t::OMDSReader::QueryResults resultLines = m_omdsReader.basicQuery( // SELECTed columns resultColumns, // schema name "CMS_GMT", // table name "GMT_SOFTWARE_CONFIG", // WHERE lhs "GMT_SOFTWARE_CONFIG.KEY", // WHERE rhs m_omdsReader.singleAttribute(objectKey) ); if(resultLines.numberRows() == 1) { const AttributeList& resultRecord = resultLines.attributeLists().front(); checkCMSSWVersion(resultRecord); helper.extractRecord(resultRecord, *ptrResult); return ptrResult; } throw cond::Exception("Couldn't find GMT_SOFTWARE_CONFIG record for GMT key `" + objectKey + "'") ; }
bool L1MuGMTParametersOnlineProducer::ignoreVersionMismatch_ [private] |
Definition at line 45 of file L1MuGMTParametersOnlineProducer.h.
Referenced by L1MuGMTParametersOnlineProducer().