19 #include "boost/lexical_cast.hpp"
45 auto pL1GtParameters = std::make_shared<L1GtParameters>();
69 std::vector<std::string>
columns;
70 columns.push_back(
"EVM_INCLUDE_TCS");
71 columns.push_back(
"EVM_INCLUDE_FDL");
72 columns.push_back(
"DAQ_INCLUDE_FDL");
73 columns.push_back(
"DAQ_INCLUDE_PSB0");
74 columns.push_back(
"DAQ_INCLUDE_PSB1");
75 columns.push_back(
"DAQ_INCLUDE_PSB2");
76 columns.push_back(
"DAQ_INCLUDE_PSB3");
77 columns.push_back(
"DAQ_INCLUDE_PSB4");
78 columns.push_back(
"DAQ_INCLUDE_PSB5");
79 columns.push_back(
"DAQ_INCLUDE_PSB6");
80 columns.push_back(
"DAQ_INCLUDE_GMT");
81 columns.push_back(
"DAQ_INCLUDE_TIM");
82 columns.push_back(
"DAQ_NB_BC_PER_EVENT_FDL");
83 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB0");
84 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB1");
85 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB2");
86 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB3");
87 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB4");
88 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB5");
89 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB6");
90 columns.push_back(
"DAQ_NB_BC_PER_EVENT_GMT");
91 columns.push_back(
"DAQ_NB_BC_PER_EVENT_TIM");
92 columns.push_back(
"BST_DATA_NB_BYTES");
101 edm::LogError(
"L1-O2O") <<
"Problem with L1GtParameters key:" << objectKey;
102 return pL1GtParameters;
105 bool activeBoardsEvmTCS =
false;
106 results.
fillVariable(
"EVM_INCLUDE_TCS", activeBoardsEvmTCS);
108 bool activeBoardsEvmFDL =
false;
109 results.
fillVariable(
"EVM_INCLUDE_FDL", activeBoardsEvmFDL);
111 bool activeBoardsDaqFDL =
false;
112 results.
fillVariable(
"DAQ_INCLUDE_FDL", activeBoardsDaqFDL);
114 bool activeBoardsDaqPSB0 =
false;
115 results.
fillVariable(
"DAQ_INCLUDE_PSB0", activeBoardsDaqPSB0);
117 bool activeBoardsDaqPSB1 =
false;
118 results.
fillVariable(
"DAQ_INCLUDE_PSB1", activeBoardsDaqPSB1);
120 bool activeBoardsDaqPSB2 =
false;
121 results.
fillVariable(
"DAQ_INCLUDE_PSB2", activeBoardsDaqPSB2);
123 bool activeBoardsDaqPSB3 =
false;
124 results.
fillVariable(
"DAQ_INCLUDE_PSB3", activeBoardsDaqPSB3);
126 bool activeBoardsDaqPSB4;
127 results.
fillVariable(
"DAQ_INCLUDE_PSB4", activeBoardsDaqPSB4);
129 bool activeBoardsDaqPSB5 =
false;
130 results.
fillVariable(
"DAQ_INCLUDE_PSB5", activeBoardsDaqPSB5);
132 bool activeBoardsDaqPSB6;
133 results.
fillVariable(
"DAQ_INCLUDE_PSB6", activeBoardsDaqPSB6);
135 bool activeBoardsDaqGMT;
136 results.
fillVariable(
"DAQ_INCLUDE_GMT", activeBoardsDaqGMT);
138 bool activeBoardsDaqTIM =
false;
139 results.
fillVariable(
"DAQ_INCLUDE_TIM", activeBoardsDaqTIM);
142 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_FDL", totalBxInEventStr);
146 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_FDL", daqNrBxBoardStrFDL);
149 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB0", daqNrBxBoardStrPSB0);
152 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB1", daqNrBxBoardStrPSB1);
155 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB2", daqNrBxBoardStrPSB2);
158 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB3", daqNrBxBoardStrPSB3);
161 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB4", daqNrBxBoardStrPSB4);
164 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB5", daqNrBxBoardStrPSB5);
167 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB6", daqNrBxBoardStrPSB6);
170 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_GMT", daqNrBxBoardStrGMT);
173 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_TIM", daqNrBxBoardStrTIM);
176 results.
fillVariable(
"BST_DATA_NB_BYTES", bstLengthBytesStr);
181 int totalBxInEventVal = boost::lexical_cast<
int>(totalBxInEventStr);
182 pL1GtParameters->setGtTotalBxInEvent(totalBxInEventVal);
190 boost::uint16_t daqActiveBoardsVal = 0;
192 int daqActiveBoardsLength = 16;
193 std::vector<int> daqNrBxBoard(daqActiveBoardsLength, 0);
196 if (activeBoardsDaqFDL) {
197 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
199 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrFDL);
202 if (activeBoardsDaqPSB0) {
203 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
205 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB0);
208 if (activeBoardsDaqPSB1) {
209 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
211 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB1);
214 if (activeBoardsDaqPSB2) {
215 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
217 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB2);
220 if (activeBoardsDaqPSB3) {
221 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
223 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB3);
226 if (activeBoardsDaqPSB4) {
227 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
229 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB4);
232 if (activeBoardsDaqPSB5) {
233 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
235 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB5);
238 if (activeBoardsDaqPSB6) {
239 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
241 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB6);
244 if (activeBoardsDaqGMT) {
245 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
247 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrGMT);
257 boost::uint16_t evmActiveBoardsVal = 0;
259 int evmActiveBoardsLength = 16;
260 std::vector<int> evmNrBxBoard(evmActiveBoardsLength, 0);
263 if (activeBoardsEvmTCS) {
264 evmActiveBoardsVal = evmActiveBoardsVal | ( 1 << iActiveBit );
267 evmNrBxBoard.at(iActiveBit) = 1;
270 if (activeBoardsEvmFDL) {
271 evmActiveBoardsVal = evmActiveBoardsVal | ( 1 << iActiveBit );
274 evmNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrFDL);
278 pL1GtParameters->setGtDaqActiveBoards(daqActiveBoardsVal);
279 pL1GtParameters->setGtEvmActiveBoards(evmActiveBoardsVal);
280 pL1GtParameters->setGtDaqNrBxBoard(daqNrBxBoard);
281 pL1GtParameters->setGtEvmNrBxBoard(evmNrBxBoard);
284 unsigned int bstLengthBytesVal = boost::lexical_cast<
unsigned int>(bstLengthBytesStr);
285 pL1GtParameters->setGtBstLengthBytes(bstLengthBytesVal);
288 std::ostringstream myCoutStream;
289 pL1GtParameters->print(myCoutStream);
290 LogTrace(
"L1GtParametersConfigOnlineProd")
291 <<
"\nThe following L1GtParameters record was read from OMDS: \n"
292 << myCoutStream.str() <<
"\n" << std::endl;
295 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="")
virtual std::shared_ptr< L1GtParameters > newObject(const std::string &objectKey)
public methods
l1t::OMDSReader m_omdsReader
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
~L1GtParametersConfigOnlineProd()
destructor