CMS 3D CMS Logo

CSCTMBHeader2013.h
Go to the documentation of this file.
1 #ifndef CSCTMBHeader2013_h
2 #define CSCTMBHeader2013_h
5 
6 
8  enum {NWORDS = 43};
10  CSCTMBHeader2013(const unsigned short * buf);
11  virtual void setEventInformation(const CSCDMBHeader & dmbHeader);
12 
13  virtual uint16_t BXNCount() const {return bits.bxnCount;}
14  virtual uint16_t ALCTMatchTime() const {return bits.matchWin;}
15  virtual uint16_t CLCTOnly() const {return bits.clctOnly;}
16  virtual uint16_t ALCTOnly() const {return bits.alctOnly;}
17  virtual uint16_t TMBMatch() const {return bits.tmbMatch;}
18  virtual uint16_t Bxn0Diff() const {return 0;}
19  virtual uint16_t Bxn1Diff() const {return 0;}
20  virtual uint16_t L1ANumber() const {return bits.l1aNumber;}
21  virtual uint16_t NTBins() const {return bits.nTBins;}
22  virtual uint16_t NCFEBs() const {return bits.nCFEBs;}
23  virtual void setNCFEBs(uint16_t ncfebs) {bits.nCFEBs = ncfebs & 0x7F;}
24  virtual uint16_t firmwareRevision() const {return bits.firmRevCode;}
25  virtual uint16_t syncError() const {return bits.syncError;}
26  virtual uint16_t syncErrorCLCT() const {return bits.clct_sync_err;}
27  virtual uint16_t syncErrorMPC0() const {return bits.MPC_Muon0_SyncErr_;}
28  virtual uint16_t syncErrorMPC1() const {return bits.MPC_Muon1_SyncErr_;}
29 
31  virtual std::vector<CSCCLCTDigi> CLCTDigis(uint32_t idlayer);
33  virtual std::vector<CSCCorrelatedLCTDigi> CorrelatedLCTDigis(uint32_t idlayer) const;
34 
35 
38  unsigned short int sizeInWords() const {return NWORDS;}
39 
40  virtual unsigned short int NHeaderFrames() const {return bits.nHeaderFrames;}
42  virtual unsigned short * data() {return (unsigned short *)(&bits);}
43  virtual bool check() const {return bits.e0bline==0x6e0b;}
44 
46  //void setChamberId(const CSCDetId & detId) {theChamberId = detId;}
47 
49  virtual void addCLCT0(const CSCCLCTDigi & digi);
50  virtual void addCLCT1(const CSCCLCTDigi & digi);
51  virtual void addALCT0(const CSCALCTDigi & digi);
52  virtual void addALCT1(const CSCALCTDigi & digi);
53  virtual void addCorrelatedLCT0(const CSCCorrelatedLCTDigi & digi);
54  virtual void addCorrelatedLCT1(const CSCCorrelatedLCTDigi & digi);
55 
56  void swapCLCTs(CSCCLCTDigi& digi1, CSCCLCTDigi& digi2);
57 
58  virtual void print(std::ostream & os) const;
59 
60  struct {
61  // 0
62  unsigned b0cline:16;
63  unsigned bxnCount:12, dduCode1:3, flag1:1;
64  unsigned l1aNumber:12, dduCode2:3, flag2:1;
65  unsigned readoutCounter:12, dduCode3:3, flag3:1;
66  // 4
67  unsigned boardID:5, cscID:4, runID:4, stackOvf:1, syncError:1, flag4:1;
68  unsigned nHeaderFrames:6, fifoMode:3, r_type:2, l1atype:2, hasBuf:1, bufFull:1, flag5:1;
69  unsigned bd_status:15, flag6:1;
70  unsigned firmRevCode:15, flag7:1;
71  // 8
73  unsigned preTrigCounterLow:15, flag9:1;
74  unsigned preTrigCounterHigh:15, flag10:1;
75  unsigned clctCounterLow:15, flag11:1;
76  // 12
77  unsigned clctCounterHigh:15, flag12:1;
78  unsigned trigCounterLow:15, flag13:1;
79  unsigned trigCounterHigh:15, flag14:1;
80  unsigned alctCounterLow:15, flag15:1;
81  // 16
82  unsigned alctCounterHigh:15, flag16:1;
83  unsigned uptimeCounterLow:15, flag17:1;
84  unsigned uptimeCounterHigh:15, flag18:1;
85  unsigned nCFEBs:3, nTBins:5, fifoPretrig:5, scopeExists:1, vmeExists:1, flag19:1;
86  // 20
91  // 24
96  // 28
101  // 32
106  // 36
111  // 40
112  // unsigned buf_fence_cnt_peak:12, reserved8:3, flag40:1;
115  unsigned e0bline:16;
116  } bits;
117 
118 
119 };
120 
121 #endif
122 
unsigned trigCounterHigh
unsigned parity_err_cfeb_ram
unsigned MPC_Muon1_halfstrip_clct_pattern
virtual uint16_t NTBins() const
virtual uint16_t syncError() const
unsigned cfeb_badbits_found
unsigned tmb_allow_alct_ro
virtual void print(std::ostream &os) const
unsigned MPC_Muon1_cscid_bit4
unsigned preTrigCounterHigh
virtual void setEventInformation(const CSCDMBHeader &dmbHeader)
unsigned buf_fence_cnt_is_peak
unsigned alctCounterHigh
virtual uint16_t ALCTMatchTime() const
unsigned MPC_Muon0_quality_
virtual uint16_t firmwareRevision() const
virtual void setNCFEBs(uint16_t ncfebs)
unsigned bcb_read_enable
virtual void addCorrelatedLCT1(const CSCCorrelatedLCTDigi &digi)
unsigned MPC_Muon0_SyncErr_
unsigned parity_err_cfeb_ram_2
unsigned MPC_Muon0_clct_pattern_
unsigned uptimeCounterLow
unsigned lyr_thresh_pretrig
unsigned MPC_Muon1_clct_pattern_
virtual unsigned short int NHeaderFrames() const
virtual void addALCT1(const CSCALCTDigi &digi)
virtual unsigned short * data()
returns the first data word
virtual uint16_t L1ANumber() const
void swapCLCTs(CSCCLCTDigi &digi1, CSCCLCTDigi &digi2)
virtual void addCLCT1(const CSCCLCTDigi &digi)
virtual uint16_t CLCTOnly() const
unsigned pop_l1a_match_win
virtual void addALCT0(const CSCALCTDigi &digi)
unsigned MPC_Muon0_cscid_low
virtual void addCLCT0(const CSCCLCTDigi &digi)
Needed before data packing.
unsigned tmb_non_trig_keep
unsigned tmb_clct1_discard
unsigned pid_thresh_postdrift
virtual uint16_t TMBMatch() const
virtual std::vector< CSCCorrelatedLCTDigi > CorrelatedLCTDigis(uint32_t idlayer) const
returns CorrelatedLCT digis
virtual uint16_t syncErrorCLCT() const
virtual uint16_t Bxn0Diff() const
virtual uint16_t ALCTOnly() const
unsigned MPC_Muon0_halfstrip_clct_pattern
unsigned uptimeCounterHigh
virtual uint16_t syncErrorMPC1() const
unsigned MPC_Muon1_SyncErr_
unsigned parity_err_summary
unsigned r_nlayers_hit_vec
unsigned tmb_allow_clct_ro
virtual std::vector< CSCCLCTDigi > CLCTDigis(uint32_t idlayer)
returns CLCT digis
unsigned clctCounterHigh
virtual uint16_t Bxn1Diff() const
unsigned cfeb_badbits_blocked
unsigned cfeb_badbits_found_2
unsigned alct_pretrig_win
unsigned MPC_Muon0_cscid_bit4
unsigned MPC_Muon1_quality_
unsigned clock_lock_lost
virtual bool check() const
struct CSCTMBHeader2013::@329 bits
unsigned preTrigCounterLow
unsigned short int sizeInWords() const
virtual uint16_t NCFEBs() const
unsigned tmb_clct0_discard
virtual uint16_t syncErrorMPC0() const
unsigned MPC_Muon1_cscid_low
virtual uint16_t BXNCount() const
virtual void addCorrelatedLCT0(const CSCCorrelatedLCTDigi &digi)
unsigned tmb_allow_match_ro