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