EventFilter
Phase2TrackerRawToDigi
interface
Phase2TrackerFEDRawChannelUnpacker.h
Go to the documentation of this file.
1
#ifndef EventFilter_Phase2TrackerRawToDigi_Phase2TrackerPhase2TrackerFEDRawChannelUnpacker_H // {
2
#define EventFilter_Phase2TrackerRawToDigi_Phase2TrackerPhase2TrackerFEDRawChannelUnpacker_H
3
4
#include "
EventFilter/Phase2TrackerRawToDigi/interface/Phase2TrackerFEDDAQHeader.h
"
5
#include "
EventFilter/Phase2TrackerRawToDigi/interface/Phase2TrackerFEDDAQTrailer.h
"
6
#include "
EventFilter/Phase2TrackerRawToDigi/interface/Phase2TrackerFEDChannel.h
"
7
#include <cstdint>
8
9
namespace
Phase2Tracker
{
10
11
// unpacker for RAW CBC data
12
// each bit of the channel is related to one strip
13
class
Phase2TrackerFEDRawChannelUnpacker
{
14
public
:
15
Phase2TrackerFEDRawChannelUnpacker
(
const
Phase2TrackerFEDChannel
& channel);
16
uint8_t
stripIndex
()
const
{
return
currentStrip_
; }
17
bool
stripOn
()
const
{
return
bool
((
currentWord_
>>
bitInWord_
) & 0
x1
); }
18
bool
hasData
()
const
{
return
valuesLeft_
; }
19
Phase2TrackerFEDRawChannelUnpacker
&
operator++
();
20
Phase2TrackerFEDRawChannelUnpacker
&
operator++
(
int
);
21
22
private
:
23
const
uint8_t*
data_
;
24
uint8_t
currentOffset_
;
25
uint8_t
currentStrip_
;
26
uint16_t
valuesLeft_
;
27
uint8_t
currentWord_
;
28
uint8_t
bitInWord_
;
29
};
// end of Phase2TrackerFEDRawChannelUnpacker
30
31
inline
Phase2TrackerFEDRawChannelUnpacker::Phase2TrackerFEDRawChannelUnpacker
(
const
Phase2TrackerFEDChannel
& channel)
32
: data_(channel.
data
()),
33
currentOffset_(channel.
offset
()),
34
currentStrip_(0),
35
valuesLeft_((channel.length()) * 8 -
STRIPS_PADDING
),
36
currentWord_(channel.
data
()[currentOffset_ ^ 7]),
37
bitInWord_(0) {}
38
39
inline
Phase2TrackerFEDRawChannelUnpacker
&
Phase2TrackerFEDRawChannelUnpacker::operator++
() {
40
bitInWord_
++;
41
currentStrip_
++;
42
if
(
bitInWord_
> 7) {
43
bitInWord_
= 0;
44
currentOffset_
++;
45
currentWord_
=
data_
[
currentOffset_
^ 7];
46
}
47
valuesLeft_
--;
48
return
(*
this
);
49
}
50
51
inline
Phase2TrackerFEDRawChannelUnpacker
&
Phase2TrackerFEDRawChannelUnpacker::operator++
(
int
) {
52
++(*this);
53
return
*
this
;
54
}
55
56
}
// namespace Phase2Tracker
57
58
#endif // } end def EventFilter_Phase2TrackerRawToDigi_Phase2TrackerPhase2TrackerFEDRawChannelUnpacker_H
Phase2TrackerFEDDAQHeader.h
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::currentOffset_
uint8_t currentOffset_
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:24
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::operator++
Phase2TrackerFEDRawChannelUnpacker & operator++()
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:39
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::valuesLeft_
uint16_t valuesLeft_
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:26
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::stripIndex
uint8_t stripIndex() const
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:16
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::stripOn
bool stripOn() const
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:17
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::data_
const uint8_t * data_
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:23
Phase2Tracker
Definition:
Phase2TrackerFEDBuffer.h:12
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::currentStrip_
uint8_t currentStrip_
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:25
Phase2Tracker::Phase2TrackerFEDChannel
Definition:
Phase2TrackerFEDChannel.h:12
Phase2TrackerFEDChannel.h
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::hasData
bool hasData() const
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:18
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::currentWord_
uint8_t currentWord_
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:27
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:13
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::bitInWord_
uint8_t bitInWord_
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:28
electrons_cff.bool
bool
Definition:
electrons_cff.py:381
Phase2TrackerFEDDAQTrailer.h
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:79
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::Phase2TrackerFEDRawChannelUnpacker
Phase2TrackerFEDRawChannelUnpacker(const Phase2TrackerFEDChannel &channel)
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:31
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition:
testProducerWithPsetDescEmpty_cfi.py:33
Phase2Tracker::STRIPS_PADDING
static const int STRIPS_PADDING
Definition:
utils.h:27
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition:
hltrates_dqm_sourceclient-live_cfg.py:83
Generated for CMSSW Reference Manual by
1.8.14