CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCTMBHeader2007_rev0x50c3.h
Go to the documentation of this file.
1 #ifndef CSCTMBHeader2007_rev0x50c3_h
2 #define CSCTMBHeader2007_rev0x50c3_h
5 
6 
8  enum {NWORDS = 43};
10  CSCTMBHeader2007_rev0x50c3(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 & 0x1F;}
24  virtual uint16_t firmwareRevision() const {return bits.firmRevCode;}
25 
27  virtual std::vector<CSCCLCTDigi> CLCTDigis(uint32_t idlayer);
29  virtual std::vector<CSCCorrelatedLCTDigi> CorrelatedLCTDigis(uint32_t idlayer) const;
30 
31 
34  unsigned short int sizeInWords() const {return NWORDS;}
35 
36  virtual unsigned short int NHeaderFrames() const {return bits.nHeaderFrames;}
38  virtual unsigned short * data() {return (unsigned short *)(&bits);}
39  virtual bool check() const {return bits.e0bline==0x6e0b;}
40 
42  //void setChamberId(const CSCDetId & detId) {theChamberId = detId;}
43 
45  virtual void addCLCT0(const CSCCLCTDigi & digi);
46  virtual void addCLCT1(const CSCCLCTDigi & digi);
47  virtual void addALCT0(const CSCALCTDigi & digi);
48  virtual void addALCT1(const CSCALCTDigi & digi);
49  virtual void addCorrelatedLCT0(const CSCCorrelatedLCTDigi & digi);
50  virtual void addCorrelatedLCT1(const CSCCorrelatedLCTDigi & digi);
51 
52  void swapCLCTs(CSCCLCTDigi& digi1, CSCCLCTDigi& digi2);
53 
54  virtual void print(std::ostream & os) const;
55 
56  struct {
57  // 0
58  unsigned b0cline:16;
59  unsigned bxnCount:12, dduCode1:3, flag1:1;
60  unsigned l1aNumber:12, dduCode2:3, flag2:1;
61  unsigned readoutCounter:12, dduCode3:3, flag3:1;
62  // 4
63  unsigned boardID:5, cscID:4, runID:4, stackOvf:1, syncError:1, flag4:1;
64  unsigned nHeaderFrames:6, fifoMode:3, r_type:2, l1atype:2, hasBuf:1, bufFull:1, flag5:1;
65  unsigned bd_status:15, flag6:1;
66  unsigned firmRevCode:15, flag7:1;
67  // 8
68  unsigned bxnPreTrigger:12, reserved:2, lock_lost:1, flag8:1;
69  unsigned preTrigCounterLow:15, flag9:1;
70  unsigned preTrigCounterHigh:15, flag10:1;
71  unsigned clctCounterLow:15, flag11:1;
72  // 12
73  unsigned clctCounterHigh:15, flag12:1;
74  unsigned trigCounterLow:15, flag13:1;
75  unsigned trigCounterHigh:15, flag14:1;
76  unsigned alctCounterLow:15, flag15:1;
77  // 16
78  unsigned alctCounterHigh:15, flag16:1;
79  unsigned uptimeCounterLow:15, flag17:1;
80  unsigned uptimeCounterHigh:15, flag18:1;
81  unsigned nCFEBs:3, nTBins:5, fifoPretrig:5, scopeExists:1, vmeExists:1, flag19:1;
82  // 20
87  // 24
92  // 28
97  // 32
102  // 36
104 
107  unsigned buf_fence_cnt:12, reserved7:3, flag39:1;
108  // 40
110  unsigned reserved9:15, flag41:1;
111  unsigned e0bline:16;
112  } bits;
113 
114 
115 };
116 
117 #endif
118 
virtual uint16_t TMBMatch() const
unsigned short int sizeInWords() const
virtual uint16_t firmwareRevision() const
virtual uint16_t BXNCount() const
struct CSCTMBHeader2007_rev0x50c3::@309 bits
virtual void addCorrelatedLCT0(const CSCCorrelatedLCTDigi &digi)
virtual void addCorrelatedLCT1(const CSCCorrelatedLCTDigi &digi)
virtual void setEventInformation(const CSCDMBHeader &dmbHeader)
virtual std::vector< CSCCLCTDigi > CLCTDigis(uint32_t idlayer)
returns CLCT digis
virtual void setNCFEBs(uint16_t ncfebs)
virtual uint16_t NCFEBs() const
virtual void print(std::ostream &os) const
virtual uint16_t ALCTMatchTime() const
virtual uint16_t CLCTOnly() const
void swapCLCTs(CSCCLCTDigi &digi1, CSCCLCTDigi &digi2)
virtual void addALCT0(const CSCALCTDigi &digi)
virtual void addCLCT1(const CSCCLCTDigi &digi)
virtual unsigned short int NHeaderFrames() const
virtual uint16_t NTBins() const
virtual unsigned short * data()
returns the first data word
virtual uint16_t L1ANumber() const
virtual uint16_t Bxn0Diff() const
virtual void addALCT1(const CSCALCTDigi &digi)
virtual uint16_t Bxn1Diff() const
virtual void addCLCT0(const CSCCLCTDigi &digi)
Needed before data packing.
virtual std::vector< CSCCorrelatedLCTDigi > CorrelatedLCTDigis(uint32_t idlayer) const
returns CorrelatedLCT digis
virtual uint16_t ALCTOnly() const