test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCSP_MBblock.h
Go to the documentation of this file.
1 #ifndef CSCSP_MBblock_h
2 #define CSCSP_MBblock_h
3 
4 class CSCSP_MBblock {
5 private:
7  unsigned quality_ : 3; // muon quality (0-7), quality > 0 for valid data;
8  unsigned zero_1 : 1; // format specific
9  unsigned phi_bend_ : 5; // phi bend angle
10  unsigned zero_2 : 3; // format specific
11  unsigned flag_ : 1; // if 1 then it is a second muon from previous bunch crossing
12  unsigned cal_ : 1; // MBy special mode flag
13  unsigned zero_3 : 2; // format specific
15  unsigned phi_ : 12;// azimuth coordinate;
16  unsigned bxn1_ : 1; // next to the least significant bit of the MB BX number
17  unsigned bxn0_ : 1; // least significant bit of the MB BX number
18  unsigned bc0_ : 1; // BX zero timing mark
19  unsigned zero_4 : 1; // format specific
21  unsigned mb_bxn_ : 12;// Stub arrival time picked from a local 12-bit Bunch Counter, that runs at data stream timing
22  unsigned spare_1 : 3; // not used
23  unsigned zero_5 : 1; // format specific
25  unsigned spare_2 : 15;// not used
26  unsigned zero_6 : 1; // format specific
27 
28  // Other data members logically belong to MB block record,
29  // but physically are located in Data Block Header, which implementation is:
30  friend class CSCSPRecord;
31  friend class CSCTFPacker;
32  // Let this class set following data memebers:
33  unsigned int tbin_; // time bin, that this MB block belongs to in global SP record
34  unsigned int valid_quality; // valid quality
35  unsigned int alignment_fifo; // AF error
36  unsigned int bxBit; // monitors the MB(DT) timing
37  unsigned int id_; // stub id (1-MB1a, 2-MB1d)
38 
39 public:
40  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; }
41 
42  unsigned int quality (void) const throw() { return quality_; }
43  unsigned int phi_bend(void) const throw() { return phi_bend_; }
44  unsigned int flag (void) const throw() { return flag_; }
45  unsigned int cal (void) const throw() { return cal_; }
46 
47  unsigned int phi(void) const throw() { return phi_; }
48  unsigned int bxn(void) const throw() { return (bxn1_<<1)|bxn0_; }
49  unsigned int bc0(void) const throw() { return bc0_; }
50  unsigned int BXN(void) const throw() { return mb_bxn_; }
51 
52  unsigned int id (void) const throw() { return id_; }
53  unsigned int tbin(void) const throw() { return tbin_; }
54  unsigned int vq (void) const throw() { return valid_quality; }
55  unsigned int af (void) const throw() { return alignment_fifo;}
56  unsigned int timingError(void) const throw() { return bxBit; }
57 
58  bool unpack(const unsigned short *&buf) throw() { memcpy(this, buf, 4*sizeof(short)); buf+=4; return check(); }
59 
60  CSCSP_MBblock(void){}
61 };
62 
63 #endif
unsigned phi_
Definition: CSCSP_MBblock.h:15
unsigned int bxBit
Definition: CSCSP_MBblock.h:36
unsigned int timingError(void) const
Definition: CSCSP_MBblock.h:56
unsigned int alignment_fifo
Definition: CSCSP_MBblock.h:35
unsigned zero_5
Definition: CSCSP_MBblock.h:23
unsigned int quality(void) const
Definition: CSCSP_MBblock.h:42
unsigned int af(void) const
Definition: CSCSP_MBblock.h:55
unsigned zero_1
Definition: CSCSP_MBblock.h:8
unsigned bc0_
Definition: CSCSP_MBblock.h:18
unsigned int tbin(void) const
Definition: CSCSP_MBblock.h:53
unsigned cal_
Definition: CSCSP_MBblock.h:12
unsigned flag_
Definition: CSCSP_MBblock.h:11
unsigned int cal(void) const
Definition: CSCSP_MBblock.h:45
unsigned bxn1_
Definition: CSCSP_MBblock.h:16
unsigned spare_1
Definition: CSCSP_MBblock.h:22
bool check(void) const
Definition: CSCSP_MBblock.h:40
CSCSP_MBblock(void)
Definition: CSCSP_MBblock.h:60
unsigned int id(void) const
Definition: CSCSP_MBblock.h:52
unsigned int bc0(void) const
Definition: CSCSP_MBblock.h:49
unsigned int flag(void) const
Definition: CSCSP_MBblock.h:44
unsigned zero_2
Definition: CSCSP_MBblock.h:10
unsigned zero_6
Definition: CSCSP_MBblock.h:26
unsigned int bxn(void) const
Definition: CSCSP_MBblock.h:48
unsigned int vq(void) const
Definition: CSCSP_MBblock.h:54
unsigned phi_bend_
Definition: CSCSP_MBblock.h:9
unsigned int id_
Definition: CSCSP_MBblock.h:37
unsigned int BXN(void) const
Definition: CSCSP_MBblock.h:50
unsigned int tbin_
Definition: CSCSP_MBblock.h:33
unsigned spare_2
Definition: CSCSP_MBblock.h:25
unsigned int phi_bend(void) const
Definition: CSCSP_MBblock.h:43
bool unpack(const unsigned short *&buf)
Definition: CSCSP_MBblock.h:58
unsigned zero_3
Definition: CSCSP_MBblock.h:13
unsigned int valid_quality
Definition: CSCSP_MBblock.h:34
unsigned zero_4
Definition: CSCSP_MBblock.h:19
unsigned bxn0_
Definition: CSCSP_MBblock.h:17
unsigned int phi(void) const
Definition: CSCSP_MBblock.h:47
unsigned mb_bxn_
Definition: CSCSP_MBblock.h:21
unsigned quality_
Definition: CSCSP_MBblock.h:7