Main Page
Namespaces
Classes
Package Documentation
src
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
{
15
public
:
16
Phase2TrackerFEDRawChannelUnpacker
(
const
Phase2TrackerFEDChannel
& channel);
17
uint8_t
stripIndex
()
const
{
return
currentStrip_
; }
18
bool
stripOn
()
const
{
return
bool
((
currentWord_
>>
bitInWord_
)&0
x1
); }
19
bool
hasData
()
const
{
return
valuesLeft_
; }
20
Phase2TrackerFEDRawChannelUnpacker
&
operator ++
();
21
Phase2TrackerFEDRawChannelUnpacker
&
operator ++
(
int
);
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
}
40
41
inline
Phase2TrackerFEDRawChannelUnpacker
&
Phase2TrackerFEDRawChannelUnpacker::operator ++
()
42
{
43
bitInWord_
++;
44
currentStrip_
++;
45
if
(
bitInWord_
> 7) {
46
bitInWord_
= 0;
47
currentOffset_
++;
48
currentWord_
=
data_
[
currentOffset_
^7];
49
}
50
valuesLeft_
--;
51
return
(*
this
);
52
}
53
54
inline
Phase2TrackerFEDRawChannelUnpacker
&
Phase2TrackerFEDRawChannelUnpacker::operator ++
(
int
)
55
{
56
++(*this);
return
*
this
;
57
}
58
59
}
// end of Phase2Tracker namespace
60
61
#endif // } end def EventFilter_Phase2TrackerRawToDigi_Phase2TrackerPhase2TrackerFEDRawChannelUnpacker_H
62
Phase2TrackerFEDDAQHeader.h
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::currentOffset_
uint8_t currentOffset_
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:24
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::operator++
Phase2TrackerFEDRawChannelUnpacker & operator++()
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:41
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::valuesLeft_
uint16_t valuesLeft_
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:26
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::Phase2TrackerFEDRawChannelUnpacker::hasData
bool hasData() const
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:19
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::stripOn
bool stripOn() const
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:18
Phase2Tracker::Phase2TrackerFEDChannel
Definition:
Phase2TrackerFEDChannel.h:12
Phase2TrackerFEDChannel.h
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::currentWord_
uint8_t currentWord_
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:27
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::stripIndex
uint8_t stripIndex() const
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:17
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:13
globals_cff.x1
x1
Definition:
globals_cff.py:29
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::bitInWord_
uint8_t bitInWord_
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:28
electrons_cff.bool
bool
Definition:
electrons_cff.py:359
Phase2TrackerFEDDAQTrailer.h
PFRecoTauDiscriminationByIsolation_cfi.offset
offset
Definition:
PFRecoTauDiscriminationByIsolation_cfi.py:62
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:82
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::Phase2TrackerFEDRawChannelUnpacker
Phase2TrackerFEDRawChannelUnpacker(const Phase2TrackerFEDChannel &channel)
Definition:
Phase2TrackerFEDRawChannelUnpacker.h:31
Phase2Tracker::STRIPS_PADDING
static const int STRIPS_PADDING
Definition:
utils.h:27
Generated for CMSSW Reference Manual by
1.8.11