CMS 3D CMS Logo

L1MuGMTParametersKeysOnlineProd.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // \class L1MuGMTParametersOnlineProd
4 //
5 // Description: A key producer to deduce the GMT LUT keys from the master
6 // GMT configuration key, closely following the example of
7 //
8 // https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideL1ConfigOnlineProd r11
9 //
10 //
11 // Author :
12 // Thomas Themel
13 //
14 //--------------------------------------------------
15 
18 
20 public:
22  LogDebug("L1-O2O") << "L1MuGMTParametersKeysOnlineProd created" << std::endl;
23  }
25 
26  void fillObjectKeys(FillType) override;
27 
28 private:
29 };
30 
32  std::string subsystemKey = pL1TriggerKey->subsystemKey(L1TriggerKey::kGMT);
33 
34  if (!subsystemKey.empty()) {
36  // SELECTed column
37  "LUT_KEY",
38  // schema name
39  "CMS_GMT",
40  // table name
41  "GMT_CONFIG",
42  // WHERE lhs
43  "GMT_CONFIG.KEY",
44  // WHERE rhs
45  m_omdsReader.singleAttribute(subsystemKey));
46 
47  if (lutKeyResults.queryFailed() || lutKeyResults.numberRows() != 1) // check if query was successful
48  {
49  edm::LogError("L1-O2O") << "Problem extracting GMT LUT key from GMT config key.";
50  return;
51  }
52 
53  l1t::OMDSReader::QueryResults softwareConfigKeyResults = m_omdsReader.basicQuery(
54  // SELECTed column
55  "GMT_SOFTWARE_CONFIG",
56  // schema name
57  "CMS_GMT",
58  // table name
59  "GMT_LUTS",
60  // WHERE lhs
61  "GMT_LUTS.KEY",
62  // WHERE rhs
63  lutKeyResults);
64 
65  if (softwareConfigKeyResults.queryFailed() ||
66  softwareConfigKeyResults.numberRows() != 1) // check if query was successful
67  {
68  edm::LogError("L1-O2O") << "Problem extracting GMT software config key from GMT config key.";
69  return;
70  }
71 
72  std::string objectKey;
73  softwareConfigKeyResults.fillVariable(objectKey);
74 
75  pL1TriggerKey->add("L1MuGMTParametersRcd", "L1MuGMTParameters", objectKey);
76  }
77 }
78 
l1t::OMDSReader::QueryResults
Definition: OMDSReader.h:49
MessageLogger.h
L1TriggerKey::kGMT
Definition: L1TriggerKey.h:27
L1ObjectKeysOnlineProdBase::m_omdsReader
l1t::OMDSReader m_omdsReader
Definition: L1ObjectKeysOnlineProdBase.h:54
L1MuGMTParametersKeysOnlineProd::fillObjectKeys
void fillObjectKeys(FillType) override
Definition: L1MuGMTParametersKeysOnlineProd.cc:31
l1t::OMDSReader::singleAttribute
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
L1MuGMTParametersKeysOnlineProd
Definition: L1MuGMTParametersKeysOnlineProd.cc:19
l1t::OMDSReader::QueryResults::fillVariable
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:274
L1MuGMTParametersKeysOnlineProd::~L1MuGMTParametersKeysOnlineProd
~L1MuGMTParametersKeysOnlineProd() override
Definition: L1MuGMTParametersKeysOnlineProd.cc:24
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1ObjectKeysOnlineProdBase
Definition: L1ObjectKeysOnlineProdBase.h:39
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
l1t::OMDSReader::QueryResults::numberRows
int numberRows() const
Definition: OMDSReader.h:60
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
L1MuGMTParametersKeysOnlineProd::L1MuGMTParametersKeysOnlineProd
L1MuGMTParametersKeysOnlineProd(const edm::ParameterSet &iConfig)
Definition: L1MuGMTParametersKeysOnlineProd.cc:21
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
l1t::OMDSReader::QueryResults::queryFailed
bool queryFailed() const
Definition: OMDSReader.h:59
L1ObjectKeysOnlineProdBase.h
L1ObjectKeysOnlineProdBase::FillType
std::unique_ptr< L1TriggerKey >::pointer FillType
Definition: L1ObjectKeysOnlineProdBase.h:45