19 #include "boost/lexical_cast.hpp"
45 boost::shared_ptr<L1GtParameters> pL1GtParameters = boost::shared_ptr<L1GtParameters>(
70 std::vector<std::string>
columns;
71 columns.push_back(
"EVM_INCLUDE_TCS");
72 columns.push_back(
"EVM_INCLUDE_FDL");
73 columns.push_back(
"DAQ_INCLUDE_FDL");
74 columns.push_back(
"DAQ_INCLUDE_PSB0");
75 columns.push_back(
"DAQ_INCLUDE_PSB1");
76 columns.push_back(
"DAQ_INCLUDE_PSB2");
77 columns.push_back(
"DAQ_INCLUDE_PSB3");
78 columns.push_back(
"DAQ_INCLUDE_PSB4");
79 columns.push_back(
"DAQ_INCLUDE_PSB5");
80 columns.push_back(
"DAQ_INCLUDE_PSB6");
81 columns.push_back(
"DAQ_INCLUDE_GMT");
82 columns.push_back(
"DAQ_INCLUDE_TIM");
83 columns.push_back(
"DAQ_NB_BC_PER_EVENT_FDL");
84 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB0");
85 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB1");
86 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB2");
87 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB3");
88 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB4");
89 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB5");
90 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB6");
91 columns.push_back(
"DAQ_NB_BC_PER_EVENT_GMT");
92 columns.push_back(
"DAQ_NB_BC_PER_EVENT_TIM");
93 columns.push_back(
"BST_DATA_NB_BYTES");
102 edm::LogError(
"L1-O2O") <<
"Problem with L1GtParameters key:" << objectKey;
103 return pL1GtParameters;
106 bool activeBoardsEvmTCS =
false;
107 results.
fillVariable(
"EVM_INCLUDE_TCS", activeBoardsEvmTCS);
109 bool activeBoardsEvmFDL =
false;
110 results.
fillVariable(
"EVM_INCLUDE_FDL", activeBoardsEvmFDL);
112 bool activeBoardsDaqFDL =
false;
113 results.
fillVariable(
"DAQ_INCLUDE_FDL", activeBoardsDaqFDL);
115 bool activeBoardsDaqPSB0 =
false;
116 results.
fillVariable(
"DAQ_INCLUDE_PSB0", activeBoardsDaqPSB0);
118 bool activeBoardsDaqPSB1 =
false;
119 results.
fillVariable(
"DAQ_INCLUDE_PSB1", activeBoardsDaqPSB1);
121 bool activeBoardsDaqPSB2 =
false;
122 results.
fillVariable(
"DAQ_INCLUDE_PSB2", activeBoardsDaqPSB2);
124 bool activeBoardsDaqPSB3 =
false;
125 results.
fillVariable(
"DAQ_INCLUDE_PSB3", activeBoardsDaqPSB3);
127 bool activeBoardsDaqPSB4;
128 results.
fillVariable(
"DAQ_INCLUDE_PSB4", activeBoardsDaqPSB4);
130 bool activeBoardsDaqPSB5 =
false;
131 results.
fillVariable(
"DAQ_INCLUDE_PSB5", activeBoardsDaqPSB5);
133 bool activeBoardsDaqPSB6;
134 results.
fillVariable(
"DAQ_INCLUDE_PSB6", activeBoardsDaqPSB6);
136 bool activeBoardsDaqGMT;
137 results.
fillVariable(
"DAQ_INCLUDE_GMT", activeBoardsDaqGMT);
139 bool activeBoardsDaqTIM =
false;
140 results.
fillVariable(
"DAQ_INCLUDE_TIM", activeBoardsDaqTIM);
143 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_FDL", totalBxInEventStr);
147 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_FDL", daqNrBxBoardStrFDL);
150 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB0", daqNrBxBoardStrPSB0);
153 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB1", daqNrBxBoardStrPSB1);
156 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB2", daqNrBxBoardStrPSB2);
159 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB3", daqNrBxBoardStrPSB3);
162 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB4", daqNrBxBoardStrPSB4);
165 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB5", daqNrBxBoardStrPSB5);
168 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB6", daqNrBxBoardStrPSB6);
171 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_GMT", daqNrBxBoardStrGMT);
174 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_TIM", daqNrBxBoardStrTIM);
177 results.
fillVariable(
"BST_DATA_NB_BYTES", bstLengthBytesStr);
182 int totalBxInEventVal = boost::lexical_cast<
int>(totalBxInEventStr);
183 pL1GtParameters->setGtTotalBxInEvent(totalBxInEventVal);
191 boost::uint16_t daqActiveBoardsVal = 0;
193 int daqActiveBoardsLength = 16;
194 std::vector<int> daqNrBxBoard(daqActiveBoardsLength, 0);
197 if (activeBoardsDaqFDL) {
198 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
200 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrFDL);
203 if (activeBoardsDaqPSB0) {
204 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
206 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB0);
209 if (activeBoardsDaqPSB1) {
210 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
212 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB1);
215 if (activeBoardsDaqPSB2) {
216 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
218 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB2);
221 if (activeBoardsDaqPSB3) {
222 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
224 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB3);
227 if (activeBoardsDaqPSB4) {
228 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
230 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB4);
233 if (activeBoardsDaqPSB5) {
234 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
236 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB5);
239 if (activeBoardsDaqPSB6) {
240 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
242 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB6);
245 if (activeBoardsDaqGMT) {
246 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
248 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrGMT);
258 boost::uint16_t evmActiveBoardsVal = 0;
260 int evmActiveBoardsLength = 16;
261 std::vector<int> evmNrBxBoard(evmActiveBoardsLength, 0);
264 if (activeBoardsEvmTCS) {
265 evmActiveBoardsVal = evmActiveBoardsVal | ( 1 << iActiveBit );
268 evmNrBxBoard.at(iActiveBit) = 1;
271 if (activeBoardsEvmFDL) {
272 evmActiveBoardsVal = evmActiveBoardsVal | ( 1 << iActiveBit );
275 evmNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrFDL);
279 pL1GtParameters->setGtDaqActiveBoards(daqActiveBoardsVal);
280 pL1GtParameters->setGtEvmActiveBoards(evmActiveBoardsVal);
281 pL1GtParameters->setGtDaqNrBxBoard(daqNrBxBoard);
282 pL1GtParameters->setGtEvmNrBxBoard(evmNrBxBoard);
285 unsigned int bstLengthBytesVal = boost::lexical_cast<
unsigned int>(bstLengthBytesStr);
286 pL1GtParameters->setGtBstLengthBytes(bstLengthBytesVal);
289 std::ostringstream myCoutStream;
290 pL1GtParameters->print(myCoutStream);
291 LogTrace(
"L1GtParametersConfigOnlineProd")
292 <<
"\nThe following L1GtParameters record was read from OMDS: \n"
293 << myCoutStream.str() <<
"\n" << std::endl;
296 return pL1GtParameters;
bool fillVariable(const std::string &columnName, T &outputVariable) const
const QueryResults singleAttribute(const T &data) const
L1GtParametersConfigOnlineProd(const edm::ParameterSet &)
constructor
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
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
virtual boost::shared_ptr< L1GtParameters > newObject(const std::string &objectKey)
public methods
~L1GtParametersConfigOnlineProd()
destructor