CMS 3D CMS Logo

CSCSPCounters.h
Go to the documentation of this file.
1 #ifndef CSCSPCounters_h
2 #define CSCSPCounters_h
3 
4 #include <cstring>
5 
6 class CSCSPCounters {
7 private:
8  // Block of counters
10  unsigned track_counter_low : 15; //
11  unsigned zero_1 : 1; //
13  unsigned track_counter_high : 15; //
14  unsigned zero_2 : 1; //
16  unsigned orbit_counter_low : 15; //
17  unsigned zero_3 : 1; //
19  unsigned orbit_counter_high : 15; //
20  unsigned zero_4 : 1; //
21 
22  friend class CSCTFPacker;
23 
24 public:
25  bool check(void) const throw() { return zero_1 != 0 || zero_2 != 0 || zero_3 != 0 || zero_4 != 0; }
26 
27  bool unpack(const unsigned short *&buf) throw() {
28  std::memcpy((void *)this, buf, 4 * sizeof(short));
29  buf += 4;
30  return check();
31  }
32 
33  int track_counter(void) const throw() { return (track_counter_high << 15) | track_counter_low; }
34  int orbit_counter(void) const throw() { return (orbit_counter_high << 15) | orbit_counter_low; }
35 
36  CSCSPCounters(void) {}
37 };
38 
39 #endif
CSCSPCounters::track_counter_high
unsigned track_counter_high
Definition: CSCSPCounters.h:13
CSCSPCounters::zero_4
unsigned zero_4
Definition: CSCSPCounters.h:20
CSCSPCounters::orbit_counter_high
unsigned orbit_counter_high
Definition: CSCSPCounters.h:19
CSCSPCounters::CSCSPCounters
CSCSPCounters(void)
Definition: CSCSPCounters.h:36
CSCSPCounters::zero_1
unsigned zero_1
Definition: CSCSPCounters.h:11
CSCSPCounters::track_counter_low
unsigned track_counter_low
Definition: CSCSPCounters.h:10
CSCSPCounters::zero_3
unsigned zero_3
Definition: CSCSPCounters.h:17
CSCSPCounters::orbit_counter
int orbit_counter(void) const
Definition: CSCSPCounters.h:34
CSCTFPacker
Definition: CSCTFPacker.h:18
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
CSCSPCounters
Definition: CSCSPCounters.h:6
CSCSPCounters::zero_2
unsigned zero_2
Definition: CSCSPCounters.h:14
CSCSPCounters::unpack
bool unpack(const unsigned short *&buf)
Definition: CSCSPCounters.h:27
CSCSPCounters::check
bool check(void) const
Definition: CSCSPCounters.h:25
CSCSPCounters::orbit_counter_low
unsigned orbit_counter_low
Definition: CSCSPCounters.h:16
CSCSPCounters::track_counter
int track_counter(void) const
Definition: CSCSPCounters.h:33