File indexing completed on 2024-04-06 12:10:29
0001 #ifndef CSCSPRecord_h
0002 #define CSCSPRecord_h
0003 #include <vector>
0004
0005 #include "EventFilter/CSCTFRawToDigi/src/CSCSP_MEblock.h"
0006 #include "EventFilter/CSCTFRawToDigi/src/CSCSP_MBblock.h"
0007 #include "EventFilter/CSCTFRawToDigi/src/CSCSP_SPblock.h"
0008
0009 class CSCSPRecord {
0010 private:
0011
0012
0013 unsigned vp_bits : 15;
0014 unsigned zero_1 : 1;
0015
0016 unsigned mode1 : 4;
0017 unsigned mode2 : 4;
0018 unsigned mode3 : 4;
0019 unsigned vq_a : 1;
0020 unsigned vq_b : 1;
0021 unsigned spare_1 : 1;
0022 unsigned zero_2 : 1;
0023
0024 unsigned se_bits : 15;
0025 unsigned zero_3 : 1;
0026
0027
0028 unsigned sm_bits : 15;
0029 unsigned zero_4 : 1;
0030
0031 unsigned af_bits : 15;
0032 unsigned zero_5 : 1;
0033
0034 unsigned bx_bits : 15;
0035 unsigned zero_6 : 1;
0036
0037 unsigned pt_low : 8;
0038 unsigned pt_spy_point : 2;
0039 unsigned spare_2 : 1;
0040 unsigned spare_3 : 1;
0041 unsigned af_barrel_1 : 1;
0042 unsigned af_barrel_2 : 1;
0043 unsigned spare_4 : 1;
0044 unsigned zero_7 : 1;
0045
0046 unsigned pt_high : 8;
0047 unsigned time_bin : 3;
0048
0049
0050
0051
0052
0053 unsigned spare_8 : 1;
0054 unsigned bx_barrel_1 : 1;
0055 unsigned bx_barrel_2 : 1;
0056 unsigned spare_9 : 1;
0057 unsigned zero_8 : 1;
0058
0059
0060 CSCSP_MEblock me[5][3];
0061 CSCSP_MBblock mb[2];
0062 CSCSP_SPblock sp[3];
0063
0064 bool meFilled[5][3], mbFilled[2], spFilled[3];
0065
0066 friend class CSCSPEvent;
0067 friend class CSCTFPacker;
0068
0069 public:
0070 bool check(void) const throw() {
0071 return zero_1 != 0 || zero_2 != 0 || zero_3 != 0 || zero_4 != 0 || zero_5 != 0 || zero_6 != 0 || zero_7 != 0 ||
0072 zero_8 != 0
0073 || spare_2 != 0 || spare_3 != 0 || spare_4 != 0 || spare_8 != 0 || spare_9 != 0;
0074 }
0075
0076
0077 std::vector<CSCSP_MEblock> LCTs(void) const throw();
0078 std::vector<CSCSP_MEblock> LCTs(unsigned int mpc) const throw();
0079 std::vector<CSCSP_MEblock> LCT(unsigned int mpc, unsigned int link) const throw();
0080 std::vector<CSCSP_SPblock> tracks(void) const throw();
0081 std::vector<CSCSP_MBblock> mbStubs(void) const throw();
0082
0083 unsigned int VPs(void) const throw() { return vp_bits | (vq_a << 15) | (vq_b << 16); }
0084 unsigned int SEs(void) const throw() { return se_bits; }
0085 unsigned int SMs(void) const throw() { return sm_bits; }
0086 unsigned int AFs(void) const throw() { return af_bits | (af_barrel_1 << 15) | (af_barrel_2 << 16); }
0087 unsigned int BXs(void) const throw() { return bx_bits | (bx_barrel_1 << 15) | (bx_barrel_2 << 16); }
0088
0089 unsigned int ptSpy(void) const throw() { return (pt_high << 8) | pt_low; }
0090 unsigned int ptSpyTrack(void) const throw() { return pt_spy_point; }
0091
0092 bool unpack(const unsigned short*& buf,
0093 unsigned int nonmasked_data_blocks,
0094 bool empty_blocks_suppressed,
0095 unsigned int tbin) throw();
0096
0097 CSCSPRecord(void) {}
0098 };
0099
0100 #endif