CMS 3D CMS Logo

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

#include <L1MuBMDataBuffer.h>

Public Types

typedef std::vector
< L1MuBMTrackSegPhi * > 
TSPhivector
 container to store phi track segments More...
 

Public Member Functions

void addTSphi (int adr, const L1MuBMTrackSegPhi &)
 add new phi track segment to the Data Buffer More...
 
const TSPhivectorgetTSphi () const
 get all track segments from the buffer More...
 
const L1MuBMTrackSegPhigetTSphi (int station, int address) const
 get phi track segment of a given station from the buffer More...
 
 L1MuBMDataBuffer (const L1MuBMSectorProcessor &)
 constructor More...
 
int numberTSphi () const
 return number of non-empty phi track segments More...
 
void printTSphi () const
 print all phi track segments which are in the buffer More...
 
void reset ()
 clear Data Buffer More...
 
virtual ~L1MuBMDataBuffer ()
 destructor More...
 

Private Attributes

const L1MuBMSectorProcessorm_sp
 
TSPhivectorm_tsphi
 

Detailed Description

Data Buffer:

The Data Buffer stores track segment data during the execution of the track assembler

N. Neumeister CERN EP

Definition at line 41 of file L1MuBMDataBuffer.h.

Member Typedef Documentation

container to store phi track segments

Definition at line 44 of file L1MuBMDataBuffer.h.

Constructor & Destructor Documentation

L1MuBMDataBuffer::L1MuBMDataBuffer ( const L1MuBMSectorProcessor sp)

constructor

Definition at line 46 of file L1MuBMDataBuffer.cc.

References m_tsphi.

46  : m_sp(sp), m_tsphi(nullptr) {
47  m_tsphi = new TSPhivector(38);
48  m_tsphi->reserve(38);
49 }
std::vector< L1MuBMTrackSegPhi * > TSPhivector
container to store phi track segments
const L1MuBMSectorProcessor & m_sp
TSPhivector * m_tsphi
L1MuBMDataBuffer::~L1MuBMDataBuffer ( )
virtual

destructor

Definition at line 54 of file L1MuBMDataBuffer.cc.

References m_tsphi.

54 { delete m_tsphi; }
TSPhivector * m_tsphi

Member Function Documentation

void L1MuBMDataBuffer::addTSphi ( int  adr,
const L1MuBMTrackSegPhi ts 
)

add new phi track segment to the Data Buffer

Definition at line 85 of file L1MuBMDataBuffer.cc.

Referenced by L1MuBMSectorReceiver::receiveBBMXData().

85  {
86  L1MuBMTrackSegPhi* tmpts = new L1MuBMTrackSegPhi(ts);
87  (*m_tsphi)[adr] = tmpts;
88 }
const TSPhivector& L1MuBMDataBuffer::getTSphi ( ) const
inline

get all track segments from the buffer

Definition at line 56 of file L1MuBMDataBuffer.h.

References m_tsphi.

Referenced by L1MuBMSEU::run(), L1MuBMExtrapolationUnit::run(), and L1MuBMAssignmentUnit::TSR().

56 { return *m_tsphi; }
TSPhivector * m_tsphi
const L1MuBMTrackSegPhi * L1MuBMDataBuffer::getTSphi ( int  station,
int  address 
) const

get phi track segment of a given station from the buffer

Definition at line 77 of file L1MuBMDataBuffer.cc.

References m_tsphi.

77  {
78  int address = (station == 1) ? reladr : reladr + (station - 2) * 12 + 2;
79  return (*m_tsphi)[address];
80 }
TSPhivector * m_tsphi
int L1MuBMDataBuffer::numberTSphi ( ) const

return number of non-empty phi track segments

Definition at line 105 of file L1MuBMDataBuffer.cc.

References submitPVResolutionJobs::count, and m_tsphi.

Referenced by L1MuBMSectorProcessor::run().

105  {
106  int count = 0;
107  TSPhivector::iterator iter = m_tsphi->begin();
108  while (iter != m_tsphi->end()) {
109  if (*iter && !(*iter)->empty())
110  count++;
111  iter++;
112  }
113  return count;
114 }
TSPhivector * m_tsphi
void L1MuBMDataBuffer::printTSphi ( ) const

print all phi track segments which are in the buffer

Definition at line 93 of file L1MuBMDataBuffer.cc.

References gather_cfg::cout, and m_tsphi.

Referenced by L1MuBMSectorProcessor::run().

93  {
94  TSPhivector::const_iterator iter = m_tsphi->begin();
95  while (iter != m_tsphi->end()) {
96  if (*iter)
97  cout << *(*iter) << endl;
98  iter++;
99  }
100 }
TSPhivector * m_tsphi
tuple cout
Definition: gather_cfg.py:144
void L1MuBMDataBuffer::reset ( void  )

clear Data Buffer

Definition at line 63 of file L1MuBMDataBuffer.cc.

References m_tsphi.

Referenced by L1MuBMSectorProcessor::reset().

63  {
64  TSPhivector::iterator iter = m_tsphi->begin();
65  while (iter != m_tsphi->end()) {
66  if (*iter) {
67  delete *iter;
68  *iter = nullptr;
69  }
70  iter++;
71  }
72 }
TSPhivector * m_tsphi

Member Data Documentation

const L1MuBMSectorProcessor& L1MuBMDataBuffer::m_sp
private

Definition at line 71 of file L1MuBMDataBuffer.h.

TSPhivector* L1MuBMDataBuffer::m_tsphi
private