21 #include "boost/lexical_cast.hpp" 51 auto pL1GtPrescaleFactors = std::make_unique<L1GtPrescaleFactors>();
67 std::vector<std::string> columnsView;
68 columnsView.push_back(
"PRESCALE_INDEX");
69 columnsView.push_back(
"PRESCALE_FACTORS_TT_FK");
72 columnsView, gtSchema,
"GT_RUN_SETTINGS_PRESC_VIEW",
79 <<
"Problem to get content of GT_RUN_SETTINGS_PRESC_VIEW " 80 <<
"for GT_RUN_SETTINGS_PRESC_VIEW.ID: " << objectKey;
81 return pL1GtPrescaleFactors;
86 std::string objectKeyPrescaleFactorsSet =
"WRONG_KEY_INITIAL";
87 short prescaleFactorsSetIndex = 9999;
89 int resultsViewRows = resultsView.
numberRows();
91 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd") <<
"\nFound " 92 << resultsViewRows <<
" prescale factors sets for \n " 93 <<
"GT_RUN_SETTINGS_PRESC_VIEW.ID = " << objectKey <<
"\n" 98 std::vector<std::vector<int> > pFactors;
99 pFactors.reserve(resultsViewRows);
103 for (
int iRow = 0; iRow < resultsViewRows; ++iRow) {
105 for (std::vector<std::string>::const_iterator constIt =
106 columnsView.begin(); constIt != columnsView.end(); ++constIt) {
108 if ((*constIt) ==
"PRESCALE_INDEX") {
110 prescaleFactorsSetIndex);
111 }
else if ((*constIt) ==
"PRESCALE_FACTORS_TT_FK") {
113 objectKeyPrescaleFactorsSet);
116 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
117 <<
"\nUnknown field " << (*constIt)
118 <<
" requested for columns in GT_RUN_SETTINGS_PRESC_VIEW" 125 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
126 <<
"\nFound prescale factors set: \n index = " 127 << prescaleFactorsSetIndex
128 <<
"\n PRESCALE_FACTORS_TT_FK = " 129 << objectKeyPrescaleFactorsSet <<
"\n" << std::endl;
140 gtSchema,
"GT_FDL_PRESCALE_FACTORS_TT");
143 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
144 <<
"\nColumn names for GT_FDL_PRESCALE_FACTORS_TT" 147 for (std::vector<std::string>::const_iterator iter =
148 columns.begin(); iter != columns.end(); iter++) {
149 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
150 << (*iter) << std::endl;
156 columns, gtSchema,
"GT_FDL_PRESCALE_FACTORS_TT",
157 "GT_FDL_PRESCALE_FACTORS_TT.ID",
163 <<
"Problem with L1GtPrescaleFactorsTechTrigRcd key:" 164 << objectKeyPrescaleFactorsSet;
165 return pL1GtPrescaleFactors;
173 if (prescaleFactorsSetIndex != countSet) {
175 <<
"L1GtPrescaleFactorsTechTrig has unordered sets PRESCALE_INDEX in DB for\n" 176 <<
" GT_RUN_SETTINGS_PRESC_VIEW.ID = " << objectKey <<
"\n" 178 return pL1GtPrescaleFactors;
184 int pfSetSize = columns.size() - 1;
185 std::vector<int> pfSet(pfSetSize, 0);
187 for (
int i = 0;
i < pfSetSize;
i++) {
191 pFactors.push_back(pfSet);
197 pL1GtPrescaleFactors->setGtPrescaleFactors(pFactors);
200 std::ostringstream myCoutStream;
201 pL1GtPrescaleFactors->print(myCoutStream);
202 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
203 <<
"\nThe following L1GtPrescaleFactorsTechTrigRcd record was read from OMDS: \n" 204 << myCoutStream.str() <<
"\n" << std::endl;
207 return pL1GtPrescaleFactors;
~L1GtPrescaleFactorsTechTrigConfigOnlineProd() override
destructor
bool fillVariable(const std::string &columnName, T &outputVariable) const
const QueryResults singleAttribute(const T &data) const
std::vector< std::string > columnNames(const std::string &schemaName, const std::string &tableName)
bool fillVariableFromRow(const std::string &columnName, int rowNumber, T &outputVariable) const
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="")
L1GtPrescaleFactorsTechTrigConfigOnlineProd(const edm::ParameterSet &)
constructor
l1t::OMDSReader m_omdsReader
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
const QueryResults basicQueryView(const std::vector< std::string > &columnNames, const std::string &schemaName, const std::string &viewName, const std::string &conditionLHS="", const QueryResults conditionRHS=QueryResults(), const std::string &conditionRHSName="")
std::unique_ptr< L1GtPrescaleFactors > newObject(const std::string &objectKey) override
public methods