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_TT_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(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
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_TT_FK") {
103 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
104 <<
"\nUnknown field " << (*constIt) <<
" requested for columns in GT_RUN_SETTINGS_PRESC_VIEW" << std::endl;
109 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
110 <<
"\nFound prescale factors set: \n index = " << prescaleFactorsSetIndex
111 <<
"\n PRESCALE_FACTORS_TT_FK = " << objectKeyPrescaleFactorsSet <<
"\n" 124 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
125 <<
"\nColumn names for GT_FDL_PRESCALE_FACTORS_TT" << std::endl;
127 for (std::vector<std::string>::const_iterator iter =
columns.begin(); iter !=
columns.end(); iter++) {
128 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd") << (*iter) << std::endl;
135 "GT_FDL_PRESCALE_FACTORS_TT",
136 "GT_FDL_PRESCALE_FACTORS_TT.ID",
141 edm::LogError(
"L1-O2O") <<
"Problem with L1GtPrescaleFactorsTechTrigRcd key:" << objectKeyPrescaleFactorsSet;
142 return pL1GtPrescaleFactors;
147 if (prescaleFactorsSetIndex != countSet) {
148 edm::LogError(
"L1-O2O") <<
"L1GtPrescaleFactorsTechTrig 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(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
173 <<
"\nThe following L1GtPrescaleFactorsTechTrigRcd record was read from OMDS: \n" 174 << myCoutStream.str() <<
"\n" 178 return pL1GtPrescaleFactors;
~L1GtPrescaleFactorsTechTrigConfigOnlineProd() override
destructor
const QueryResults singleAttribute(const T &data) const
Log< level::Error, false > LogError
std::vector< std::string > columnNames(const std::string &schemaName, const std::string &tableName)
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="")
bool fillVariableFromRow(const std::string &columnName, int rowNumber, T &outputVariable) const
L1GtPrescaleFactorsTechTrigConfigOnlineProd(const edm::ParameterSet &)
constructor
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
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="")
std::unique_ptr< L1GtPrescaleFactors > newObject(const std::string &objectKey) override
public methods