Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05:08

0001 #ifndef DataFormats_RPCDigi_RecordCD_H
0002 #define DataFormats_RPCDigi_RecordCD_H
0003 
0004 #include "DataFormats/RPCDigi/interface/DataRecord.h"
0005 #include <vector>
0006 
0007 namespace rpcrawtodigi {
0008   class RecordCD : public DataRecord {
0009   private:
0010     static const int CD_TYPE_LESSTHENFLAG = 0x3;
0011     static const int CD_TYPE_SHIFT = 14;
0012 
0013     static const int PARTITION_DATA_MASK = 0XFF;
0014     static const int PARTITION_DATA_SHIFT = 0;
0015 
0016     static const int PARTITION_NUMBER_MASK = 0XF;
0017     static const int PARTITION_NUMBER_SHIFT = 10;
0018 
0019     static const int HALFP_MASK = 0X1;
0020     static const int HALFP_SHIFT = 8;
0021 
0022     static const int EOD_MASK = 0X1;
0023     static const int EOD_SHIFT = 9;
0024 
0025     static const int CHAMBER_MASK = 0X3;
0026     static const int CHAMBER_SHIFT = 14;
0027 
0028     static const int BITS_PER_PARTITION = 8;
0029 
0030   public:
0031     // empty record
0032     RecordCD() : DataRecord() {}
0033 
0034     // set with Data
0035     RecordCD(int chamber, int partitionNumber, int eod, int halfP, const std::vector<int>& packedStrips);
0036 
0037     // set LB from raw
0038     RecordCD(const Data& lbData) : DataRecord(lbData) {}
0039 
0040     // specialize given recort to this type
0041     RecordCD(const DataRecord& rec) : DataRecord(rec) {}
0042 
0043     ~RecordCD() override {}
0044 
0045     static bool matchType(const DataRecord& record) {
0046       return ((record.data() >> CD_TYPE_SHIFT) < CD_TYPE_LESSTHENFLAG);
0047     }
0048 
0049     // more precisly - link board in link number
0050     int lbInLink() const;
0051 
0052     int partitionNumber() const;
0053     int eod() const;
0054     int halfP() const;
0055 
0056     std::vector<int> packedStrips() const;
0057     int partitionData() const;
0058 
0059     std::string print() const;
0060   };
0061 }  // namespace rpcrawtodigi
0062 #endif