CMS 3D CMS Logo

L1MuGMTChannelMaskOnlineProducer.cc
Go to the documentation of this file.
4 
5 class L1MuGMTChannelMaskOnlineProducer : public L1ConfigOnlineProdBase<L1MuGMTChannelMaskRcd, L1MuGMTChannelMask> {
6 public:
10 
11  std::unique_ptr<L1MuGMTChannelMask> newObject(const std::string& objectKey) override;
12 
13 private:
14 };
15 
16 std::unique_ptr<L1MuGMTChannelMask> L1MuGMTChannelMaskOnlineProducer::newObject(const std::string& objectKey) {
17  std::vector<std::string> columns;
18  columns.push_back("ENABLE_RPCB");
19  columns.push_back("ENABLE_CSC");
20  columns.push_back("ENABLE_DT");
21  columns.push_back("ENABLE_RPCF");
22 
23  // Execute SQL queries to get data from OMDS (using key) and make C++ object
24  // Example: SELECT A_PARAMETER FROM CMS_XXX.XXX_CONF WHERE XXX_CONF.XXX_KEY = objectKey
26  columns, "CMS_GMT", "GMT_RUN_SETTINGS", "GMT_RUN_SETTINGS.ID", m_omdsReader.singleAttribute(objectKey));
27 
28  if (results.queryFailed()) // check if query was successful
29  {
30  edm::LogError("L1-O2O") << "L1MuGMTChannelMaskOnlineProducer: Problem getting " << objectKey
31  << " key from GMT_RUN_SETTING.";
32  return std::unique_ptr<L1MuGMTChannelMask>();
33  }
34 
35  unsigned mask = 0;
36  bool maskaux;
37  results.fillVariable("ENABLE_RPCB", maskaux);
38  if (!maskaux)
39  mask |= 2;
40  results.fillVariable("ENABLE_CSC", maskaux);
41  if (!maskaux)
42  mask |= 4;
43  results.fillVariable("ENABLE_DT", maskaux);
44  if (!maskaux)
45  mask |= 1;
46  results.fillVariable("ENABLE_RPCF", maskaux);
47  if (!maskaux)
48  mask |= 8;
49 
50  auto gmtchanmask = std::make_unique<L1MuGMTChannelMask>();
51 
52  gmtchanmask->setSubsystemMask(mask);
53 
54  return gmtchanmask;
55 }
56 
l1t::OMDSReader::QueryResults
Definition: OMDSReader.h:49
L1MuGMTChannelMask.h
L1MuGMTChannelMaskOnlineProducer
Definition: L1MuGMTChannelMaskOnlineProducer.cc:5
L1ConfigOnlineProdBase< L1MuGMTChannelMaskRcd, L1MuGMTChannelMask >::m_omdsReader
l1t::OMDSReader m_omdsReader
Definition: L1ConfigOnlineProdBase.h:65
bookConverter.results
results
Definition: bookConverter.py:144
l1t::OMDSReader::singleAttribute
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
L1ConfigOnlineProdBase
Definition: L1ConfigOnlineProdBase.h:52
L1MuGMTChannelMask
Definition: L1MuGMTChannelMask.h:25
L1MuGMTChannelMaskRcd.h
L1MuGMTChannelMaskOnlineProducer::~L1MuGMTChannelMaskOnlineProducer
~L1MuGMTChannelMaskOnlineProducer() override
Definition: L1MuGMTChannelMaskOnlineProducer.cc:9
edm::ParameterSet
Definition: ParameterSet.h:47
L1MuGMTChannelMaskOnlineProducer::L1MuGMTChannelMaskOnlineProducer
L1MuGMTChannelMaskOnlineProducer(const edm::ParameterSet &iConfig)
Definition: L1MuGMTChannelMaskOnlineProducer.cc:7
l1t::OMDSReader::basicQuery
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
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
mps_check.columns
columns
Definition: mps_check.py:244
L1MuGMTChannelMaskRcd
Definition: L1MuGMTChannelMaskRcd.h:10
L1ConfigOnlineProdBase.h
L1MuGMTChannelMaskOnlineProducer::newObject
std::unique_ptr< L1MuGMTChannelMask > newObject(const std::string &objectKey) override
Definition: L1MuGMTChannelMaskOnlineProducer.cc:16