CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCSPCounters.h
Go to the documentation of this file.
1 #ifndef CSCSPCounters_h
2 #define CSCSPCounters_h
3 
4 class CSCSPCounters {
5 private:
6  // Block of counters
8  unsigned track_counter_low : 15; //
9  unsigned zero_1 : 1; //
11  unsigned track_counter_high : 15; //
12  unsigned zero_2 : 1; //
14  unsigned orbit_counter_low : 15; //
15  unsigned zero_3 : 1; //
17  unsigned orbit_counter_high : 15; //
18  unsigned zero_4 : 1; //
19 
20  friend class CSCTFPacker;
21 
22 public:
23  bool check(void) const throw() {
24  return zero_1 !=0 || zero_2 !=0 || zero_3 !=0 || zero_4 !=0 ;
25  }
26 
27  bool unpack(const unsigned short *&buf) throw() { memcpy((void*)this,buf,4*sizeof(short)); buf+=4; return check(); }
28 
29  int track_counter(void) const throw() { return (track_counter_high<<15) | track_counter_low; }
30  int orbit_counter(void) const throw() { return (orbit_counter_high<<15) | orbit_counter_low; }
31 
32  CSCSPCounters(void){}
33 };
34 
35 #endif
unsigned orbit_counter_low
Definition: CSCSPCounters.h:14
unsigned orbit_counter_high
Definition: CSCSPCounters.h:17
unsigned zero_2
Definition: CSCSPCounters.h:12
unsigned zero_3
Definition: CSCSPCounters.h:15
bool check(void) const
Definition: CSCSPCounters.h:23
unsigned track_counter_low
Definition: CSCSPCounters.h:8
unsigned zero_1
Definition: CSCSPCounters.h:9
int orbit_counter(void) const
Definition: CSCSPCounters.h:30
int track_counter(void) const
Definition: CSCSPCounters.h:29
unsigned track_counter_high
Definition: CSCSPCounters.h:11
CSCSPCounters(void)
Definition: CSCSPCounters.h:32
unsigned zero_4
Definition: CSCSPCounters.h:18
bool unpack(const unsigned short *&buf)
Definition: CSCSPCounters.h:27