CMS 3D CMS Logo

SimpleVFATFrameCollection.cc
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * This is a part of the TOTEM offline software.
4 * Authors:
5 * Jan Kašpar (jan.kaspar@gmail.com)
6 *
7 ****************************************************************************/
8 
10 
11 using namespace std;
12 
14 
16 
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 }
28 
30  MapType::const_iterator it = data.find(index);
31  if (it != data.end())
32  return &(it->second);
33  else
34  return nullptr;
35 }
36 
38  MapType::const_iterator it = data.begin();
39  return (it == data.end()) ? value_type(TotemFramePosition(), nullptr) : value_type(it->first, &it->second);
40 }
41 
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 }
51 
52 bool SimpleVFATFrameCollection::IsEndIterator(const value_type& value) const { return (value.second == nullptr); }
value_type NextIterator(const value_type &) const override
shifts the iterator
uint32_t ID
Definition: Definitions.h:24
const VFATFrame * GetFrameByIndex(TotemFramePosition index) const override
returns frame at given position in Slink frame
std::pair< TotemFramePosition, const VFATFrame * > value_type
pair: frame DAQ position, frame data
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...
value_type BeginIterator() const override
returns the beginning of the collection
Definition: value.py:1
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
bool IsEndIterator(const value_type &) const override
checks whether the iterator points over the end of the collection