CMS 3D CMS Logo

RCTObjectKeysOnlineProd.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1TriggerConfig
4 // Class: RCTObjectKeysOnlineProd
5 //
13 //
14 // Original Author: Werner Man-Li Sun
15 // Created: Fri Aug 22 19:51:36 CEST 2008
16 //
17 //
18 
19 // system include files
20 #include <iostream>
21 
22 // user include files
24 
26 
27 //
28 // class declaration
29 //
30 
32 public:
34  ~RCTObjectKeysOnlineProd() override;
35 
36  void fillObjectKeys(FillType pL1TriggerKey) override;
37 
38 private:
39  // ----------member data ---------------------------
40 };
41 
42 //
43 // constants, enums and typedefs
44 //
45 
46 //
47 // static data member definitions
48 //
49 
50 //
51 // constructors and destructor
52 //
54  : L1ObjectKeysOnlineProdBase(iConfig) {}
55 
57  // do anything here that needs to be done at desctruction time
58  // (e.g. close files, deallocate resources etc.)
59 }
60 
61 //
62 // member functions
63 //
64 
65 // ------------ method called to produce the data ------------
67  std::string rctKey = pL1TriggerKey->subsystemKey(L1TriggerKey::kRCT);
68 
69  if (!rctKey.empty()) {
70  std::string paremKey, scaleKey, ecalScaleKey, hcalScaleKey;
71  // SELECT RCT_PARAMETER FROM RCT_CONF WHERE RCT_CONF.RCT_KEY = rctKey
73  "RCT_PARAMETER", "CMS_RCT", "RCT_CONF", "RCT_CONF.RCT_KEY", m_omdsReader.singleAttribute(rctKey));
74 
75  if (paremKeyResults.queryFailed() || paremKeyResults.numberRows() != 1) // check query successful
76  {
77  edm::LogError("L1-O2O") << "Problem with RCT Parameter key.";
78  return;
79  }
80 
81  l1t::OMDSReader::QueryResults scaleKeyResults =
82  m_omdsReader.basicQuery("L1T_SCALE_CALO_ET_THRESHOLD_ID",
83  "CMS_RCT",
84  "PAREM_CONF",
85  "PAREM_CONF.PAREM_KEY",
86  paremKeyResults); // not null no need to check
87 
89  "ECAL_CONF", "CMS_RCT", "RCT_CONF", "RCT_CONF.RCT_KEY", m_omdsReader.singleAttribute(rctKey));
90 
91  if (ecalKeyResults.queryFailed() || ecalKeyResults.numberRows() > 1) // check query successful)
92  {
93  edm::LogError("L1-O2O") << "Problem with rct_conf.ecal_conf.";
94  return;
95  }
96  std::string ecalKey;
97  if (!ecalKeyResults.fillVariable(ecalKey))
98  ecalScaleKey = "NULL";
99  else { // fill variable not null
100 
101  if (ecalKey == "NULL")
102  ecalScaleKey = "NULL";
103  else if (ecalKey == "IDENTITY")
104  ecalScaleKey = "IDENTITY";
105  else { // not identity or null
106 
108  "ECAL_LUT_CONFIG_ID", "CMS_RCT", "ECAL_SCALE_KEY", "ECAL_SCALE_KEY.ECAL_TAG", ecalKeyResults);
109 
110  if (ecalScaleKeyResults.queryFailed() || ecalScaleKeyResults.numberRows() > 1) // check query successful)
111  {
112  std::cout << " nrows " << ecalScaleKeyResults.numberRows() << std::endl;
113  edm::LogError("L1-O2O") << "bad results from lut_config_id.";
114  return;
115  }
116  int ecalScaleTemp = -1;
117 
118  ecalScaleKeyResults.fillVariable(ecalScaleTemp);
119 
120  std::stringstream ss;
121  ss << ecalScaleTemp;
122  ecalScaleKey = ss.str();
123  }
124  }
125 
127  "HCAL_CONF", "CMS_RCT", "RCT_CONF", "RCT_CONF.RCT_KEY", m_omdsReader.singleAttribute(rctKey));
128 
129  if (hcalKeyResults.queryFailed() || hcalKeyResults.numberRows() > 1) // check query successful)
130  {
131  edm::LogError("L1-O2O") << "Problem with rct_conf.hcal_conf.";
132  return;
133  }
134  std::string hcalKey;
135  if (!hcalKeyResults.fillVariable(hcalScaleKey))
136  hcalScaleKey = "NULL";
137 
138  paremKeyResults.fillVariable(paremKey);
139  scaleKeyResults.fillVariable(scaleKey);
140 
141  pL1TriggerKey->add("L1RCTParametersRcd", "L1RCTParameters", paremKey);
142  pL1TriggerKey->add("L1EmEtScaleRcd", "L1CaloEtScale", scaleKey);
143  pL1TriggerKey->add("L1CaloEcalScaleRcd", "L1CaloEcalScale", ecalScaleKey);
144  pL1TriggerKey->add("L1CaloHcalScaleRcd", "L1CaloHcalScale", hcalScaleKey);
145  }
146 }
147 
148 //define this as a plug-in
l1t::OMDSReader::QueryResults
Definition: OMDSReader.h:49
MessageLogger.h
gather_cfg.cout
cout
Definition: gather_cfg.py:144
L1ObjectKeysOnlineProdBase::m_omdsReader
l1t::OMDSReader m_omdsReader
Definition: L1ObjectKeysOnlineProdBase.h:54
l1t::OMDSReader::singleAttribute
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
l1t::OMDSReader::QueryResults::fillVariable
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:274
RCTObjectKeysOnlineProd
Definition: RCTObjectKeysOnlineProd.cc:31
L1TriggerKey::kRCT
Definition: L1TriggerKey.h:27
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1ObjectKeysOnlineProdBase
Definition: L1ObjectKeysOnlineProdBase.h:39
edm::ParameterSet
Definition: ParameterSet.h:47
RCTObjectKeysOnlineProd::~RCTObjectKeysOnlineProd
~RCTObjectKeysOnlineProd() override
Definition: RCTObjectKeysOnlineProd.cc:56
RCTObjectKeysOnlineProd::RCTObjectKeysOnlineProd
RCTObjectKeysOnlineProd(const edm::ParameterSet &)
Definition: RCTObjectKeysOnlineProd.cc:53
l1t::OMDSReader::QueryResults::numberRows
int numberRows() const
Definition: OMDSReader.h:60
RCTObjectKeysOnlineProd::fillObjectKeys
void fillObjectKeys(FillType pL1TriggerKey) override
Definition: RCTObjectKeysOnlineProd.cc:66
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
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