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.

42 { m_Records.reserve(nbx); };

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

65 { m_Records.push_back(rec); };

References m_Records.

◆ getDefaultFor()

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

Definition at line 21 of file L1MuGMTReadoutCollection.cc.

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 }

References l1GtPatternGenerator_cfi::bx, and s_empty_record_cache.

Referenced by getRecord().

◆ getRecord()

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

Definition at line 55 of file L1MuGMTReadoutCollection.h.

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

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

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

◆ getRecords()

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

◆ reset()

void L1MuGMTReadoutCollection::reset ( void  )
inline

Definition at line 46 of file L1MuGMTReadoutCollection.h.

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

References mps_fire::i, and m_Records.

Member Data Documentation

◆ m_Records

std::vector<L1MuGMTReadoutRecord> L1MuGMTReadoutCollection::m_Records
private
mps_fire.i
i
Definition: mps_fire.py:428
L1MuGMTReadoutCollection::reset
void reset()
Definition: L1MuGMTReadoutCollection.h:46
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
L1MuGMTReadoutRecord
Definition: L1MuGMTReadoutRecord.h:44
L1MuGMTReadoutCollection::getDefaultFor
static L1MuGMTReadoutRecord const & getDefaultFor(int bx)
Definition: L1MuGMTReadoutCollection.cc:21
s_empty_record_cache
static tbb::concurrent_unordered_map< int, L1MuGMTReadoutRecord > s_empty_record_cache
Definition: L1MuGMTReadoutCollection.cc:19
L1MuGMTReadoutCollection::m_Records
std::vector< L1MuGMTReadoutRecord > m_Records
Definition: L1MuGMTReadoutCollection.h:70