Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:12

0001 /****************************************************************************
0002 *
0003 * This is a part of TOTEM offline software.
0004 * Authors:
0005 *   Jan Kašpar (jan.kaspar@gmail.com)
0006 *
0007 ****************************************************************************/
0008 
0009 #ifndef DataFormats_CTPPSDigi_TotemFEDInfo
0010 #define DataFormats_CTPPSDigi_TotemFEDInfo
0011 
0012 #include <cstdint>
0013 
0014 /**
0015  * \brief OptoRx headers and footers.
0016  **/
0017 class TotemFEDInfo {
0018 public:
0019   TotemFEDInfo(int id = 0) : fedId_(id), header(0), orbitCounter_(0), footer(0) {}
0020 
0021   void setFEDId(int f) { fedId_ = f; }
0022   int fedId() const { return fedId_; }
0023 
0024   void setHeader(uint64_t _h) { header = _h; }
0025   uint8_t boe() const { return (header >> 60) & 0xF; }
0026   uint32_t lv1() const { return (header >> 32) & 0xFFFFFF; }
0027   uint16_t bx() const { return (header >> 20) & 0xFFF; }
0028   uint16_t optoRxId() const { return (header >> 8) & 0xFFF; }
0029   uint8_t fov() const { return (header >> 4) & 0xF; }
0030   uint8_t h0() const { return (header >> 0) & 0xF; }
0031 
0032   void setOrbitCounter(uint32_t oc) { orbitCounter_ = oc; }
0033   uint32_t orbitCounter() const { return orbitCounter_; }
0034 
0035   void setFooter(uint64_t _f) { footer = _f; }
0036   uint8_t eoe() const { return (footer >> 60) & 0xF; }
0037   uint16_t fSize() const { return (footer >> 32) & 0x3FF; }
0038   uint8_t f0() const { return (footer >> 0) & 0xF; }
0039 
0040 private:
0041   /// Id from FEDRawDataCollection.
0042   int fedId_;
0043 
0044   /// Data from OptoRx headers and footer.
0045   uint64_t header;
0046   uint32_t orbitCounter_;
0047   uint64_t footer;
0048 };
0049 
0050 #endif