19 #include "boost/lexical_cast.hpp" 44 auto pL1GtParameters = std::make_unique<L1GtParameters>();
68 std::vector<std::string>
columns;
69 columns.push_back(
"EVM_INCLUDE_TCS");
70 columns.push_back(
"EVM_INCLUDE_FDL");
71 columns.push_back(
"DAQ_INCLUDE_FDL");
72 columns.push_back(
"DAQ_INCLUDE_PSB0");
73 columns.push_back(
"DAQ_INCLUDE_PSB1");
74 columns.push_back(
"DAQ_INCLUDE_PSB2");
75 columns.push_back(
"DAQ_INCLUDE_PSB3");
76 columns.push_back(
"DAQ_INCLUDE_PSB4");
77 columns.push_back(
"DAQ_INCLUDE_PSB5");
78 columns.push_back(
"DAQ_INCLUDE_PSB6");
79 columns.push_back(
"DAQ_INCLUDE_GMT");
80 columns.push_back(
"DAQ_INCLUDE_TIM");
81 columns.push_back(
"DAQ_NB_BC_PER_EVENT_FDL");
82 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB0");
83 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB1");
84 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB2");
85 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB3");
86 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB4");
87 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB5");
88 columns.push_back(
"DAQ_NB_BC_PER_EVENT_PSB6");
89 columns.push_back(
"DAQ_NB_BC_PER_EVENT_GMT");
90 columns.push_back(
"DAQ_NB_BC_PER_EVENT_TIM");
91 columns.push_back(
"BST_DATA_NB_BYTES");
100 edm::LogError(
"L1-O2O") <<
"Problem with L1GtParameters key:" << objectKey;
101 return pL1GtParameters;
104 bool activeBoardsEvmTCS =
false;
105 results.
fillVariable(
"EVM_INCLUDE_TCS", activeBoardsEvmTCS);
107 bool activeBoardsEvmFDL =
false;
108 results.
fillVariable(
"EVM_INCLUDE_FDL", activeBoardsEvmFDL);
110 bool activeBoardsDaqFDL =
false;
111 results.
fillVariable(
"DAQ_INCLUDE_FDL", activeBoardsDaqFDL);
113 bool activeBoardsDaqPSB0 =
false;
114 results.
fillVariable(
"DAQ_INCLUDE_PSB0", activeBoardsDaqPSB0);
116 bool activeBoardsDaqPSB1 =
false;
117 results.
fillVariable(
"DAQ_INCLUDE_PSB1", activeBoardsDaqPSB1);
119 bool activeBoardsDaqPSB2 =
false;
120 results.
fillVariable(
"DAQ_INCLUDE_PSB2", activeBoardsDaqPSB2);
122 bool activeBoardsDaqPSB3 =
false;
123 results.
fillVariable(
"DAQ_INCLUDE_PSB3", activeBoardsDaqPSB3);
125 bool activeBoardsDaqPSB4;
126 results.
fillVariable(
"DAQ_INCLUDE_PSB4", activeBoardsDaqPSB4);
128 bool activeBoardsDaqPSB5 =
false;
129 results.
fillVariable(
"DAQ_INCLUDE_PSB5", activeBoardsDaqPSB5);
131 bool activeBoardsDaqPSB6;
132 results.
fillVariable(
"DAQ_INCLUDE_PSB6", activeBoardsDaqPSB6);
134 bool activeBoardsDaqGMT;
135 results.
fillVariable(
"DAQ_INCLUDE_GMT", activeBoardsDaqGMT);
137 bool activeBoardsDaqTIM =
false;
138 results.
fillVariable(
"DAQ_INCLUDE_TIM", activeBoardsDaqTIM);
141 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_FDL", totalBxInEventStr);
145 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_FDL", daqNrBxBoardStrFDL);
148 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB0", daqNrBxBoardStrPSB0);
151 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB1", daqNrBxBoardStrPSB1);
154 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB2", daqNrBxBoardStrPSB2);
157 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB3", daqNrBxBoardStrPSB3);
160 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB4", daqNrBxBoardStrPSB4);
163 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB5", daqNrBxBoardStrPSB5);
166 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_PSB6", daqNrBxBoardStrPSB6);
169 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_GMT", daqNrBxBoardStrGMT);
172 results.
fillVariable(
"DAQ_NB_BC_PER_EVENT_TIM", daqNrBxBoardStrTIM);
175 results.
fillVariable(
"BST_DATA_NB_BYTES", bstLengthBytesStr);
180 int totalBxInEventVal = boost::lexical_cast<
int>(totalBxInEventStr);
181 pL1GtParameters->setGtTotalBxInEvent(totalBxInEventVal);
189 boost::uint16_t daqActiveBoardsVal = 0;
191 int daqActiveBoardsLength = 16;
192 std::vector<int> daqNrBxBoard(daqActiveBoardsLength, 0);
195 if (activeBoardsDaqFDL) {
196 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
198 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrFDL);
201 if (activeBoardsDaqPSB0) {
202 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
204 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB0);
207 if (activeBoardsDaqPSB1) {
208 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
210 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB1);
213 if (activeBoardsDaqPSB2) {
214 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
216 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB2);
219 if (activeBoardsDaqPSB3) {
220 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
222 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB3);
225 if (activeBoardsDaqPSB4) {
226 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
228 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB4);
231 if (activeBoardsDaqPSB5) {
232 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
234 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB5);
237 if (activeBoardsDaqPSB6) {
238 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
240 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrPSB6);
243 if (activeBoardsDaqGMT) {
244 daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
246 daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrGMT);
256 boost::uint16_t evmActiveBoardsVal = 0;
258 int evmActiveBoardsLength = 16;
259 std::vector<int> evmNrBxBoard(evmActiveBoardsLength, 0);
262 if (activeBoardsEvmTCS) {
263 evmActiveBoardsVal = evmActiveBoardsVal | ( 1 << iActiveBit );
266 evmNrBxBoard.at(iActiveBit) = 1;
269 if (activeBoardsEvmFDL) {
270 evmActiveBoardsVal = evmActiveBoardsVal | ( 1 << iActiveBit );
273 evmNrBxBoard.at(iActiveBit) = boost::lexical_cast<
int>(daqNrBxBoardStrFDL);
277 pL1GtParameters->setGtDaqActiveBoards(daqActiveBoardsVal);
278 pL1GtParameters->setGtEvmActiveBoards(evmActiveBoardsVal);
279 pL1GtParameters->setGtDaqNrBxBoard(daqNrBxBoard);
280 pL1GtParameters->setGtEvmNrBxBoard(evmNrBxBoard);
283 unsigned int bstLengthBytesVal = boost::lexical_cast<
unsigned int>(bstLengthBytesStr);
284 pL1GtParameters->setGtBstLengthBytes(bstLengthBytesVal);
287 std::ostringstream myCoutStream;
288 pL1GtParameters->print(myCoutStream);
289 LogTrace(
"L1GtParametersConfigOnlineProd")
290 <<
"\nThe following L1GtParameters record was read from OMDS: \n" 291 << myCoutStream.str() <<
"\n" << std::endl;
294 return pL1GtParameters;
std::unique_ptr< L1GtParameters > newObject(const std::string &objectKey) override
public methods
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
~L1GtParametersConfigOnlineProd() override
destructor
#define DEFINE_FWK_EVENTSETUP_MODULE(type)