23 edm::LogError(
"CSCMotherboardME11|SetupError") <<
"+++ TMB constructed while isSLHC_ is not set! +++\n";
26 edm::LogError(
"CSCMotherboardME11|SetupError") <<
"+++ TMB constructed while runME11Up_ is not set! +++\n";
36 edm::LogError(
"CSCMotherboardME11|SetupError") <<
"+++ TMB constructed while isSLHC_ is not set! +++\n";
39 edm::LogError(
"CSCMotherboardME11|SetupError") <<
"+++ TMB constructed while runME11Up_ is not set! +++\n";
58 edm::LogError(
"CSCMotherboardME11|SetupError") <<
"+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
73 unsigned alctBits =
alctProc->getHighMultiplictyBits();
76 int used_alct_mask[20];
77 int used_clct_mask[20];
78 for (
int b = 0;
b < 20;
b++)
79 used_alct_mask[
b] = used_clct_mask[
b] = 0;
84 if (
clctProc->getBestCLCT(bx_clct).isValid()) {
85 bool is_matched =
false;
88 for (
int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++) {
93 if (
alctProc->getBestALCT(bx_alct).isValid()) {
96 <<
"Successful CLCT-ALCT match in ME11: bx_clct = " << bx_clct <<
"; match window: [" << bx_alct_start
97 <<
"; " << bx_alct_stop <<
"]; bx_alct = " << bx_alct;
98 int mbx = bx_alct_stop - bx_alct;
105 if (
allLCTs(bx_alct, mbx, 0).isValid()) {
106 used_alct_mask[bx_alct] += 1;
115 LogTrace(
"CSCMotherboard") <<
"Unsuccessful ALCT-CLCT match (CLCT only): bx_clct = " << bx_clct
116 <<
" first CLCT " <<
clctProc->getBestCLCT(bx_clct) <<
"; match window: ["
117 << bx_alct_start <<
"; " << bx_alct_stop <<
"]";
125 if (
alctProc->getBestALCT(bx_alct).isValid()) {
130 bool is_matched =
false;
131 for (
int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
136 if (
clctProc->getBestCLCT(bx_clct).isValid()) {
139 <<
"Successful ALCT-CLCT match in ME11: bx_alct = " << bx_alct <<
"; match window: [" << bx_clct_start
140 <<
"; " << bx_clct_stop <<
"]; bx_clct = " << bx_clct;
141 int mbx = bx_clct - bx_clct_start;
148 if (
allLCTs(bx_alct, mbx, 0).isValid()) {
150 used_clct_mask[bx_clct] += 1;
158 LogTrace(
"CSCMotherboard") <<
"Unsuccessful ALCT-CLCT match (ALCT only): bx_alct = " << bx_alct
159 <<
" first ALCT " <<
alctProc->getBestALCT(bx_alct) <<
"; match window: ["
160 << bx_clct_start <<
"; " << bx_clct_stop <<
"]";
170 unsigned int nlct = 0;
171 unsigned int nbx = 0;
179 LogDebug(
"CSCMotherboardME11") <<
"LCT" <<
i + 1 <<
" " <<
bx <<
"/"
187 if (
infoV > 0 && nlct > 0)
188 LogDebug(
"CSCMotherboardME11") <<
"bx " <<
bx <<
" nLCT: " << nlct <<
" total mbx with LCTs " << nbx;
209 LogDebug(
"CSCMotherboardME11") <<
"After x-bx sorting:";
216 LogDebug(
"CSCMotherboardME11") <<
"LCT" <<
i + 1 <<
" " <<
bx <<
"/"
221 if (
infoV > 0 && nlct > 0)
222 LogDebug(
"CSCMotherboardME11") <<
"bx " <<
bx <<
" nnLCT: " << nlct;
235 std::vector<CSCCorrelatedLCTDigi> tmpV;
250 std::vector<CSCCorrelatedLCTDigi> all_lcts;
255 std::vector<CSCCorrelatedLCTDigi>::const_iterator plct = all_lcts.begin();
256 for (; plct != all_lcts.end(); plct++) {
257 if (!plct->isValid())
260 int bx = (*plct).getBX();
273 tmpV.push_back(*plct);
274 if (bx_readout == -1)
277 tmpV.push_back(*plct);
281 for (
const auto& lct : tmpV) {
290 std::vector<CSCCorrelatedLCTDigi> tmpV;
307 std::vector<CSCCorrelatedLCTDigi> tmpV;
343 const bool anodeBestValid = bestALCT.
isValid();
344 const bool anodeSecondValid = secondALCT.
isValid();
345 const bool cathodeBestValid = bestCLCT.
isValid();
346 const bool cathodeSecondValid = secondCLCT.
isValid();
347 if (anodeBestValid and !anodeSecondValid)
348 secondALCT = bestALCT;
349 if (!anodeBestValid and anodeSecondValid)
350 bestALCT = secondALCT;
351 if (cathodeBestValid and !cathodeSecondValid)
352 secondCLCT = bestCLCT;
353 if (!cathodeBestValid and cathodeSecondValid)
354 bestCLCT = secondCLCT;
361 if (((secondALCT != bestALCT)
or (secondCLCT != bestCLCT)) and
368 if (secondALCT == bestALCT)
370 if (secondCLCT == bestCLCT)
377 const int code = (ok11 << 3) | (ok12 << 2) | (ok21 << 1) | (ok22);
381 LogTrace(
"CSCMotherboardME11") <<
"debug correlateLCTs in ME11 " <<
cscId_ << std::endl
382 <<
"ALCT1: " << bestALCT << std::endl
383 <<
"ALCT2: " << secondALCT << std::endl
384 <<
"CLCT1: " << bestCLCT << std::endl
385 <<
"CLCT2: " << secondCLCT << std::endl
386 <<
"ok 11 12 21 22 code = " << ok11 <<
" " << ok12 <<
" " << ok21 <<
" " << ok22
387 <<
" " << code << std::endl;
415 LogTrace(
"CSCMotherboardME11") <<
"lut 0 1 = " << lut[code][0] <<
" " << lut[code][1] << std::endl;
417 switch (lut[code][0]) {
435 LogTrace(
"CSCMotherboardME11") <<
"lct1: " << lct1 << std::endl;
437 switch (lut[code][1]) {
441 LogTrace(
"CSCMotherboardME11") <<
"lct2: " << lct2 << std::endl;
446 LogTrace(
"CSCMotherboardME11") <<
"lct2: " << lct2 << std::endl;
451 LogTrace(
"CSCMotherboardME11") <<
"lct2: " << lct2 << std::endl;
457 LogTrace(
"CSCMotherboardME11") <<
"out of correlateLCTsME11" << std::endl;