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 inputStatus : 23; // Input status (critical) only first 13 bits used
15  uint64_t vfatWordCnt : 12; // Size of VFAT payload in 64bit words expected to send to AMC13
16  uint64_t inputID : 5 ; // GLIB input ID (starting at 0)
17  uint64_t zeroSupWordsCnt : 24; // Bitmask indicating if certain VFAT blocks have been zero suppressed
18  };
19  };
22  struct {
23  uint64_t ecOH : 20; // OH event counter
24  uint64_t bcOH : 14; // OH bunch crossing
25  uint64_t stuckData : 1; // Input status (warning): There was data in InFIFO or EvtFIFO when L1A FIFO was empty
26  uint64_t inFIFOund : 1; // Input status (critical): Input FIFO underflow occurred while sending this event
27  uint64_t vfatWordCntT : 12; // Size of VFAT payload in 64bit words sent to AMC13
28  uint64_t ohcrc : 16; // CRC of OH data (currently not available – filled with 0)
29  };
30  };
31 
32  class GEBdata
33  {
34  public:
35 
36  GEBdata() {};
37  ~GEBdata() {vfatd_.clear();}
38 
41  void setChamberHeader(uint16_t vfatWordCnt, uint8_t inputID)
42  {
45  u.inputID = inputID;
46  ch_ = u.word;
47  }
48  uint64_t getChamberHeader() const { return ch_;}
49 
52  void setChamberTrailer(uint32_t ecOH, uint16_t bcOH, uint16_t vfatWordCntT)
53  {
55  u.ecOH = ecOH;
56  u.bcOH = bcOH;
57  u.vfatWordCntT = vfatWordCntT;
58  ct_ = u.word;
59  }
60  uint64_t getChamberTrailer() const { return ct_;}
61 
62  uint32_t inputStatus() const {return GEBchamberHeader{ch_}.inputStatus;}
63  uint16_t vfatWordCnt() const {return GEBchamberHeader{ch_}.vfatWordCnt;}
64  uint8_t inputID() const {return GEBchamberHeader{ch_}.inputID;}
65  uint16_t zeroSupWordsCnt() const {return GEBchamberHeader{ch_}.zeroSupWordsCnt;}
66 
67  uint32_t ecOH() const {return GEBchamberTrailer{ct_}.ecOH;}
68  uint16_t bcOH() const {return GEBchamberTrailer{ct_}.bcOH;}
69  uint8_t stuckData() const {return GEBchamberTrailer{ct_}.stuckData;}
70  uint8_t inFIFOund() const {return GEBchamberTrailer{ct_}.inFIFOund;}
71  uint16_t vfatWordCntT() const {return GEBchamberTrailer{ct_}.vfatWordCntT;}
72  uint16_t ohcrc() const {return GEBchamberTrailer{ct_}.ohcrc;}
73 
75  void addVFAT(VFATdata v) {vfatd_.push_back(v);}
77  const std::vector<VFATdata> * vFATs() const {return &vfatd_;}
78 
79  static const int sizeGebID = 5;
80 
81  private:
82  uint64_t ch_; // GEBchamberHeader
83  uint64_t ct_; // GEBchamberTrailer
84 
85  std::vector<VFATdata> vfatd_;
86  };
87 }
88 #endif
void setChamberHeader(uint16_t vfatWordCnt, uint8_t inputID)
Definition: GEBdata.h:41
std::vector< VFATdata > vfatd_
Definition: GEBdata.h:85
void setChamberHeader(uint64_t word)
Read chamberHeader from the block.
Definition: GEBdata.h:40
uint32_t ecOH() const
Definition: GEBdata.h:67
uint64_t inFIFOund
Definition: GEBdata.h:26
uint64_t stuckData
Definition: GEBdata.h:25
uint64_t ch_
Definition: GEBdata.h:82
uint64_t vfatWordCntT
Definition: GEBdata.h:27
uint64_t ct_
Definition: GEBdata.h:83
uint16_t zeroSupWordsCnt() const
Definition: GEBdata.h:65
Definition: AMC13Event.h:6
uint16_t bcOH() const
Definition: GEBdata.h:68
void addVFAT(VFATdata v)
Adds VFAT data to the vector.
Definition: GEBdata.h:75
uint16_t ohcrc() const
Definition: GEBdata.h:72
uint8_t stuckData() const
Definition: GEBdata.h:69
uint64_t vfatWordCnt
Definition: GEBdata.h:15
void setChamberTrailer(uint64_t word)
Read chamberTrailer from the block.
Definition: GEBdata.h:51
uint64_t inputID
Definition: GEBdata.h:16
void setChamberTrailer(uint32_t ecOH, uint16_t bcOH, uint16_t vfatWordCntT)
Definition: GEBdata.h:52
uint64_t getChamberTrailer() const
Definition: GEBdata.h:60
uint8_t inputID() const
Definition: GEBdata.h:64
uint8_t inFIFOund() const
Definition: GEBdata.h:70
unsigned long long uint64_t
Definition: Time.h:15
uint64_t getChamberHeader() const
Definition: GEBdata.h:48
uint64_t zeroSupWordsCnt
Definition: GEBdata.h:17
uint16_t vfatWordCnt() const
Definition: GEBdata.h:63
uint16_t vfatWordCntT() const
Definition: GEBdata.h:71
uint64_t inputStatus
Definition: GEBdata.h:14
uint32_t inputStatus() const
Definition: GEBdata.h:62
const std::vector< VFATdata > * vFATs() const
Returns the vector of FVAT data.
Definition: GEBdata.h:77