20 #include "boost/shared_ptr.hpp"
38 const std::vector<std::string>& chInputStrings)
40 std::vector<L1GtObject> chInputObjectsV;
41 chInputObjectsV.reserve(chInputStrings.size());
45 for (std::vector<std::string>::const_iterator itObj =
46 chInputStrings.begin(); itObj != chInputStrings.end(); ++itObj) {
48 if ((*itObj) ==
"Mu") {
51 else if ((*itObj) ==
"NoIsoEG") {
54 else if ((*itObj) ==
"IsoEG") {
57 else if ((*itObj) ==
"CenJet") {
60 else if ((*itObj) ==
"ForJet") {
63 else if ((*itObj) ==
"TauJet") {
66 else if ((*itObj) ==
"ETM") {
69 else if ((*itObj) ==
"ETT") {
72 else if ((*itObj) ==
"HTT") {
75 else if ((*itObj) ==
"HTM") {
78 else if ((*itObj) ==
"JetCounts") {
81 else if ((*itObj) ==
"HfBitCounts") {
84 else if ((*itObj) ==
"HfRingEtSums") {
87 else if ((*itObj) ==
"TechTrig") {
90 else if ((*itObj) ==
"BPTX") {
93 else if ((*itObj) ==
"GtExternal") {
98 <<
"\nError: no such L1 GT object: " << (*itObj) <<
"\n"
99 <<
"\n Can not define the mapping of the L1 GT boards. \n"
104 chInputObjectsV.push_back(obj);
107 return chInputObjectsV;
119 std::vector<std::string> boardList =
120 parSet.
getParameter<std::vector<std::string> >(
"BoardList");
122 std::vector<int> boardIndexVec =
128 if (boardList.size() != boardIndexVec.size()) {
130 <<
"\nError: inconsistent length of board list and board indices.\n"
131 <<
"\n Can not define the mapping of the L1 GT boards. \n"
136 std::vector<int> boardPositionDaqRecord =
137 parSet.
getParameter<std::vector<int> >(
"BoardPositionDaqRecord");
139 if (boardList.size() != boardPositionDaqRecord.size()) {
141 <<
"\nError: inconsistent length of board list and board indices in GT DAQ record.\n"
142 <<
"\n Can not define the mapping of the L1 GT boards. \n"
147 std::vector<int> boardPositionEvmRecord =
148 parSet.
getParameter<std::vector<int> >(
"BoardPositionEvmRecord");
150 if (boardList.size() != boardPositionEvmRecord.size()) {
152 <<
"\nError: inconsistent length of board list and board indices in GT EVM record.\n"
153 <<
"\n Can not define the mapping of the L1 GT boards. \n"
158 std::vector<int> activeBoardsDaqRecord =
159 parSet.
getParameter<std::vector<int> >(
"ActiveBoardsDaqRecord");
161 if (boardList.size() != activeBoardsDaqRecord.size()) {
163 <<
"\nError: inconsistent length of board list and active boards in GT DAQ record.\n"
164 <<
"\n Can not define the mapping of the L1 GT boards. \n"
169 std::vector<int> activeBoardsEvmRecord =
170 parSet.
getParameter<std::vector<int> >(
"ActiveBoardsEvmRecord");
172 if (boardList.size() != activeBoardsEvmRecord.size()) {
174 <<
"\nError: inconsistent length of board list and active boards in GT EVM record.\n"
175 <<
"\n Can not define the mapping of the L1 GT boards. \n"
180 std::vector<int> boardSlotMap =
183 if (boardList.size() != boardSlotMap.size()) {
185 <<
"\nError: inconsistent length of board list and board - slot map.\n"
186 <<
"\n Can not define the mapping of the L1 GT boards. \n"
191 std::vector<int> boardHexNameMap =
192 parSet.
getParameter<std::vector<int> >(
"BoardHexNameMap");
194 if (boardList.size() != boardHexNameMap.size()) {
196 <<
"\nError: inconsistent length of board list and board name in hw record map.\n"
197 <<
"\n Can not define the mapping of the L1 GT boards. \n"
207 std::vector<std::string> cableList =
208 parSet.
getParameter<std::vector<std::string> >(
"CableList");
213 std::vector<int> cableToPsbMap =
214 parSet.
getParameter<std::vector<int> >(
"CableToPsbMap");
217 if (cableList.size() != cableToPsbMap.size()) {
219 <<
"\nError: inconsistent length of cable list and input to PSB list.\n"
220 <<
"\n Can not define the mapping of GCT quadruplets to GT PSBs.\n"
226 std::vector<edm::ParameterSet> psbInput = parSet.
getParameter<std::vector<
236 for (std::vector<std::string>::const_iterator
237 it = boardList.begin(); it != boardList.end(); ++it) {
241 if ( (*it) ==
"GTFE" ) {
243 }
else if ( (*it) ==
"FDL" ) {
245 }
else if ( (*it) ==
"PSB" ) {
247 }
else if ( (*it) ==
"GMT" ) {
249 }
else if ( (*it) ==
"TCS" ) {
251 }
else if ( (*it) ==
"TIM" ) {
255 <<
"\nError: no such board: " << (*it).c_str() <<
"\n"
256 <<
"\n Can not define the mapping of the L1 GT boards. \n"
262 int iBoard = boardIndexVec.at(posVec);
282 int boardSlot = boardSlotMap.at(posVec);
291 if (boardType ==
PSB) {
298 for (std::vector<std::string>::const_iterator
299 cIt = cableList.begin(); cIt != cableList.end(); ++cIt) {
302 if ( *cIt ==
"TechTr" ) {
304 }
else if ( *cIt ==
"IsoEGQ" ) {
306 }
else if ( *cIt ==
"NoIsoEGQ" ) {
308 }
else if ( *cIt ==
"CenJetQ" ) {
310 }
else if ( *cIt ==
"ForJetQ" ) {
312 }
else if ( *cIt ==
"TauJetQ" ) {
314 }
else if ( *cIt ==
"ESumsQ" ) {
316 }
else if ( *cIt ==
"JetCountsQ" ) {
318 }
else if ( *cIt ==
"MQB1" ) {
320 }
else if ( *cIt ==
"MQB2" ) {
322 }
else if ( *cIt ==
"MQF3" ) {
324 }
else if ( *cIt ==
"MQF4" ) {
326 }
else if ( *cIt ==
"MQB5" ) {
328 }
else if ( *cIt ==
"MQB6" ) {
330 }
else if ( *cIt ==
"MQF7" ) {
332 }
else if ( *cIt ==
"MQF8" ) {
334 }
else if ( *cIt ==
"MQB9" ) {
336 }
else if ( *cIt ==
"MQB10" ) {
338 }
else if ( *cIt ==
"MQF11" ) {
340 }
else if ( *cIt ==
"MQF12" ) {
342 }
else if ( *cIt ==
"Free" ) {
344 }
else if ( *cIt ==
"HfQ" ) {
349 <<
"\nError: no such quadruplet: " << (*cIt).c_str() <<
"\n"
350 <<
"\n Can not define the mapping of quadruplets to the L1 PSB boards.\n"
354 int psbIndex = cableToPsbMap.at(posCable);
360 <<
"\nError: too many cables for PSB_" << gtBoard.
gtBoardIndex()
362 <<
"Can not define the mapping of cables to L1 PSB boards. \n"
366 quadVec[iPsb] = psbQuad;
377 if (boardType ==
PSB) {
379 std::map<int, std::vector<L1GtObject> > inputPsbChannels;
381 std::vector<std::string> chStrings;
382 chStrings.reserve(2);
384 std::vector<L1GtObject> chObjects;
386 for (std::vector<edm::ParameterSet>::const_iterator itPSet =
387 psbInput.begin(); itPSet != psbInput.end(); ++itPSet) {
390 int slot = itPSet->getParameter<
int> (
"Slot");
392 if (slot == boardSlot) {
393 chStrings = itPSet->getParameter<std::vector<std::string> > (
396 inputPsbChannels[0] = chObjects;
400 chStrings = itPSet->getParameter<std::vector<std::string> > (
403 inputPsbChannels[1] = chObjects;
407 chStrings = itPSet->getParameter<std::vector<std::string> > (
410 inputPsbChannels[2] = chObjects;
414 chStrings = itPSet->getParameter<std::vector<std::string> > (
417 inputPsbChannels[3] = chObjects;
421 chStrings = itPSet->getParameter<std::vector<std::string> > (
424 inputPsbChannels[4] = chObjects;
428 chStrings = itPSet->getParameter<std::vector<std::string> > (
431 inputPsbChannels[5] = chObjects;
435 chStrings = itPSet->getParameter<std::vector<std::string> > (
438 inputPsbChannels[6] = chObjects;
442 chStrings = itPSet->getParameter<std::vector<std::string> > (
445 inputPsbChannels[7] = chObjects;
480 using namespace edm::es;
482 boost::shared_ptr<L1GtBoardMaps> pL1GtBoardMaps =
487 return pL1GtBoardMaps ;
T getParameter(std::string const &) const
void setGtBoardSlot(const int &)
void setGtBoardHexName(const int &)
void setGtBitEvmActiveBoards(const int &)
~L1GtBoardMapsTrivialProducer()
destructor
std::vector< L1GtObject > chInputObjects(const std::vector< std::string > &chInputStrings)
void setGtPositionEvmRecord(const int &)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
L1GtPsbQuad
quadruples sent to GT via PSB
std::vector< L1GtBoard > m_gtBoardMaps
L1 GT boards and their mapping.
L1GtBoardType
board types in GT
void setGtInputPsbChannels(const std::map< int, std::vector< L1GtObject > > &)
const int gtBoardIndex() const
get / set board index
void setGtBitDaqActiveBoards(const int &)
void setGtPositionDaqRecord(const int &)
L1GtBoardMapsTrivialProducer(const edm::ParameterSet &)
constructor
boost::shared_ptr< L1GtBoardMaps > produceBoardMaps(const L1GtBoardMapsRcd &)
public methods
static const int NumberCablesBoard
number of InfiniCables per board
void setGtQuadInPsb(const std::vector< L1GtPsbQuad > &)