43 auto pL1GtPrescaleFactors = std::make_unique<L1GtPrescaleFactors>();
59 std::vector<std::string> columnsView;
60 columnsView.push_back(
"PRESCALE_INDEX");
61 columnsView.push_back(
"PRESCALE_FACTORS_ALGO_FK");
65 "GT_RUN_SETTINGS_PRESC_VIEW",
66 "GT_RUN_SETTINGS_PRESC_VIEW.ID",
71 edm::LogError(
"L1-O2O") <<
"Problem to get content of GT_RUN_SETTINGS_PRESC_VIEW "
72 <<
"for GT_RUN_SETTINGS_PRESC_VIEW.ID: " << objectKey;
73 return pL1GtPrescaleFactors;
78 std::string objectKeyPrescaleFactorsSet =
"WRONG_KEY_INITIAL";
79 short prescaleFactorsSetIndex = 9999;
81 int resultsViewRows = resultsView.
numberRows();
83 LogTrace(
"L1GtPrescaleFactorsAlgoTrigConfigOnlineProd")
84 <<
"\nFound " << resultsViewRows <<
" prescale factors sets for \n "
85 <<
"GT_RUN_SETTINGS_PRESC_VIEW.ID = " << objectKey <<
"\n"
90 std::vector<std::vector<int> > pFactors;
91 pFactors.reserve(resultsViewRows);
95 for (
int iRow = 0; iRow < resultsViewRows; ++iRow) {
96 for (std::vector<std::string>::const_iterator constIt = columnsView.begin(); constIt != columnsView.end();
98 if ((*constIt) ==
"PRESCALE_INDEX") {
100 }
else if ((*constIt) ==
"PRESCALE_FACTORS_ALGO_FK") {
103 LogTrace(
"L1GtPrescaleFactorsAlgoTrigConfigOnlineProd")
104 <<
"\nUnknown field " << (*constIt) <<
" requested for columns in GT_RUN_SETTINGS_PRESC_VIEW" << std::endl;
109 LogTrace(
"L1GtPrescaleFactorsAlgoTrigConfigOnlineProd")
110 <<
"\nFound prescale factors set: \n index = " << prescaleFactorsSetIndex
111 <<
"\n PRESCALE_FACTORS_ALGO_FK = " << objectKeyPrescaleFactorsSet <<
"\n"
124 LogTrace(
"L1GtPrescaleFactorsAlgoTrigConfigOnlineProd")
125 <<
"\nColumn names for GT_FDL_PRESCALE_FACTORS_ALGO" << std::endl;
127 for (std::vector<std::string>::const_iterator iter = columns.begin(); iter != columns.end(); iter++) {
128 LogTrace(
"L1GtPrescaleFactorsAlgoTrigConfigOnlineProd") << (*iter) << std::endl;
135 "GT_FDL_PRESCALE_FACTORS_ALGO",
136 "GT_FDL_PRESCALE_FACTORS_ALGO.ID",
141 edm::LogError(
"L1-O2O") <<
"Problem with L1GtPrescaleFactorsAlgoTrigRcd key:" << objectKeyPrescaleFactorsSet;
142 return pL1GtPrescaleFactors;
147 if (prescaleFactorsSetIndex != countSet) {
148 edm::LogError(
"L1-O2O") <<
"L1GtPrescaleFactorsAlgoTrig has unordered sets PRESCALE_INDEX in DB for\n"
149 <<
" GT_RUN_SETTINGS_PRESC_VIEW.ID = " << objectKey <<
"\n"
151 return pL1GtPrescaleFactors;
155 int pfSetSize = columns.size() - 1;
156 std::vector<int> pfSet(pfSetSize, 0);
158 for (
int i = 0;
i < pfSetSize;
i++) {
162 pFactors.push_back(pfSet);
167 pL1GtPrescaleFactors->setGtPrescaleFactors(pFactors);
170 std::ostringstream myCoutStream;
171 pL1GtPrescaleFactors->print(myCoutStream);
172 LogTrace(
"L1GtPrescaleFactorsAlgoTrigConfigOnlineProd")
173 <<
"\nThe following L1GtPrescaleFactorsAlgoTrigRcd record was read from OMDS: \n"
174 << myCoutStream.str() <<
"\n"
178 return pL1GtPrescaleFactors;
L1GtPrescaleFactorsAlgoTrigConfigOnlineProd(const edm::ParameterSet &)
constructor
bool fillVariable(const std::string &columnName, T &outputVariable) const
const QueryResults singleAttribute(const T &data) const
~L1GtPrescaleFactorsAlgoTrigConfigOnlineProd() override
destructor
Log< level::Error, false > LogError
std::vector< std::string > columnNames(const std::string &schemaName, const std::string &tableName)
bool fillVariableFromRow(const std::string &columnName, int rowNumber, T &outputVariable) const
std::unique_ptr< L1GtPrescaleFactors > newObject(const std::string &objectKey) override
public methods
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="")
l1t::OMDSReader m_omdsReader
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="")
#define DEFINE_FWK_EVENTSETUP_MODULE(type)