CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
SimpleVFATFrameCollection Class Reference

#include <SimpleVFATFrameCollection.h>

Inheritance diagram for SimpleVFATFrameCollection:
VFATFrameCollection

Public Member Functions

void Clear ()
 cleans completely the collection More...
 
bool Empty () const override
 returns whether the collection is empty More...
 
const VFATFrameGetFrameByID (unsigned int ID) const override
 returns pointer to frame with ID, performs NO duplicity check (if there is precisely one frame with this 12bit ID) More...
 
const VFATFrameGetFrameByIndex (TotemFramePosition index) const override
 returns frame at given position in Slink frame More...
 
void Insert (const TotemFramePosition &index, const VFATFrame &frame)
 
void Insert (const TotemT2FramePosition &index, const VFATFrame &frame)
 
VFATFrameInsertEmptyFrame (TotemFramePosition index)
 inserts an empty (default) frame to the given position and returns pointer to the frame More...
 
 SimpleVFATFrameCollection ()
 
unsigned int Size () const override
 return the number of VFAT frames in the collection More...
 
 ~SimpleVFATFrameCollection () override
 
- Public Member Functions inherited from VFATFrameCollection
virtual const VFATFrameGetFrameByIndexID (TotemFramePosition index, unsigned int ID)
 returns frame at given position in Slink frame and checks 12bit ID More...
 
 VFATFrameCollection ()
 
virtual ~VFATFrameCollection ()
 

Protected Types

typedef std::map< TotemFramePosition, VFATFrameMapType
 

Protected Member Functions

value_type BeginIterator () const override
 returns the beginning of the collection More...
 
bool IsEndIterator (const value_type &) const override
 checks whether the iterator points over the end of the collection More...
 
value_type NextIterator (const value_type &) const override
 shifts the iterator More...
 

Protected Attributes

MapType data
 

Additional Inherited Members

- Public Types inherited from VFATFrameCollection
typedef std::pair< TotemFramePosition, const VFATFrame * > value_type
 pair: frame DAQ position, frame data More...
 

Detailed Description

A basic implementation of VFAT frame collection, as map: TotemFramePosition –> VFATFrame.

Definition at line 21 of file SimpleVFATFrameCollection.h.

Member Typedef Documentation

◆ MapType

Definition at line 23 of file SimpleVFATFrameCollection.h.

Constructor & Destructor Documentation

◆ SimpleVFATFrameCollection()

SimpleVFATFrameCollection::SimpleVFATFrameCollection ( )

Definition at line 13 of file SimpleVFATFrameCollection.cc.

13 {}

◆ ~SimpleVFATFrameCollection()

SimpleVFATFrameCollection::~SimpleVFATFrameCollection ( )
override

Definition at line 15 of file SimpleVFATFrameCollection.cc.

References data.

Member Function Documentation

◆ BeginIterator()

VFATFrameCollection::value_type SimpleVFATFrameCollection::BeginIterator ( ) const
overrideprotectedvirtual

returns the beginning of the collection

Implements VFATFrameCollection.

Definition at line 37 of file SimpleVFATFrameCollection.cc.

References data.

37  {
38  MapType::const_iterator it = data.begin();
39  return (it == data.end()) ? value_type(TotemFramePosition(), nullptr) : value_type(it->first, &it->second);
40 }
std::pair< TotemFramePosition, const VFATFrame * > value_type
pair: frame DAQ position, frame data

◆ Clear()

void SimpleVFATFrameCollection::Clear ( )
inline

cleans completely the collection

Definition at line 50 of file SimpleVFATFrameCollection.h.

References data.

◆ Empty()

bool SimpleVFATFrameCollection::Empty ( ) const
inlineoverridevirtual

returns whether the collection is empty

Implements VFATFrameCollection.

Definition at line 40 of file SimpleVFATFrameCollection.h.

References data.

40 { return (data.empty()); }

◆ GetFrameByID()

const VFATFrame * SimpleVFATFrameCollection::GetFrameByID ( unsigned int  ID) const
overridevirtual

returns pointer to frame with ID, performs NO duplicity check (if there is precisely one frame with this 12bit ID)

Implements VFATFrameCollection.

Definition at line 17 of file SimpleVFATFrameCollection.cc.

References data.

17  {
18  // first convert ID to 12bit form
19  ID = ID & 0xFFF;
20 
21  for (MapType::const_iterator it = data.begin(); it != data.end(); ++it)
22  if (it->second.getChipID() == ID)
23  if (it->second.checkFootprint() && it->second.checkCRC())
24  return &(it->second);
25 
26  return nullptr;
27 }
uint32_t ID
Definition: Definitions.h:24

◆ GetFrameByIndex()

const VFATFrame * SimpleVFATFrameCollection::GetFrameByIndex ( TotemFramePosition  index) const
overridevirtual

returns frame at given position in Slink frame

Implements VFATFrameCollection.

Definition at line 29 of file SimpleVFATFrameCollection.cc.

References data.

29  {
30  MapType::const_iterator it = data.find(index);
31  if (it != data.end())
32  return &(it->second);
33  else
34  return nullptr;
35 }

◆ Insert() [1/2]

void SimpleVFATFrameCollection::Insert ( const TotemFramePosition index,
const VFATFrame frame 
)
inline

◆ Insert() [2/2]

void SimpleVFATFrameCollection::Insert ( const TotemT2FramePosition index,
const VFATFrame frame 
)
inline

◆ InsertEmptyFrame()

VFATFrame* SimpleVFATFrameCollection::InsertEmptyFrame ( TotemFramePosition  index)
inline

inserts an empty (default) frame to the given position and returns pointer to the frame

Definition at line 47 of file SimpleVFATFrameCollection.h.

References data, and dqmdumpme::first.

Referenced by pps::RawDataUnpacker::processOptoRxFrameSerial().

◆ IsEndIterator()

bool SimpleVFATFrameCollection::IsEndIterator ( const value_type ) const
overrideprotectedvirtual

checks whether the iterator points over the end of the collection

Implements VFATFrameCollection.

Definition at line 52 of file SimpleVFATFrameCollection.cc.

52 { return (value.second == nullptr); }
Definition: value.py:1

◆ NextIterator()

VFATFrameCollection::value_type SimpleVFATFrameCollection::NextIterator ( const value_type ) const
overrideprotectedvirtual

shifts the iterator

Implements VFATFrameCollection.

Definition at line 42 of file SimpleVFATFrameCollection.cc.

References data, and relativeConstraints::value.

42  {
43  if (!value.second)
44  return value;
45 
46  MapType::const_iterator it = data.find(value.first);
47  it++;
48 
49  return (it == data.end()) ? value_type(TotemFramePosition(), nullptr) : value_type(it->first, &it->second);
50 }
std::pair< TotemFramePosition, const VFATFrame * > value_type
pair: frame DAQ position, frame data
Definition: value.py:1

◆ Size()

unsigned int SimpleVFATFrameCollection::Size ( ) const
inlineoverridevirtual

return the number of VFAT frames in the collection

Implements VFATFrameCollection.

Definition at line 38 of file SimpleVFATFrameCollection.h.

References data.

38 { return data.size(); }

Member Data Documentation

◆ data

MapType SimpleVFATFrameCollection::data
protected