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;
24 bits.fifo_tbins_gem_ = 12;
25 bits.gem_enabled_fibers_ = 0xf;
32 bits.l1aNumber = dmbHeader.
l1a();
33 bits.bxnCount = dmbHeader.
bxn();
38 std::vector<CSCCLCTDigi>
result;
39 unsigned halfstrip =
bits.clct0_key_low + (
bits.clct0_key_high << 7);
40 unsigned strip = halfstrip % 32;
42 bool quartstrip = (
bits.clct0_xky >> 1) & 0
x1;
44 bool eighthstrip =
bits.clct0_xky & 0x1;
45 unsigned cfeb = halfstrip / 32;
48 unsigned run3_pattern =
bits.clct0_shape & 0x7;
49 unsigned bend =
bits.clct0_LR_bend;
63 bits.clct0_comparator_code,
70 halfstrip =
bits.clct1_key_low + (
bits.clct1_key_high << 7);
71 strip = halfstrip % 32;
73 quartstrip = (
bits.clct1_xky >> 1) & 0
x1;
75 eighthstrip =
bits.clct1_xky & 0x1;
76 cfeb = halfstrip / 32;
79 run3_pattern =
bits.clct1_shape & 0x7;
80 bend =
bits.clct1_LR_bend;
94 bits.clct1_comparator_code,
108 std::vector<CSCCorrelatedLCTDigi>
result;
110 unsigned strip =
bits.MPC_Muon0_clct_key_halfstrip;
111 unsigned slope = (
bits.MPC_Muon0_clct_bend_low & 0x7) | (
bits.MPC_Muon0_clct_bend_bit4 << 3);
112 unsigned hmt =
bits.MPC_Muon_HMT_bit0 | (
bits.MPC_Muon_HMT_high << 1);
113 unsigned clct_pattern_id =
bits.MPC_Muon_clct_pattern_low | (
bits.MPC_Muon_clct_pattern_bit5 << 4);
117 unsigned run3_pattern = run3_pattern_pair.second & 0x7;
120 bits.MPC_Muon0_lct_vpf,
121 bits.MPC_Muon0_lct_quality,
122 bits.MPC_Muon0_alct_key_wire,
125 bits.MPC_Muon0_clct_LR,
126 bits.MPC_Muon_alct_bxn,
128 bits.MPC_Muon0_clct_bx0,
132 bits.MPC_Muon0_clct_QuarterStrip,
133 bits.MPC_Muon0_clct_EighthStrip,
139 strip =
bits.MPC_Muon1_clct_key_halfstrip;
140 slope = (
bits.MPC_Muon1_clct_bend_low & 0x7) | (
bits.MPC_Muon1_clct_bend_bit4 << 3);
142 run3_pattern = run3_pattern_pair.first & 0x7;
145 bits.MPC_Muon1_lct_vpf,
146 bits.MPC_Muon1_lct_quality,
147 bits.MPC_Muon1_alct_key_wire,
150 bits.MPC_Muon1_clct_LR,
151 bits.MPC_Muon_alct_bxn,
153 bits.MPC_Muon1_clct_bx0,
157 bits.MPC_Muon1_clct_QuarterStrip,
158 bits.MPC_Muon1_clct_EighthStrip,
167 unsigned hmt_bits =
bits.MPC_Muon_HMT_bit0 | (
bits.MPC_Muon_HMT_high << 1);
186 throw cms::Exception(
"In CSC TMBHeaderFormat 2007, ALCTs belong in ALCT header");
190 throw cms::Exception(
"In CSC TMBHeaderFormat 2007, ALCTs belong in ALCT header");
200 bits.clct0_key_low = halfStrip & (0x7F);
202 bits.clct0_key_high = (halfStrip >> 7) & (0
x1);
218 bits.clct1_key_low = halfStrip & (0x7F);
220 bits.clct1_key_high = (halfStrip >> 7) & (0
x1);
233 bits.MPC_Muon0_clct_key_halfstrip = digi.
getStrip(2) & 0xFF;
240 bits.MPC_Muon_clct_pattern_low = run3_pattern & 0xF;
241 bits.MPC_Muon_clct_pattern_bit5 = (run3_pattern >> 4) & 0
x1;
246 bits.MPC_Muon_HMT_high = (digi.
getHMT() >> 1) & 0x7;
254 bits.MPC_Muon1_clct_key_halfstrip = digi.
getStrip(2) & 0xFF;
262 uint16_t clct_pattern_id =
bits.MPC_Muon_clct_pattern_low | (
bits.MPC_Muon_clct_pattern_bit5 << 4);
264 clct_pattern_id = (clct_pattern_id + (run3_pattern + 1) * 5) % 30;
265 bits.MPC_Muon_clct_pattern_low = clct_pattern_id & 0xF;
266 bits.MPC_Muon_clct_pattern_bit5 = (clct_pattern_id >> 4) & 0
x1;
272 bits.MPC_Muon_HMT_high = (digi.
getHMT() >> 1) & 0x7;
279 bits.MPC_Muon_HMT_bit0 = hmt_bits & 0x1;
280 bits.MPC_Muon_HMT_high = (hmt_bits >> 1) & 0x7;
285 bits.anode_hmt = hmt_bits;
290 bits.cathode_hmt = hmt_bits;
294 os <<
"...............(O)TMB2020 ME11 GEM/CCLUT/HMT Header.................." 296 os << std::hex <<
"BOC LINE " <<
bits.b0cline <<
" EOB " <<
bits.e0bline <<
"\n";
297 os << std::hex <<
"FW revision: 0x" <<
bits.firmRevCode <<
"\n";
298 os <<
std::dec <<
"fifoMode = " <<
bits.fifoMode <<
", nTBins = " <<
bits.nTBins <<
"\n";
299 os <<
"boardID = " <<
bits.boardID <<
", cscID = " <<
bits.cscID <<
"\n";
300 os <<
"l1aNumber = " <<
bits.l1aNumber <<
", bxnCount = " <<
bits.bxnCount <<
"\n";
301 os <<
"trigSourceVect = " <<
bits.trigSourceVect <<
", run3_trig_df = " <<
bits.run3_trig_df
302 <<
", gem_enable = " <<
bits.gem_enable <<
", gem_csc_bend_enable = " <<
bits.gem_csc_bend_enable
303 <<
", activeCFEBs = 0x" << std::hex << (
bits.activeCFEBs | (
bits.activeCFEBs_2 << 5)) <<
", readCFEBs = 0x" 304 << std::hex << (
bits.readCFEBs | (
bits.readCFEBs_2 << 5)) <<
std::dec <<
"\n";
305 os <<
"bxnPreTrigger = " <<
bits.bxnPreTrigger <<
"\n";
306 os <<
"tmbMatch = " <<
bits.tmbMatch <<
" alctOnly = " <<
bits.alctOnly <<
" clctOnly = " <<
bits.clctOnly <<
"\n";
308 os <<
"readoutCounter: " <<
std::dec <<
bits.readoutCounter <<
", buf_q_ovf: " <<
bits.stackOvf
309 <<
", sync_err: " <<
bits.syncError <<
", has_buf: " <<
bits.hasBuf <<
", buf_stalled: " <<
bits.bufFull <<
"\n";
310 os <<
"r_wr_buf_adr: 0x" << std::hex <<
bits.r_wr_buf_adr <<
", r_wr_buf_ready: " <<
bits.r_wr_buf_ready
311 <<
", wr_buf_ready: " <<
bits.wr_buf_ready <<
", buf_q_full: " <<
bits.buf_q_full
312 <<
", buf_q_empty: " <<
bits.buf_q_empty <<
",\nr_buf_fence_dist: 0x" <<
bits.r_buf_fence_dist
313 <<
", buf_q_ovf_err: " <<
bits.buf_q_ovf_err <<
", buf_q_udf_err: " <<
bits.buf_q_udf_err
314 <<
", buf_q_adr_err: " <<
bits.buf_q_adr_err <<
", buf_stalled: " <<
bits.buf_stalled <<
",\nbuf_fence_cnt: 0x" 315 <<
bits.buf_fence_cnt <<
", reverse_hs_csc: " <<
bits.reverse_hs_csc
316 <<
", reverse_hs_me1a: " <<
bits.reverse_hs_me1a <<
", reverse_hs_me1b: " <<
bits.reverse_hs_me1b <<
std::dec 318 os <<
"CLCT Words:\n" 319 <<
" bits.clct0_valid = " <<
bits.clct0_valid <<
" bits.clct0_shape = " <<
bits.clct0_shape
320 <<
" bits.clct0_quality = " <<
bits.clct0_quality
321 <<
" halfstrip = " << (
bits.clct0_key_low + (
bits.clct0_key_high << 7)) <<
"\n";
322 os <<
" bits.clct0_xky = " <<
bits.clct0_xky <<
" bits.clct0_comparator_code = " <<
bits.clct0_comparator_code
323 <<
" bits.clct0_LR_bend = " <<
bits.clct0_LR_bend <<
" bits.clct0_slope = " <<
bits.clct0_slope <<
"\n";
325 os <<
" bits.clct1_valid = " <<
bits.clct1_valid <<
" bits.clct1_shape = " <<
bits.clct1_shape
326 <<
" bits.clct1_quality = " <<
bits.clct1_quality
327 <<
" halfstrip = " << (
bits.clct1_key_low + (
bits.clct1_key_high << 7)) <<
"\n";
328 os <<
" bits.clct1_xky = " <<
bits.clct1_xky <<
" bits.clct1_comparator_code = " <<
bits.clct1_comparator_code
329 <<
" bits.clct1_LR_bend = " <<
bits.clct1_LR_bend <<
" bits.clct1_slope = " <<
bits.clct1_slope <<
"\n";
332 <<
" LCT0 valid = " <<
bits.MPC_Muon0_lct_vpf <<
" key WG = " <<
bits.MPC_Muon0_alct_key_wire
333 <<
" key halfstrip = " <<
bits.MPC_Muon0_clct_key_halfstrip
334 <<
" 1/4strip flag = " <<
bits.MPC_Muon0_clct_QuarterStrip
335 <<
" 1/8strip flag = " <<
bits.MPC_Muon0_clct_EighthStrip <<
"\n" 336 <<
" quality = " <<
bits.MPC_Muon0_lct_quality
337 <<
" slope/bend = " << ((
bits.MPC_Muon0_clct_bend_low & 0x7) | (
bits.MPC_Muon0_clct_bend_bit4 << 3))
338 <<
" L/R bend = " <<
bits.MPC_Muon0_clct_LR <<
"\n";
340 os <<
" LCT1 valid = " <<
bits.MPC_Muon1_lct_vpf <<
" key WG = " <<
bits.MPC_Muon1_alct_key_wire
341 <<
" key halfstrip = " <<
bits.MPC_Muon1_clct_key_halfstrip
342 <<
" 1/4strip flag = " <<
bits.MPC_Muon1_clct_QuarterStrip
343 <<
" 1/8strip flag = " <<
bits.MPC_Muon1_clct_EighthStrip <<
"\n" 344 <<
" quality = " <<
bits.MPC_Muon1_lct_quality
345 <<
" slope/bend = " << ((
bits.MPC_Muon1_clct_bend_low & 0x7) | (
bits.MPC_Muon1_clct_bend_bit4 << 3))
346 <<
" L/R bend = " <<
bits.MPC_Muon1_clct_LR <<
"\n";
348 os <<
" clct_5bit_pattern_id = " << (
bits.MPC_Muon_clct_pattern_low | (
bits.MPC_Muon_clct_pattern_bit5 << 4))
349 <<
" HMT = " << (
bits.MPC_Muon_HMT_bit0 | (
bits.MPC_Muon_HMT_high << 1)) <<
", alctHMT = " <<
bits.anode_hmt
350 <<
", clctHMT = " <<
bits.cathode_hmt <<
"\n";
356 <<
" gem_zero_suppress = " <<
gem_zero_suppress() <<
" gem_csc_bend_enable = " <<
bits.gem_csc_bend_enable
357 <<
" gem_sync_dataword = 0x" << std::hex <<
gem_sync_dataword() <<
" gem_timing_dataword = 0x" << std::hex
359 os <<
" gem num_copad: " <<
bits.num_copad <<
", gem_delay: " <<
bits.gem_delay
360 <<
", gem_clct_win: " <<
bits.gem_clct_win <<
", alct_gem_win: " <<
bits.alct_gem_win <<
"\n";
static const double slope[3]
uint16_t getQuality() const
return quality of a pattern (number of layers hit!)
uint16_t getKeyStrip(const uint16_t n=2) const
bool getEighthStripBit() const
get single eighth strip bit
uint16_t bitsOutOfTime() const
int16_t getCompCode() const
bool getQuartStripBit() const
get single quart strip bit
uint16_t getFullBX() const
return 12-bit full BX.
bool isValid() const
check CLCT validity (1 - valid CLCT)
uint16_t getBX() const
return BX
uint16_t bitsInTime() const
uint16_t getSlope() const
return the slope
uint16_t getRun3Pattern() const
return pattern