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 = 0x401;
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) & 0
x1;
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) & 0
x1;
71 eighthstrip =
bits.clct1_xky & 0x1;
72 cfeb = halfstrip / 32;
75 run3_pattern =
bits.clct1_shape & 0x7;
76 bend =
bits.clct1_LR_bend;
90 bits.clct1_comparator_code,
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,
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,
163 unsigned hmt_bits =
bits.MPC_Muon_HMT_bit0 | (
bits.MPC_Muon_HMT_high << 1);
182 throw cms::Exception(
"In CSC TMBHeaderFormat 2007, ALCTs belong in ALCT header");
186 throw cms::Exception(
"In CSC TMBHeaderFormat 2007, ALCTs belong in ALCT header");
196 bits.clct0_key_low = halfStrip & (0x7F);
198 bits.clct0_key_high = (halfStrip >> 7) & (0
x1);
214 bits.clct1_key_low = halfStrip & (0x7F);
216 bits.clct1_key_high = (halfStrip >> 7) & (0
x1);
229 bits.MPC_Muon0_clct_key_halfstrip = digi.
getStrip(2) & 0xFF;
236 bits.MPC_Muon_clct_pattern_low = run3_pattern & 0xF;
237 bits.MPC_Muon_clct_pattern_bit5 = (run3_pattern >> 4) & 0
x1;
242 bits.MPC_Muon_HMT_high = (digi.
getHMT() >> 1) & 0x7;
250 bits.MPC_Muon1_clct_key_halfstrip = digi.
getStrip(2) & 0xFF;
258 uint16_t clct_pattern_id =
bits.MPC_Muon_clct_pattern_low | (
bits.MPC_Muon_clct_pattern_bit5 << 4);
260 clct_pattern_id = (clct_pattern_id + (run3_pattern + 1) * 5) % 30;
261 bits.MPC_Muon_clct_pattern_low = clct_pattern_id & 0xF;
262 bits.MPC_Muon_clct_pattern_bit5 = (clct_pattern_id >> 4) & 0
x1;
268 bits.MPC_Muon_HMT_high = (digi.
getHMT() >> 1) & 0x7;
275 bits.MPC_Muon_HMT_bit0 = hmt_bits & 0x1;
276 bits.MPC_Muon_HMT_high = (hmt_bits >> 1) & 0x7;
281 bits.anode_hmt = hmt_bits;
286 bits.cathode_hmt = hmt_bits;
290 os <<
"...............(O)TMB2020 CCLUT/HMT Header.................." 292 os << std::hex <<
"BOC LINE " <<
bits.b0cline <<
" EOB " <<
bits.e0bline <<
"\n";
293 os << std::hex <<
"FW revision: 0x" <<
bits.firmRevCode <<
"\n";
294 os <<
std::dec <<
"fifoMode = " <<
bits.fifoMode <<
", nTBins = " <<
bits.nTBins <<
"\n";
295 os <<
"boardID = " <<
bits.boardID <<
", cscID = " <<
bits.cscID <<
"\n";
296 os <<
"l1aNumber = " <<
bits.l1aNumber <<
", bxnCount = " <<
bits.bxnCount <<
"\n";
297 os <<
"trigSourceVect = " <<
bits.trigSourceVect <<
", run3_trig_df = " <<
bits.run3_trig_df <<
", activeCFEBs = 0x" 298 << std::hex << (
bits.activeCFEBs | (
bits.activeCFEBs_2 << 5)) <<
", readCFEBs = 0x" << std::hex
300 os <<
"bxnPreTrigger = " <<
bits.bxnPreTrigger <<
"\n";
301 os <<
"tmbMatch = " <<
bits.tmbMatch <<
" alctOnly = " <<
bits.alctOnly <<
" clctOnly = " <<
bits.clctOnly <<
"\n";
303 os <<
"readoutCounter: " <<
std::dec <<
bits.readoutCounter <<
", buf_q_ovf: " <<
bits.stackOvf
304 <<
", sync_err: " <<
bits.syncError <<
", has_buf: " <<
bits.hasBuf <<
", buf_stalled: " <<
bits.bufFull <<
"\n";
305 os <<
"r_wr_buf_adr: 0x" << std::hex <<
bits.r_wr_buf_adr <<
", r_wr_buf_ready: " <<
bits.r_wr_buf_ready
306 <<
", wr_buf_ready: " <<
bits.wr_buf_ready <<
", buf_q_full: " <<
bits.buf_q_full
307 <<
", buf_q_empty: " <<
bits.buf_q_empty <<
",\nr_buf_fence_dist: 0x" <<
bits.r_buf_fence_dist
308 <<
", buf_q_ovf_err: " <<
bits.buf_q_ovf_err <<
", buf_q_udf_err: " <<
bits.buf_q_udf_err
309 <<
", buf_q_adr_err: " <<
bits.buf_q_adr_err <<
", buf_stalled: " <<
bits.buf_stalled <<
",\nbuf_fence_cnt: 0x" 310 <<
bits.buf_fence_cnt <<
", reverse_hs_csc: " <<
bits.reverse_hs_csc
311 <<
", reverse_hs_me1a: " <<
bits.reverse_hs_me1a <<
", reverse_hs_me1b: " <<
bits.reverse_hs_me1b <<
"\n";
312 os <<
"CLCT Words:\n" 313 <<
" bits.clct0_valid = " <<
bits.clct0_valid <<
" bits.clct0_shape = " <<
bits.clct0_shape
314 <<
" bits.clct0_quality = " <<
bits.clct0_quality
315 <<
" halfstrip = " << (
bits.clct0_key_low + (
bits.clct0_key_high << 7)) <<
"\n";
316 os <<
" bits.clct0_xky = " <<
bits.clct0_xky <<
" bits.clct0_comparator_code = " <<
bits.clct0_comparator_code
317 <<
" bits.clct0_LR_bend = " <<
bits.clct0_LR_bend <<
" bits.clct0_slope = " <<
bits.clct0_slope <<
"\n";
319 os <<
" bits.clct1_valid = " <<
bits.clct1_valid <<
" bits.clct1_shape = " <<
bits.clct1_shape
320 <<
" bits.clct1_quality = " <<
bits.clct1_quality
321 <<
" halfstrip = " << (
bits.clct1_key_low + (
bits.clct1_key_high << 7)) <<
"\n";
322 os <<
" bits.clct1_xky = " <<
bits.clct1_xky <<
" bits.clct1_comparator_code = " <<
bits.clct1_comparator_code
323 <<
" bits.clct1_LR_bend = " <<
bits.clct1_LR_bend <<
" bits.clct1_slope = " <<
bits.clct1_slope <<
"\n";
326 <<
" LCT0 valid = " <<
bits.MPC_Muon0_lct_vpf <<
" key WG = " <<
bits.MPC_Muon0_alct_key_wire
327 <<
" key halfstrip = " <<
bits.MPC_Muon0_clct_key_halfstrip
328 <<
" 1/4strip flag = " <<
bits.MPC_Muon0_clct_QuarterStrip
329 <<
" 1/8strip flag = " <<
bits.MPC_Muon0_clct_EighthStrip <<
"\n" 330 <<
" quality = " <<
bits.MPC_Muon0_lct_quality
331 <<
" slope/bend = " << ((
bits.MPC_Muon0_clct_bend_low & 0x7) | (
bits.MPC_Muon0_clct_bend_bit4 << 3))
332 <<
" L/R bend = " <<
bits.MPC_Muon0_clct_LR <<
"\n";
334 os <<
" LCT1 valid = " <<
bits.MPC_Muon1_lct_vpf <<
" key WG = " <<
bits.MPC_Muon1_alct_key_wire
335 <<
" key halfstrip = " <<
bits.MPC_Muon1_clct_key_halfstrip
336 <<
" 1/4strip flag = " <<
bits.MPC_Muon1_clct_QuarterStrip
337 <<
" 1/8strip flag = " <<
bits.MPC_Muon1_clct_EighthStrip <<
"\n" 338 <<
" quality = " <<
bits.MPC_Muon1_lct_quality
339 <<
" slope/bend = " << ((
bits.MPC_Muon1_clct_bend_low & 0x7) | (
bits.MPC_Muon1_clct_bend_bit4 << 3))
340 <<
" L/R bend = " <<
bits.MPC_Muon1_clct_LR <<
"\n";
342 os <<
" clct_5bit_pattern_id = " << (
bits.MPC_Muon_clct_pattern_low | (
bits.MPC_Muon_clct_pattern_bit5 << 4))
343 <<
" HMT = " << (
bits.MPC_Muon_HMT_bit0 | (
bits.MPC_Muon_HMT_high << 1)) <<
", alctHMT = " <<
bits.anode_hmt
344 <<
", clctHMT = " <<
bits.cathode_hmt <<
"\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