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)
 
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 19 of file SimpleVFATFrameCollection.h.

Member Typedef Documentation

◆ MapType

Definition at line 27 of file SimpleVFATFrameCollection.h.

Constructor & Destructor Documentation

◆ SimpleVFATFrameCollection()

SimpleVFATFrameCollection::SimpleVFATFrameCollection ( )

Definition at line 12 of file SimpleVFATFrameCollection.cc.

◆ ~SimpleVFATFrameCollection()

SimpleVFATFrameCollection::~SimpleVFATFrameCollection ( )
override

Definition at line 14 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 36 of file SimpleVFATFrameCollection.cc.

37  {
38  MapType::const_iterator it = data.begin();
39  return (it == data.end()) ? value_type(TotemFramePosition(), nullptr) : value_type(it->first, &it->second);

References data.

◆ Clear()

void SimpleVFATFrameCollection::Clear ( )
inline

cleans completely the collection

Definition at line 52 of file SimpleVFATFrameCollection.h.

◆ Empty()

bool SimpleVFATFrameCollection::Empty ( ) const
inlineoverridevirtual

returns whether the collection is empty

Implements VFATFrameCollection.

Definition at line 44 of file SimpleVFATFrameCollection.h.

44 { return &data.insert({index, VFATFrame()}).first->second; }

References data, and first.

◆ 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 16 of file SimpleVFATFrameCollection.cc.

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;

References data.

◆ GetFrameByIndex()

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

returns frame at given position in Slink frame

Implements VFATFrameCollection.

Definition at line 28 of file SimpleVFATFrameCollection.cc.

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

References data.

◆ Insert()

void SimpleVFATFrameCollection::Insert ( const TotemFramePosition 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 49 of file SimpleVFATFrameCollection.h.

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 51 of file SimpleVFATFrameCollection.cc.

◆ NextIterator()

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

shifts the iterator

Implements VFATFrameCollection.

Definition at line 41 of file SimpleVFATFrameCollection.cc.

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

References data, and relativeConstraints::value.

◆ Size()

unsigned int SimpleVFATFrameCollection::Size ( ) const
inlineoverridevirtual

return the number of VFAT frames in the collection

Implements VFATFrameCollection.

Definition at line 42 of file SimpleVFATFrameCollection.h.

44 { return &data.insert({index, VFATFrame()}).first->second; }

Member Data Documentation

◆ data

MapType SimpleVFATFrameCollection::data
protected
VFATFrameCollection::value_type
std::pair< TotemFramePosition, const VFATFrame * > value_type
pair: frame DAQ position, frame data
Definition: VFATFrameCollection.h:46
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
align::ID
uint32_t ID
Definition: Definitions.h:24
TotemFramePosition
Definition: TotemFramePosition.h:31
value
Definition: value.py:1
VFATFrame
Definition: VFATFrame.h:18
relativeConstraints.value
value
Definition: relativeConstraints.py:53
SimpleVFATFrameCollection::data
MapType data
Definition: SimpleVFATFrameCollection.h:29
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46