21 #include "boost/lexical_cast.hpp" 52 auto pL1GtPrescaleFactors = std::make_shared<L1GtPrescaleFactors>();
68 std::vector<std::string> columnsView;
69 columnsView.push_back(
"PRESCALE_INDEX");
70 columnsView.push_back(
"PRESCALE_FACTORS_ALGO_FK");
73 columnsView, gtSchema,
"GT_RUN_SETTINGS_PRESC_VIEW",
80 <<
"Problem to get content of GT_RUN_SETTINGS_PRESC_VIEW " 81 <<
"for GT_RUN_SETTINGS_PRESC_VIEW.ID: " << objectKey;
82 return pL1GtPrescaleFactors;
87 std::string objectKeyPrescaleFactorsSet =
"WRONG_KEY_INITIAL";
88 short prescaleFactorsSetIndex = 9999;
90 int resultsViewRows = resultsView.
numberRows();
92 LogTrace(
"L1GtPrescaleFactorsAlgoTrigConfigOnlineProd") <<
"\nFound " 93 << resultsViewRows <<
" prescale factors sets for \n " 94 <<
"GT_RUN_SETTINGS_PRESC_VIEW.ID = " << objectKey <<
"\n" 99 std::vector<std::vector<int> > pFactors;
100 pFactors.reserve(resultsViewRows);
104 for (
int iRow = 0; iRow < resultsViewRows; ++iRow) {
106 for (std::vector<std::string>::const_iterator constIt =
107 columnsView.begin(); constIt != columnsView.end(); ++constIt) {
109 if ((*constIt) ==
"PRESCALE_INDEX") {
111 prescaleFactorsSetIndex);
112 }
else if ((*constIt) ==
"PRESCALE_FACTORS_ALGO_FK") {
114 objectKeyPrescaleFactorsSet);
117 LogTrace(
"L1GtPrescaleFactorsAlgoTrigConfigOnlineProd")
118 <<
"\nUnknown field " << (*constIt)
119 <<
" requested for columns in GT_RUN_SETTINGS_PRESC_VIEW" 126 LogTrace(
"L1GtPrescaleFactorsAlgoTrigConfigOnlineProd")
127 <<
"\nFound prescale factors set: \n index = " 128 << prescaleFactorsSetIndex
129 <<
"\n PRESCALE_FACTORS_ALGO_FK = " 130 << objectKeyPrescaleFactorsSet <<
"\n" << std::endl;
141 gtSchema,
"GT_FDL_PRESCALE_FACTORS_ALGO");
144 LogTrace(
"L1GtPrescaleFactorsAlgoTrigConfigOnlineProd")
145 <<
"\nColumn names for GT_FDL_PRESCALE_FACTORS_ALGO" 148 for (std::vector<std::string>::const_iterator iter =
149 columns.begin(); iter != columns.end(); iter++) {
150 LogTrace(
"L1GtPrescaleFactorsAlgoTrigConfigOnlineProd")
151 << (*iter) << std::endl;
157 columns, gtSchema,
"GT_FDL_PRESCALE_FACTORS_ALGO",
158 "GT_FDL_PRESCALE_FACTORS_ALGO.ID",
164 <<
"Problem with L1GtPrescaleFactorsAlgoTrigRcd key:" 165 << objectKeyPrescaleFactorsSet;
166 return pL1GtPrescaleFactors;
174 if (prescaleFactorsSetIndex != countSet) {
176 <<
"L1GtPrescaleFactorsAlgoTrig has unordered sets PRESCALE_INDEX in DB for\n" 177 <<
" GT_RUN_SETTINGS_PRESC_VIEW.ID = " << objectKey <<
"\n" 179 return pL1GtPrescaleFactors;
185 int pfSetSize = columns.size() - 1;
186 std::vector<int> pfSet(pfSetSize, 0);
188 for (
int i = 0;
i < pfSetSize;
i++) {
192 pFactors.push_back(pfSet);
198 pL1GtPrescaleFactors->setGtPrescaleFactors(pFactors);
201 std::ostringstream myCoutStream;
202 pL1GtPrescaleFactors->print(myCoutStream);
203 LogTrace(
"L1GtPrescaleFactorsAlgoTrigConfigOnlineProd")
204 <<
"\nThe following L1GtPrescaleFactorsAlgoTrigRcd record was read from OMDS: \n" 205 << myCoutStream.str() <<
"\n" << std::endl;
208 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
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="")
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)
std::shared_ptr< L1GtPrescaleFactors > newObject(const std::string &objectKey) override
public methods