CMS 3D CMS Logo

L1GtRsObjectKeysOnlineProd.cc
Go to the documentation of this file.
1 
15 // this class header
17 
18 // system include files
19 
20 // user include files
22 
23 // constructor
26  m_partitionNumber(parSet.getParameter<int>("PartitionNumber")),
27  m_enableL1GtPrescaleFactorsAlgoTrig(parSet.getParameter<bool>("EnableL1GtPrescaleFactorsAlgoTrig")),
28  m_enableL1GtPrescaleFactorsTechTrig(parSet.getParameter<bool>("EnableL1GtPrescaleFactorsTechTrig")),
29  m_enableL1GtTriggerMaskAlgoTrig(parSet.getParameter<bool>("EnableL1GtTriggerMaskAlgoTrig")),
30  m_enableL1GtTriggerMaskTechTrig(parSet.getParameter<bool>("EnableL1GtTriggerMaskTechTrig")),
31  m_enableL1GtTriggerMaskVetoTechTrig(parSet.getParameter<bool>("EnableL1GtTriggerMaskVetoTechTrig")) {
32  // empty
33 }
34 
35 // destructor
37  // empty
38 }
39 
40 // private methods
42  std::string objectKey;
43 
44  // SELECT GT_RUN_SETTINGS_FK FROM CMS_GT.GT_RUN_SETTINGS_KEY_CURRENT
45  // WHERE GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER = m_partitionNumber
46  l1t::OMDSReader::QueryResults objectKeyResults =
47  m_omdsReader.basicQueryGenericKey<int>("GT_RUN_SETTINGS_FK",
48  gtSchema,
49  "GT_RUN_SETTINGS_KEY_CURRENT",
50  "GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER",
52  "");
53 
54  // check if query was successful
55  if (objectKeyResults.queryFailed()) {
56  edm::LogError("L1-O2O") << "Problem with key for record L1GtPrescaleFactorsAlgoTrigRcd: query failed ";
57  return objectKey;
58  } else if ((objectKeyResults.numberRows() != 1)) {
59  edm::LogError("L1-O2O") << "Problem with key for record L1GtPrescaleFactorsAlgoTrigRcd: "
60  << (objectKeyResults.numberRows()) << " rows were returned";
61  return objectKey;
62  }
63 
64  objectKeyResults.fillVariable(objectKey);
65 
66  //
67  if (edm::isDebugEnabled()) {
68  LogTrace("L1GtRsObjectKeysOnlineProd") << "\nThe following GT_RUN_SETTINGS_FK key "
69  << "was found for L1GtPrescaleFactorsAlgoTrigRcd: \n " << objectKey
70  << "\nfor partition " << m_partitionNumber << "\n"
71  << std::endl;
72  }
73 
74  return objectKey;
75 }
76 
78  std::string objectKey;
79 
80  // SELECT GT_RUN_SETTINGS_FK FROM CMS_GT.GT_RUN_SETTINGS_KEY_CURRENT
81  // WHERE GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER = m_partitionNumber
82  l1t::OMDSReader::QueryResults objectKeyResults =
83  m_omdsReader.basicQueryGenericKey<int>("GT_RUN_SETTINGS_FK",
84  gtSchema,
85  "GT_RUN_SETTINGS_KEY_CURRENT",
86  "GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER",
88  "");
89 
90  // check if query was successful
91  if (objectKeyResults.queryFailed()) {
92  edm::LogError("L1-O2O") << "Problem with key for record L1GtPrescaleFactorsTechTrigRcd: query failed ";
93  return objectKey;
94  } else if ((objectKeyResults.numberRows() != 1)) {
95  edm::LogError("L1-O2O") << "Problem with key for record L1GtPrescaleFactorsTechTrigRcd: "
96  << (objectKeyResults.numberRows()) << " rows were returned";
97  return objectKey;
98  }
99 
100  objectKeyResults.fillVariable(objectKey);
101 
102  //
103  if (edm::isDebugEnabled()) {
104  LogTrace("L1GtRsObjectKeysOnlineProd") << "\nThe following GT_RUN_SETTINGS_FK key "
105  << "was found for L1GtPrescaleFactorsTechTrigRcd: \n " << objectKey
106  << "\nfor partition " << m_partitionNumber << "\n"
107  << std::endl;
108  }
109 
110  return objectKey;
111 }
112 
114  std::string objectKey;
115 
116  // SELECT FINOR_ALGO_FK FROM CMS_GT.GT_RUN_SETTINGS
117  // WHERE GT_RUN_SETTINGS.ID = (
118  // SELECT GT_RUN_SETTINGS_FK FROM CMS_GT.GT_RUN_SETTINGS_KEY_CURRENT
119  // WHERE GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER = m_partitionNumber)
120  l1t::OMDSReader::QueryResults objectKeyResults =
121  m_omdsReader.basicQuery("FINOR_ALGO_FK",
122  gtSchema,
123  "GT_RUN_SETTINGS",
124  "GT_RUN_SETTINGS.ID",
125  m_omdsReader.basicQueryGenericKey<int>("GT_RUN_SETTINGS_FK",
126  gtSchema,
127  "GT_RUN_SETTINGS_KEY_CURRENT",
128  "GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER",
130  ""));
131 
132  // check if query was successful
133  if (objectKeyResults.queryFailed()) {
134  edm::LogError("L1-O2O") << "Problem with key for record L1GtTriggerMaskAlgoTrigRcd: query failed ";
135  return objectKey;
136  } else if ((objectKeyResults.numberRows() != 1)) {
137  edm::LogError("L1-O2O") << "Problem with key for record L1GtTriggerMaskAlgoTrigRcd: "
138  << (objectKeyResults.numberRows()) << " rows were returned";
139  return objectKey;
140  }
141 
142  objectKeyResults.fillVariable(objectKey);
143 
144  //
145  if (edm::isDebugEnabled()) {
146  LogTrace("L1GtRsObjectKeysOnlineProd") << "\nThe following key was found for L1GtTriggerMaskAlgoTrigRcd: \n "
147  << objectKey << "\nfor partition " << m_partitionNumber << "\n"
148  << std::endl;
149  }
150 
151  return objectKey;
152 }
153 
155  std::string objectKey;
156 
157  // SELECT FINOR_TT_FK FROM CMS_GT.GT_RUN_SETTINGS
158  // WHERE GT_RUN_SETTINGS.ID = (
159  // SELECT GT_RUN_SETTINGS_FK FROM CMS_GT.GT_RUN_SETTINGS_KEY_CURRENT
160  // WHERE GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER = m_partitionNumber)
161  l1t::OMDSReader::QueryResults objectKeyResults =
162  m_omdsReader.basicQuery("FINOR_TT_FK",
163  gtSchema,
164  "GT_RUN_SETTINGS",
165  "GT_RUN_SETTINGS.ID",
166  m_omdsReader.basicQueryGenericKey<int>("GT_RUN_SETTINGS_FK",
167  gtSchema,
168  "GT_RUN_SETTINGS_KEY_CURRENT",
169  "GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER",
171  ""));
172 
173  // check if query was successful
174  if (objectKeyResults.queryFailed()) {
175  edm::LogError("L1-O2O") << "Problem with key for record L1GtTriggerMaskTechTrigRcd: query failed ";
176  return objectKey;
177  } else if ((objectKeyResults.numberRows() != 1)) {
178  edm::LogError("L1-O2O") << "Problem with key for record L1GtTriggerMaskTechTrigRcd: "
179  << (objectKeyResults.numberRows()) << " rows were returned";
180  return objectKey;
181  }
182 
183  objectKeyResults.fillVariable(objectKey);
184 
185  //
186  if (edm::isDebugEnabled()) {
187  LogTrace("L1GtRsObjectKeysOnlineProd") << "\nThe following key was found for L1GtTriggerMaskTechTrigRcd: \n "
188  << objectKey << "\nfor partition " << m_partitionNumber << "\n"
189  << std::endl;
190  }
191 
192  return objectKey;
193 }
194 
196  std::string objectKey;
197 
198  // SELECT VETO_TT_FK FROM CMS_GT.GT_RUN_SETTINGS
199  // WHERE GT_RUN_SETTINGS.ID = (
200  // SELECT GT_RUN_SETTINGS_FK FROM CMS_GT.GT_RUN_SETTINGS_KEY_CURRENT
201  // WHERE GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER = m_partitionNumber)
202  l1t::OMDSReader::QueryResults objectKeyResults =
203  m_omdsReader.basicQuery("VETO_TT_FK",
204  gtSchema,
205  "GT_RUN_SETTINGS",
206  "GT_RUN_SETTINGS.ID",
207  m_omdsReader.basicQueryGenericKey<int>("GT_RUN_SETTINGS_FK",
208  gtSchema,
209  "GT_RUN_SETTINGS_KEY_CURRENT",
210  "GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER",
212  ""));
213 
214  // check if query was successful
215  if (objectKeyResults.queryFailed()) {
216  edm::LogError("L1-O2O") << "Problem with key for record L1GtTriggerMaskVetoTechTrigRcd: query failed ";
217  return objectKey;
218  } else if ((objectKeyResults.numberRows() != 1)) {
219  edm::LogError("L1-O2O") << "Problem with key for record L1GtTriggerMaskVetoTechTrigRcd: "
220  << (objectKeyResults.numberRows()) << " rows were returned";
221  return objectKey;
222  }
223 
224  objectKeyResults.fillVariable(objectKey);
225 
226  //
227  if (edm::isDebugEnabled()) {
228  LogTrace("L1GtRsObjectKeysOnlineProd") << "\nThe following key was found for L1GtTriggerMaskVetoTechTrigRcd: \n "
229  << objectKey << "\nfor partition " << m_partitionNumber << "\n"
230  << std::endl;
231  }
232 
233  return objectKey;
234 }
235 
236 // public methods
238  const std::string gtSchema = "CMS_GT";
239 
241  const std::string& objectKey = keyL1GtPrescaleFactorsAlgoTrig(gtSchema);
242  if (!objectKey.empty()) {
243  pL1TriggerKey->add("L1GtPrescaleFactorsAlgoTrigRcd", "L1GtPrescaleFactors", objectKey);
244  }
245  }
246 
248  const std::string& objectKey = keyL1GtPrescaleFactorsTechTrig(gtSchema);
249  if (!objectKey.empty()) {
250  pL1TriggerKey->add("L1GtPrescaleFactorsTechTrigRcd", "L1GtPrescaleFactors", objectKey);
251  }
252  }
253 
255  const std::string& objectKey = keyL1GtTriggerMaskAlgoTrig(gtSchema);
256  if (!objectKey.empty()) {
257  pL1TriggerKey->add("L1GtTriggerMaskAlgoTrigRcd", "L1GtTriggerMask", objectKey);
258  }
259  }
260 
262  const std::string& objectKey = keyL1GtTriggerMaskTechTrig(gtSchema);
263  if (!objectKey.empty()) {
264  pL1TriggerKey->add("L1GtTriggerMaskTechTrigRcd", "L1GtTriggerMask", objectKey);
265  }
266  }
267 
269  const std::string& objectKey = keyL1GtTriggerMaskVetoTechTrig(gtSchema);
270  if (!objectKey.empty()) {
271  pL1TriggerKey->add("L1GtTriggerMaskVetoTechTrigRcd", "L1GtTriggerMask", objectKey);
272  }
273  }
274 }
275 
l1t::OMDSReader::QueryResults
Definition: OMDSReader.h:49
L1GtRsObjectKeysOnlineProd.h
electrons_cff.bool
bool
Definition: electrons_cff.py:366
L1GtRsObjectKeysOnlineProd::m_enableL1GtTriggerMaskVetoTechTrig
bool m_enableL1GtTriggerMaskVetoTechTrig
Definition: L1GtRsObjectKeysOnlineProd.h:52
MessageLogger.h
L1GtRsObjectKeysOnlineProd::L1GtRsObjectKeysOnlineProd
L1GtRsObjectKeysOnlineProd(const edm::ParameterSet &)
constructor
Definition: L1GtRsObjectKeysOnlineProd.cc:24
L1GtRsObjectKeysOnlineProd::m_enableL1GtTriggerMaskAlgoTrig
bool m_enableL1GtTriggerMaskAlgoTrig
Definition: L1GtRsObjectKeysOnlineProd.h:50
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
L1GtRsObjectKeysOnlineProd::m_enableL1GtPrescaleFactorsAlgoTrig
bool m_enableL1GtPrescaleFactorsAlgoTrig
enable key search for each record
Definition: L1GtRsObjectKeysOnlineProd.h:48
L1GtRsObjectKeysOnlineProd::fillObjectKeys
void fillObjectKeys(FillType pL1TriggerKey) override
public methods
Definition: L1GtRsObjectKeysOnlineProd.cc:237
L1GtRsObjectKeysOnlineProd::m_enableL1GtPrescaleFactorsTechTrig
bool m_enableL1GtPrescaleFactorsTechTrig
Definition: L1GtRsObjectKeysOnlineProd.h:49
l1t::OMDSReader::basicQueryGenericKey
const QueryResults basicQueryGenericKey(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.h:194
L1GtRsObjectKeysOnlineProd::keyL1GtPrescaleFactorsTechTrig
std::string keyL1GtPrescaleFactorsTechTrig(const std::string &)
Definition: L1GtRsObjectKeysOnlineProd.cc:77
l1t::OMDSReader::QueryResults::fillVariable
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:274
L1GtRsObjectKeysOnlineProd::m_partitionNumber
int m_partitionNumber
partition number
Definition: L1GtRsObjectKeysOnlineProd.h:45
L1GtRsObjectKeysOnlineProd::keyL1GtTriggerMaskTechTrig
std::string keyL1GtTriggerMaskTechTrig(const std::string &)
Definition: L1GtRsObjectKeysOnlineProd.cc:154
L1GtRsObjectKeysOnlineProd::keyL1GtPrescaleFactorsAlgoTrig
std::string keyL1GtPrescaleFactorsAlgoTrig(const std::string &)
keys for individual objects
Definition: L1GtRsObjectKeysOnlineProd.cc:41
L1ObjectKeysOnlineProdBase
Definition: L1ObjectKeysOnlineProdBase.h:39
L1GtRsObjectKeysOnlineProd::m_enableL1GtTriggerMaskTechTrig
bool m_enableL1GtTriggerMaskTechTrig
Definition: L1GtRsObjectKeysOnlineProd.h:51
edm::ParameterSet
Definition: ParameterSet.h:47
L1GtRsObjectKeysOnlineProd::keyL1GtTriggerMaskAlgoTrig
std::string keyL1GtTriggerMaskAlgoTrig(const std::string &)
Definition: L1GtRsObjectKeysOnlineProd.cc:113
L1GtRsObjectKeysOnlineProd::keyL1GtTriggerMaskVetoTechTrig
std::string keyL1GtTriggerMaskVetoTechTrig(const std::string &)
Definition: L1GtRsObjectKeysOnlineProd.cc:195
createfilelist.int
int
Definition: createfilelist.py:10
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
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
l1t::OMDSReader::QueryResults::queryFailed
bool queryFailed() const
Definition: OMDSReader.h:59
edm::isDebugEnabled
bool isDebugEnabled()
Definition: MessageLogger.cc:12
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
L1GtRsObjectKeysOnlineProd::~L1GtRsObjectKeysOnlineProd
~L1GtRsObjectKeysOnlineProd() override
destructor
Definition: L1GtRsObjectKeysOnlineProd.cc:36
L1ObjectKeysOnlineProdBase::FillType
std::unique_ptr< L1TriggerKey >::pointer FillType
Definition: L1ObjectKeysOnlineProdBase.h:45
L1GtRsObjectKeysOnlineProd
Definition: L1GtRsObjectKeysOnlineProd.h:24