CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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(
27  parSet.getParameter<int> ("PartitionNumber")),
28  m_enableL1GtPrescaleFactorsAlgoTrig(
29  parSet.getParameter<bool> ("EnableL1GtPrescaleFactorsAlgoTrig")),
30  m_enableL1GtPrescaleFactorsTechTrig(
31  parSet.getParameter<bool> ("EnableL1GtPrescaleFactorsTechTrig")),
32  m_enableL1GtTriggerMaskAlgoTrig(
33  parSet.getParameter<bool> ("EnableL1GtTriggerMaskAlgoTrig")),
34  m_enableL1GtTriggerMaskTechTrig(
35  parSet.getParameter<bool> ("EnableL1GtTriggerMaskTechTrig")),
36  m_enableL1GtTriggerMaskVetoTechTrig(
37  parSet.getParameter<bool> ("EnableL1GtTriggerMaskVetoTechTrig")) {
38 
39  // empty
40 }
41 
42 // destructor
44 
45  // empty
46 
47 }
48 
49 // private methods
51 
52  std::string objectKey;
53 
54  // SELECT GT_RUN_SETTINGS_FK FROM CMS_GT.GT_RUN_SETTINGS_KEY_CURRENT
55  // WHERE GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER = m_partitionNumber
56  l1t::OMDSReader::QueryResults objectKeyResults =
57  m_omdsReader.basicQueryGenericKey<int> ("GT_RUN_SETTINGS_FK",
58  gtSchema, "GT_RUN_SETTINGS_KEY_CURRENT",
59  "GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER",
61 
62  // check if query was successful
63  if (objectKeyResults.queryFailed()) {
64  edm::LogError("L1-O2O")
65  << "Problem with key for record L1GtPrescaleFactorsAlgoTrigRcd: query failed ";
66  return objectKey;
67  } else if ( ( objectKeyResults.numberRows() != 1 )) {
68  edm::LogError("L1-O2O") << "Problem with key for record L1GtPrescaleFactorsAlgoTrigRcd: "
69  << ( objectKeyResults.numberRows() ) << " rows were returned";
70  return objectKey;
71  }
72 
73  objectKeyResults.fillVariable(objectKey);
74 
75  //
76  if (edm::isDebugEnabled()) {
77  LogTrace("L1GtRsObjectKeysOnlineProd")
78  << "\nThe following GT_RUN_SETTINGS_FK key "
79  << "was found for L1GtPrescaleFactorsAlgoTrigRcd: \n "
80  << objectKey << "\nfor partition " << m_partitionNumber << "\n"
81  << std::endl;
82  }
83 
84  return objectKey;
85 }
86 
87 
89 
90  std::string objectKey;
91 
92  // SELECT GT_RUN_SETTINGS_FK FROM CMS_GT.GT_RUN_SETTINGS_KEY_CURRENT
93  // WHERE GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER = m_partitionNumber
94  l1t::OMDSReader::QueryResults objectKeyResults =
95  m_omdsReader.basicQueryGenericKey<int> ("GT_RUN_SETTINGS_FK",
96  gtSchema, "GT_RUN_SETTINGS_KEY_CURRENT",
97  "GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER",
99 
100  // check if query was successful
101  if (objectKeyResults.queryFailed()) {
102  edm::LogError("L1-O2O")
103  << "Problem with key for record L1GtPrescaleFactorsTechTrigRcd: query failed ";
104  return objectKey;
105  } else if ( ( objectKeyResults.numberRows() != 1 )) {
106  edm::LogError("L1-O2O") << "Problem with key for record L1GtPrescaleFactorsTechTrigRcd: "
107  << ( objectKeyResults.numberRows() ) << " rows were returned";
108  return objectKey;
109  }
110 
111  objectKeyResults.fillVariable(objectKey);
112 
113  //
114  if (edm::isDebugEnabled()) {
115  LogTrace("L1GtRsObjectKeysOnlineProd")
116  << "\nThe following GT_RUN_SETTINGS_FK key "
117  << "was found for L1GtPrescaleFactorsTechTrigRcd: \n "
118  << objectKey << "\nfor partition " << m_partitionNumber << "\n"
119  << std::endl;
120  }
121 
122  return objectKey;
123 }
124 
125 
127 
128  std::string objectKey;
129 
130  // SELECT FINOR_ALGO_FK FROM CMS_GT.GT_RUN_SETTINGS
131  // WHERE GT_RUN_SETTINGS.ID = (
132  // SELECT GT_RUN_SETTINGS_FK FROM CMS_GT.GT_RUN_SETTINGS_KEY_CURRENT
133  // WHERE GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER = m_partitionNumber)
135  "FINOR_ALGO_FK", gtSchema, "GT_RUN_SETTINGS", "GT_RUN_SETTINGS.ID",
137  "GT_RUN_SETTINGS_FK", gtSchema, "GT_RUN_SETTINGS_KEY_CURRENT",
138  "GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER",
140 
141  // check if query was successful
142  if (objectKeyResults.queryFailed()) {
143  edm::LogError("L1-O2O")
144  << "Problem with key for record L1GtTriggerMaskAlgoTrigRcd: query failed ";
145  return objectKey;
146  } else if ( ( objectKeyResults.numberRows() != 1 )) {
147  edm::LogError("L1-O2O") << "Problem with key for record L1GtTriggerMaskAlgoTrigRcd: "
148  << ( objectKeyResults.numberRows() ) << " rows were returned";
149  return objectKey;
150  }
151 
152  objectKeyResults.fillVariable(objectKey);
153 
154  //
155  if (edm::isDebugEnabled()) {
156  LogTrace("L1GtRsObjectKeysOnlineProd")
157  << "\nThe following key was found for L1GtTriggerMaskAlgoTrigRcd: \n " << objectKey
158  << "\nfor partition " << m_partitionNumber << "\n" << std::endl;
159  }
160 
161  return objectKey;
162 }
163 
165 
166  std::string objectKey;
167 
168  // SELECT FINOR_TT_FK FROM CMS_GT.GT_RUN_SETTINGS
169  // WHERE GT_RUN_SETTINGS.ID = (
170  // SELECT GT_RUN_SETTINGS_FK FROM CMS_GT.GT_RUN_SETTINGS_KEY_CURRENT
171  // WHERE GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER = m_partitionNumber)
173  "FINOR_TT_FK", gtSchema, "GT_RUN_SETTINGS", "GT_RUN_SETTINGS.ID",
175  "GT_RUN_SETTINGS_FK", gtSchema, "GT_RUN_SETTINGS_KEY_CURRENT",
176  "GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER",
178 
179  // check if query was successful
180  if (objectKeyResults.queryFailed()) {
181  edm::LogError("L1-O2O")
182  << "Problem with key for record L1GtTriggerMaskTechTrigRcd: query failed ";
183  return objectKey;
184  } else if ( ( objectKeyResults.numberRows() != 1 )) {
185  edm::LogError("L1-O2O") << "Problem with key for record L1GtTriggerMaskTechTrigRcd: "
186  << ( objectKeyResults.numberRows() ) << " rows were returned";
187  return objectKey;
188  }
189 
190  objectKeyResults.fillVariable(objectKey);
191 
192  //
193  if (edm::isDebugEnabled()) {
194  LogTrace("L1GtRsObjectKeysOnlineProd")
195  << "\nThe following key was found for L1GtTriggerMaskTechTrigRcd: \n " << objectKey
196  << "\nfor partition " << m_partitionNumber << "\n" << std::endl;
197  }
198 
199  return objectKey;
200 }
201 
203 
204  std::string objectKey;
205 
206  // SELECT VETO_TT_FK FROM CMS_GT.GT_RUN_SETTINGS
207  // WHERE GT_RUN_SETTINGS.ID = (
208  // SELECT GT_RUN_SETTINGS_FK FROM CMS_GT.GT_RUN_SETTINGS_KEY_CURRENT
209  // WHERE GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER = m_partitionNumber)
211  "VETO_TT_FK", gtSchema, "GT_RUN_SETTINGS", "GT_RUN_SETTINGS.ID",
213  "GT_RUN_SETTINGS_FK", gtSchema, "GT_RUN_SETTINGS_KEY_CURRENT",
214  "GT_RUN_SETTINGS_KEY_CURRENT.GT_PARTITION_NUMBER",
216 
217  // check if query was successful
218  if (objectKeyResults.queryFailed()) {
219  edm::LogError("L1-O2O")
220  << "Problem with key for record L1GtTriggerMaskVetoTechTrigRcd: query failed ";
221  return objectKey;
222  } else if ( ( objectKeyResults.numberRows() != 1 )) {
223  edm::LogError("L1-O2O") << "Problem with key for record L1GtTriggerMaskVetoTechTrigRcd: "
224  << ( objectKeyResults.numberRows() ) << " rows were returned";
225  return objectKey;
226  }
227 
228  objectKeyResults.fillVariable(objectKey);
229 
230  //
231  if (edm::isDebugEnabled()) {
232  LogTrace("L1GtRsObjectKeysOnlineProd")
233  << "\nThe following key was found for L1GtTriggerMaskVetoTechTrigRcd: \n "
234  << objectKey << "\nfor partition " << m_partitionNumber << "\n" << std::endl;
235  }
236 
237  return objectKey;
238 }
239 
240 // public methods
242 
243  const std::string gtSchema = "CMS_GT";
244 
246  const std::string& objectKey = keyL1GtPrescaleFactorsAlgoTrig(gtSchema);
247  if (!objectKey.empty()) {
248  pL1TriggerKey->add(
249  "L1GtPrescaleFactorsAlgoTrigRcd", "L1GtPrescaleFactors", objectKey);
250  }
251  }
252 
254  const std::string& objectKey = keyL1GtPrescaleFactorsTechTrig(gtSchema);
255  if (!objectKey.empty()) {
256  pL1TriggerKey->add(
257  "L1GtPrescaleFactorsTechTrigRcd", "L1GtPrescaleFactors", objectKey);
258  }
259  }
260 
262  const std::string& objectKey = keyL1GtTriggerMaskAlgoTrig(gtSchema);
263  if (!objectKey.empty()) {
264  pL1TriggerKey->add("L1GtTriggerMaskAlgoTrigRcd", "L1GtTriggerMask", objectKey);
265  }
266  }
267 
269  const std::string& objectKey = keyL1GtTriggerMaskTechTrig(gtSchema);
270  if (!objectKey.empty()) {
271  pL1TriggerKey->add("L1GtTriggerMaskTechTrigRcd", "L1GtTriggerMask", objectKey);
272  }
273  }
274 
276  const std::string& objectKey = keyL1GtTriggerMaskVetoTechTrig(gtSchema);
277  if (!objectKey.empty()) {
278  pL1TriggerKey->add(
279  "L1GtTriggerMaskVetoTechTrigRcd", "L1GtTriggerMask", objectKey);
280  }
281  }
282 
283 }
284 
bool isDebugEnabled()
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:311
bool m_enableL1GtPrescaleFactorsAlgoTrig
enable key search for each record
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:295
std::string keyL1GtTriggerMaskVetoTechTrig(const std::string &)
std::string keyL1GtTriggerMaskTechTrig(const std::string &)
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:216
std::string keyL1GtTriggerMaskAlgoTrig(const std::string &)
std::string keyL1GtPrescaleFactorsTechTrig(const std::string &)
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:86
L1GtRsObjectKeysOnlineProd(const edm::ParameterSet &)
constructor
#define LogTrace(id)
std::string keyL1GtPrescaleFactorsAlgoTrig(const std::string &)
keys for individual objects
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
virtual void fillObjectKeys(ReturnType pL1TriggerKey)
public methods
std::shared_ptr< L1TriggerKey > ReturnType