Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef EventFilter_RPCRawToDigi_RPCLBRecord_h
0002 #define EventFilter_RPCRawToDigi_RPCLBRecord_h
0003 
0004 #include <cstdint>
0005 
0006 class RPCLBRecord {
0007 public:
0008   /* https://twiki.cern.ch/twiki/bin/viewauth/CMS/DtUpgradeTwinMux#RPC_payload RPC_optical_links_data_format.pdf */
0009   /* 4b partition is split in 3b connector + 1b partition */
0010   static std::uint32_t const bcn_mask_ = 0xfe000000;
0011   static std::uint32_t const bc0_mask_ = 0x01000000;
0012   static std::uint32_t const link_board_mask_ = 0x00060000;
0013   static std::uint32_t const eod_mask_ = 0x00008000;
0014   static std::uint32_t const delay_mask_ = 0x00007000;
0015   static std::uint32_t const connector_mask_ = 0x00000e00;
0016   static std::uint32_t const partition_mask_ = 0x00000100;
0017   static std::uint32_t const partition_data_mask_ = 0x000000ff;
0018 
0019   static unsigned int const bcn_offset_ = 25;
0020   static unsigned int const bc0_offset_ = 24;
0021   static unsigned int const link_board_offset_ = 17;
0022   static unsigned int const eod_offset_ = 15;
0023   static unsigned int const delay_offset_ = 12;
0024   static unsigned int const connector_offset_ = 9;
0025   static unsigned int const partition_offset_ = 8;
0026   static unsigned int const partition_data_offset_ = 0;
0027 
0028 public:
0029   RPCLBRecord(std::uint32_t const record = 0x0);
0030   RPCLBRecord(unsigned int bcn,
0031               bool bc0,
0032               unsigned int link_board,
0033               bool eod,
0034               unsigned int delay,
0035               unsigned int connector,
0036               unsigned int partition,
0037               std::uint8_t data);
0038 
0039   void set(std::uint32_t const record = 0x0);
0040   void reset();
0041 
0042   std::uint32_t const& getRecord() const;
0043 
0044   unsigned int getBCN() const;
0045   bool isBC0() const;
0046   unsigned int getLinkBoard() const;
0047   bool isEOD() const;
0048   unsigned int getDelay() const;
0049   unsigned int getConnector() const;
0050   unsigned int getPartition() const;
0051   std::uint8_t getPartitionData() const;
0052 
0053   void setBCN(unsigned int bcn);
0054   void setBC0(bool bc0);
0055   void setLinkBoard(unsigned int link_board);
0056   void setEOD(bool eod);
0057   void setDelay(unsigned int delay);
0058   void setConnector(unsigned int connector);
0059   void setPartition(unsigned int partition);
0060   void setPartitionData(std::uint8_t data);
0061 
0062   bool operator<(RPCLBRecord const& rhs) const;
0063 
0064 protected:
0065   std::uint32_t record_;
0066 };
0067 
0068 #include "EventFilter/RPCRawToDigi/interface/RPCLBRecord.icc"
0069 
0070 #endif  // EventFilter_RPCRawToDigi_RPCLBRecord_h