CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 43 of file L1MuGMTReadoutCollection.h.

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

Definition at line 44 of file L1MuGMTReadoutCollection.h.

References m_Records.

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

Definition at line 46 of file L1MuGMTReadoutCollection.h.

46 {};

Member Function Documentation

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

Definition at line 63 of file L1MuGMTReadoutCollection.h.

References m_Records.

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

Definition at line 22 of file L1MuGMTReadoutCollection.cc.

References s_empty_record_cache.

Referenced by getRecord().

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

Definition at line 54 of file L1MuGMTReadoutCollection.h.

References getDefaultFor(), getDQMSummary::iter, and m_Records.

Referenced by L1GTDigiToRaw::packGmtCollection().

54  {
55  std::vector<L1MuGMTReadoutRecord>::const_iterator iter;
56  for (iter=m_Records.begin(); iter!=m_Records.end(); iter++) {
57  if ((*iter).getBxCounter() == bx) return (*iter);
58  }
59  return getDefaultFor(bx);
60  };
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 48 of file L1MuGMTReadoutCollection.h.

References i, m_Records, and reset().

Referenced by reset().

48 { for(unsigned int i=0; i<m_Records.size(); i++) m_Records[i].reset(); };
int i
Definition: DBlmapReader.cc:9
std::vector< L1MuGMTReadoutRecord > m_Records

Member Data Documentation

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