CMS 3D CMS Logo

L1GctTSCObjectKeysOnlineProd.cc
Go to the documentation of this file.
3 
5 public:
8 
9  void fillObjectKeys(FillType pL1TriggerKey) override;
10 
11 private:
12 };
13 
15  // kMYSUBSYSTEM = kCSCTF, kDTTF, kRPC, kGMT, kRCT, kGCT, kGT, or kTSP0
16  // subsystemKey = TRIGGERSUP_CONF.{CSCTF_KEY, DTTF_KEY, RPC_KEY, GMT_KEY, RCT_KEY, GCT_KEY, GT_KEY}
17  std::string subsystemKey = pL1TriggerKey->subsystemKey(L1TriggerKey::kGCT);
18 
19  if (!subsystemKey.empty()) {
20  // Execute SQL queries to get data from OMDS (using key) and make C++ object.
21  // Example: SELECT A_PARAMETER FROM CMS_XXX.XXX_CONF WHERE XXX_CONF.XXX_KEY = subsystemKey
22 
23  // get main crate key
24  l1t::OMDSReader::QueryResults mainCrateKeyResults =
25  m_omdsReader.basicQuery("GCT_MAIN_CRATE_KEY",
26  "CMS_GCT",
27  "GCT_CONFIG",
28  "GCT_CONFIG.CONFIG_KEY",
29  m_omdsReader.singleAttribute(subsystemKey));
30 
31  // get phys params key
33  "GCT_PHYS_PARAMS_KEY", "CMS_GCT", "GCT_MAIN_CRATE", "GCT_MAIN_CRATE.CONFIG_KEY", mainCrateKeyResults);
34 
35  std::string physParamsKey;
36 
37  if (physParamsKeyResults.queryFailed()) {
38  edm::LogError("L1-O2O") << "Problem with key for record L1GctJetFinderParamsRcd: query failed ";
39  } else if (physParamsKeyResults.numberRows() != 1) {
40  edm::LogError("L1-O2O") << "Problem with key for record L1GctJetFinderParamsRcd: "
41  << (physParamsKeyResults.numberRows()) << " rows were returned";
42  } else {
43  physParamsKeyResults.fillVariable(physParamsKey);
44  }
45 
46  pL1TriggerKey->add("L1GctJetFinderParamsRcd", "L1GctJetFinderParams", physParamsKey);
47  pL1TriggerKey->add("L1JetEtScaleRcd", "L1CaloEtScale", physParamsKey);
48  pL1TriggerKey->add("L1HtMissScaleRcd", "L1CaloEtScale", physParamsKey);
49  pL1TriggerKey->add("L1HfRingEtScaleRcd", "L1CaloEtScale", physParamsKey);
50  }
51 }
52 
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
std::unique_ptr< L1TriggerKey >::pointer FillType
Log< level::Error, false > LogError
void fillObjectKeys(FillType pL1TriggerKey) override
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
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:274
L1GctTSCObjectKeysOnlineProd(const edm::ParameterSet &iConfig)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60