Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:33

0001 #ifndef DataFormat_L1TMuon_Omtf_CscDataWord64_H
0002 #define DataFormat_L1TMuon_Omtf_CscDataWord64_H
0003 
0004 #include <iostream>
0005 #include "DataFormats/L1TMuon/interface/OMTF/OmtfDataWord64.h"
0006 
0007 namespace omtf {
0008 
0009   class CscDataWord64 {
0010   public:
0011     CscDataWord64(const Word64 &data) : rawData(data) {}
0012     CscDataWord64() : rawData(Word64(DataWord64::csc) << 60) {}
0013 
0014     unsigned int type() const { return type_; }
0015     unsigned int bxNum() const { return bxNum_; }
0016     unsigned int hitNum() const { return hitNum_; }
0017     unsigned int wireGroup() const { return keyWG_; }
0018     unsigned int quality() const { return quality_; }
0019     unsigned int clctPattern() const { return clctPattern_; }
0020     unsigned int cscID() const { return cscID_; }
0021     unsigned int halfStrip() const { return halfStrip_; }
0022     unsigned int linkNum() const { return linkNum_; }
0023     unsigned int station() const { return station_; }
0024     unsigned int bend() const { return lr_; }
0025     unsigned int valid() const { return vp_; }
0026 
0027     friend class OmtfPacker;
0028     friend class CscPacker;
0029     friend std::ostream &operator<<(std::ostream &out, const CscDataWord64 &o);
0030 
0031   private:
0032     union {
0033       uint64_t rawData;
0034       struct {                      // watch out - bit fields are  is implementation-defined
0035         uint64_t dummy7_ : 3;       //2:0   unused, oryginalnie TBIN Num
0036         uint64_t vp_ : 1;           //3:3   VP
0037         uint64_t station_ : 3;      //6:4   Station
0038         uint64_t af_ : 1;           //7:7   AF
0039         uint64_t dummy6_ : 4;       //11:8  unused, oryginalnie EPC
0040         uint64_t sm_ : 1;           //12:12 unused, oryginalnie SM
0041         uint64_t se_ : 1;           //13:13 SE
0042         uint64_t dummy5_ : 1;       //14:14 unused, oryginalnie AFEF
0043         uint64_t dummy4_ : 2;       //16:15 unused, oryginalnie ME BXN [11:0]
0044         uint64_t nit_ : 1;          //17:17 NIT
0045         uint64_t cik_ : 1;          //18:18 CIK
0046         uint64_t dummy3_ : 1;       //19:19 unused, oryginalnie AFFF
0047         uint64_t linkNum_ : 6;      //25:20 numer linku CSC
0048         uint64_t halfStrip_ : 8;    //33:26 CLCT key half-strip [7:0]
0049         uint64_t cscID_ : 4;        //37:34 CSC ID [3:0]
0050         uint64_t lr_ : 1;           //38:38 L/R
0051         uint64_t dummy2_ : 1;       //39:39 unused, oryginalnie BXE
0052         uint64_t dummy1_ : 1;       //40:40 unused, oryginalnie BC0
0053         uint64_t clctPattern_ : 4;  //44:41 CLCT pattern [3:0]              4b
0054         uint64_t quality_ : 4;      //48:45 Quality [3:0]
0055         uint64_t keyWG_ : 7;        //55:49 Key wire group [6:0]
0056         uint64_t hitNum_ : 1;       //56:56 int in chamber 0 or 1
0057         uint64_t bxNum_ : 3;        //59:57 SBXN
0058         uint64_t type_ : 4;         //63:60 CSC identifier 0xC
0059       };
0060     };
0061   };
0062 
0063 }  // namespace omtf
0064 #endif