CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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...
 
boost::shared_ptr< L1GtBoardMapsproduceBoardMaps (const L1GtBoardMapsRcd &)
 public methods More...
 
 ~L1GtBoardMapsTrivialProducer ()
 destructor More...
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- 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 ()
 

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, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
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::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 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 35 of file L1GtBoardMapsTrivialProducer.h.

Constructor & Destructor Documentation

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

constructor

Definition at line 111 of file L1GtBoardMapsTrivialProducer.cc.

References CenJetQ, chInputObjects(), ESumsQ, edm::hlt::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.

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

destructor

Definition at line 465 of file L1GtBoardMapsTrivialProducer.cc.

466 {
467 
468  // empty
469 
470 }

Member Function Documentation

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

public methods

produce mappings of the L1 GT boards

Definition at line 476 of file L1GtBoardMapsTrivialProducer.cc.

References m_gtBoardMaps.

Referenced by L1GtBoardMapsTrivialProducer().

478 {
479 
480  using namespace edm::es;
481 
482  boost::shared_ptr<L1GtBoardMaps> pL1GtBoardMaps =
483  boost::shared_ptr<L1GtBoardMaps>( new L1GtBoardMaps() );
484 
485  pL1GtBoardMaps->setGtBoardMaps(m_gtBoardMaps);
486 
487  return pL1GtBoardMaps ;
488 }
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 56 of file L1GtBoardMapsTrivialProducer.h.

Referenced by L1GtBoardMapsTrivialProducer(), and produceBoardMaps().