21 #include "boost/lexical_cast.hpp"
52 boost::shared_ptr<L1GtPrescaleFactors> pL1GtPrescaleFactors =
69 std::vector<std::string> columnsView;
70 columnsView.push_back(
"PRESCALE_INDEX");
71 columnsView.push_back(
"PRESCALE_FACTORS_TT_FK");
74 columnsView, gtSchema,
"GT_RUN_SETTINGS_PRESC_VIEW",
81 <<
"Problem to get content of GT_RUN_SETTINGS_PRESC_VIEW "
82 <<
"for GT_RUN_SETTINGS_PRESC_VIEW.ID: " << objectKey;
83 return pL1GtPrescaleFactors;
88 std::string objectKeyPrescaleFactorsSet =
"WRONG_KEY_INITIAL";
89 short prescaleFactorsSetIndex = 9999;
91 int resultsViewRows = resultsView.
numberRows();
93 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd") <<
"\nFound "
94 << resultsViewRows <<
" prescale factors sets for \n "
95 <<
"GT_RUN_SETTINGS_PRESC_VIEW.ID = " << objectKey <<
"\n"
100 std::vector<std::vector<int> > pFactors;
101 pFactors.reserve(resultsViewRows);
105 for (
int iRow = 0; iRow < resultsViewRows; ++iRow) {
107 for (std::vector<std::string>::const_iterator constIt =
108 columnsView.begin(); constIt != columnsView.end(); ++constIt) {
110 if ((*constIt) ==
"PRESCALE_INDEX") {
112 prescaleFactorsSetIndex);
113 }
else if ((*constIt) ==
"PRESCALE_FACTORS_TT_FK") {
115 objectKeyPrescaleFactorsSet);
118 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
119 <<
"\nUnknown field " << (*constIt)
120 <<
" requested for columns in GT_RUN_SETTINGS_PRESC_VIEW"
127 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
128 <<
"\nFound prescale factors set: \n index = "
129 << prescaleFactorsSetIndex
130 <<
"\n PRESCALE_FACTORS_TT_FK = "
131 << objectKeyPrescaleFactorsSet <<
"\n" << std::endl;
142 gtSchema,
"GT_FDL_PRESCALE_FACTORS_TT");
145 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
146 <<
"\nColumn names for GT_FDL_PRESCALE_FACTORS_TT"
149 for (std::vector<std::string>::const_iterator iter =
150 columns.begin(); iter != columns.end(); iter++) {
151 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
152 << (*iter) << std::endl;
158 columns, gtSchema,
"GT_FDL_PRESCALE_FACTORS_TT",
159 "GT_FDL_PRESCALE_FACTORS_TT.ID",
165 <<
"Problem with L1GtPrescaleFactorsTechTrigRcd key:"
166 << objectKeyPrescaleFactorsSet;
167 return pL1GtPrescaleFactors;
175 if (prescaleFactorsSetIndex != countSet) {
177 <<
"L1GtPrescaleFactorsTechTrig has unordered sets PRESCALE_INDEX in DB for\n"
178 <<
" GT_RUN_SETTINGS_PRESC_VIEW.ID = " << objectKey <<
"\n"
180 return pL1GtPrescaleFactors;
186 int pfSetSize = columns.size() - 1;
187 std::vector<int> pfSet(pfSetSize, 0);
189 for (
int i = 0;
i < pfSetSize;
i++) {
193 pFactors.push_back(pfSet);
199 pL1GtPrescaleFactors->setGtPrescaleFactors(pFactors);
202 std::ostringstream myCoutStream;
203 pL1GtPrescaleFactors->print(myCoutStream);
204 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
205 <<
"\nThe following L1GtPrescaleFactorsTechTrigRcd record was read from OMDS: \n"
206 << myCoutStream.str() <<
"\n" << std::endl;
209 return pL1GtPrescaleFactors;
bool fillVariable(const std::string &columnName, T &outputVariable) const
const QueryResults singleAttribute(const T &data) const
virtual boost::shared_ptr< L1GtPrescaleFactors > newObject(const std::string &objectKey)
public methods
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
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)
~L1GtPrescaleFactorsTechTrigConfigOnlineProd()
destructor