CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCSP_MEblock.h
Go to the documentation of this file.
1 #ifndef CSCSP_MEblock_h
2 #define CSCSP_MEblock_h
3 
4 class CSCSP_MEblock {
5 private:
7  unsigned clct_pattern_number : 4; // higher pattern number - straighter high-momentum tracks with more layers hit, also encodes half/di-strip indication
8  unsigned quality_ : 4; // the more hits the higher LCT Quality
9  unsigned wire_group_id : 7; // radial position of the pattern within the chamber (0-111)
10  unsigned zero_1 : 1; // format specific
12  unsigned clct_pattern_id : 8; // azimuthal position ot the pattern at the third (key) layer: (0-159 for half-strips 0-39 for di-strips)
13  unsigned csc_id : 4; // chamber # (1-9)
14  unsigned left_right : 1; // L/R - track is heading towards lower/higher strip number
15  unsigned bx0_ : 1; // BX counter least significant bit
16  unsigned bc0_ : 1; // BC Zero flag marks that next BXN = 0
17  unsigned zero_2 : 1; // format specific
19  unsigned me_bxn : 12;// LCT arrival time picked from a local 12-bit BX Counter, that runs at link timing
20  unsigned receiver_status_er1 : 1; // receiver status for the frame 1 (see below)
21  unsigned receiver_status_dv1 : 1; // receiver status for the frame 1 (see below)
22  unsigned aligment_fifo_full : 1; // Alignment FIFO Full Flag, should be 0, if AF has been initialized successfully by L1Reset
23  unsigned zero_3 : 1; // format specific
25  unsigned link_id : 2; // Link number (1-3) [reported by MPC on every L1 Reset]
26  unsigned mpc_id : 6; // MPC Crate number (0-63) [reported by MPC on every L1 Reset]
27  unsigned err_prop_cnt : 4; // accumulates the "Receive Error Propagation" occurrences since last L1Reset
28  unsigned receiver_status_er2 : 1; // receiver status for the frame 2 (see below)
29  unsigned receiver_status_dv2 : 1; // receiver status for the frame 2 (see below)
30  unsigned aligment_fifo_empty : 1; // Alignment FIFO Empty Flag, should be 0, if AF has been initialized successfully by L1Reset
31  unsigned zero_4 : 1; // format specific
32 
33  // Optical Receiver Status options:
34  // {receiver_status_dv, receiver_status_er} = {Receive Data Valid, Receive Error}
35  // {0,0} - Receive Idle Character;
36  // {0,1} - Receive Carrier Extend;
37  // {1,0} - Receive Normal Data Character <- expect to have;
38  // {1,1} - Receive Error Propagation;
39 
40  // Other data members logically belong to ME Block record,
41  // but physically are located in Data Block Header, which implementation is:
42  friend class CSCSPRecord;
43  friend class CSCTFPacker;
44  // Let this class set following data memebers:
45  unsigned int tbin_; // time bin, that this ME block belongs to in global SP record
46  unsigned int valid_pattern; // LCT valid bit
47  unsigned int sync_error; // LCT synchronization error bit
48  unsigned int sync_modified; // LCT modified synchronization error bit
49  unsigned int alignment_fifo; // AF error
50  unsigned int bxBit; // monitors the ALCT/TMB/MPC timing
51  unsigned int spInput_; // Input SP link, this LCT come through [1..15] (as SP sees it)
52 
53 public:
54  bool check(void) const throw() { return zero_1!=0||zero_2!=0||zero_3!=0||zero_4!=0; }
55 
56  unsigned int quality(void) const throw() { return quality_; }
57  unsigned int BXN (void) const throw() { return me_bxn; }
58  unsigned int bx0 (void) const throw() { return bx0_; }
59  unsigned int bc0 (void) const throw() { return bc0_; }
60 
61  unsigned int spInput(void) const throw() { return spInput_; }
62  unsigned int link (void) const throw() { return link_id; }
63  unsigned int mpc (void) const throw() { return mpc_id; }
64  unsigned int csc (void) const throw() { return csc_id; }
65 
66  unsigned int l_r (void) const throw() { return left_right; }
67  unsigned int wireGroup(void) const throw() { return wire_group_id; }
68  unsigned int strip (void) const throw() { return clct_pattern_id; }
69  unsigned int pattern(void) const throw() { return clct_pattern_number; }
70 
71  enum AF { EMPTY=1, FULL=2 };
72  unsigned int aligment_fifo(void) const throw() { return (aligment_fifo_full<<1)|aligment_fifo_empty; }
73 
75  unsigned int receiver_status_frame1(void) const throw() { return (receiver_status_dv1<<1)|receiver_status_er1; }
76  unsigned int receiver_status_frame2(void) const throw() { return (receiver_status_dv2<<1)|receiver_status_er2; }
77 
78  unsigned int errCnt(void) const throw() { return err_prop_cnt; }
79 
80  unsigned int tbin(void) const throw() { return tbin_; }
81  unsigned int vp (void) const throw() { return valid_pattern; }
82  unsigned int se (void) const throw() { return sync_error; }
83  unsigned int sm (void) const throw() { return sync_modified; }
84  unsigned int af (void) const throw() { return alignment_fifo;}
85  unsigned int timingError(void) const throw() { return bxBit; }
86 
87  bool unpack(const unsigned short *&buf) throw() { memcpy((void*)this,buf,4*sizeof(short)); buf+=4; return check(); }
88 
89  CSCSP_MEblock(void){}
90 };
91 
92 #endif
unsigned me_bxn
Definition: CSCSP_MEblock.h:19
unsigned int mpc(void) const
Definition: CSCSP_MEblock.h:63
unsigned int wireGroup(void) const
Definition: CSCSP_MEblock.h:67
unsigned zero_4
Definition: CSCSP_MEblock.h:31
unsigned aligment_fifo_empty
Definition: CSCSP_MEblock.h:30
unsigned int bxBit
Definition: CSCSP_MEblock.h:50
unsigned int spInput(void) const
Definition: CSCSP_MEblock.h:61
unsigned int sync_modified
Definition: CSCSP_MEblock.h:48
unsigned int vp(void) const
Definition: CSCSP_MEblock.h:81
unsigned int pattern(void) const
Definition: CSCSP_MEblock.h:69
unsigned clct_pattern_number
Definition: CSCSP_MEblock.h:7
unsigned bx0_
Definition: CSCSP_MEblock.h:15
unsigned int se(void) const
Definition: CSCSP_MEblock.h:82
unsigned aligment_fifo_full
Definition: CSCSP_MEblock.h:22
unsigned int timingError(void) const
Definition: CSCSP_MEblock.h:85
unsigned int sm(void) const
Definition: CSCSP_MEblock.h:83
unsigned csc_id
Definition: CSCSP_MEblock.h:13
unsigned left_right
Definition: CSCSP_MEblock.h:14
unsigned int errCnt(void) const
Definition: CSCSP_MEblock.h:78
unsigned zero_2
Definition: CSCSP_MEblock.h:17
unsigned int receiver_status_frame1(void) const
Definition: CSCSP_MEblock.h:75
unsigned int af(void) const
Definition: CSCSP_MEblock.h:84
unsigned int BXN(void) const
Definition: CSCSP_MEblock.h:57
unsigned int spInput_
Definition: CSCSP_MEblock.h:51
unsigned clct_pattern_id
Definition: CSCSP_MEblock.h:12
unsigned receiver_status_dv2
Definition: CSCSP_MEblock.h:29
unsigned receiver_status_dv1
Definition: CSCSP_MEblock.h:21
unsigned int sync_error
Definition: CSCSP_MEblock.h:47
unsigned int l_r(void) const
Definition: CSCSP_MEblock.h:66
unsigned receiver_status_er2
Definition: CSCSP_MEblock.h:28
unsigned bc0_
Definition: CSCSP_MEblock.h:16
unsigned receiver_status_er1
Definition: CSCSP_MEblock.h:20
CSCSP_MEblock(void)
Definition: CSCSP_MEblock.h:89
unsigned int alignment_fifo
Definition: CSCSP_MEblock.h:49
unsigned int csc(void) const
Definition: CSCSP_MEblock.h:64
unsigned int strip(void) const
Definition: CSCSP_MEblock.h:68
unsigned zero_1
Definition: CSCSP_MEblock.h:10
unsigned int bc0(void) const
Definition: CSCSP_MEblock.h:59
unsigned int tbin_
Definition: CSCSP_MEblock.h:45
unsigned int bx0(void) const
Definition: CSCSP_MEblock.h:58
unsigned int link(void) const
Definition: CSCSP_MEblock.h:62
unsigned quality_
Definition: CSCSP_MEblock.h:8
unsigned wire_group_id
Definition: CSCSP_MEblock.h:9
bool unpack(const unsigned short *&buf)
Definition: CSCSP_MEblock.h:87
unsigned mpc_id
Definition: CSCSP_MEblock.h:26
unsigned int quality(void) const
Definition: CSCSP_MEblock.h:56
unsigned err_prop_cnt
Definition: CSCSP_MEblock.h:27
unsigned int aligment_fifo(void) const
Definition: CSCSP_MEblock.h:72
unsigned int valid_pattern
Definition: CSCSP_MEblock.h:46
unsigned link_id
Definition: CSCSP_MEblock.h:25
unsigned int tbin(void) const
Definition: CSCSP_MEblock.h:80
unsigned zero_3
Definition: CSCSP_MEblock.h:23
bool check(void) const
Definition: CSCSP_MEblock.h:54
unsigned int receiver_status_frame2(void) const
Definition: CSCSP_MEblock.h:76