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
 
- 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

$Date$ $Revision$

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

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

$Date$ $Revision$

Definition at line 37 of file L1GtBoardMapsTrivialProducer.h.

Constructor & Destructor Documentation

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

constructor

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

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

destructor

Definition at line 467 of file L1GtBoardMapsTrivialProducer.cc.

468 {
469 
470  // empty
471 
472 }

Member Function Documentation

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

public methods

produce mappings of the L1 GT boards

Definition at line 478 of file L1GtBoardMapsTrivialProducer.cc.

References m_gtBoardMaps.

Referenced by L1GtBoardMapsTrivialProducer().

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

Referenced by L1GtBoardMapsTrivialProducer(), and produceBoardMaps().