CMS 3D CMS Logo

CSCTMBHeader2007_rev0x50c3.h

Go to the documentation of this file.
00001 #ifndef CSCTMBHeader2007_rev0x50c3_h
00002 #define CSCTMBHeader2007_rev0x50c3_h
00003 #include "EventFilter/CSCRawToDigi/interface/CSCVTMBHeaderFormat.h"
00004 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
00005 
00006 
00007 struct CSCTMBHeader2007_rev0x50c3 : public CSCVTMBHeaderFormat {
00008   enum {NWORDS = 43};
00009   CSCTMBHeader2007_rev0x50c3();
00010   CSCTMBHeader2007_rev0x50c3(const unsigned short * buf);
00011   virtual void setEventInformation(const CSCDMBHeader & dmbHeader);
00012 
00013   virtual uint16_t BXNCount() const {return bits.bxnCount;}
00014   virtual uint16_t ALCTMatchTime() const {return bits.matchWin;}
00015   virtual uint16_t CLCTOnly() const {return bits.clctOnly;}
00016   virtual uint16_t ALCTOnly() const {return bits.alctOnly;}
00017   virtual uint16_t TMBMatch() const {return bits.tmbMatch;}
00018   virtual uint16_t Bxn0Diff() const {return 0;}
00019   virtual uint16_t Bxn1Diff() const {return 0;}
00020   virtual uint16_t L1ANumber() const {return bits.l1aNumber;}
00021   virtual uint16_t NTBins() const {return bits.nTBins;}
00022   virtual uint16_t NCFEBs() const {return bits.nCFEBs;}
00023   virtual uint16_t firmwareRevision() const {return bits.firmRevCode;}
00024 
00026   virtual std::vector<CSCCLCTDigi> CLCTDigis(uint32_t idlayer);
00028   virtual std::vector<CSCCorrelatedLCTDigi> CorrelatedLCTDigis(uint32_t idlayer) const;
00029  
00030   
00033   unsigned short int sizeInWords() const     {return NWORDS;}
00034 
00035   virtual unsigned short int NHeaderFrames() const {return bits.nHeaderFrames;}
00037   virtual unsigned short * data() {return (unsigned short *)(&bits);}
00038   virtual bool check() const {return bits.e0bline==0x6e0b;}
00039 
00041   //void setChamberId(const CSCDetId & detId) {theChamberId = detId;}
00042 
00044   virtual void addCLCT0(const CSCCLCTDigi & digi);
00045   virtual void addCLCT1(const CSCCLCTDigi & digi);
00046   virtual void addALCT0(const CSCALCTDigi & digi);
00047   virtual void addALCT1(const CSCALCTDigi & digi);
00048   virtual void addCorrelatedLCT0(const CSCCorrelatedLCTDigi & digi);
00049   virtual void addCorrelatedLCT1(const CSCCorrelatedLCTDigi & digi);
00050 
00051   void swapCLCTs(CSCCLCTDigi& digi1, CSCCLCTDigi& digi2);
00052 
00053   virtual void print(std::ostream & os) const;
00054 
00055   struct {
00056   // 0
00057   unsigned b0cline:16; 
00058   unsigned bxnCount:12, dduCode1:3, flag1:1;
00059   unsigned l1aNumber:12, dduCode2:3, flag2:1;
00060   unsigned readoutCounter:12, dduCode3:3, flag3:1;
00061   // 4
00062   unsigned boardID:5, cscID:4, runID:4, stackOvf:1, syncError:1, flag4:1;
00063   unsigned nHeaderFrames:6, fifoMode:3, r_type:2, l1atype:2, hasBuf:1, bufFull:1, flag5:1;
00064   unsigned bd_status:15, flag6:1;
00065   unsigned firmRevCode:15, flag7:1;
00066   // 8
00067   unsigned bxnPreTrigger:12, reserved:2, lock_lost:1, flag8:1; 
00068   unsigned preTrigCounterLow:15, flag9:1;
00069   unsigned preTrigCounterHigh:15, flag10:1;
00070   unsigned clctCounterLow:15, flag11:1;
00071   // 12
00072   unsigned clctCounterHigh:15, flag12:1;
00073   unsigned trigCounterLow:15, flag13:1;
00074   unsigned trigCounterHigh:15, flag14:1;
00075   unsigned alctCounterLow:15, flag15:1;
00076   // 16
00077   unsigned alctCounterHigh:15, flag16:1;
00078   unsigned uptimeCounterLow:15, flag17:1;
00079   unsigned uptimeCounterHigh:15, flag18:1;
00080   unsigned nCFEBs:3, nTBins:5, fifoPretrig:5, scopeExists:1, vmeExists:1, flag19:1;
00081   // 20
00082   unsigned hitThresh:3, pidThresh:4, nphThresh:3, lyrThresh:3, layerTrigEnabled:1, staggerCSC:1, flag20:1;
00083   unsigned triadPersist:4, dmbThresh:3, alct_delay:4, clct_width:4, flag21:1;
00084   unsigned trigSourceVect:9, r_nlayers_hit_vec:6, flag22:1;
00085   unsigned activeCFEBs:5, readCFEBs:5, pop_l1a_match_win:4, aff_source:1, flag23:1;
00086   // 24
00087   unsigned tmbMatch:1, alctOnly:1, clctOnly:1, matchWin:4, noALCT:1, oneALCT:1, oneCLCT:1, twoALCT:1, twoCLCT:1, dupeALCT:1, dupeCLCT:1, lctRankErr:1, flag24:1;
00088   unsigned clct0_valid:1, clct0_quality:3, clct0_shape:4, clct0_key_low:7, flag25:1;
00089   unsigned clct1_valid:1, clct1_quality:3, clct1_shape:4, clct1_key_low:7, flag26:1;
00090   unsigned clct0_key_high:1, clct1_key_high:1, clct_bxn:2, clct_sync_err:1,  clct0Invalid:1, clct1Invalid:1, clct1Busy:1, parity_err_cfeb_ram:5, parity_err_rpc:1, parity_err_summary:1, flag27:1;
00091   // 28
00092   unsigned alct0Valid:1, alct0Quality:2, alct0Amu:1, alct0Key:7, alct_pretrig_win:4, flag28:1;
00093   unsigned alct1Valid:1, alct1Quality:2, alct1Amu:1, alct1Key:7, drift_delay:2, reserved3:1, layerTriggered:1, flag29:1;
00094   unsigned alctBXN:5, alctSeqStatus:2, alctSEUStatus:2, alctReserved:4, alctCfg:1, reserved4:1, flag30:1;
00095   unsigned MPC_Muon0_wire_:7, MPC_Muon0_clct_pattern_:4, MPC_Muon0_quality_:4, flag31:1;
00096   // 32
00097   unsigned MPC_Muon0_halfstrip_clct_pattern:8, MPC_Muon0_bend_:1, MPC_Muon0_SyncErr_:1, MPC_Muon0_bx_:1, MPC_Muon0_bc0_:1, MPC_Muon0_cscid_low:3, flag32:1;
00098   unsigned MPC_Muon1_wire_:7, MPC_Muon1_clct_pattern_:4, MPC_Muon1_quality_:4, flag33:1;
00099   unsigned MPC_Muon1_halfstrip_clct_pattern:8, MPC_Muon1_bend_:1, MPC_Muon1_SyncErr_:1, MPC_Muon1_bx_:1, MPC_Muon1_bc0_:1, MPC_Muon1_cscid_low:3, flag34:1;
00100   unsigned MPC_Muon0_vpf_:1, MPC_Muon0_cscid_bit4:1, MPC_Muon1_vpf_:1, MPC_Muon1_cscid_bit4:1, MPCDelay:4, MPCAccept:2, CFEBsEnabled:5, flag35:1;
00101   // 36
00102   unsigned RPCList:2, NRPCs:2, RPCEnable:1, fifo_tbins_rpc:5, fifo_pretrig_rpc:5, flag36:1;
00103 
00104   unsigned r_wr_buf_adr:11, r_wr_buf_ready:1, wr_buf_ready:1, buf_q_full:1, buf_q_empty:1, flag37:1;
00105   unsigned r_buf_fence_dist:11, buf_q_ovf_err:1, buf_q_udf_err:1, buf_q_adr_err:1, buf_stalled:1, flag38:1;
00106   unsigned buf_fence_cnt:12, reserved7:3, flag39:1;
00107   // 40
00108   unsigned buf_fence_cnt_peak:12, reserved8:3, flag40:1;
00109   unsigned reserved9:15, flag41:1;
00110   unsigned e0bline:16;
00111   } bits;
00112 
00113 
00114 };
00115 
00116 #endif
00117 

Generated on Tue Jun 9 17:34:22 2009 for CMSSW by  doxygen 1.5.4