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...
 
virtual bool Empty () const
 returns whether the collection is empty More...
 
const VFATFrameGetFrameByID (unsigned int ID) const
 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
 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 ()
 
virtual unsigned int Size () const
 return the number of VFAT frames in the collection More...
 
 ~SimpleVFATFrameCollection ()
 
- 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

virtual value_type BeginIterator () const
 returns the beginning of the collection More...
 
virtual bool IsEndIterator (const value_type &) const
 checks whether the iterator points over the end of the collection More...
 
virtual value_type NextIterator (const value_type &) const
 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

Definition at line 24 of file SimpleVFATFrameCollection.h.

Constructor & Destructor Documentation

SimpleVFATFrameCollection::SimpleVFATFrameCollection ( )

Definition at line 16 of file SimpleVFATFrameCollection.cc.

17 {
18 }
SimpleVFATFrameCollection::~SimpleVFATFrameCollection ( )

Definition at line 22 of file SimpleVFATFrameCollection.cc.

References data.

23 {
24  data.clear();
25 }

Member Function Documentation

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

returns the beginning of the collection

Implements VFATFrameCollection.

Definition at line 55 of file SimpleVFATFrameCollection.cc.

References data, and NULL.

56 {
57  MapType::const_iterator it = data.begin();
58  return (it == data.end()) ? value_type(TotemFramePosition(), NULL) : value_type(it->first, &it->second);
59 }
#define NULL
Definition: scimark2.h:8
std::pair< TotemFramePosition, const VFATFrame * > value_type
pair: frame DAQ position, frame data
void SimpleVFATFrameCollection::Clear ( )
inline

cleans completely the collection

Definition at line 61 of file SimpleVFATFrameCollection.h.

62  {
63  data.clear();
64  }
virtual bool SimpleVFATFrameCollection::Empty ( ) const
inlinevirtual

returns whether the collection is empty

Implements VFATFrameCollection.

Definition at line 44 of file SimpleVFATFrameCollection.h.

45  {
46  return (data.size() == 0);
47  }
const VFATFrame * SimpleVFATFrameCollection::GetFrameByID ( unsigned int  ID) const
virtual

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

References data, and NULL.

30 {
31  // first convert ID to 12bit form
32  ID = ID & 0xFFF;
33 
34  for (MapType::const_iterator it = data.begin(); it != data.end(); ++it)
35  if (it->second.getChipID() == ID)
36  if (it->second.checkFootprint() && it->second.checkCRC())
37  return &(it->second);
38 
39  return NULL;
40 }
uint32_t ID
Definition: Definitions.h:26
#define NULL
Definition: scimark2.h:8
const VFATFrame * SimpleVFATFrameCollection::GetFrameByIndex ( TotemFramePosition  index) const
virtual

returns frame at given position in Slink frame

Implements VFATFrameCollection.

Definition at line 44 of file SimpleVFATFrameCollection.cc.

References data, and NULL.

45 {
46  MapType::const_iterator it = data.find(index);
47  if (it != data.end())
48  return &(it->second);
49  else
50  return NULL;
51 }
#define NULL
Definition: scimark2.h:8
void SimpleVFATFrameCollection::Insert ( const TotemFramePosition index,
const VFATFrame frame 
)
inline

Definition at line 49 of file SimpleVFATFrameCollection.h.

References diffTreeTool::index.

Referenced by RawDataUnpacker::ProcessVFATDataParallel().

50  {
51  data.insert({index, frame});
52  }
VFATFrame* SimpleVFATFrameCollection::InsertEmptyFrame ( TotemFramePosition  index)
inline

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

Definition at line 55 of file SimpleVFATFrameCollection.h.

References plotBeamSpotDB::first, and diffTreeTool::index.

Referenced by RawDataUnpacker::ProcessOptoRxFrameSerial().

56  {
57  return &data.insert({index, VFATFrame()}).first->second;
58  }
bool SimpleVFATFrameCollection::IsEndIterator ( const value_type ) const
protectedvirtual

checks whether the iterator points over the end of the collection

Implements VFATFrameCollection.

Definition at line 76 of file SimpleVFATFrameCollection.cc.

References NULL.

77 {
78  return (value.second == NULL);
79 }
#define NULL
Definition: scimark2.h:8
Definition: value.py:1
VFATFrameCollection::value_type SimpleVFATFrameCollection::NextIterator ( const value_type ) const
protectedvirtual

shifts the iterator

Implements VFATFrameCollection.

Definition at line 63 of file SimpleVFATFrameCollection.cc.

References data, NULL, and relativeConstraints::value.

64 {
65  if (!value.second)
66  return value;
67 
68  MapType::const_iterator it = data.find(value.first);
69  it++;
70 
71  return (it == data.end()) ? value_type(TotemFramePosition(), NULL) : value_type(it->first, &it->second);
72 }
#define NULL
Definition: scimark2.h:8
std::pair< TotemFramePosition, const VFATFrame * > value_type
pair: frame DAQ position, frame data
Definition: value.py:1
virtual unsigned int SimpleVFATFrameCollection::Size ( ) const
inlinevirtual

return the number of VFAT frames in the collection

Implements VFATFrameCollection.

Definition at line 39 of file SimpleVFATFrameCollection.h.

40  {
41  return data.size();
42  }

Member Data Documentation

MapType SimpleVFATFrameCollection::data
protected