CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:274
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
std::unique_ptr< L1TriggerKey >::pointer FillType
Log< level::Error, false > LogError
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(const edm::ParameterSet &iConfig)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
#define LogDebug(id)