CMS 3D CMS Logo

Phase2TrackerFEDRawChannelUnpacker.h
Go to the documentation of this file.
1 #ifndef EventFilter_Phase2TrackerRawToDigi_Phase2TrackerPhase2TrackerFEDRawChannelUnpacker_H // {
2 #define EventFilter_Phase2TrackerRawToDigi_Phase2TrackerPhase2TrackerFEDRawChannelUnpacker_H
3 
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
14  public:
16  uint8_t stripIndex() const { return currentStrip_; }
17  bool stripOn() const { return bool((currentWord_ >> bitInWord_) & 0x1); }
18  bool hasData() const { return valuesLeft_; }
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 
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 
40  bitInWord_++;
41  currentStrip_++;
42  if (bitInWord_ > 7) {
43  bitInWord_ = 0;
46  }
47  valuesLeft_--;
48  return (*this);
49  }
50 
52  ++(*this);
53  return *this;
54  }
55 
56 } // namespace Phase2Tracker
57 
58 #endif // } end def EventFilter_Phase2TrackerRawToDigi_Phase2TrackerPhase2TrackerFEDRawChannelUnpacker_H
Phase2Tracker::STRIPS_PADDING
static const int STRIPS_PADDING
Definition: utils.h:27
Phase2Tracker::Phase2TrackerFEDChannel
Definition: Phase2TrackerFEDChannel.h:12
electrons_cff.bool
bool
Definition: electrons_cff.py:366
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::valuesLeft_
uint16_t valuesLeft_
Definition: Phase2TrackerFEDRawChannelUnpacker.h:26
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::Phase2TrackerFEDRawChannelUnpacker
Phase2TrackerFEDRawChannelUnpacker(const Phase2TrackerFEDChannel &channel)
Definition: Phase2TrackerFEDRawChannelUnpacker.h:31
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::stripOn
bool stripOn() const
Definition: Phase2TrackerFEDRawChannelUnpacker.h:17
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
Phase2TrackerFEDChannel.h
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::currentOffset_
uint8_t currentOffset_
Definition: Phase2TrackerFEDRawChannelUnpacker.h:24
Phase2TrackerFEDDAQHeader.h
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::hasData
bool hasData() const
Definition: Phase2TrackerFEDRawChannelUnpacker.h:18
Phase2TrackerFEDDAQTrailer.h
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::stripIndex
uint8_t stripIndex() const
Definition: Phase2TrackerFEDRawChannelUnpacker.h:16
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::data_
const uint8_t * data_
Definition: Phase2TrackerFEDRawChannelUnpacker.h:23
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::bitInWord_
uint8_t bitInWord_
Definition: Phase2TrackerFEDRawChannelUnpacker.h:28
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker
Definition: Phase2TrackerFEDRawChannelUnpacker.h:13
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::currentStrip_
uint8_t currentStrip_
Definition: Phase2TrackerFEDRawChannelUnpacker.h:25
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::operator++
Phase2TrackerFEDRawChannelUnpacker & operator++()
Definition: Phase2TrackerFEDRawChannelUnpacker.h:39
Phase2Tracker::Phase2TrackerFEDRawChannelUnpacker::currentWord_
uint8_t currentWord_
Definition: Phase2TrackerFEDRawChannelUnpacker.h:27
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
Phase2Tracker
Definition: Phase2TrackerFEDBuffer.h:12