CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/EventFilter/CSCTFRawToDigi/src/CSCSP_MBblock.h

Go to the documentation of this file.
00001 #ifndef CSCSP_MBblock_h
00002 #define CSCSP_MBblock_h
00003 
00004 class CSCSP_MBblock {
00005 private:
00007         unsigned quality_  : 3; // muon quality (0-7),  quality > 0 for valid data;
00008         unsigned zero_1    : 1; // format specific
00009         unsigned phi_bend_ : 5; // phi bend angle
00010         unsigned zero_2    : 3; // format specific
00011         unsigned flag_     : 1; // if 1 then it is a second muon from previous bunch crossing
00012         unsigned cal_      : 1; // MBy special mode flag
00013         unsigned zero_3    : 2; // format specific
00015         unsigned phi_      : 12;// azimuth coordinate;
00016         unsigned bxn1_     : 1; // next to the least significant bit of the MB BX number
00017         unsigned bxn0_     : 1; // least significant bit of the MB BX number
00018         unsigned bc0_      : 1; // BX zero timing mark
00019         unsigned zero_4    : 1; // format specific
00021         unsigned mb_bxn_   : 12;// Stub arrival time picked from a local 12-bit Bunch Counter, that runs at data stream timing
00022         unsigned spare_1   : 3; // not used
00023         unsigned zero_5    : 1; // format specific
00025         unsigned spare_2   : 15;// not used
00026         unsigned zero_6    : 1; // format specific
00027 
00028         // Other data members logically belong to MB block record,
00029         //  but physically are located in Data Block Header, which implementation is:
00030         friend class CSCSPRecord;
00031         friend class CSCTFPacker;
00032         // Let this class set following data memebers:
00033         unsigned int tbin_;           // time bin, that this MB block belongs to in global SP record
00034         unsigned int valid_quality;   // valid quality
00035         unsigned int alignment_fifo;  // AF error
00036         unsigned int bxBit;           // monitors the MB(DT) timing
00037         unsigned int id_;             // stub id (1-MB1a, 2-MB1d)
00038 
00039 public:
00040         bool check(void) const throw() { return zero_1!=0||zero_2!=0||zero_3!=0||zero_4!=0||zero_5!=0||zero_6!=0||spare_1!=0||spare_2!=0; }
00041 
00042         unsigned int quality (void) const throw() { return quality_;  }
00043         unsigned int phi_bend(void) const throw() { return phi_bend_; }
00044         unsigned int flag    (void) const throw() { return flag_;     }
00045         unsigned int cal     (void) const throw() { return cal_;      }
00046 
00047         unsigned int phi(void) const throw() { return phi_;    }
00048         unsigned int bxn(void) const throw() { return (bxn1_<<1)|bxn0_; }
00049         unsigned int bc0(void) const throw() { return bc0_;    }
00050         unsigned int BXN(void) const throw() { return mb_bxn_; }
00051 
00052         unsigned int id  (void) const throw() { return id_;           }
00053         unsigned int tbin(void) const throw() { return tbin_;         }
00054         unsigned int vq  (void) const throw() { return valid_quality; }
00055         unsigned int af  (void) const throw() { return alignment_fifo;}
00056         unsigned int timingError(void) const throw() { return bxBit; }
00057 
00058         bool unpack(const unsigned short *&buf) throw() { memcpy(this, buf, 4*sizeof(short)); buf+=4; return check(); }
00059 
00060         CSCSP_MBblock(void){}
00061 };
00062 
00063 #endif