5 const std::vector<std::pair<unsigned, unsigned> >
6 run3_pattern_lookup_tbl = {{0, 0}, {0, 1}, {0, 2}, {0, 3}, {0, 4},
7 {0, 0}, {0, 1}, {0, 2}, {0, 3}, {0, 4}, {1, 0}, {1, 1}, {1, 2}, {1, 3},
8 {1, 4}, {2, 0}, {2, 1}, {2, 2}, {2, 3}, {2, 4}, {3, 0}, {3, 1}, {3, 2},
9 {3, 3}, {3, 4}, {4, 0}, {4, 1}, {4, 2}, {4, 3}, {4, 4}};
11 const unsigned run2_pattern_lookup_tbl[2][16] = {{10, 10, 10, 8, 8, 8, 6, 6, 6, 4, 4, 4, 2, 2, 2, 2},
12 {10, 10, 10, 9, 9, 9, 7, 7, 7, 5, 5, 5, 3, 3, 3, 3}};
16 bits.nHeaderFrames = 42;
17 bits.e0bline = 0x6E0B;
18 bits.b0cline = 0xDB0C;
19 bits.firmRevCode = 0x601;
28 bits.l1aNumber = dmbHeader.
l1a();
29 bits.bxnCount = dmbHeader.
bxn();
34 std::vector<CSCCLCTDigi>
result;
35 unsigned halfstrip =
bits.clct0_key_low + (
bits.clct0_key_high << 7);
36 unsigned strip = halfstrip % 32;
38 bool quartstrip = (
bits.clct0_xky >> 1) & 0x1;
40 bool eighthstrip =
bits.clct0_xky & 0x1;
41 unsigned cfeb = halfstrip / 32;
44 unsigned run3_pattern =
bits.clct0_shape & 0x7;
45 unsigned bend =
bits.clct0_LR_bend;
59 bits.clct0_comparator_code,
66 halfstrip =
bits.clct1_key_low + (
bits.clct1_key_high << 7);
67 strip = halfstrip % 32;
69 quartstrip = (
bits.clct1_xky >> 1) & 0x1;
71 eighthstrip =
bits.clct1_xky & 0x1;
72 cfeb = halfstrip / 32;
75 run3_pattern =
bits.clct1_shape & 0x7;
76 bend =
bits.clct1_LR_bend;
77 slope =
bits.clct1_slope;
90 bits.clct1_comparator_code,
97 result.push_back(digi0);
98 result.push_back(digi1);
104 std::vector<CSCCorrelatedLCTDigi>
result;
106 unsigned strip =
bits.MPC_Muon0_clct_key_halfstrip;
107 unsigned slope = (
bits.MPC_Muon0_clct_bend_low & 0x7) | (
bits.MPC_Muon0_clct_bend_bit4 << 3);
108 unsigned hmt =
bits.MPC_Muon_HMT_bit0 | (
bits.MPC_Muon_HMT_high << 1);
109 unsigned clct_pattern_id =
bits.MPC_Muon_clct_pattern_low | (
bits.MPC_Muon_clct_pattern_bit5 << 4);
113 unsigned run3_pattern = run3_pattern_pair.second & 0x7;
116 bits.MPC_Muon0_lct_vpf,
117 bits.MPC_Muon0_lct_quality,
118 bits.MPC_Muon0_alct_key_wire,
121 bits.MPC_Muon0_clct_LR,
122 bits.MPC_Muon_alct_bxn,
124 bits.MPC_Muon0_clct_bx0,
128 bits.MPC_Muon0_clct_QuarterStrip,
129 bits.MPC_Muon0_clct_EighthStrip,
133 result.push_back(digi);
135 strip =
bits.MPC_Muon1_clct_key_halfstrip;
136 slope = (
bits.MPC_Muon1_clct_bend_low & 0x7) | (
bits.MPC_Muon1_clct_bend_bit4 << 3);
138 run3_pattern = run3_pattern_pair.first & 0x7;
141 bits.MPC_Muon1_lct_vpf,
142 bits.MPC_Muon1_lct_quality,
143 bits.MPC_Muon1_alct_key_wire,
146 bits.MPC_Muon1_clct_LR,
147 bits.MPC_Muon_alct_bxn,
149 bits.MPC_Muon1_clct_bx0,
153 bits.MPC_Muon1_clct_QuarterStrip,
154 bits.MPC_Muon1_clct_EighthStrip,
158 result.push_back(digi);
163 unsigned hmt_bits =
bits.MPC_Muon_HMT_bit0 | (
bits.MPC_Muon_HMT_high << 1);
170 throw cms::Exception(
"In CSC TMBHeaderFormat 2007, ALCTs belong in ALCT header");
174 throw cms::Exception(
"In CSC TMBHeaderFormat 2007, ALCTs belong in ALCT header");
182 bits.clct0_shape = pattern;
184 bits.clct0_key_low = halfStrip & (0x7F);
186 bits.clct0_key_high = (halfStrip >> 7) & (0x1);
200 bits.clct1_shape = pattern;
202 bits.clct1_key_low = halfStrip & (0x7F);
204 bits.clct1_key_high = (halfStrip >> 7) & (0x1);
217 bits.MPC_Muon0_clct_key_halfstrip = digi.
getStrip(2) & 0xFF;
224 bits.MPC_Muon_clct_pattern_low = run3_pattern & 0xF;
225 bits.MPC_Muon_clct_pattern_bit5 = (run3_pattern >> 4) & 0x1;
227 bits.MPC_Muon0_clct_bend_bit4 = (digi.
getSlope() >> 3) & 0x1;
230 bits.MPC_Muon_HMT_high = (digi.
getHMT() >> 1) & 0x7;
238 bits.MPC_Muon1_clct_key_halfstrip = digi.
getStrip(2) & 0xFF;
246 uint16_t clct_pattern_id =
bits.MPC_Muon_clct_pattern_low | (
bits.MPC_Muon_clct_pattern_bit5 << 4);
248 clct_pattern_id = (clct_pattern_id + (run3_pattern + 1) * 5) % 30;
249 bits.MPC_Muon_clct_pattern_low = clct_pattern_id & 0xF;
250 bits.MPC_Muon_clct_pattern_bit5 = (clct_pattern_id >> 4) & 0x1;
253 bits.MPC_Muon1_clct_bend_bit4 = (digi.
getSlope() >> 3) & 0x1;
256 bits.MPC_Muon_HMT_high = (digi.
getHMT() >> 1) & 0x7;
263 bits.MPC_Muon_HMT_bit0 = hmt_bits & 0x1;
264 bits.MPC_Muon_HMT_high = (hmt_bits >> 1) & 0x7;
268 os <<
"...............(O)TMB2020 ME11 GEM/CCLUT/HMT Header.................."
270 os << std::hex <<
"BOC LINE " <<
bits.b0cline <<
" EOB " <<
bits.e0bline <<
"\n";
271 os << std::hex <<
"FW revision: 0x" <<
bits.firmRevCode <<
"\n";
272 os <<
std::dec <<
"fifoMode = " <<
bits.fifoMode <<
", nTBins = " <<
bits.nTBins <<
"\n";
273 os <<
"boardID = " <<
bits.boardID <<
", cscID = " <<
bits.cscID <<
"\n";
274 os <<
"l1aNumber = " <<
bits.l1aNumber <<
", bxnCount = " <<
bits.bxnCount <<
"\n";
275 os <<
"trigSourceVect = " <<
bits.trigSourceVect <<
", run3_trig_df = " <<
bits.run3_trig_df
276 <<
", gem_enable = " <<
bits.gem_enable <<
", gem_csc_bend_enable = " <<
bits.gem_csc_bend_enable
277 <<
", activeCFEBs = 0x" << std::hex << (
bits.activeCFEBs | (
bits.activeCFEBs_2 << 5)) <<
", readCFEBs = 0x"
278 << std::hex << (
bits.readCFEBs | (
bits.readCFEBs_2 << 5)) <<
std::dec <<
"\n";
279 os <<
"bxnPreTrigger = " <<
bits.bxnPreTrigger <<
"\n";
280 os <<
"tmbMatch = " <<
bits.tmbMatch <<
" alctOnly = " <<
bits.alctOnly <<
" clctOnly = " <<
bits.clctOnly <<
"\n";
282 os <<
"readoutCounter: " <<
std::dec <<
bits.readoutCounter <<
", buf_q_ovf: " <<
bits.stackOvf
283 <<
", sync_err: " <<
bits.syncError <<
", has_buf: " <<
bits.hasBuf <<
", buf_stalled: " <<
bits.bufFull <<
"\n";
284 os <<
"r_wr_buf_adr: 0x" << std::hex <<
bits.r_wr_buf_adr <<
", r_wr_buf_ready: " <<
bits.r_wr_buf_ready
285 <<
", wr_buf_ready: " <<
bits.wr_buf_ready <<
", buf_q_full: " <<
bits.buf_q_full
286 <<
", buf_q_empty: " <<
bits.buf_q_empty <<
",\nr_buf_fence_dist: 0x" <<
bits.r_buf_fence_dist
287 <<
", buf_q_ovf_err: " <<
bits.buf_q_ovf_err <<
", buf_q_udf_err: " <<
bits.buf_q_udf_err
288 <<
", buf_q_adr_err: " <<
bits.buf_q_adr_err <<
", buf_stalled: " <<
bits.buf_stalled <<
",\nbuf_fence_cnt: 0x"
289 <<
bits.buf_fence_cnt <<
", reverse_hs_csc: " <<
bits.reverse_hs_csc
290 <<
", reverse_hs_me1a: " <<
bits.reverse_hs_me1a <<
", reverse_hs_me1b: " <<
bits.reverse_hs_me1b <<
std::dec
292 os <<
"CLCT Words:\n"
293 <<
" bits.clct0_valid = " <<
bits.clct0_valid <<
" bits.clct0_shape = " <<
bits.clct0_shape
294 <<
" bits.clct0_quality = " <<
bits.clct0_quality
295 <<
" halfstrip = " << (
bits.clct0_key_low + (
bits.clct0_key_high << 7)) <<
"\n";
296 os <<
" bits.clct0_xky = " <<
bits.clct0_xky <<
" bits.clct0_comparator_code = " <<
bits.clct0_comparator_code
297 <<
" bits.clct0_LR_bend = " <<
bits.clct0_LR_bend <<
" bits.clct0_slope = " <<
bits.clct0_slope <<
"\n";
299 os <<
" bits.clct1_valid = " <<
bits.clct1_valid <<
" bits.clct1_shape = " <<
bits.clct1_shape
300 <<
" bits.clct1_quality = " <<
bits.clct1_quality
301 <<
" halfstrip = " << (
bits.clct1_key_low + (
bits.clct1_key_high << 7)) <<
"\n";
302 os <<
" bits.clct1_xky = " <<
bits.clct1_xky <<
" bits.clct1_comparator_code = " <<
bits.clct1_comparator_code
303 <<
" bits.clct1_LR_bend = " <<
bits.clct1_LR_bend <<
" bits.clct1_slope = " <<
bits.clct1_slope <<
"\n";
306 <<
" LCT0 valid = " <<
bits.MPC_Muon0_lct_vpf <<
" key WG = " <<
bits.MPC_Muon0_alct_key_wire
307 <<
" key halfstrip = " <<
bits.MPC_Muon0_clct_key_halfstrip
308 <<
" 1/4strip flag = " <<
bits.MPC_Muon0_clct_QuarterStrip
309 <<
" 1/8strip flag = " <<
bits.MPC_Muon0_clct_EighthStrip <<
"\n"
310 <<
" quality = " <<
bits.MPC_Muon0_lct_quality
311 <<
" slope/bend = " << ((
bits.MPC_Muon0_clct_bend_low & 0x7) | (
bits.MPC_Muon0_clct_bend_bit4 << 3))
312 <<
" L/R bend = " <<
bits.MPC_Muon0_clct_LR <<
"\n";
314 os <<
" LCT1 valid = " <<
bits.MPC_Muon1_lct_vpf <<
" key WG = " <<
bits.MPC_Muon1_alct_key_wire
315 <<
" key halfstrip = " <<
bits.MPC_Muon1_clct_key_halfstrip
316 <<
" 1/4strip flag = " <<
bits.MPC_Muon1_clct_QuarterStrip
317 <<
" 1/8strip flag = " <<
bits.MPC_Muon1_clct_EighthStrip <<
"\n"
318 <<
" quality = " <<
bits.MPC_Muon1_lct_quality
319 <<
" slope/bend = " << ((
bits.MPC_Muon1_clct_bend_low & 0x7) | (
bits.MPC_Muon1_clct_bend_bit4 << 3))
320 <<
" L/R bend = " <<
bits.MPC_Muon1_clct_LR <<
"\n";
322 os <<
" clct_5bit_pattern_id = " << (
bits.MPC_Muon_clct_pattern_low | (
bits.MPC_Muon_clct_pattern_bit5 << 4))
323 <<
" HMT = " << (
bits.MPC_Muon_HMT_bit0 | (
bits.MPC_Muon_HMT_high << 1)) <<
"\n";
329 <<
" gem_zero_suppress = " <<
gem_zero_suppress() <<
" gem_csc_bend_enable = " <<
bits.gem_csc_bend_enable
330 <<
" gem_sync_dataword = 0x" << std::hex <<
gem_sync_dataword() <<
" gem_timing_dataword = 0x" << std::hex
332 os <<
" gem num_copad: " <<
bits.num_copad <<
", gem_delay: " <<
bits.gem_delay
333 <<
", gem_clct_win: " <<
bits.gem_clct_win <<
", alct_gem_win: " <<
bits.alct_gem_win <<
"\n";
uint16_t getRun3Pattern() const
return pattern
uint16_t getFullBX() const
return 12-bit full BX.
uint16_t getBX() const
return BX
static const double slope[3]
uint16_t getKeyStrip(const uint16_t n=2) const
uint16_t bitsInTime() const
bool getEighthStripBit() const
get single eighth strip bit
bool isValid() const
check CLCT validity (1 - valid CLCT)
uint16_t bitsOutOfTime() const
uint16_t getSlope() const
return the slope
uint16_t getQuality() const
return quality of a pattern (number of layers hit!)
int16_t getCompCode() const
bool getQuartStripBit() const
get single quart strip bit