25 edm::LogError(
"CSCMotherboardME11|SetupError") <<
"+++ TMB constructed while runPhase2_ is not set! +++\n";
28 edm::LogError(
"CSCMotherboardME11|SetupError") <<
"+++ TMB constructed while runME11Up_ is not set! +++\n";
30 cscTmbLUT_ = std::make_unique<CSCMotherboardLUTME11>();
38 edm::LogError(
"CSCMotherboardME11|SetupError") <<
"+++ TMB constructed while runPhase2_ is not set! +++\n";
41 edm::LogError(
"CSCMotherboardME11|SetupError") <<
"+++ TMB constructed while runME11Up_ is not set! +++\n";
60 edm::LogError(
"CSCMotherboardME11|SetupError") <<
"+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
75 unsigned alctBits =
alctProc->getHighMultiplictyBits();
78 int used_alct_mask[20];
79 int used_clct_mask[20];
80 for (
int b = 0;
b < 20;
b++)
81 used_alct_mask[
b] = used_clct_mask[
b] = 0;
86 if (
clctProc->getBestCLCT(bx_clct).isValid()) {
87 bool is_matched =
false;
90 for (
int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++) {
95 if (
alctProc->getBestALCT(bx_alct).isValid()) {
98 <<
"Successful CLCT-ALCT match in ME11: bx_clct = " << bx_clct <<
"; match window: [" << bx_alct_start
99 <<
"; " << bx_alct_stop <<
"]; bx_alct = " << bx_alct;
100 int mbx = bx_alct_stop - bx_alct;
107 if (
allLCTs(bx_alct, mbx, 0).isValid()) {
108 used_alct_mask[bx_alct] += 1;
117 LogTrace(
"CSCMotherboard") <<
"Unsuccessful ALCT-CLCT match (CLCT only): bx_clct = " << bx_clct
118 <<
" first CLCT " <<
clctProc->getBestCLCT(bx_clct) <<
"; match window: ["
119 << bx_alct_start <<
"; " << bx_alct_stop <<
"]";
127 if (
alctProc->getBestALCT(bx_alct).isValid()) {
132 bool is_matched =
false;
133 for (
int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
138 if (
clctProc->getBestCLCT(bx_clct).isValid()) {
141 <<
"Successful ALCT-CLCT match in ME11: bx_alct = " << bx_alct <<
"; match window: [" << bx_clct_start
142 <<
"; " << bx_clct_stop <<
"]; bx_clct = " << bx_clct;
143 int mbx = bx_clct - bx_clct_start;
150 if (
allLCTs(bx_alct, mbx, 0).isValid()) {
152 used_clct_mask[bx_clct] += 1;
160 LogTrace(
"CSCMotherboard") <<
"Unsuccessful ALCT-CLCT match (ALCT only): bx_alct = " << bx_alct
161 <<
" first ALCT " <<
alctProc->getBestALCT(bx_alct) <<
"; match window: ["
162 << bx_clct_start <<
"; " << bx_clct_stop <<
"]";
172 unsigned int nlct = 0;
173 unsigned int nbx = 0;
181 LogDebug(
"CSCMotherboardME11") <<
"LCT" <<
i + 1 <<
" " <<
bx <<
"/"
189 if (
infoV > 0 && nlct > 0)
190 LogDebug(
"CSCMotherboardME11") <<
"bx " <<
bx <<
" nLCT: " << nlct <<
" total mbx with LCTs " << nbx;
211 LogDebug(
"CSCMotherboardME11") <<
"After x-bx sorting:";
218 LogDebug(
"CSCMotherboardME11") <<
"LCT" <<
i + 1 <<
" " <<
bx <<
"/"
223 if (
infoV > 0 && nlct > 0)
224 LogDebug(
"CSCMotherboardME11") <<
"bx " <<
bx <<
" nnLCT: " << nlct;
237 std::vector<CSCCorrelatedLCTDigi> tmpV;
252 std::vector<CSCCorrelatedLCTDigi> all_lcts;
257 std::vector<CSCCorrelatedLCTDigi>::const_iterator plct = all_lcts.begin();
258 for (; plct != all_lcts.end(); plct++) {
259 if (!plct->isValid())
262 int bx = (*plct).getBX();
275 tmpV.push_back(*plct);
276 if (bx_readout == -1)
279 tmpV.push_back(*plct);
284 for (
const auto& lct : tmpV) {
293 std::vector<CSCCorrelatedLCTDigi> tmpV;
310 std::vector<CSCCorrelatedLCTDigi> tmpV;
346 const bool anodeBestValid = bestALCT.
isValid();
347 const bool anodeSecondValid = secondALCT.
isValid();
348 const bool cathodeBestValid = bestCLCT.
isValid();
349 const bool cathodeSecondValid = secondCLCT.
isValid();
350 if (anodeBestValid and !anodeSecondValid)
351 secondALCT = bestALCT;
352 if (!anodeBestValid and anodeSecondValid)
353 bestALCT = secondALCT;
354 if (cathodeBestValid and !cathodeSecondValid)
355 secondCLCT = bestCLCT;
356 if (!cathodeBestValid and cathodeSecondValid)
357 bestCLCT = secondCLCT;
364 if (((secondALCT != bestALCT)
or (secondCLCT != bestCLCT)) and
371 if (secondALCT == bestALCT)
373 if (secondCLCT == bestCLCT)
380 const int code = (ok11 << 3) | (ok12 << 2) | (ok21 << 1) | (ok22);
384 LogTrace(
"CSCMotherboardME11") <<
"debug correlateLCTs in ME11 " <<
cscId_ << std::endl
385 <<
"ALCT1: " << bestALCT << std::endl
386 <<
"ALCT2: " << secondALCT << std::endl
387 <<
"CLCT1: " << bestCLCT << std::endl
388 <<
"CLCT2: " << secondCLCT << std::endl
389 <<
"ok 11 12 21 22 code = " << ok11 <<
" " << ok12 <<
" " << ok21 <<
" " << ok22
390 <<
" " << code << std::endl;
418 LogTrace(
"CSCMotherboardME11") <<
"lut 0 1 = " << lut[code][0] <<
" " << lut[code][1] << std::endl;
420 switch (lut[code][0]) {
438 LogTrace(
"CSCMotherboardME11") <<
"lct1: " << lct1 << std::endl;
440 switch (lut[code][1]) {
444 LogTrace(
"CSCMotherboardME11") <<
"lct2: " << lct2 << std::endl;
449 LogTrace(
"CSCMotherboardME11") <<
"lct2: " << lct2 << std::endl;
454 LogTrace(
"CSCMotherboardME11") <<
"lct2: " << lct2 << std::endl;
460 LogTrace(
"CSCMotherboardME11") <<
"out of correlateLCTsME11" << std::endl;