CMS 3D CMS Logo

CSCTMBHeader2007.h
Go to the documentation of this file.
1 #ifndef CSCTMBHeader2007_h
2 #define CSCTMBHeader2007_h
5 
7  enum { NWORDS = 43 };
9  CSCTMBHeader2007(const unsigned short* buf);
10  void setEventInformation(const CSCDMBHeader& dmbHeader) override;
11 
12  uint16_t BXNCount() const override { return bits.bxnCount; }
13  uint16_t ALCTMatchTime() const override { return bits.matchWin; }
14  uint16_t CLCTOnly() const override { return bits.clctOnly; }
15  uint16_t ALCTOnly() const override { return bits.alctOnly; }
16  uint16_t TMBMatch() const override { return bits.tmbMatch; }
17  uint16_t Bxn0Diff() const override { return 0; }
18  uint16_t Bxn1Diff() const override { return 0; }
19  uint16_t L1ANumber() const override { return bits.l1aNumber; }
20  uint16_t NTBins() const override { return bits.nTBins; }
21  uint16_t NCFEBs() const override { return bits.nCFEBs; }
22  void setNCFEBs(uint16_t ncfebs) override { bits.nCFEBs = ncfebs & 0x1F; }
23  uint16_t firmwareRevision() const override { return bits.firmRevCode; }
24  uint16_t syncError() const override { return bits.syncError; }
25  uint16_t syncErrorCLCT() const override { return (bits.clct0_sync_err | bits.clct1_sync_err); }
26  uint16_t syncErrorMPC0() const override { return bits.MPC_Muon0_SyncErr_; }
27  uint16_t syncErrorMPC1() const override { return bits.MPC_Muon1_SyncErr_; }
28 
30  std::vector<CSCCLCTDigi> CLCTDigis(uint32_t idlayer) override;
32  std::vector<CSCCorrelatedLCTDigi> CorrelatedLCTDigis(uint32_t idlayer) const override;
33 
36  unsigned short int sizeInWords() const override { return NWORDS; }
37 
38  unsigned short int NHeaderFrames() const override { return bits.nHeaderFrames; }
40  unsigned short* data() override { return (unsigned short*)(&bits); }
41  bool check() const override { return bits.e0bline == 0x6e0b; }
42 
44  //void setChamberId(const CSCDetId & detId) {theChamberId = detId;}
45 
47  void addCLCT0(const CSCCLCTDigi& digi) override;
48  void addCLCT1(const CSCCLCTDigi& digi) override;
49  void addALCT0(const CSCALCTDigi& digi) override;
50  void addALCT1(const CSCALCTDigi& digi) override;
51  void addCorrelatedLCT0(const CSCCorrelatedLCTDigi& digi) override;
52  void addCorrelatedLCT1(const CSCCorrelatedLCTDigi& digi) override;
53 
54  void swapCLCTs(CSCCLCTDigi& digi1, CSCCLCTDigi& digi2);
55 
56  void print(std::ostream& os) const override;
57 
58  struct {
59  unsigned b0cline : 16;
60  unsigned bxnCount : 12, dduCode1 : 3, flag1 : 1;
61  unsigned l1aNumber : 12, dduCode2 : 3, flag2 : 1;
62  unsigned readoutCounter : 12, dduCode3 : 3, flag3 : 1;
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  unsigned bxnPreTrigger : 12, reserved : 3, flag8 : 1;
68  unsigned preTrigCounterLow : 15, flag9 : 1;
69  unsigned preTrigCounterHigh : 15, flag10 : 1;
70  unsigned clctCounterLow : 15, flag11 : 1;
71  unsigned clctCounterHigh : 15, flag12 : 1;
72  unsigned trigCounterLow : 15, flag13 : 1;
73  unsigned trigCounterHigh : 15, flag14 : 1;
74  unsigned alctCounterLow : 15, flag15 : 1;
75  unsigned alctCounterHigh : 15, flag16 : 1;
76  unsigned uptimeCounterLow : 15, flag17 : 1;
77  unsigned uptimeCounterHigh : 15, flag18 : 1;
78  unsigned nCFEBs : 3, nTBins : 5, fifoPretrig : 5, scopeExists : 1, vmeExists : 1, flag19 : 1;
79  unsigned hitThresh : 3, pidThresh : 4, nphThresh : 3, lyrThresh : 3, layerTrigEnabled : 1, staggerCSC : 1,
80  flag20 : 1;
81  unsigned triadPersist : 4, dmbThresh : 3, alct_delay : 4, clct_width : 4, flag21 : 1;
82  unsigned trigSourceVect : 9, r_nlayers_hit_vec : 6, flag22 : 1;
83  unsigned activeCFEBs : 5, readCFEBs : 5, pop_l1a_match_win : 4, layerTriggered : 1, flag23 : 1;
84  unsigned tmbMatch : 1, alctOnly : 1, clctOnly : 1, matchWin : 4, noTMBTrig : 1, noMPCFrame : 1, noMPCResponse : 1,
85  reserved1 : 5, flag24 : 1;
87  flag25 : 1;
89  flag26 : 1;
92  flag27 : 1;
93  unsigned alct0Valid : 1, alct0Quality : 2, alct0Amu : 1, alct0Key : 7, reserved2 : 4, flag28 : 1;
94  unsigned alct1Valid : 1, alct1Quality : 2, alct1Amu : 1, alct1Key : 7, reserved3 : 4, flag29 : 1;
95  unsigned alctBXN : 5, alctSeqStatus : 2, alctSEUStatus : 2, alctReserved : 4, alctCfg : 1, reserved4 : 1,
96  flag30 : 1;
104  MPCAccept : 2, CFEBsEnabled : 5, flag35 : 1;
105  unsigned RPCExists : 2, RPCList : 2, NRPCs : 2, RPCEnable : 1, RPCMatch : 8, flag36 : 1;
106  unsigned addrPretrig : 12, bufReady : 1, reserved5 : 2, flag37 : 1;
107  unsigned addrL1a : 12, reserved6 : 3, flag38 : 1;
108  unsigned reserved7 : 15, flag39 : 1;
109  unsigned reserved8 : 15, flag40 : 1;
110  unsigned reserved9 : 15, flag41 : 1;
111  unsigned e0bline : 16;
112  } bits;
113 };
114 
115 #endif
void print(std::ostream &os) const override
uint16_t TMBMatch() const override
unsigned uptimeCounterHigh
unsigned trigCounterHigh
void addCorrelatedLCT1(const CSCCorrelatedLCTDigi &digi) override
uint16_t syncError() const override
uint16_t syncErrorMPC0() const override
void setNCFEBs(uint16_t ncfebs) override
void addALCT0(const CSCALCTDigi &digi) override
unsigned MPC_Muon0_cscid_bit4
uint16_t ALCTMatchTime() const override
unsigned MPC_Muon1_SyncErr_
uint16_t BXNCount() const override
unsigned uptimeCounterLow
unsigned layerTrigEnabled
unsigned MPC_Muon0_quality_
bool check() const override
unsigned MPC_Muon0_bend_
void addCLCT1(const CSCCLCTDigi &digi) override
void swapCLCTs(CSCCLCTDigi &digi1, CSCCLCTDigi &digi2)
unsigned MPC_Muon0_clct_pattern_
unsigned MPC_Muon0_wire_
uint16_t Bxn0Diff() const override
unsigned short * data() override
returns the first data word
unsigned pop_l1a_match_win
unsigned r_nlayers_hit_vec
std::vector< CSCCLCTDigi > CLCTDigis(uint32_t idlayer) override
returns CLCT digis
unsigned short int sizeInWords() const override
unsigned alctCounterHigh
unsigned clct0_bx0_local
unsigned MPC_Muon0_cscid_low
uint16_t ALCTOnly() const override
unsigned clct0_cfeb_high
uint16_t CLCTOnly() const override
uint16_t NTBins() const override
void addALCT1(const CSCALCTDigi &digi) override
unsigned MPC_Muon1_halfstrip_clct_pattern
std::vector< CSCCorrelatedLCTDigi > CorrelatedLCTDigis(uint32_t idlayer) const override
returns CorrelatedLCT digis
unsigned clctCounterHigh
uint16_t NCFEBs() const override
unsigned short int NHeaderFrames() const override
void setEventInformation(const CSCDMBHeader &dmbHeader) override
uint16_t L1ANumber() const override
unsigned MPC_Muon0_halfstrip_clct_pattern
unsigned MPC_Muon1_clct_pattern_
uint16_t syncErrorMPC1() const override
unsigned preTrigCounterHigh
unsigned clct1_bx0_local
uint16_t syncErrorCLCT() const override
unsigned MPC_Muon0_SyncErr_
unsigned preTrigCounterLow
void addCLCT0(const CSCCLCTDigi &digi) override
Needed before data packing.
struct CSCTMBHeader2007::@419 bits
unsigned MPC_Muon1_cscid_bit4
uint16_t Bxn1Diff() const override
uint16_t firmwareRevision() const override
unsigned MPC_Muon1_cscid_low
void addCorrelatedLCT0(const CSCCorrelatedLCTDigi &digi) override
unsigned clct1_cfeb_high
unsigned MPC_Muon1_quality_