EventFilter
CTPPSRawToDigi
src
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
9
#include "
EventFilter/CTPPSRawToDigi/interface/SimpleVFATFrameCollection.h
"
10
11
using namespace
std
;
12
13
SimpleVFATFrameCollection::SimpleVFATFrameCollection
() {}
14
15
SimpleVFATFrameCollection::~SimpleVFATFrameCollection
() {
data
.clear(); }
16
17
const
VFATFrame
*
SimpleVFATFrameCollection::GetFrameByID
(
unsigned
int
ID
)
const
{
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
29
const
VFATFrame
*
SimpleVFATFrameCollection::GetFrameByIndex
(
TotemFramePosition
index
)
const
{
30
MapType::const_iterator it =
data
.find(
index
);
31
if
(it !=
data
.end())
32
return
&(it->second);
33
else
34
return
nullptr
;
35
}
36
37
VFATFrameCollection::value_type
SimpleVFATFrameCollection::BeginIterator
()
const
{
38
MapType::const_iterator it =
data
.begin();
39
return
(it ==
data
.end()) ?
value_type
(
TotemFramePosition
(),
nullptr
) :
value_type
(it->first, &it->second);
40
}
41
42
VFATFrameCollection::value_type
SimpleVFATFrameCollection::NextIterator
(
const
value_type
&
value
)
const
{
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
); }
std::data
constexpr auto data(C &c) -> decltype(c.data())
Definition:
cuda_cxx17.h:40
SimpleVFATFrameCollection.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
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
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
value
Definition:
value.py:1
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition:
JetExtendedAssociation.h:30
std
Definition:
JetResolutionObject.h:76
VFATFrame
Definition:
VFATFrame.h:18
relativeConstraints.value
value
Definition:
relativeConstraints.py:53
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
SimpleVFATFrameCollection::GetFrameByIndex
const VFATFrame * GetFrameByIndex(TotemFramePosition index) const override
returns frame at given position in Slink frame
Definition:
SimpleVFATFrameCollection.cc:28
Generated for CMSSW Reference Manual by
1.8.16