23 #include "boost/lexical_cast.hpp"
54 boost::shared_ptr<L1GtPrescaleFactors> pL1GtPrescaleFactors =
71 std::vector<std::string> columnsView;
72 columnsView.push_back(
"PRESCALE_INDEX");
73 columnsView.push_back(
"PRESCALE_FACTORS_TT_FK");
76 columnsView, gtSchema,
"GT_RUN_SETTINGS_PRESC_VIEW",
83 <<
"Problem to get content of GT_RUN_SETTINGS_PRESC_VIEW "
84 <<
"for GT_RUN_SETTINGS_PRESC_VIEW.ID: " << objectKey;
85 return pL1GtPrescaleFactors;
90 std::string objectKeyPrescaleFactorsSet =
"WRONG_KEY_INITIAL";
91 short prescaleFactorsSetIndex = 9999;
93 int resultsViewRows = resultsView.
numberRows();
95 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd") <<
"\nFound "
96 << resultsViewRows <<
" prescale factors sets for \n "
97 <<
"GT_RUN_SETTINGS_PRESC_VIEW.ID = " << objectKey <<
"\n"
102 std::vector<std::vector<int> > pFactors;
103 pFactors.reserve(resultsViewRows);
107 for (
int iRow = 0; iRow < resultsViewRows; ++iRow) {
109 for (std::vector<std::string>::const_iterator constIt =
110 columnsView.begin(); constIt != columnsView.end(); ++constIt) {
112 if ((*constIt) ==
"PRESCALE_INDEX") {
114 prescaleFactorsSetIndex);
115 }
else if ((*constIt) ==
"PRESCALE_FACTORS_TT_FK") {
117 objectKeyPrescaleFactorsSet);
120 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
121 <<
"\nUnknown field " << (*constIt)
122 <<
" requested for columns in GT_RUN_SETTINGS_PRESC_VIEW"
129 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
130 <<
"\nFound prescale factors set: \n index = "
131 << prescaleFactorsSetIndex
132 <<
"\n PRESCALE_FACTORS_TT_FK = "
133 << objectKeyPrescaleFactorsSet <<
"\n" << std::endl;
144 gtSchema,
"GT_FDL_PRESCALE_FACTORS_TT");
147 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
148 <<
"\nColumn names for GT_FDL_PRESCALE_FACTORS_TT"
151 for (std::vector<std::string>::const_iterator iter =
152 columns.begin(); iter != columns.end(); iter++) {
153 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
154 << (*iter) << std::endl;
160 columns, gtSchema,
"GT_FDL_PRESCALE_FACTORS_TT",
161 "GT_FDL_PRESCALE_FACTORS_TT.ID",
167 <<
"Problem with L1GtPrescaleFactorsTechTrigRcd key:"
168 << objectKeyPrescaleFactorsSet;
169 return pL1GtPrescaleFactors;
177 if (prescaleFactorsSetIndex != countSet) {
179 <<
"L1GtPrescaleFactorsTechTrig has unordered sets PRESCALE_INDEX in DB for\n"
180 <<
" GT_RUN_SETTINGS_PRESC_VIEW.ID = " << objectKey <<
"\n"
182 return pL1GtPrescaleFactors;
188 int pfSetSize = columns.size() - 1;
189 std::vector<int> pfSet(pfSetSize, 0);
191 for (
int i = 0;
i < pfSetSize;
i++) {
195 pFactors.push_back(pfSet);
201 pL1GtPrescaleFactors->setGtPrescaleFactors(pFactors);
204 std::ostringstream myCoutStream;
205 pL1GtPrescaleFactors->print(myCoutStream);
206 LogTrace(
"L1GtPrescaleFactorsTechTrigConfigOnlineProd")
207 <<
"\nThe following L1GtPrescaleFactorsTechTrigRcd record was read from OMDS: \n"
208 << myCoutStream.str() <<
"\n" << std::endl;
211 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
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="") const
L1GtPrescaleFactorsTechTrigConfigOnlineProd(const edm::ParameterSet &)
constructor
l1t::OMDSReader m_omdsReader
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
~L1GtPrescaleFactorsTechTrigConfigOnlineProd()
destructor
std::vector< std::string > columnNames(const std::string &schemaName, const std::string &tableName) const
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="") const