CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCSPRecord.h
Go to the documentation of this file.
1 #ifndef CSCSPRecord_h
2 #define CSCSPRecord_h
3 #include <vector>
4 
8 
9 class CSCSPRecord {
10 private:
11  // Data Block Header format
13  unsigned vp_bits : 15; // Valid Pattern bits for 15 ME LCTs
14  unsigned zero_1 : 1; // format specific
16  unsigned mode1 : 4; // First track mode (ids of stations, that give LCTs to build a track, mode=0 - no track)
17  unsigned mode2 : 4; // Second track mode (...)
18  unsigned mode3 : 4; // Third track mode (...)
19  unsigned vq_a : 1; // Valid Quality (Q > 0) bit for the first MB Stub;
20  unsigned vq_b : 1; // Valid Quality (Q > 0) bit for the second MB Stub;
21  unsigned spare_1 : 1; // not used
22  unsigned zero_2 : 1; // format specific
24  unsigned se_bits : 15; // Sync Error bits for 15 ME LCTs
25  unsigned zero_3 : 1; // format specific
27  unsigned sm_bits : 15; // Modified Sync Error bits for 15 ME LCTs: (SE) OR (Optical Link status) OR (Alignment FIFO status) OR (Bunch Crossing Counter status)
28  unsigned zero_4 : 1; // format specific
30  unsigned af_bits : 15; // Alignment FIFO status bits for 15 ME links, in normal state zero
31  unsigned zero_5 : 1; // format specific
33  unsigned bx_bits : 15; // set for LCT with BC0 commig early or later that the BC0 => monitors the ALCT/TMB/MPC timing
34  unsigned zero_6 : 1; // format specific
36  unsigned pt_low : 8; // low byte of pt for track, that we are spying at
37  unsigned pt_spy_point: 2; // defines track, that we are spying at
38  unsigned spare_2 : 1; // not used
39  unsigned spare_3 : 1; // not used
40  unsigned af_barrel_1 : 1;
41  unsigned af_barrel_2 : 1;
42  unsigned spare_4 : 1; // not used
43  unsigned zero_7 : 1; // format specific
45  unsigned pt_high : 8; // high byte of pt for track, that we are spying at
46  unsigned time_bin : 3;
47 
48 // unsigned spare_5 : 1; // not used
49 // unsigned spare_6 : 1; // not used
50 // unsigned spare_7 : 1; // not used
51 
52  unsigned spare_8 : 1; // not used
53  unsigned bx_barrel_1 : 1;
54  unsigned bx_barrel_2 : 1;
55  unsigned spare_9 : 1; // not used
56  unsigned zero_8 : 1; // format specific
57 
58  // persistent storage for specific data blocks
62  // data blocks, that were used (=true) in this record
63  bool meFilled[5][3], mbFilled[2], spFilled[3];
64  // Allow CSCSPEvent, front end to the data format, access 'sp' field dirrectly
65  friend class CSCSPEvent;
66  friend class CSCTFPacker;
67 
68 public:
69  bool check(void) const throw() {
70  return zero_1 !=0 || zero_2 !=0 || zero_3 !=0 || zero_4 !=0
71  || zero_5 !=0 || zero_6 !=0 || zero_7 !=0 || zero_8 !=0 // || spare_1!=0
72  || spare_2!=0 || spare_3!=0 || spare_4!=0 || spare_8!=0
73  || spare_9!=0;
74  }
75 
76  // Following functions return empty vector if no LCTs/MB_stubs/tracks are available
77  std::vector<CSCSP_MEblock> LCTs (void) const throw();
78  std::vector<CSCSP_MEblock> LCTs (unsigned int mpc) const throw();
79  std::vector<CSCSP_MEblock> LCT (unsigned int mpc, unsigned int link) const throw();
80  std::vector<CSCSP_SPblock> tracks (void) const throw();
81  std::vector<CSCSP_MBblock> mbStubs(void) const throw();
82 
83  unsigned int VPs(void) const throw() { return vp_bits|(vq_a<<15)|(vq_b<<16); }
84  unsigned int SEs(void) const throw() { return se_bits; }
85  unsigned int SMs(void) const throw() { return sm_bits; }
86  unsigned int AFs(void) const throw() { return af_bits|(af_barrel_1<<15)|(af_barrel_2<<16); }
87  unsigned int BXs(void) const throw() { return bx_bits|(bx_barrel_1<<15)|(bx_barrel_2<<16); }
88 
89  unsigned int ptSpy (void) const throw() { return (pt_high<<8)|pt_low; }
90  unsigned int ptSpyTrack(void) const throw() { return pt_spy_point; }
91 
92  bool unpack(const unsigned short* &buf, unsigned int nonmasked_data_blocks, bool empty_blocks_suppressed, unsigned int tbin) throw() ;
93 
94  CSCSPRecord(void){}
95 };
96 
97 #endif
unsigned bx_bits
Definition: CSCSPRecord.h:33
std::vector< CSCSP_MBblock > mbStubs(void) const
Definition: CSCSPRecord.cc:100
unsigned int ptSpyTrack(void) const
Definition: CSCSPRecord.h:90
unsigned int SEs(void) const
Definition: CSCSPRecord.h:84
unsigned spare_1
Definition: CSCSPRecord.h:21
unsigned zero_5
Definition: CSCSPRecord.h:31
bool meFilled[5][3]
Definition: CSCSPRecord.h:63
unsigned af_barrel_1
Definition: CSCSPRecord.h:40
std::vector< CSCSP_MEblock > LCT(unsigned int mpc, unsigned int link) const
Definition: CSCSPRecord.cc:85
unsigned zero_6
Definition: CSCSPRecord.h:34
unsigned int AFs(void) const
Definition: CSCSPRecord.h:86
unsigned bx_barrel_1
Definition: CSCSPRecord.h:53
CSCSP_SPblock sp[3]
Definition: CSCSPRecord.h:61
unsigned af_bits
Definition: CSCSPRecord.h:30
unsigned int VPs(void) const
Definition: CSCSPRecord.h:83
unsigned int ptSpy(void) const
Definition: CSCSPRecord.h:89
unsigned mode2
Definition: CSCSPRecord.h:17
unsigned pt_spy_point
Definition: CSCSPRecord.h:37
bool unpack(const unsigned short *&buf, unsigned int nonmasked_data_blocks, bool empty_blocks_suppressed, unsigned int tbin)
Definition: CSCSPRecord.cc:5
std::string link(std::string &nm, std::string &ns)
Definition: hierarchy.cc:47
unsigned zero_7
Definition: CSCSPRecord.h:43
unsigned spare_9
Definition: CSCSPRecord.h:55
std::vector< CSCSP_SPblock > tracks(void) const
Definition: CSCSPRecord.cc:92
unsigned zero_3
Definition: CSCSPRecord.h:25
bool spFilled[3]
Definition: CSCSPRecord.h:63
CSCSP_MEblock me[5][3]
Definition: CSCSPRecord.h:59
unsigned spare_2
Definition: CSCSPRecord.h:38
unsigned zero_2
Definition: CSCSPRecord.h:22
unsigned int SMs(void) const
Definition: CSCSPRecord.h:85
unsigned zero_1
Definition: CSCSPRecord.h:14
unsigned spare_4
Definition: CSCSPRecord.h:42
unsigned int BXs(void) const
Definition: CSCSPRecord.h:87
std::vector< CSCSP_MEblock > LCTs(void) const
Definition: CSCSPRecord.cc:69
bool mbFilled[2]
Definition: CSCSPRecord.h:63
unsigned mode3
Definition: CSCSPRecord.h:18
string const
Definition: compareJSON.py:14
unsigned time_bin
Definition: CSCSPRecord.h:46
unsigned mode1
Definition: CSCSPRecord.h:16
unsigned spare_8
Definition: CSCSPRecord.h:52
bool check(void) const
Definition: CSCSPRecord.h:69
unsigned vq_a
Definition: CSCSPRecord.h:19
CSCSPRecord(void)
Definition: CSCSPRecord.h:94
unsigned se_bits
Definition: CSCSPRecord.h:24
unsigned pt_low
Definition: CSCSPRecord.h:36
unsigned vq_b
Definition: CSCSPRecord.h:20
unsigned zero_4
Definition: CSCSPRecord.h:28
unsigned spare_3
Definition: CSCSPRecord.h:39
unsigned pt_high
Definition: CSCSPRecord.h:45
unsigned af_barrel_2
Definition: CSCSPRecord.h:41
unsigned zero_8
Definition: CSCSPRecord.h:56
unsigned bx_barrel_2
Definition: CSCSPRecord.h:54
unsigned sm_bits
Definition: CSCSPRecord.h:27
CSCSP_MBblock mb[2]
Definition: CSCSPRecord.h:60
unsigned vp_bits
Definition: CSCSPRecord.h:13