Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:37

0001 #ifndef DataFormats_RPCDigi_RecordBX_H
0002 #define DataFormats_RPCDigi_RecordBX_H
0003 
0004 #include "DataFormats/RPCDigi/interface/DataRecord.h"
0005 
0006 namespace rpcrawtodigi {
0007   class RecordBX : public DataRecord {
0008   private:
0009     static const int BX_TYPE_FLAG = 0xD;
0010     static const int BX_TYPE_SHIFT = 12;
0011     static const int BX_MASK = 0xFFF;
0012     static const int BX_SHIFT = 0;
0013 
0014   public:
0015     // empty record
0016     RecordBX() : DataRecord() {}
0017 
0018     // set BX
0019     RecordBX(int bx) : DataRecord(0) {
0020       theData = (BX_TYPE_FLAG << BX_TYPE_SHIFT);
0021       theData |= (bx << BX_SHIFT);
0022     }
0023 
0024     // specialize given recort to this type
0025     RecordBX(const DataRecord& rec) : DataRecord(rec) {}
0026 
0027     ~RecordBX() override {}
0028     int bx() const { return ((theData >> BX_SHIFT) & BX_MASK); }
0029     std::string print() const;
0030     static bool matchType(const DataRecord& record);
0031   };
0032 }  // namespace rpcrawtodigi
0033 #endif