CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Private Member Functions | Private Attributes
L1MuGMTReadoutCollection Class Reference

#include <L1MuGMTReadoutCollection.h>

Public Member Functions

void addRecord (L1MuGMTReadoutRecord const &rec)
 
L1MuGMTReadoutRecord const & getRecord (int bx=0) const
 
std::vector
< L1MuGMTReadoutRecord > const & 
getRecords () const
 
 L1MuGMTReadoutCollection ()
 
 L1MuGMTReadoutCollection (int nbx)
 
void reset ()
 
virtual ~L1MuGMTReadoutCollection ()
 

Static Private Member Functions

static L1MuGMTReadoutRecord const & getDefaultFor (int bx)
 

Private Attributes

std::vector< L1MuGMTReadoutRecordm_Records
 

Detailed Description

Definition at line 39 of file L1MuGMTReadoutCollection.h.

Constructor & Destructor Documentation

L1MuGMTReadoutCollection::L1MuGMTReadoutCollection ( )
inline

Definition at line 41 of file L1MuGMTReadoutCollection.h.

41 {};
L1MuGMTReadoutCollection::L1MuGMTReadoutCollection ( int  nbx)
inline

Definition at line 42 of file L1MuGMTReadoutCollection.h.

References m_Records.

42 { m_Records.reserve(nbx); };
std::vector< L1MuGMTReadoutRecord > m_Records
virtual L1MuGMTReadoutCollection::~L1MuGMTReadoutCollection ( )
inlinevirtual

Definition at line 44 of file L1MuGMTReadoutCollection.h.

44 {};

Member Function Documentation

void L1MuGMTReadoutCollection::addRecord ( L1MuGMTReadoutRecord const &  rec)
inline

Definition at line 65 of file L1MuGMTReadoutCollection.h.

References m_Records.

65 { m_Records.push_back(rec); };
std::vector< L1MuGMTReadoutRecord > m_Records
L1MuGMTReadoutRecord const & L1MuGMTReadoutCollection::getDefaultFor ( int  bx)
staticprivate

Definition at line 21 of file L1MuGMTReadoutCollection.cc.

References s_empty_record_cache.

Referenced by getRecord().

21  {
22  // if bx not found return empty readout record
23  auto itFound = s_empty_record_cache.find(bx);
24  if (itFound == s_empty_record_cache.end()) {
25  auto foundPair = s_empty_record_cache.insert(std::make_pair(bx, L1MuGMTReadoutRecord(bx)));
26  itFound = foundPair.first;
27  }
28  return itFound->second;
29 }
static tbb::concurrent_unordered_map< int, L1MuGMTReadoutRecord > s_empty_record_cache
L1MuGMTReadoutRecord const& L1MuGMTReadoutCollection::getRecord ( int  bx = 0) const
inline

Definition at line 55 of file L1MuGMTReadoutCollection.h.

References makePileupJSON::bx, getDefaultFor(), and m_Records.

Referenced by L1GTDigiToRaw::packGmtCollection().

55  {
56  std::vector<L1MuGMTReadoutRecord>::const_iterator iter;
57  for (iter = m_Records.begin(); iter != m_Records.end(); iter++) {
58  if ((*iter).getBxCounter() == bx)
59  return (*iter);
60  }
61  return getDefaultFor(bx);
62  };
std::vector< L1MuGMTReadoutRecord > m_Records
static L1MuGMTReadoutRecord const & getDefaultFor(int bx)
std::vector<L1MuGMTReadoutRecord> const& L1MuGMTReadoutCollection::getRecords ( ) const
inline
void L1MuGMTReadoutCollection::reset ( void  )
inline

Definition at line 46 of file L1MuGMTReadoutCollection.h.

References mps_fire::i, and m_Records.

46  {
47  for (unsigned int i = 0; i < m_Records.size(); i++)
48  m_Records[i].reset();
49  };
std::vector< L1MuGMTReadoutRecord > m_Records

Member Data Documentation

std::vector<L1MuGMTReadoutRecord> L1MuGMTReadoutCollection::m_Records
private