21 static std::atomic<bool> config_dumped{
false};
54 if (
infoV > 0 && !config_dumped) {
62 static std::atomic<bool> config_dumped{
false};
79 if (
infoV > 0 && !config_dumped) {
105 static std::atomic<bool> config_dumped{
false};
116 alctProc->setConfigParameters(conf);
117 clctProc->setConfigParameters(conf);
121 if (!config_dumped) {
123 config_dumped =
true;
134 edm::LogError(
"CSCMotherboard|SetupError") <<
"+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
150 unsigned alctBits =
alctProc->getHighMultiplictyBits();
155 int used_alct_mask[20];
156 for (
int a = 0;
a < 20; ++
a)
157 used_alct_mask[
a] = 0;
159 int bx_alct_matched = 0;
165 if (
clctProc->getBestCLCT(bx_clct).isValid()) {
174 bool is_matched =
false;
178 for (
int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++) {
184 if (
alctProc->getBestALCT(bx_alct).isValid()) {
186 LogTrace(
"CSCMotherboard") <<
"Successful CLCT-ALCT match: bx_clct = " << bx_clct <<
"; match window: ["
187 << bx_alct_start <<
"; " << bx_alct_stop <<
"]; bx_alct = " << bx_alct;
193 used_alct_mask[bx_alct] += 1;
195 bx_alct_matched = bx_alct;
203 LogTrace(
"CSCMotherboard") <<
"Unsuccessful CLCT-ALCT match (CLCT only): bx_clct = " << bx_clct
204 <<
" first ALCT " <<
clctProc->getBestCLCT(bx_clct) <<
"; match window: ["
205 << bx_alct_start <<
"; " << bx_alct_stop <<
"]";
219 if (bx_alct >= 0 && bx_alct > bx_alct_matched) {
222 LogTrace(
"CSCMotherboard") <<
"Unsuccessful CLCT-ALCT match (ALCT only): bx_alct = " << bx_alct;
235 int used_clct_mask[20];
236 for (
int a = 0;
a < 20; ++
a)
237 used_clct_mask[
a] = 0;
239 int bx_clct_matched = 0;
245 if (
alctProc->getBestALCT(bx_alct).isValid()) {
254 bool is_matched =
false;
258 for (
int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
264 if (
clctProc->getBestCLCT(bx_clct).isValid()) {
266 LogTrace(
"CSCMotherboard") <<
"Successful ALCT-CLCT match: bx_alct = " << bx_alct <<
"; match window: ["
267 << bx_clct_start <<
"; " << bx_clct_stop <<
"]; bx_clct = " << bx_clct;
273 used_clct_mask[bx_clct] += 1;
275 bx_clct_matched = bx_clct;
283 LogTrace(
"CSCMotherboard") <<
"Unsuccessful ALCT-CLCT match (ALCT only): bx_alct = " << bx_alct
284 <<
" first ALCT " <<
alctProc->getBestALCT(bx_alct) <<
"; match window: ["
285 << bx_clct_start <<
"; " << bx_clct_stop <<
"]";
300 if (bx_clct >= 0 && bx_clct > bx_clct_matched) {
303 LogTrace(
"CSCMotherboard") <<
"Unsuccessful ALCT-CLCT match (CLCT only): bx_clct = " << bx_clct;
330 std::vector<CSCCorrelatedLCTDigi> tmpV;
346 <<
"+++ early_tbins = " <<
early_tbins <<
"; in-time LCTs are not getting read-out!!! +++"
353 <<
"+++ Allowed range of time bins, [0-" << late_tbins <<
"] exceeds max allowed, "
355 <<
"+++ Set late_tbins to max allowed +++\n";
364 const std::vector<CSCCorrelatedLCTDigi>& all_lcts =
getLCTs();
365 for (
auto plct = all_lcts.begin(); plct != all_lcts.end(); plct++) {
366 if (!plct->isValid())
369 int bx = (*plct).getBX();
373 LogDebug(
"CSCMotherboard") <<
" Do not report correlated LCT on key halfstrip " << plct->getStrip()
374 <<
" and key wire " << plct->getKeyWG() <<
": found at bx " <<
bx
375 <<
", whereas the earliest allowed bx is " <<
early_tbins + 1;
380 if (
bx > late_tbins) {
382 LogDebug(
"CSCMotherboard") <<
" Do not report correlated LCT on key halfstrip " << plct->getStrip()
383 <<
" and key wire " << plct->getKeyWG() <<
": found at bx " <<
bx
384 <<
", whereas the latest allowed bx is " << late_tbins;
392 if (bx_readout == -1 ||
bx == bx_readout) {
393 tmpV.push_back(*plct);
394 if (bx_readout == -1)
400 tmpV.push_back(*plct);
407 std::vector<CSCCorrelatedLCTDigi> tmpV;
428 bool anodeBestValid = bestALCT.
isValid();
429 bool anodeSecondValid = secondALCT.
isValid();
430 bool cathodeBestValid = bestCLCT.
isValid();
431 bool cathodeSecondValid = secondCLCT.
isValid();
433 if (anodeBestValid && !anodeSecondValid)
434 secondALCT = bestALCT;
435 if (!anodeBestValid && anodeSecondValid)
436 bestALCT = secondALCT;
437 if (cathodeBestValid && !cathodeSecondValid)
438 secondCLCT = bestCLCT;
439 if (!cathodeBestValid && cathodeSecondValid)
440 bestCLCT = secondCLCT;
453 <<
"+++ Bx of first LCT candidate, " <<
bx <<
", is not within the allowed range, [0-"
458 if (((secondALCT != bestALCT) || (secondCLCT != bestCLCT)) &&
468 <<
"+++ Bx of second LCT candidate, " <<
bx <<
", is not within the allowed range, [0-"
515 const int kPatternBitWidth = 4;
518 unsigned int pattern = (
abs(ptn) & ((1 << kPatternBitWidth) - 1));
570 <<
"+++ findQuality: Unexpected CLCT pattern id = " <<
pattern <<
"+++\n";
583 static const unsigned int max_mpc_block_me1a = 1 << 1;
584 static const unsigned int max_alct_trig_enable = 1 << 1;
585 static const unsigned int max_clct_trig_enable = 1 << 1;
586 static const unsigned int max_match_trig_enable = 1 << 1;
587 static const unsigned int max_match_trig_window_size = 1 << 4;
588 static const unsigned int max_tmb_l1a_window_size = 1 << 4;
603 std::ostringstream strm;
605 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
606 strm <<
"+ TMB configuration parameters: +\n";
607 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
608 strm <<
" mpc_block_me1a [block/not block triggers which come from ME1/A] = " <<
mpc_block_me1a <<
"\n";
609 strm <<
" alct_trig_enable [allow ALCT-only triggers] = " <<
alct_trig_enable <<
"\n";
610 strm <<
" clct_trig_enable [allow CLCT-only triggers] = " <<
clct_trig_enable <<
"\n";
611 strm <<
" match_trig_enable [allow matched ALCT-CLCT triggers] = " <<
match_trig_enable <<
"\n";
612 strm <<
" match_trig_window_size [ALCT-CLCT match window width, in 25 ns] = " <<
match_trig_window_size <<
"\n";
613 strm <<
" tmb_l1a_window_size [L1Accept window width, in 25 ns bins] = " <<
tmb_l1a_window_size <<
"\n";
614 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
615 LogDebug(
"CSCMotherboard") << strm.str();