CMS 3D CMS Logo

GEBdata.h
Go to the documentation of this file.
1 #ifndef EventFilter_GEMRawToDigi_GEBdata_h
2 #define EventFilter_GEMRawToDigi_GEBdata_h
3 #include "VFATdata.h"
4 #include <vector>
5 
6 namespace gem {
7  // Input status 1 bit for each
8  // BX mismatch GLIB OH / BX mismatch GLIB VFAT / OOS GLIB OH / OOS GLIB VFAT / No VFAT marker
9  // Event size warn / L1AFIFO near full / InFIFO near full / EvtFIFO near full / Event size overflow
10  // L1AFIFO full / InFIFO full / EvtFIFO full
13  struct {
14  uint64_t BxmVvV : 11; // 1st bit BX mismatch VFAT vs VFAT
15  uint64_t BxmAvV : 1; // BX mismatch AMC vs VFAT
16  uint64_t OOScVvV : 1; // OOS (EC mismatch) VFAT vs VFAT
17  uint64_t OOScAvV : 1; // OOS (EC mismatch) AMC vs VFAT
18  uint64_t noVFAT : 1; // No VFAT marker
19  uint64_t EvtSzW : 1; // Event size warning
20  uint64_t L1aNF : 1; // L1A FIFO near full
21  uint64_t InNF : 1; // Input FIFO near full
22  uint64_t EvtNF : 1; // Event FIFO near full
23  uint64_t EvtSzOFW : 1; // Event size overflow
24  uint64_t L1aF : 1; // L1A FIFO full
25  uint64_t InF : 1; // Input FIFO full
26  uint64_t EvtF : 1; // Event FIFO full
27  uint64_t VfWdCnt : 12; // VFAT word count (in number of 64-bit words)
28  uint64_t inputID : 5; // Input link ID
29  uint64_t zeroSupWordsCnt : 24; // Number of zero suppressed VFAT 64bit words
30  };
31  };
34  struct {
35  uint64_t ecOH : 20; // OH event counter
36  uint64_t bcOH : 13; // OH bunch crossing
37  uint64_t InUfw : 1; // Input FIFO underflow
38  uint64_t SkD : 1; // Stuck data
39  uint64_t EvUfw : 1; // Event FIFO underflow
40  uint64_t VfWdCntT : 12; // VFAT word count (in number of 64-bit words)
41  uint64_t crc16 : 16; // CRC of OH data (currently not available – filled with 0)
42  };
43  };
44 
45  class GEBdata {
46  public:
47  GEBdata() : ch_(0), ct_(0){};
48  ~GEBdata() { vfatd_.clear(); }
49 
52  void setChamberHeader(uint16_t vfatWordCnt, uint8_t inputID) {
53  GEBchamberHeader u{0};
54  u.VfWdCnt = vfatWordCnt;
55  u.inputID = inputID;
56  ch_ = u.word;
57  }
58  uint64_t getChamberHeader() const { return ch_; }
59 
62  void setChamberTrailer(uint32_t ecOH, uint16_t bcOH, uint16_t vfatWordCntT) {
63  GEBchamberTrailer u{0};
64  u.ecOH = ecOH;
65  u.bcOH = bcOH;
66  u.VfWdCntT = vfatWordCntT;
67  ct_ = u.word;
68  }
69  uint64_t getChamberTrailer() const { return ct_; }
70 
71  uint16_t bxmVvV() const { return GEBchamberHeader{ch_}.BxmVvV; }
72  uint8_t bxmAvV() const { return GEBchamberHeader{ch_}.BxmAvV; }
73  uint8_t oOScVvV() const { return GEBchamberHeader{ch_}.OOScVvV; }
74  uint8_t oOScAvV() const { return GEBchamberHeader{ch_}.OOScAvV; }
75  uint8_t noVFAT() const { return GEBchamberHeader{ch_}.noVFAT; }
76  uint8_t evtSzW() const { return GEBchamberHeader{ch_}.EvtSzW; }
77  uint8_t l1aNF() const { return GEBchamberHeader{ch_}.L1aNF; }
78  uint8_t inNF() const { return GEBchamberHeader{ch_}.InNF; }
79  uint8_t evtNF() const { return GEBchamberHeader{ch_}.EvtNF; }
80  uint8_t evtSzOFW() const { return GEBchamberHeader{ch_}.EvtSzOFW; }
81  uint8_t l1aF() const { return GEBchamberHeader{ch_}.L1aF; }
82  uint8_t inF() const { return GEBchamberHeader{ch_}.InF; }
83  uint8_t evtF() const { return GEBchamberHeader{ch_}.EvtF; }
84  uint16_t vfatWordCnt() const { return GEBchamberHeader{ch_}.VfWdCnt; }
85  uint8_t inputID() const { return GEBchamberHeader{ch_}.inputID; }
86  uint32_t zeroSupWordsCnt() const { return GEBchamberHeader{ch_}.zeroSupWordsCnt; }
87 
88  uint32_t ecOH() const { return GEBchamberTrailer{ct_}.ecOH; }
89  uint16_t bcOH() const { return GEBchamberTrailer{ct_}.bcOH; }
90  uint8_t inUfw() const { return GEBchamberTrailer{ct_}.InUfw; }
91  uint8_t stuckData() const { return GEBchamberTrailer{ct_}.SkD; }
92  uint8_t evUfw() const { return GEBchamberTrailer{ct_}.EvUfw; }
93  uint16_t vfatWordCntT() const { return GEBchamberTrailer{ct_}.VfWdCntT; }
94  uint16_t crc() const { return GEBchamberTrailer{ct_}.crc16; }
95 
97  void addVFAT(VFATdata v) { vfatd_.push_back(v); }
99  const std::vector<VFATdata>* vFATs() const { return &vfatd_; }
100 
101  static const int sizeGebID = 5;
102 
103  private:
104  uint64_t ch_; // GEBchamberHeader
105  uint64_t ct_; // GEBchamberTrailer
106 
107  std::vector<VFATdata> vfatd_;
108  };
109 } // namespace gem
110 #endif
gem::GEBdata::addVFAT
void addVFAT(VFATdata v)
Adds VFAT data to the vector.
Definition: GEBdata.h:97
gem::GEBchamberHeader::InF
uint64_t InF
Definition: GEBdata.h:25
gem::GEBdata::zeroSupWordsCnt
uint32_t zeroSupWordsCnt() const
Definition: GEBdata.h:86
gem::GEBdata::crc
uint16_t crc() const
Definition: GEBdata.h:94
gem::GEBchamberTrailer::InUfw
uint64_t InUfw
Definition: GEBdata.h:37
gem::GEBdata::inNF
uint8_t inNF() const
Definition: GEBdata.h:78
gem::GEBdata
Definition: GEBdata.h:45
gem::GEBdata::inputID
uint8_t inputID() const
Definition: GEBdata.h:85
gem::GEBdata::vFATs
const std::vector< VFATdata > * vFATs() const
Returns the vector of FVAT data.
Definition: GEBdata.h:99
gem::GEBchamberHeader::L1aNF
uint64_t L1aNF
Definition: GEBdata.h:20
VFATdata.h
gem::GEBdata::oOScVvV
uint8_t oOScVvV() const
Definition: GEBdata.h:73
gem::GEBchamberHeader::InNF
uint64_t InNF
Definition: GEBdata.h:21
gem::GEBdata::l1aF
uint8_t l1aF() const
Definition: GEBdata.h:81
gem::GEBdata::ct_
uint64_t ct_
Definition: GEBdata.h:105
gem::GEBchamberHeader::noVFAT
uint64_t noVFAT
Definition: GEBdata.h:18
gem::GEBdata::vfatd_
std::vector< VFATdata > vfatd_
Definition: GEBdata.h:107
gem::GEBdata::setChamberTrailer
void setChamberTrailer(uint64_t word)
Read chamberTrailer from the block.
Definition: GEBdata.h:61
findQualityFiles.v
v
Definition: findQualityFiles.py:179
gem::GEBdata::noVFAT
uint8_t noVFAT() const
Definition: GEBdata.h:75
gem::GEBdata::getChamberTrailer
uint64_t getChamberTrailer() const
Definition: GEBdata.h:69
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
gem::GEBchamberHeader
Definition: GEBdata.h:11
gem::GEBchamberTrailer::SkD
uint64_t SkD
Definition: GEBdata.h:38
gem::GEBchamberTrailer
Definition: GEBdata.h:32
gem::GEBdata::vfatWordCnt
uint16_t vfatWordCnt() const
Definition: GEBdata.h:84
gem::GEBchamberHeader::BxmVvV
uint64_t BxmVvV
Definition: GEBdata.h:14
gem::GEBdata::evtSzOFW
uint8_t evtSzOFW() const
Definition: GEBdata.h:80
gem::GEBchamberTrailer::EvUfw
uint64_t EvUfw
Definition: GEBdata.h:39
gem::GEBdata::l1aNF
uint8_t l1aNF() const
Definition: GEBdata.h:77
gem::GEBdata::vfatWordCntT
uint16_t vfatWordCntT() const
Definition: GEBdata.h:93
gem::GEBdata::ecOH
uint32_t ecOH() const
Definition: GEBdata.h:88
gem::GEBdata::setChamberHeader
void setChamberHeader(uint16_t vfatWordCnt, uint8_t inputID)
Definition: GEBdata.h:52
gem::GEBdata::inUfw
uint8_t inUfw() const
Definition: GEBdata.h:90
gem::GEBdata::bcOH
uint16_t bcOH() const
Definition: GEBdata.h:89
gem::GEBdata::inF
uint8_t inF() const
Definition: GEBdata.h:82
gem::GEBdata::bxmVvV
uint16_t bxmVvV() const
Definition: GEBdata.h:71
gem::GEBdata::stuckData
uint8_t stuckData() const
Definition: GEBdata.h:91
gem::GEBchamberTrailer::crc16
uint64_t crc16
Definition: GEBdata.h:41
gem::GEBdata::~GEBdata
~GEBdata()
Definition: GEBdata.h:48
gem::VFATdata
Definition: VFATdata.h:48
gem::GEBchamberHeader::inputID
uint64_t inputID
Definition: GEBdata.h:28
gem::GEBdata::ch_
uint64_t ch_
Definition: GEBdata.h:104
gem
Definition: AMC13Event.h:6
gem::GEBchamberHeader::zeroSupWordsCnt
uint64_t zeroSupWordsCnt
Definition: GEBdata.h:29
gem::GEBchamberHeader::EvtNF
uint64_t EvtNF
Definition: GEBdata.h:22
gem::GEBdata::GEBdata
GEBdata()
Definition: GEBdata.h:47
gem::GEBdata::oOScAvV
uint8_t oOScAvV() const
Definition: GEBdata.h:74
gem::GEBchamberHeader::EvtF
uint64_t EvtF
Definition: GEBdata.h:26
gem::GEBdata::bxmAvV
uint8_t bxmAvV() const
Definition: GEBdata.h:72
gem::GEBdata::getChamberHeader
uint64_t getChamberHeader() const
Definition: GEBdata.h:58
gem::GEBchamberHeader::VfWdCnt
uint64_t VfWdCnt
Definition: GEBdata.h:27
gem::GEBchamberHeader::word
uint64_t word
Definition: GEBdata.h:12
gem::GEBdata::setChamberHeader
void setChamberHeader(uint64_t word)
Read chamberHeader from the block.
Definition: GEBdata.h:51
gem::GEBchamberHeader::EvtSzW
uint64_t EvtSzW
Definition: GEBdata.h:19
gem::GEBdata::evUfw
uint8_t evUfw() const
Definition: GEBdata.h:92
gem::GEBchamberTrailer::word
uint64_t word
Definition: GEBdata.h:33
gem::GEBchamberTrailer::ecOH
uint64_t ecOH
Definition: GEBdata.h:35
gem::GEBchamberHeader::EvtSzOFW
uint64_t EvtSzOFW
Definition: GEBdata.h:23
gem::GEBchamberHeader::OOScAvV
uint64_t OOScAvV
Definition: GEBdata.h:17
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
gem::GEBchamberTrailer::VfWdCntT
uint64_t VfWdCntT
Definition: GEBdata.h:40
gem::GEBdata::sizeGebID
static const int sizeGebID
Definition: GEBdata.h:101
gem::GEBdata::setChamberTrailer
void setChamberTrailer(uint32_t ecOH, uint16_t bcOH, uint16_t vfatWordCntT)
Definition: GEBdata.h:62
gem::GEBdata::evtF
uint8_t evtF() const
Definition: GEBdata.h:83
gem::GEBchamberHeader::OOScVvV
uint64_t OOScVvV
Definition: GEBdata.h:16
gem::GEBchamberHeader::L1aF
uint64_t L1aF
Definition: GEBdata.h:24
gem::GEBchamberHeader::BxmAvV
uint64_t BxmAvV
Definition: GEBdata.h:15
gem::GEBchamberTrailer::bcOH
uint64_t bcOH
Definition: GEBdata.h:36
gem::GEBdata::evtNF
uint8_t evtNF() const
Definition: GEBdata.h:79
gem::GEBdata::evtSzW
uint8_t evtSzW() const
Definition: GEBdata.h:76