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::shared_ptr< L1GtBoardMapsproduceBoardMaps (const L1GtBoardMapsRcd &)
 public methods More...
 
 ~L1GtBoardMapsTrivialProducer () override
 destructor More...
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
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

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- 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 eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

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 ( const edm::ParameterSet parSet)

constructor

Definition at line 110 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.

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

destructor

Definition at line 464 of file L1GtBoardMapsTrivialProducer.cc.

465 {
466 
467  // empty
468 
469 }

Member Function Documentation

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

public methods

produce mappings of the L1 GT boards

Definition at line 475 of file L1GtBoardMapsTrivialProducer.cc.

References m_gtBoardMaps.

Referenced by L1GtBoardMapsTrivialProducer().

477 {
478 
479  using namespace edm::es;
480 
481  auto pL1GtBoardMaps = std::make_shared<L1GtBoardMaps>();
482 
483  pL1GtBoardMaps->setGtBoardMaps(m_gtBoardMaps);
484 
485  return pL1GtBoardMaps ;
486 }
std::vector< L1GtBoard > m_gtBoardMaps
L1 GT boards and their mapping.

Member Data Documentation

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

L1 GT boards and their mapping.

Definition at line 55 of file L1GtBoardMapsTrivialProducer.h.

Referenced by L1GtBoardMapsTrivialProducer(), and produceBoardMaps().