CMS 3D CMS Logo

GEBdata.h
Go to the documentation of this file.
1 #ifndef DataFormats_GEMDigi_GEBdata_h
2 #define DataFormats_GEMDigi_GEBdata_h
3 #include "VFATdata.h"
4 #include <vector>
5 
6 namespace gem {
7 
10  struct {
11  uint64_t : 10; // unused
12  uint64_t BxmVvV : 1; // 1st bit BX mismatch VFAT vs VFAT
13  uint64_t BxmAvV : 1; // BX mismatch AMC vs VFAT
14  uint64_t OOScVvV : 1; // Out of Sync (EC mismatch) VFAT vs VFAT
15  uint64_t OOScAvV : 1; // Out of Sync (EC mismatch) AMC vs VFAT
16  uint64_t Inv : 1; // Invalid event
17  uint64_t EvtSzW : 1; // Event size warning
18  uint64_t L1aNF : 1; // L1A FIFO near full
19  uint64_t InNF : 1; // Input FIFO near full
20  uint64_t EvtNF : 1; // Event FIFO near full
21  uint64_t EvtSzOFW : 1; // Event size overflow
22  uint64_t L1aF : 1; // L1A FIFO full
23  uint64_t InF : 1; // Input FIFO full
24  uint64_t EvtF : 1; // Event FIFO full
25  uint64_t VfWdCnt : 12; // VFAT word count (in number of 64-bit words)
26  uint64_t InputID : 5; // Input link ID
27  uint64_t CALIB_CHAN : 7; // Calibration channel number
28  uint64_t : 17; // unused
29  };
30  };
31 
34  struct {
35  uint64_t ecOH : 20; // NOT USED - OptoHybrid event counter
36  uint64_t bcOH : 13; // NOT USED - OptoHybrid bunch crossing
37  uint64_t InUfw : 1; // Input FIFO underflow
38  uint64_t SkD : 1; // NOT USED - Stuck data
39  uint64_t EvUfw : 1; // NOT USED - Event FIFO underflow
40  uint64_t VfWdCntT : 12; // VFAT word count (in number of 64-bit words)
41  uint64_t crc16 : 16; // CRC of OptoHybrid 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 vfatWordCnt() const { return GEBchamberHeader{ch_}.VfWdCnt; }
72  uint8_t inputID() const { return GEBchamberHeader{ch_}.InputID; }
73  uint16_t vfatWordCntT() const { return GEBchamberTrailer{ct_}.VfWdCntT; }
74 
75  bool bxmVvV() const { return GEBchamberHeader{ch_}.BxmVvV; }
76  bool bxmAvV() const { return GEBchamberHeader{ch_}.BxmAvV; }
77  bool oOScVvV() const { return GEBchamberHeader{ch_}.OOScVvV; }
78  bool oOScAvV() const { return GEBchamberHeader{ch_}.OOScAvV; }
79  bool inv() const { return GEBchamberHeader{ch_}.Inv; }
80  bool evtSzW() const { return GEBchamberHeader{ch_}.EvtSzW; }
81  bool l1aNF() const { return GEBchamberHeader{ch_}.L1aNF; }
82  bool inNF() const { return GEBchamberHeader{ch_}.InNF; }
83  bool evtNF() const { return GEBchamberHeader{ch_}.EvtNF; }
84  bool evtSzOFW() const { return GEBchamberHeader{ch_}.EvtSzOFW; }
85  bool l1aF() const { return GEBchamberHeader{ch_}.L1aF; }
86  bool inF() const { return GEBchamberHeader{ch_}.InF; }
87  bool evtF() const { return GEBchamberHeader{ch_}.EvtF; }
88  bool inUfw() const { return GEBchamberTrailer{ct_}.InUfw; }
89 
90  bool noVFAT() const { return false; } // to be removed
91  bool stuckData() const { return false; } // to be removed
92  bool evUfw() const { return false; } // to be removed
93 
95  void addVFAT(VFATdata v) { vfatd_.push_back(v); }
97  const std::vector<VFATdata>* vFATs() const { return &vfatd_; }
99  void clearVFATs() { vfatd_.clear(); }
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::oOScAvV
bool oOScAvV() const
Definition: GEBdata.h:78
gem::GEBdata::addVFAT
void addVFAT(VFATdata v)
Adds VFAT data to the vector.
Definition: GEBdata.h:95
gem::GEBchamberHeader::InF
uint64_t InF
Definition: GEBdata.h:23
gem::GEBdata::inv
bool inv() const
Definition: GEBdata.h:79
gem::GEBdata::bxmAvV
bool bxmAvV() const
Definition: GEBdata.h:76
gem::GEBchamberTrailer::InUfw
uint64_t InUfw
Definition: GEBdata.h:37
gem::GEBdata
Definition: GEBdata.h:45
gem::GEBdata::inputID
uint8_t inputID() const
Definition: GEBdata.h:72
gem::GEBdata::vFATs
const std::vector< VFATdata > * vFATs() const
Returns the vector of VFAT data.
Definition: GEBdata.h:97
gem::GEBchamberHeader::L1aNF
uint64_t L1aNF
Definition: GEBdata.h:18
VFATdata.h
gem::GEBchamberHeader::InNF
uint64_t InNF
Definition: GEBdata.h:19
gem::GEBdata::ct_
uint64_t ct_
Definition: GEBdata.h:105
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::getChamberTrailer
uint64_t getChamberTrailer() const
Definition: GEBdata.h:69
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
gem::GEBchamberHeader
Definition: GEBdata.h:8
gem::GEBchamberHeader::CALIB_CHAN
uint64_t CALIB_CHAN
Definition: GEBdata.h:27
gem::GEBdata::inF
bool inF() const
Definition: GEBdata.h:86
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:71
gem::GEBdata::oOScVvV
bool oOScVvV() const
Definition: GEBdata.h:77
gem::GEBchamberHeader::BxmVvV
uint64_t BxmVvV
Definition: GEBdata.h:12
gem::GEBdata::evtF
bool evtF() const
Definition: GEBdata.h:87
gem::GEBchamberTrailer::EvUfw
uint64_t EvUfw
Definition: GEBdata.h:39
gem::GEBdata::evtSzOFW
bool evtSzOFW() const
Definition: GEBdata.h:84
gem::GEBdata::evUfw
bool evUfw() const
Definition: GEBdata.h:92
gem::GEBdata::l1aF
bool l1aF() const
Definition: GEBdata.h:85
gem::GEBdata::evtSzW
bool evtSzW() const
Definition: GEBdata.h:80
gem::GEBdata::vfatWordCntT
uint16_t vfatWordCntT() const
Definition: GEBdata.h:73
gem::GEBdata::evtNF
bool evtNF() const
Definition: GEBdata.h:83
gem::GEBdata::setChamberHeader
void setChamberHeader(uint16_t vfatWordCnt, uint8_t inputID)
Definition: GEBdata.h:52
gem::GEBdata::inNF
bool inNF() const
Definition: GEBdata.h:82
gem::GEBchamberTrailer::crc16
uint64_t crc16
Definition: GEBdata.h:41
gem::GEBdata::~GEBdata
~GEBdata()
Definition: GEBdata.h:48
gem::GEBdata::inUfw
bool inUfw() const
Definition: GEBdata.h:88
gem::VFATdata
Definition: VFATdata.h:48
gem::GEBchamberHeader::Inv
uint64_t Inv
Definition: GEBdata.h:16
gem::GEBdata::l1aNF
bool l1aNF() const
Definition: GEBdata.h:81
gem::GEBdata::ch_
uint64_t ch_
Definition: GEBdata.h:104
gem
Definition: AMC13Event.h:6
gem::GEBchamberHeader::EvtNF
uint64_t EvtNF
Definition: GEBdata.h:20
gem::GEBdata::GEBdata
GEBdata()
Definition: GEBdata.h:47
gem::GEBchamberHeader::EvtF
uint64_t EvtF
Definition: GEBdata.h:24
gem::GEBdata::bxmVvV
bool bxmVvV() const
Definition: GEBdata.h:75
gem::GEBdata::getChamberHeader
uint64_t getChamberHeader() const
Definition: GEBdata.h:58
gem::GEBchamberHeader::VfWdCnt
uint64_t VfWdCnt
Definition: GEBdata.h:25
gem::GEBchamberHeader::word
uint64_t word
Definition: GEBdata.h:9
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:17
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:21
gem::GEBchamberHeader::OOScAvV
uint64_t OOScAvV
Definition: GEBdata.h:15
gem::GEBdata::noVFAT
bool noVFAT() const
Definition: GEBdata.h:90
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
gem::GEBdata::clearVFATs
void clearVFATs()
Clear the vector rof VFAT data.
Definition: GEBdata.h:99
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::stuckData
bool stuckData() const
Definition: GEBdata.h:91
gem::GEBchamberHeader::OOScVvV
uint64_t OOScVvV
Definition: GEBdata.h:14
gem::GEBchamberHeader::L1aF
uint64_t L1aF
Definition: GEBdata.h:22
gem::GEBchamberHeader::BxmAvV
uint64_t BxmAvV
Definition: GEBdata.h:13
gem::GEBchamberHeader::InputID
uint64_t InputID
Definition: GEBdata.h:26
gem::GEBchamberTrailer::bcOH
uint64_t bcOH
Definition: GEBdata.h:36