CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/EventFilter/CSCTFRawToDigi/src/CSCSPCounters.h

Go to the documentation of this file.
00001 #ifndef CSCSPCounters_h
00002 #define CSCSPCounters_h
00003 
00004 class CSCSPCounters {
00005 private:
00006         // Block of counters
00008         unsigned track_counter_low  : 15; //
00009         unsigned zero_1             : 1;  //
00011         unsigned track_counter_high : 15; //
00012         unsigned zero_2             : 1;  //
00014         unsigned orbit_counter_low  : 15; //
00015         unsigned zero_3             : 1;  //
00017         unsigned orbit_counter_high : 15; //
00018         unsigned zero_4             : 1;  //
00019 
00020         friend class CSCTFPacker;
00021 
00022 public:
00023         bool check(void) const throw() {
00024                 return zero_1 !=0 || zero_2 !=0 || zero_3 !=0 || zero_4 !=0 ;
00025         }
00026 
00027         bool unpack(const unsigned short *&buf) throw() { memcpy((void*)this,buf,4*sizeof(short)); buf+=4; return check(); }
00028 
00029         int track_counter(void) const throw() { return (track_counter_high<<15) | track_counter_low; }
00030         int orbit_counter(void) const throw() { return (orbit_counter_high<<15) | orbit_counter_low; }
00031 
00032         CSCSPCounters(void){}
00033 };
00034 
00035 #endif