CMS 3D CMS Logo

SimpleVFATFrameCollection.h
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * This is a part of the TOTEM offline software.
4 * Authors:
5 * Mate Csanad (mate.csanad@cern.ch)
6 * Jan Kašpar (jan.kaspar@gmail.com)
7 *
8 ****************************************************************************/
9 
10 #ifndef EventFilter_CTPPSRawToDigi_SimpleVFATFrameCollection
11 #define EventFilter_CTPPSRawToDigi_SimpleVFATFrameCollection
12 
14 
15 #include <map>
16 
21 protected:
22  typedef std::map<TotemFramePosition, VFATFrame> MapType;
23 
24  MapType data;
25 
26  value_type BeginIterator() const override;
27  value_type NextIterator(const value_type&) const override;
28  bool IsEndIterator(const value_type&) const override;
29 
30 public:
32  ~SimpleVFATFrameCollection() override;
33 
34  const VFATFrame* GetFrameByID(unsigned int ID) const override;
35  const VFATFrame* GetFrameByIndex(TotemFramePosition index) const override;
36 
37  unsigned int Size() const override { return data.size(); }
38 
39  bool Empty() const override { return (data.empty()); }
40 
41  void Insert(const TotemFramePosition& index, const VFATFrame& frame) { data.insert({index, frame}); }
42 
45 
47  void Clear() { data.clear(); }
48 };
49 
50 #endif
SimpleVFATFrameCollection::Insert
void Insert(const TotemFramePosition &index, const VFATFrame &frame)
Definition: SimpleVFATFrameCollection.h:46
VFATFrameCollection.h
SimpleVFATFrameCollection::IsEndIterator
bool IsEndIterator(const value_type &) const override
checks whether the iterator points over the end of the collection
Definition: SimpleVFATFrameCollection.cc:51
SimpleVFATFrameCollection::MapType
std::map< TotemFramePosition, VFATFrame > MapType
Definition: SimpleVFATFrameCollection.h:27
SimpleVFATFrameCollection::Clear
void Clear()
cleans completely the collection
Definition: SimpleVFATFrameCollection.h:52
SimpleVFATFrameCollection::Size
unsigned int Size() const override
return the number of VFAT frames in the collection
Definition: SimpleVFATFrameCollection.h:42
VFATFrameCollection::value_type
std::pair< TotemFramePosition, const VFATFrame * > value_type
pair: frame DAQ position, frame data
Definition: VFATFrameCollection.h:46
SimpleVFATFrameCollection::BeginIterator
value_type BeginIterator() const override
returns the beginning of the collection
Definition: SimpleVFATFrameCollection.cc:36
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
SimpleVFATFrameCollection::InsertEmptyFrame
VFATFrame * InsertEmptyFrame(TotemFramePosition index)
inserts an empty (default) frame to the given position and returns pointer to the frame
Definition: SimpleVFATFrameCollection.h:49
align::ID
uint32_t ID
Definition: Definitions.h:24
SimpleVFATFrameCollection::NextIterator
value_type NextIterator(const value_type &) const override
shifts the iterator
Definition: SimpleVFATFrameCollection.cc:41
TotemFramePosition
Definition: TotemFramePosition.h:31
SimpleVFATFrameCollection::~SimpleVFATFrameCollection
~SimpleVFATFrameCollection() override
Definition: SimpleVFATFrameCollection.cc:14
SimpleVFATFrameCollection
Definition: SimpleVFATFrameCollection.h:19
SimpleVFATFrameCollection::Empty
bool Empty() const override
returns whether the collection is empty
Definition: SimpleVFATFrameCollection.h:44
VFATFrame
Definition: VFATFrame.h:18
amptDefault_cfi.frame
frame
Definition: amptDefault_cfi.py:12
SimpleVFATFrameCollection::data
MapType data
Definition: SimpleVFATFrameCollection.h:29
SimpleVFATFrameCollection::SimpleVFATFrameCollection
SimpleVFATFrameCollection()
Definition: SimpleVFATFrameCollection.cc:12
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
SimpleVFATFrameCollection::GetFrameByID
const VFATFrame * GetFrameByID(unsigned int ID) const override
returns pointer to frame with ID, performs NO duplicity check (if there is precisely one frame with t...
Definition: SimpleVFATFrameCollection.cc:16
VFATFrameCollection
Definition: VFATFrameCollection.h:20
SimpleVFATFrameCollection::GetFrameByIndex
const VFATFrame * GetFrameByIndex(TotemFramePosition index) const override
returns frame at given position in Slink frame
Definition: SimpleVFATFrameCollection.cc:28