CMS 3D CMS Logo

CSCTMBHeader2006.cc
Go to the documentation of this file.
4 
6  bzero(data(), sizeInWords() * 2);
7  bits.nHeaderFrames = 26;
8  bits.e0bline = 0x6E0B;
9  bits.b0cline = 0x6B0C;
10  bits.nTBins = 7;
11  bits.nCFEBs = 5;
12 }
13 
14 CSCTMBHeader2006::CSCTMBHeader2006(const unsigned short* buf) { memcpy(&bits, buf, sizeInWords() * 2); }
15 
17  bits.cscID = dmbHeader.dmbID();
18  bits.l1aNumber = dmbHeader.l1a();
19  // bits.bxnCount = dmbHeader.bxn();
20 }
21 
23 std::vector<CSCCLCTDigi> CSCTMBHeader2006::CLCTDigis(uint32_t idlayer) {
24  std::vector<CSCCLCTDigi> result;
27  int shape = 0;
28  int type = 0;
29 
30  if (bits.firmRevCode < 3769) { //3769 is may 25 2007 - date of firmware with halfstrip only patterns
31  shape = bits.clct0_shape;
32  type = bits.clct0_strip_type;
33  } else { //new firmware only halfstrip pattern => stripType==1 and shape is 4 bits
34  shape = (bits.clct0_strip_type << 3) + bits.clct0_shape;
35  type = 1;
36  }
37  int strip = bits.clct0_key;
38  int cfeb = (bits.clct0_cfeb_low) | (bits.clct0_cfeb_high << 1);
39  int bend = bits.clct0_bend;
40  //offlineStripNumbering(strip, cfeb, shape, bend);
41 
42  CSCCLCTDigi digi0(
43  bits.clct0_valid, bits.clct0_quality, shape, type, bend, strip, cfeb, bits.clct0_bxn, 1, bits.bxnPreTrigger);
44  result.push_back(digi0);
45 
47  if (bits.firmRevCode < 3769) {
48  shape = bits.clct1_shape;
49  type = bits.clct1_strip_type;
50  } else {
51  shape = (bits.clct1_strip_type << 3) + bits.clct1_shape;
52  type = 1;
53  }
54 
55  strip = bits.clct1_key;
56  cfeb = (bits.clct1_cfeb_low) | (bits.clct1_cfeb_high << 1);
57  bend = bits.clct1_bend;
58  //offlineStripNumbering(strip, cfeb, shape, bend);
59  CSCCLCTDigi digi1(
60  bits.clct1_valid, bits.clct1_quality, shape, type, bend, strip, cfeb, bits.clct1_bxn, 2, bits.bxnPreTrigger);
61  result.push_back(digi1);
62  return result;
63 }
64 
66 std::vector<CSCCorrelatedLCTDigi> CSCTMBHeader2006::CorrelatedLCTDigis(uint32_t idlayer) const {
67  std::vector<CSCCorrelatedLCTDigi> result;
69  int strip = bits.MPC_Muon0_halfstrip_clct_pattern; //this goes from 0-159
70  //offlineHalfStripNumbering(strip);
71  CSCCorrelatedLCTDigi digi(1,
72  bits.MPC_Muon0_vpf_,
73  bits.MPC_Muon0_quality_,
74  bits.MPC_Muon0_wire_,
75  strip,
76  bits.MPC_Muon0_clct_pattern_,
77  bits.MPC_Muon0_bend_,
78  bits.MPC_Muon0_bx_,
79  0,
80  bits.MPC_Muon0_bc0_,
81  bits.MPC_Muon0_SyncErr_,
82  bits.MPC_Muon0_cscid_low | (bits.MPC_Muon0_cscid_bit4 << 3));
83  result.push_back(digi);
85  strip = bits.MPC_Muon1_halfstrip_clct_pattern; //this goes from 0-159
86  //offlineHalfStripNumbering(strip);
87  digi = CSCCorrelatedLCTDigi(2,
88  bits.MPC_Muon1_vpf_,
89  bits.MPC_Muon1_quality_,
90  bits.MPC_Muon1_wire_,
91  strip,
92  bits.MPC_Muon1_clct_pattern_,
93  bits.MPC_Muon1_bend_,
94  bits.MPC_Muon1_bx_,
95  0,
96  bits.MPC_Muon1_bc0_,
97  bits.MPC_Muon1_SyncErr_,
98  bits.MPC_Muon1_cscid_low | (bits.MPC_Muon1_cscid_bit4 << 3));
99  result.push_back(digi);
100  return result;
101 }
102 
104  throw cms::Exception("In CSC TMBHeaderFormat 2006, ALCTs belong in ALCT header");
105 }
106 
108  throw cms::Exception("In CSC TMBHeaderFormat 2006, ALCTs belong in ALCT header");
109 }
110 
112  int strip = digi.getStrip();
113  int cfeb = digi.getCFEB();
114  int bend = digi.getBend();
115  int pattern = digi.getPattern();
116  //hardwareStripNumbering(strip, cfeb, pattern, bend);
117  bits.clct0_valid = digi.isValid();
118  bits.clct0_quality = digi.getQuality();
119  bits.clct0_shape = pattern;
120  bits.clct0_strip_type = digi.getStripType();
121  bits.clct0_bend = bend;
122  bits.clct0_key = strip;
123  bits.clct0_cfeb_low = (cfeb & 0x1);
124  bits.clct0_cfeb_high = (cfeb >> 1);
125  bits.clct0_bxn = digi.getBX();
126  bits.bxnPreTrigger = digi.getFullBX();
127 }
128 
130  int strip = digi.getStrip();
131  int cfeb = digi.getCFEB();
132  int bend = digi.getBend();
133  int pattern = digi.getPattern();
134  //hardwareStripNumbering(strip, cfeb, pattern, bend);
135  bits.clct1_valid = digi.isValid();
136  bits.clct1_quality = digi.getQuality();
137  bits.clct1_shape = pattern;
138  bits.clct1_strip_type = digi.getStripType();
139  bits.clct1_bend = bend;
140  bits.clct1_key = strip;
141  bits.clct1_cfeb_low = (cfeb & 0x1);
142  bits.clct1_cfeb_high = (cfeb >> 1);
143  bits.clct1_bxn = digi.getBX();
144  bits.bxnPreTrigger = digi.getFullBX();
145 }
146 
148  int halfStrip = digi.getStrip();
149  //hardwareHalfStripNumbering(halfStrip);
150 
151  bits.MPC_Muon0_vpf_ = digi.isValid();
152  bits.MPC_Muon0_wire_ = digi.getKeyWG();
153  bits.MPC_Muon0_clct_pattern_ = digi.getPattern();
154  bits.MPC_Muon0_quality_ = digi.getQuality();
155  bits.MPC_Muon0_halfstrip_clct_pattern = halfStrip;
156  bits.MPC_Muon0_bend_ = digi.getBend();
157  bits.MPC_Muon0_SyncErr_ = digi.getSyncErr();
158  bits.MPC_Muon0_bx_ = digi.getBX();
159  bits.MPC_Muon0_bc0_ = digi.getBX0();
160  bits.MPC_Muon0_cscid_low = digi.getCSCID() & 0x7;
161  bits.MPC_Muon0_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1;
162 }
163 
165  int halfStrip = digi.getStrip();
166  //hardwareHalfStripNumbering(halfStrip);
167 
168  bits.MPC_Muon1_vpf_ = digi.isValid();
169  bits.MPC_Muon1_wire_ = digi.getKeyWG();
170  bits.MPC_Muon1_clct_pattern_ = digi.getPattern();
171  bits.MPC_Muon1_quality_ = digi.getQuality();
172  bits.MPC_Muon1_halfstrip_clct_pattern = halfStrip;
173  bits.MPC_Muon1_bend_ = digi.getBend();
174  bits.MPC_Muon1_SyncErr_ = digi.getSyncErr();
175  bits.MPC_Muon1_bx_ = digi.getBX();
176  bits.MPC_Muon1_bc0_ = digi.getBX0();
177  bits.MPC_Muon1_cscid_low = digi.getCSCID() & 0x7;
178  bits.MPC_Muon0_cscid_bit4 = (digi.getCSCID() >> 3) & 0x1;
179 }
180 
181 void CSCTMBHeader2006::print(std::ostream& os) const {
182  os << "...............TMB Header.................."
183  << "\n";
184  os << std::hex << "BOC LINE " << bits.b0cline << " EOB " << bits.e0bline << "\n";
185  os << std::dec << "fifoMode = " << bits.fifoMode << ", nTBins = " << bits.nTBins << "\n";
186  os << "dumpCFEBs = " << bits.dumpCFEBs << ", nHeaderFrames = " << bits.nHeaderFrames << "\n";
187  os << "boardID = " << bits.boardID << ", cscID = " << bits.cscID << "\n";
188  os << "l1aNumber = " << bits.l1aNumber << ", bxnCount = " << bits.bxnCount << "\n";
189  os << "preTrigTBins = " << bits.preTrigTBins << ", nCFEBs = " << bits.nCFEBs << "\n";
190  os << "trigSourceVect = " << bits.trigSourceVect << ", activeCFEBs = " << bits.activeCFEBs << "\n";
191  os << "bxnPreTrigger = " << bits.bxnPreTrigger << "\n";
192  os << "tmbMatch = " << bits.tmbMatch << " alctOnly = " << bits.alctOnly << " clctOnly = " << bits.clctOnly
193  << " alctMatchTime = " << bits.alctMatchTime << "\n";
194  os << "hs_thresh = " << bits.hs_thresh << ", ds_thresh = " << bits.ds_thresh << "\n";
195  os << ".clct0_key = " << bits.clct0_key << " clct0_shape = " << bits.clct0_shape
196  << " clct0_quality = " << bits.clct0_quality << "\n";
197  os << "r_buf_nbusy = " << bits.r_buf_nbusy << "\n";
198  os << "Firmware Rev code " << bits.firmRevCode << "\n";
199  os << "..................CLCT....................." << std::endl;
200 }
void addALCT0(const CSCALCTDigi &digi) override
uint16_t getPattern() const
return the Run-2 pattern ID
uint16_t getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTDigi.h:56
struct CSCTMBHeader2006::@489 bits
uint16_t getStrip() const
return halfstrip that goes from 0 to 31 in a (D)CFEB
Definition: CSCCLCTDigi.h:99
uint16_t getFullBX() const
return 12-bit full BX.
Definition: CSCCLCTDigi.h:165
uint16_t getBX() const
return BX
uint16_t getBend() const
Definition: CSCCLCTDigi.h:93
bool isValid() const
return valid pattern bit
void addCorrelatedLCT1(const CSCCorrelatedLCTDigi &digi) override
uint16_t getStripType() const
return striptype
Definition: CSCCLCTDigi.h:85
void addCLCT0(const CSCCLCTDigi &digi) override
for data packing
void setEventInformation(const CSCDMBHeader &dmbHeader) override
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:50
unsigned l1a() const
Definition: CSCDMBHeader.h:39
uint16_t getSyncErr() const
uint16_t getQuality() const
return the Quality
unsigned dmbID() const
Definition: CSCDMBHeader.h:36
uint16_t getStrip(uint16_t n=2) const
return the key halfstrip from 0,159
uint16_t getCFEB() const
return Key CFEB ID
Definition: CSCCLCTDigi.h:117
uint16_t getBX() const
return BX
Definition: CSCCLCTDigi.h:123
uint16_t getPattern() const
return pattern
Definition: CSCCLCTDigi.h:62
uint16_t getKeyWG() const
return the key wire group. counts from 0.
std::vector< CSCCorrelatedLCTDigi > CorrelatedLCTDigis(uint32_t idlayer) const override
returns CorrelatedLCT digis
void print(std::ostream &os) const override
void addCLCT1(const CSCCLCTDigi &digi) override
void addCorrelatedLCT0(const CSCCorrelatedLCTDigi &digi) override
std::vector< CSCCLCTDigi > CLCTDigis(uint32_t idlayer) override
returns CLCT digis
unsigned short * data() override
returns the first data word
void addALCT1(const CSCALCTDigi &digi) override
unsigned short int sizeInWords() const override