CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L1GtBoardMapsTrivialProducer Class Reference

#include <L1GtBoardMapsTrivialProducer.h>

Inheritance diagram for L1GtBoardMapsTrivialProducer:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 L1GtBoardMapsTrivialProducer (const edm::ParameterSet &)
 constructor More...
 
std::unique_ptr< L1GtBoardMapsproduceBoardMaps (const L1GtBoardMapsRcd &)
 public methods More...
 
 ~L1GtBoardMapsTrivialProducer () override
 destructor More...
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Attributes

std::vector< L1GtBoardm_gtBoardMaps
 L1 GT boards and their mapping. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Description: ESProducer for mappings of the L1 GT boards.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Description: ESProducer for various mappings of the L1 GT boards.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Definition at line 34 of file L1GtBoardMapsTrivialProducer.h.

Constructor & Destructor Documentation

◆ L1GtBoardMapsTrivialProducer()

L1GtBoardMapsTrivialProducer::L1GtBoardMapsTrivialProducer ( const edm::ParameterSet parSet)

constructor

Definition at line 89 of file L1GtBoardMapsTrivialProducer.cc.

References CenJetQ, chInputObjects(), ESumsQ, Exception, FDL, ForJetQ, Free, edm::ParameterSet::getParameter(), GMT, L1GtBoard::gtBoardIndex(), GTFE, HfQ, IsoEGQ, JetCountsQ, m_gtBoardMaps, MQB1, MQB10, MQB2, MQB5, MQB6, MQB9, MQF11, MQF12, MQF3, MQF4, MQF7, MQF8, NoIsoEGQ, L1GtBoard::NumberCablesBoard, produceBoardMaps(), PSB, L1GtBoard::setGtBitDaqActiveBoards(), L1GtBoard::setGtBitEvmActiveBoards(), L1GtBoard::setGtBoardHexName(), L1GtBoard::setGtBoardSlot(), L1GtBoard::setGtInputPsbChannels(), L1GtBoard::setGtPositionDaqRecord(), L1GtBoard::setGtPositionEvmRecord(), L1GtBoard::setGtQuadInPsb(), edm::ESProducer::setWhatProduced(), TauJetQ, TCS, TechTr, and TIM.

