22 static std::atomic<bool> config_dumped{
false};
55 if (
infoV > 0 && !config_dumped) {
66 static std::atomic<bool> config_dumped{
false};
70 alctProc = std::make_unique<CSCAnodeLCTProcessor>();
71 clctProc = std::make_unique<CSCCathodeLCTProcessor>();
83 if (
infoV > 0 && !config_dumped) {
109 static std::atomic<bool> config_dumped{
false};
120 alctProc->setConfigParameters(conf);
121 clctProc->setConfigParameters(conf);
125 if (!config_dumped) {
127 config_dumped =
true;
137 edm::LogError(
"CSCMotherboard|SetupError") <<
"+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
153 unsigned alctBits =
alctProc->getHighMultiplictyBits();
158 int used_alct_mask[20];
159 for (
int a = 0;
a < 20; ++
a)
160 used_alct_mask[
a] = 0;
162 int bx_alct_matched = 0;
168 if (
clctProc->getBestCLCT(bx_clct).isValid()) {
177 bool is_matched =
false;
181 for (
int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++) {
187 if (
alctProc->getBestALCT(bx_alct).isValid()) {
189 LogTrace(
"CSCMotherboard") <<
"Successful CLCT-ALCT match: bx_clct = " << bx_clct <<
"; match window: ["
190 << bx_alct_start <<
"; " << bx_alct_stop <<
"]; bx_alct = " << bx_alct;
196 used_alct_mask[bx_alct] += 1;
198 bx_alct_matched = bx_alct;
206 LogTrace(
"CSCMotherboard") <<
"Unsuccessful CLCT-ALCT match (CLCT only): bx_clct = " << bx_clct
207 <<
" first ALCT " <<
clctProc->getBestCLCT(bx_clct) <<
"; match window: ["
208 << bx_alct_start <<
"; " << bx_alct_stop <<
"]";
222 if (bx_alct >= 0 && bx_alct > bx_alct_matched) {
225 LogTrace(
"CSCMotherboard") <<
"Unsuccessful CLCT-ALCT match (ALCT only): bx_alct = " << bx_alct;
238 int used_clct_mask[20];
239 for (
int a = 0;
a < 20; ++
a)
240 used_clct_mask[
a] = 0;
242 int bx_clct_matched = 0;
248 if (
alctProc->getBestALCT(bx_alct).isValid()) {
257 bool is_matched =
false;
261 for (
int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
267 if (
clctProc->getBestCLCT(bx_clct).isValid()) {
269 LogTrace(
"CSCMotherboard") <<
"Successful ALCT-CLCT match: bx_alct = " << bx_alct <<
"; match window: ["
270 << bx_clct_start <<
"; " << bx_clct_stop <<
"]; bx_clct = " << bx_clct;
276 used_clct_mask[bx_clct] += 1;
278 bx_clct_matched = bx_clct;
286 LogTrace(
"CSCMotherboard") <<
"Unsuccessful ALCT-CLCT match (ALCT only): bx_alct = " << bx_alct
287 <<
" first ALCT " <<
alctProc->getBestALCT(bx_alct) <<
"; match window: ["
288 << bx_clct_start <<
"; " << bx_clct_stop <<
"]";
303 if (bx_clct >= 0 && bx_clct > bx_clct_matched) {
306 LogTrace(
"CSCMotherboard") <<
"Unsuccessful ALCT-CLCT match (CLCT only): bx_clct = " << bx_clct;
333 std::vector<CSCCorrelatedLCTDigi> tmpV;
349 <<
"+++ early_tbins = " <<
early_tbins <<
"; in-time LCTs are not getting read-out!!! +++"
356 <<
"+++ Allowed range of time bins, [0-" << late_tbins <<
"] exceeds max allowed, "
358 <<
"+++ Set late_tbins to max allowed +++\n";
367 const std::vector<CSCCorrelatedLCTDigi>& all_lcts =
getLCTs();
368 for (
auto plct = all_lcts.begin(); plct != all_lcts.end(); plct++) {
369 if (!plct->isValid())
372 int bx = (*plct).getBX();
376 LogDebug(
"CSCMotherboard") <<
" Do not report correlated LCT on key halfstrip " << plct->getStrip()
377 <<
" and key wire " << plct->getKeyWG() <<
": found at bx " <<
bx
378 <<
", whereas the earliest allowed bx is " <<
early_tbins + 1;
383 if (
bx > late_tbins) {
385 LogDebug(
"CSCMotherboard") <<
" Do not report correlated LCT on key halfstrip " << plct->getStrip()
386 <<
" and key wire " << plct->getKeyWG() <<
": found at bx " <<
bx
387 <<
", whereas the latest allowed bx is " << late_tbins;
395 if (bx_readout == -1 ||
bx == bx_readout) {
396 tmpV.push_back(*plct);
397 if (bx_readout == -1)
403 tmpV.push_back(*plct);
408 for (
const auto& lct : tmpV) {
417 std::vector<CSCCorrelatedLCTDigi> tmpV;
438 bool anodeBestValid = bestALCT.
isValid();
439 bool anodeSecondValid = secondALCT.
isValid();
440 bool cathodeBestValid = bestCLCT.
isValid();
441 bool cathodeSecondValid = secondCLCT.
isValid();
443 if (anodeBestValid && !anodeSecondValid)
444 secondALCT = bestALCT;
445 if (!anodeBestValid && anodeSecondValid)
446 bestALCT = secondALCT;
447 if (cathodeBestValid && !cathodeSecondValid)
448 secondCLCT = bestCLCT;
449 if (!cathodeBestValid && cathodeSecondValid)
450 bestCLCT = secondCLCT;
463 <<
"+++ Bx of first LCT candidate, " <<
bx <<
", is not within the allowed range, [0-"
468 if (((secondALCT != bestALCT) || (secondCLCT != bestCLCT)) &&
478 <<
"+++ Bx of second LCT candidate, " <<
bx <<
", is not within the allowed range, [0-"
508 unsigned int syncErr = 0;
526 thisLCT.setRun3(
true);
541 const int kPatternBitWidth = 4;
544 unsigned int pattern = (
abs(ptn) & ((1 << kPatternBitWidth) - 1));
662 static const unsigned int max_mpc_block_me1a = 1 << 1;
663 static const unsigned int max_alct_trig_enable = 1 << 1;
664 static const unsigned int max_clct_trig_enable = 1 << 1;
665 static const unsigned int max_match_trig_enable = 1 << 1;
666 static const unsigned int max_match_trig_window_size = 1 << 4;
667 static const unsigned int max_tmb_l1a_window_size = 1 << 4;
682 std::ostringstream strm;
684 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
685 strm <<
"+ TMB configuration parameters: +\n";
686 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
687 strm <<
" mpc_block_me1a [block/not block triggers which come from ME1/A] = " <<
mpc_block_me1a <<
"\n";
688 strm <<
" alct_trig_enable [allow ALCT-only triggers] = " <<
alct_trig_enable <<
"\n";
689 strm <<
" clct_trig_enable [allow CLCT-only triggers] = " <<
clct_trig_enable <<
"\n";
690 strm <<
" match_trig_enable [allow matched ALCT-CLCT triggers] = " <<
match_trig_enable <<
"\n";
691 strm <<
" match_trig_window_size [ALCT-CLCT match window width, in 25 ns] = " <<
match_trig_window_size <<
"\n";
692 strm <<
" tmb_l1a_window_size [L1Accept window width, in 25 ns bins] = " <<
tmb_l1a_window_size <<
"\n";
693 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
694 LogDebug(
"CSCMotherboard") << strm.str();