CMS 3D CMS Logo

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() [1/2]

L1MuGMTReadoutCollection::L1MuGMTReadoutCollection ( )
inline

Definition at line 41 of file L1MuGMTReadoutCollection.h.

41 {};

◆ L1MuGMTReadoutCollection() [2/2]

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

◆ ~L1MuGMTReadoutCollection()

virtual L1MuGMTReadoutCollection::~L1MuGMTReadoutCollection ( )
inlinevirtual

Definition at line 44 of file L1MuGMTReadoutCollection.h.

44 {};

Member Function Documentation

◆ addRecord()

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

◆ getDefaultFor()

L1MuGMTReadoutRecord const & L1MuGMTReadoutCollection::getDefaultFor ( int  bx)
staticprivate

Definition at line 21 of file L1MuGMTReadoutCollection.cc.

References nano_mu_digi_cff::bx, and 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

◆ getRecord()

L1MuGMTReadoutRecord const& L1MuGMTReadoutCollection::getRecord ( int  bx = 0) const
inline

Definition at line 55 of file L1MuGMTReadoutCollection.h.

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

Referenced by L1TGT::analyze(), L1GTDigiToRaw::packGmtCollection(), L1TMuonLegacyConverter::produce(), and L1ExtraParticlesProd::produce().

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)

◆ getRecords()

std::vector<L1MuGMTReadoutRecord> const& L1MuGMTReadoutCollection::getRecords ( ) const
inline

◆ reset()

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

◆ m_Records

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