Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:23

0001 #ifndef EventFilter_CSCRawToDigi_CSCVTMBHeaderFormat_h
0002 #define EventFilter_CSCRawToDigi_CSCVTMBHeaderFormat_h
0003 
0004 #include "DataFormats/CSCDigi/interface/CSCCLCTDigi.h"
0005 #include "DataFormats/CSCDigi/interface/CSCALCTDigi.h"
0006 #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h"
0007 #include "DataFormats/CSCDigi/interface/CSCShowerDigi.h"
0008 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
0009 #include "DataFormats/CSCDigi/interface/CSCConstants.h"
0010 #include <vector>
0011 #include <iosfwd>
0012 #include <strings.h>
0013 class CSCDMBHeader;
0014 
0015 class CSCVTMBHeaderFormat {
0016 public:
0017   virtual ~CSCVTMBHeaderFormat() {}
0018 
0019   virtual void setEventInformation(const CSCDMBHeader&) = 0;
0020   virtual uint16_t BXNCount() const = 0;
0021   virtual uint16_t ALCTMatchTime() const = 0;
0022   virtual void setALCTMatchTime(uint16_t alctmatchtime) = 0;
0023   virtual uint16_t CLCTOnly() const = 0;
0024   virtual uint16_t ALCTOnly() const = 0;
0025   virtual uint16_t TMBMatch() const = 0;
0026   virtual uint16_t Bxn0Diff() const = 0;
0027   virtual uint16_t Bxn1Diff() const = 0;
0028   virtual uint16_t L1ANumber() const = 0;
0029   virtual uint16_t syncError() const = 0;
0030   virtual uint16_t syncErrorCLCT() const = 0;
0031   virtual uint16_t syncErrorMPC0() const = 0;
0032   virtual uint16_t syncErrorMPC1() const = 0;
0033   virtual uint16_t L1AMatchTime() const = 0;
0034 
0035   /// == Run 3 CSC-GEM Trigger Format
0036   virtual uint16_t clct0_ComparatorCode() const = 0;
0037   virtual uint16_t clct1_ComparatorCode() const = 0;
0038   virtual uint16_t clct0_xky() const = 0;
0039   virtual uint16_t clct1_xky() const = 0;
0040   virtual uint16_t hmt_nhits() const = 0;
0041   virtual uint16_t hmt_ALCTMatchTime() const = 0;
0042   virtual uint16_t alctHMT() const = 0;
0043   virtual uint16_t clctHMT() const = 0;
0044   virtual uint16_t gem_enabled_fibers() const = 0;
0045   virtual uint16_t gem_fifo_tbins() const = 0;
0046   virtual uint16_t gem_fifo_pretrig() const = 0;
0047   virtual uint16_t gem_zero_suppress() const = 0;
0048   virtual uint16_t gem_sync_dataword() const = 0;
0049   virtual uint16_t gem_timing_dataword() const = 0;
0050   virtual uint16_t run3_CLCT_patternID() const = 0;
0051 
0052   uint16_t sizeInBytes() const { return sizeInWords() * 2; }
0053   virtual uint16_t NTBins() const = 0;
0054   virtual uint16_t NCFEBs() const = 0;
0055   virtual void setNCFEBs(uint16_t ncfebs) = 0;
0056   virtual uint16_t firmwareRevision() const = 0;
0057   ///returns CLCT digis
0058   virtual std::vector<CSCCLCTDigi> CLCTDigis(uint32_t idlayer) = 0;
0059   ///returns CorrelatedLCT digis
0060   virtual std::vector<CSCCorrelatedLCTDigi> CorrelatedLCTDigis(uint32_t idlayer) const = 0;
0061   ///returns Run3 lct HMT Shower digi
0062   virtual CSCShowerDigi showerDigi(uint32_t idlayer) const = 0;
0063   ///returns Run3 anode HMT Shower digi
0064   virtual CSCShowerDigi anodeShowerDigi(uint32_t idlayer) const = 0;
0065   ///returns Run3 cathode HMT Shower digi
0066   virtual CSCShowerDigi cathodeShowerDigi(uint32_t idlayer) const = 0;
0067 
0068   /// in 16-bit words.  Add olne because we include beginning(b0c) and
0069   /// end (e0c) flags
0070   virtual unsigned short int sizeInWords() const = 0;
0071 
0072   virtual unsigned short int NHeaderFrames() const = 0;
0073   virtual unsigned short* data() = 0;
0074   virtual bool check() const = 0;
0075 
0076   /// for data packing
0077   virtual void addCLCT0(const CSCCLCTDigi& digi) = 0;
0078   virtual void addCLCT1(const CSCCLCTDigi& digi) = 0;
0079   virtual void addALCT0(const CSCALCTDigi& digi) = 0;
0080   virtual void addALCT1(const CSCALCTDigi& digi) = 0;
0081   virtual void addCorrelatedLCT0(const CSCCorrelatedLCTDigi& digi) = 0;
0082   virtual void addCorrelatedLCT1(const CSCCorrelatedLCTDigi& digi) = 0;
0083   virtual void addShower(const CSCShowerDigi& digi) = 0;
0084   virtual void addAnodeShower(const CSCShowerDigi& digi) = 0;
0085   virtual void addCathodeShower(const CSCShowerDigi& digi) = 0;
0086 
0087   virtual void print(std::ostream& os) const = 0;
0088 
0089 protected:
0090   void swapCLCTs(CSCCLCTDigi& digi1, CSCCLCTDigi& digi2);
0091 };
0092 
0093 #endif