File indexing completed on 2024-04-06 12:10:21
0001 #ifndef EventFilter_CSCRawToDigi_CSCRawToDigi_CSCALCTHeader2006_h
0002 #define EventFilter_CSCRawToDigi_CSCRawToDigi_CSCALCTHeader2006_h
0003
0004 #include <vector>
0005 #include <cstring>
0006 #include <strings.h>
0007 #include "DataFormats/CSCDigi/interface/CSCALCTDigi.h"
0008 class CSCDMBHeader;
0009
0010
0011 struct CSCALCTHeader2006 {
0012 CSCALCTHeader2006() { init(); }
0013
0014 explicit CSCALCTHeader2006(int chamberType);
0015
0016 void setFromBuffer(unsigned short const* buf) { memcpy(this, buf, sizeInWords() * 2); }
0017
0018 void init() {
0019 bzero(this, sizeInWords() * 2);
0020 }
0021
0022 short unsigned int sizeInWords() const {
0023 return 4;
0024 }
0025
0026 unsigned short int BXNCount() const { return bxnCount; }
0027
0028 unsigned short nLCTChipRead() const;
0029
0030 void setEventInformation(const CSCDMBHeader&);
0031
0032 void setDAV(int afebBoard) { activeFEBs |= 1 << afebBoard; }
0033
0034
0035 unsigned l1Acc : 4;
0036
0037 unsigned cscID : 4;
0038
0039 unsigned boardID : 3;
0040
0041 unsigned flag_0 : 5;
0042
0043
0044 unsigned fifoMode : 2;
0045
0046 unsigned nTBins : 5;
0047
0048 unsigned l1aMatch : 1;
0049
0050 unsigned extTrig : 1;
0051
0052 unsigned promote1 : 1;
0053
0054 unsigned promote2 : 1;
0055
0056 unsigned reserved_1 : 3;
0057
0058 unsigned flag_1 : 2;
0059
0060
0061 unsigned bxnCount : 12;
0062
0063 unsigned reserved_2 : 2;
0064
0065 unsigned flag_2 : 2;
0066
0067
0068 unsigned lctChipRead : 7;
0069
0070 unsigned activeFEBs : 7;
0071
0072 unsigned flag_3 : 2;
0073 };
0074
0075 struct CSCALCTs2006 {
0076 CSCALCTs2006() {
0077 bzero(this, 8);
0078 }
0079
0080 void setFromBuffer(unsigned short const* buf) { memcpy(this, buf, sizeInWords() * 2); }
0081
0082 short unsigned int sizeInWords() const {
0083 return 4;
0084 }
0085
0086 std::vector<CSCALCTDigi> ALCTDigis() const;
0087
0088
0089 void add(const std::vector<CSCALCTDigi>& digis);
0090 void addALCT0(const CSCALCTDigi& digi);
0091 void addALCT1(const CSCALCTDigi& digi);
0092
0093
0094
0095 unsigned alct0_valid : 1;
0096 unsigned alct0_quality : 2;
0097 unsigned alct0_accel : 1;
0098 unsigned alct0_pattern : 1;
0099 unsigned alct0_key_wire : 7;
0100 unsigned alct0_bxn_low : 3;
0101
0102 unsigned flag_4 : 1;
0103
0104 unsigned alct0_bxn_high : 2;
0105 unsigned alct0_reserved : 13;
0106
0107 unsigned flag_5 : 1;
0108
0109
0110 unsigned alct1_valid : 1;
0111 unsigned alct1_quality : 2;
0112 unsigned alct1_accel : 1;
0113 unsigned alct1_pattern : 1;
0114 unsigned alct1_key_wire : 7;
0115 unsigned alct1_bxn_low : 3;
0116 unsigned flag_6 : 1;
0117
0118 unsigned alct1_bxn_high : 2;
0119 unsigned alct1_reserved : 13;
0120 unsigned flag_7 : 1;
0121 };
0122
0123 #endif