89  {
90  // tell the framework what data is being produced
92 
93  // now do what ever other initialization is needed
94 
95  // get the list of the board names and indices
96  std::vector<std::string> boardList = parSet.getParameter<std::vector<std::string> >("BoardList");
97 
98  std::vector<int> boardIndexVec = parSet.getParameter<std::vector<int> >("BoardIndex");
99 
100  // check if the board list and the board indices are consistent
101  // i.e. have the same number of entries
102 
103  if (boardList.size() != boardIndexVec.size()) {
104  throw cms::Exception("Configuration") << "\nError: inconsistent length of board list and board indices.\n"
105  << "\n Can not define the mapping of the L1 GT boards. \n"
106  << std::endl;
107  }
108 
109  // L1 GT DAQ record map
110  std::vector<int> boardPositionDaqRecord = parSet.getParameter<std::vector<int> >("BoardPositionDaqRecord");
111 
112  if (boardList.size() != boardPositionDaqRecord.size()) {
113  throw cms::Exception("Configuration")
114  << "\nError: inconsistent length of board list and board indices in GT DAQ record.\n"
115  << "\n Can not define the mapping of the L1 GT boards. \n"
116  << std::endl;
117  }
118 
119  // L1 GT EVM record map
120  std::vector<int> boardPositionEvmRecord = parSet.getParameter<std::vector<int> >("BoardPositionEvmRecord");
121 
122  if (boardList.size() != boardPositionEvmRecord.size()) {
123  throw cms::Exception("Configuration")
124  << "\nError: inconsistent length of board list and board indices in GT EVM record.\n"
125  << "\n Can not define the mapping of the L1 GT boards. \n"
126  << std::endl;
127  }
128 
129  // L1 GT "active boards" map for DAQ record
130  std::vector<int> activeBoardsDaqRecord = parSet.getParameter<std::vector<int> >("ActiveBoardsDaqRecord");
131 
132  if (boardList.size() != activeBoardsDaqRecord.size()) {
133  throw cms::Exception("Configuration")
134  << "\nError: inconsistent length of board list and active boards in GT DAQ record.\n"
135  << "\n Can not define the mapping of the L1 GT boards. \n"
136  << std::endl;
137  }
138 
139  // L1 GT "active boards" map for EVM record
140  std::vector<int> activeBoardsEvmRecord = parSet.getParameter<std::vector<int> >("ActiveBoardsEvmRecord");
141 
142  if (boardList.size() != activeBoardsEvmRecord.size()) {
143  throw cms::Exception("Configuration")
144  << "\nError: inconsistent length of board list and active boards in GT EVM record.\n"
145  << "\n Can not define the mapping of the L1 GT boards. \n"
146  << std::endl;
147  }
148 
149  // L1 GT board - slot map
150  std::vector<int> boardSlotMap = parSet.getParameter<std::vector<int> >("BoardSlotMap");
151 
152  if (boardList.size() != boardSlotMap.size()) {
153  throw cms::Exception("Configuration") << "\nError: inconsistent length of board list and board - slot map.\n"
154  << "\n Can not define the mapping of the L1 GT boards. \n"
155  << std::endl;
156  }
157 
158  // L1 GT board name in hw record map
159  std::vector<int> boardHexNameMap = parSet.getParameter<std::vector<int> >("BoardHexNameMap");
160 
161  if (boardList.size() != boardHexNameMap.size()) {
162  throw cms::Exception("Configuration")
163  << "\nError: inconsistent length of board list and board name in hw record map.\n"
164  << "\n Can not define the mapping of the L1 GT boards. \n"
165  << std::endl;
166  }
167 
168  // GCT PSB to GT - map cables to input quadruplets and PSB indices
169 
170  // L1 GT cable list (GCT input to PSB)
171  std::vector<std::string> cableList = parSet.getParameter<std::vector<std::string> >("CableList");
172 
173  // L1 GT calo input to PSB map
174  // gives the mapping of GT calorimeter input to GT PSBs via PSB index
175  // 4 infinicables per PSB (last PSB can use only 2!)
176  std::vector<int> cableToPsbMap = parSet.getParameter<std::vector<int> >("CableToPsbMap");
177 
178  if (cableList.size() != cableToPsbMap.size()) {
179  throw cms::Exception("Configuration") << "\nError: inconsistent length of cable list and input to PSB list.\n"
180  << "\n Can not define the mapping of GCT quadruplets to GT PSBs.\n"
181  << std::endl;
182  }
183 
184  // detailed input configuration for PSB
185  std::vector<edm::ParameterSet> psbInput = parSet.getParameter<std::vector<edm::ParameterSet> >("PsbInput");
186 
187  // reserve space for L1 GT boards
188  m_gtBoardMaps.reserve(boardList.size());
189 
190  // fill the maps
191  int posVec = 0;
192 
193  for (std::vector<std::string>::const_iterator it = boardList.begin(); it != boardList.end(); ++it) {
194  L1GtBoardType boardType;
195 
196  if ((*it) == "GTFE") {
197  boardType = GTFE;
198  } else if ((*it) == "FDL") {
199  boardType = FDL;
200  } else if ((*it) == "PSB") {
201  boardType = PSB;
202  } else if ((*it) == "GMT") {
203  boardType = GMT;
204  } else if ((*it) == "TCS") {
205  boardType = TCS;
206  } else if ((*it) == "TIM") {
207  boardType = TIM;
208  } else {
209  throw cms::Exception("Configuration") << "\nError: no such board: " << (*it).c_str() << "\n"
210  << "\n Can not define the mapping of the L1 GT boards. \n"
211  << std::endl;
212  }
213 
214  // construct from board type and board index
215 
216  int iBoard = boardIndexVec.at(posVec);
217  L1GtBoard gtBoard = L1GtBoard(boardType, iBoard);
218 
219  // set the position of board data block
220  // in the GT DAQ readout record
221  gtBoard.setGtPositionDaqRecord(boardPositionDaqRecord.at(posVec));
222 
223  // set the position of board data block
224  // in the GT EVM readout record
225  gtBoard.setGtPositionEvmRecord(boardPositionEvmRecord.at(posVec));
226 
227  // set the bit of board in the GTFE ACTIVE_BOARDS
228  // for the GT DAQ readout record
229  gtBoard.setGtBitDaqActiveBoards(activeBoardsDaqRecord.at(posVec));
230 
231  // set the bit of board in the GTFE ACTIVE_BOARDS
232  // for the GT EVM readout record
233  gtBoard.setGtBitEvmActiveBoards(activeBoardsEvmRecord.at(posVec));
234 
235  // set board slot
236  int boardSlot = boardSlotMap.at(posVec);
237  gtBoard.setGtBoardSlot(boardSlot);
238 
239  // set board hex fragment name in hw record
240  gtBoard.setGtBoardHexName(boardHexNameMap.at(posVec));
241 
242  // set L1 quadruplet (4x16 bits)(cable) in the PSB input
243  // valid for PSB only
244 
245  if (boardType == PSB) {
246  L1GtPsbQuad psbQuad = Free;
247  int posCable = 0;
248  int iPsb = 0;
249  std::vector<L1GtPsbQuad> quadVec(L1GtBoard::NumberCablesBoard);
250 
251  for (std::vector<std::string>::const_iterator cIt = cableList.begin(); cIt != cableList.end(); ++cIt) {
252  if (*cIt == "TechTr") {
253  psbQuad = TechTr;
254  } else if (*cIt == "IsoEGQ") {
255  psbQuad = IsoEGQ;
256  } else if (*cIt == "NoIsoEGQ") {
257  psbQuad = NoIsoEGQ;
258  } else if (*cIt == "CenJetQ") {
259  psbQuad = CenJetQ;
260  } else if (*cIt == "ForJetQ") {
261  psbQuad = ForJetQ;
262  } else if (*cIt == "TauJetQ") {
263  psbQuad = TauJetQ;
264  } else if (*cIt == "ESumsQ") {
265  psbQuad = ESumsQ;
266  } else if (*cIt == "JetCountsQ") {
267  psbQuad = JetCountsQ;
268  } else if (*cIt == "MQB1") {
269  psbQuad = MQB1;
270  } else if (*cIt == "MQB2") {
271  psbQuad = MQB2;
272  } else if (*cIt == "MQF3") {
273  psbQuad = MQF3;
274  } else if (*cIt == "MQF4") {
275  psbQuad = MQF4;
276  } else if (*cIt == "MQB5") {
277  psbQuad = MQB5;
278  } else if (*cIt == "MQB6") {
279  psbQuad = MQB6;
280  } else if (*cIt == "MQF7") {
281  psbQuad = MQF7;
282  } else if (*cIt == "MQF8") {
283  psbQuad = MQF8;
284  } else if (*cIt == "MQB9") {
285  psbQuad = MQB9;
286  } else if (*cIt == "MQB10") {
287  psbQuad = MQB10;
288  } else if (*cIt == "MQF11") {
289  psbQuad = MQF11;
290  } else if (*cIt == "MQF12") {
291  psbQuad = MQF12;
292  } else if (*cIt == "Free") {
293  psbQuad = Free;
294  } else if (*cIt == "HfQ") {
295  psbQuad = HfQ;
296  } else {
297  // should not arrive here
298  throw cms::Exception("Configuration")
299  << "\nError: no such quadruplet: " << (*cIt).c_str() << "\n"
300  << "\n Can not define the mapping of quadruplets to the L1 PSB boards.\n"
301  << std::endl;
302  }
303 
304  int psbIndex = cableToPsbMap.at(posCable);
305 
306  if (psbIndex == gtBoard.gtBoardIndex()) {
307  if (iPsb > L1GtBoard::NumberCablesBoard) {
308  throw cms::Exception("Configuration")
309  << "\nError: too many cables for PSB_" << gtBoard.gtBoardIndex() << "\n\n "
310  << "Can not define the mapping of cables to L1 PSB boards. \n"
311  << std::endl;
312  }
313  quadVec[iPsb] = psbQuad;
314  iPsb++;
315  }
316  posCable++;
317  }
318 
319  gtBoard.setGtQuadInPsb(quadVec);
320  }
321 
322  if (boardType == PSB) {
323  std::map<int, std::vector<L1GtObject> > inputPsbChannels;
324 
325  std::vector<std::string> chStrings;
326  chStrings.reserve(2); // most channels have 2 objects
327 
328  std::vector<L1GtObject> chObjects;
329 
330  for (std::vector<edm::ParameterSet>::const_iterator itPSet = psbInput.begin(); itPSet != psbInput.end();
331  ++itPSet) {
332  //
333  int slot = itPSet->getParameter<int>("Slot");
334 
335  if (slot == boardSlot) {
336  chStrings = itPSet->getParameter<std::vector<std::string> >("Ch0");
337  chObjects = chInputObjects(chStrings);
338  inputPsbChannels[0] = chObjects;
339  chStrings.clear();
340  chObjects.clear();
341 
342  chStrings = itPSet->getParameter<std::vector<std::string> >("Ch1");
343  chObjects = chInputObjects(chStrings);
344  inputPsbChannels[1] = chObjects;
345  chStrings.clear();
346  chObjects.clear();
347 
348  chStrings = itPSet->getParameter<std::vector<std::string> >("Ch2");
349  chObjects = chInputObjects(chStrings);
350  inputPsbChannels[2] = chObjects;
351  chStrings.clear();
352  chObjects.clear();
353 
354  chStrings = itPSet->getParameter<std::vector<std::string> >("Ch3");
355  chObjects = chInputObjects(chStrings);
356  inputPsbChannels[3] = chObjects;
357  chStrings.clear();
358  chObjects.clear();
359 
360  chStrings = itPSet->getParameter<std::vector<std::string> >("Ch4");
361  chObjects = chInputObjects(chStrings);
362  inputPsbChannels[4] = chObjects;
363  chStrings.clear();
364  chObjects.clear();
365 
366  chStrings = itPSet->getParameter<std::vector<std::string> >("Ch5");
367  chObjects = chInputObjects(chStrings);
368  inputPsbChannels[5] = chObjects;
369  chStrings.clear();
370  chObjects.clear();
371 
372  chStrings = itPSet->getParameter<std::vector<std::string> >("Ch6");
373  chObjects = chInputObjects(chStrings);
374  inputPsbChannels[6] = chObjects;
375  chStrings.clear();
376  chObjects.clear();
377 
378  chStrings = itPSet->getParameter<std::vector<std::string> >("Ch7");
379  chObjects = chInputObjects(chStrings);
380  inputPsbChannels[7] = chObjects;
381  chStrings.clear();
382  chObjects.clear();
383  }
384  }
385 
386  gtBoard.setGtInputPsbChannels(inputPsbChannels);
387  }
388 
389  // push the board in the vector
390  m_gtBoardMaps.push_back(gtBoard);
391 
392  // increase the counter
393  posVec++;
394  }
395 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void setGtBoardSlot(const int &)
Definition: L1GtBoard.cc:204
void setGtBoardHexName(const int &)
Definition: L1GtBoard.cc:207
void setGtBitEvmActiveBoards(const int &)
Definition: L1GtBoard.cc:199
std::vector< L1GtObject > chInputObjects(const std::vector< std::string > &chInputStrings)
void setGtPositionEvmRecord(const int &)
Definition: L1GtBoard.cc:187
std::unique_ptr< L1GtBoardMaps > produceBoardMaps(const L1GtBoardMapsRcd &)
public methods
std::vector< L1GtBoard > m_gtBoardMaps
L1 GT boards and their mapping.
const int gtBoardIndex() const
get / set board index
Definition: L1GtBoard.h:73
void setGtInputPsbChannels(const std::map< int, std::vector< L1GtObject > > &)
Definition: L1GtBoard.cc:215
void setGtBitDaqActiveBoards(const int &)
Definition: L1GtBoard.cc:193
void setGtPositionDaqRecord(const int &)
Definition: L1GtBoard.cc:181
L1GtBoardType
board types in GT
L1GtPsbQuad
quadruples sent to GT via PSB
static const int NumberCablesBoard
number of InfiniCables per board
Definition: L1GtBoard.h:64
void setGtQuadInPsb(const std::vector< L1GtPsbQuad > &)
Definition: L1GtBoard.cc:211

◆ ~L1GtBoardMapsTrivialProducer()

L1GtBoardMapsTrivialProducer::~L1GtBoardMapsTrivialProducer ( )
override

destructor

Definition at line 398 of file L1GtBoardMapsTrivialProducer.cc.

398  {
399  // empty
400 }

Member Function Documentation

◆ produceBoardMaps()

std::unique_ptr< L1GtBoardMaps > L1GtBoardMapsTrivialProducer::produceBoardMaps ( const L1GtBoardMapsRcd iRecord)

public methods

produce mappings of the L1 GT boards

Definition at line 405 of file L1GtBoardMapsTrivialProducer.cc.

References m_gtBoardMaps.

Referenced by L1GtBoardMapsTrivialProducer().

405  {
406  auto pL1GtBoardMaps = std::make_unique<L1GtBoardMaps>();
407 
408  pL1GtBoardMaps->setGtBoardMaps(m_gtBoardMaps);
409 
410  return pL1GtBoardMaps;
411 }
std::vector< L1GtBoard > m_gtBoardMaps
L1 GT boards and their mapping.

Member Data Documentation

◆ m_gtBoardMaps

std::vector<L1GtBoard> L1GtBoardMapsTrivialProducer::m_gtBoardMaps
private

L1 GT boards and their mapping.

Definition at line 49 of file L1GtBoardMapsTrivialProducer.h.

Referenced by L1GtBoardMapsTrivialProducer(), and produceBoardMaps().