13 unsigned sector,
unsigned subsector,
16 CSCBaseboard(endcap, station, sector, subsector, chamber, conf)
20 static std::atomic<bool> config_dumped{
false};
50 if (infoV > 0 && !config_dumped) {
60 static std::atomic<bool> config_dumped{
false};
77 if (
infoV > 0 && !config_dumped) {
103 static std::atomic<bool> config_dumped{
false};
114 alctProc->setConfigParameters(conf);
115 clctProc->setConfigParameters(conf);
119 if (!config_dumped) {
121 config_dumped =
true;
136 <<
"+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
152 int used_alct_mask[20];
153 for (
int a=0;
a<20;++
a) used_alct_mask[
a]=0;
155 int bx_alct_matched = 0;
162 if (
clctProc->bestCLCT[bx_clct].isValid()) {
171 bool is_matched =
false;
175 for (
int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++) {
180 if (
alctProc->bestALCT[bx_alct].isValid()) {
182 <<
"Successful CLCT-ALCT match: bx_clct = " << bx_clct
183 <<
"; match window: [" << bx_alct_start <<
"; " << bx_alct_stop
184 <<
"]; bx_alct = " << bx_alct;
188 used_alct_mask[bx_alct] += 1;
190 bx_alct_matched = bx_alct;
198 <<
"Unsuccessful CLCT-ALCT match (CLCT only): bx_clct = " 199 << bx_clct <<
" first ALCT "<<
clctProc->bestCLCT[bx_clct]
200 <<
"; match window: [" << bx_alct_start
201 <<
"; " << bx_alct_stop <<
"]";
213 if (bx_alct >= 0 && bx_alct > bx_alct_matched) {
216 <<
"Unsuccessful CLCT-ALCT match (ALCT only): bx_alct = " 228 int used_clct_mask[20];
229 for (
int a=0;
a<20;++
a) used_clct_mask[
a]=0;
231 int bx_clct_matched = 0;
238 if (
alctProc->bestALCT[bx_alct].isValid()) {
247 bool is_matched =
false;
251 for (
int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
256 if (
clctProc->bestCLCT[bx_clct].isValid()) {
258 <<
"Successful ALCT-CLCT match: bx_alct = " << bx_alct
259 <<
"; match window: [" << bx_clct_start <<
"; " << bx_clct_stop
260 <<
"]; bx_clct = " << bx_clct;
264 used_clct_mask[bx_clct] += 1;
266 bx_clct_matched = bx_clct;
274 <<
"Unsuccessful ALCT-CLCT match (ALCT only): bx_alct = " 275 << bx_alct <<
" first ALCT "<<
alctProc->bestALCT[bx_alct]
276 <<
"; match window: [" << bx_clct_start
277 <<
"; " << bx_clct_stop <<
"]";
290 if (bx_clct >= 0 && bx_clct > bx_clct_matched) {
293 <<
"Unsuccessful ALCT-CLCT match (CLCT only): bx_clct = " 321 std::vector<CSCCorrelatedLCTDigi> tmpV;
338 <<
"; in-time LCTs are not getting read-out!!! +++" <<
"\n";
343 <<
"+++ Allowed range of time bins, [0-" << late_tbins
345 <<
"+++ Set late_tbins to max allowed +++\n";
346 late_tbins = CSCConstants::MAX_LCT_TBINS-1;
354 const std::vector<CSCCorrelatedLCTDigi>& all_lcts =
getLCTs();
355 for (
auto plct = all_lcts.begin(); plct != all_lcts.end(); plct++) {
356 if (!plct->isValid())
continue;
358 int bx = (*plct).getBX();
362 <<
" Do not report correlated LCT on key halfstrip " 363 << plct->getStrip() <<
" and key wire " << plct->getKeyWG()
364 <<
": found at bx " << bx <<
", whereas the earliest allowed bx is " 370 if (bx > late_tbins) {
372 <<
" Do not report correlated LCT on key halfstrip " 373 << plct->getStrip() <<
" and key wire " << plct->getKeyWG()
374 <<
": found at bx " << bx <<
", whereas the latest allowed bx is " 383 if (bx_readout == -1 || bx == bx_readout) {
384 tmpV.push_back(*plct);
385 if (bx_readout == -1) bx_readout = bx;
389 else tmpV.push_back(*plct);
397 std::vector<CSCCorrelatedLCTDigi> tmpV;
422 bool anodeBestValid = bestALCT.
isValid();
423 bool anodeSecondValid = secondALCT.
isValid();
424 bool cathodeBestValid = bestCLCT.
isValid();
425 bool cathodeSecondValid = secondCLCT.
isValid();
427 if (anodeBestValid && !anodeSecondValid) secondALCT = bestALCT;
428 if (!anodeBestValid && anodeSecondValid) bestALCT = secondALCT;
429 if (cathodeBestValid && !cathodeSecondValid) secondCLCT = bestCLCT;
430 if (!cathodeBestValid && cathodeSecondValid) bestCLCT = secondCLCT;
438 int bx = lct.
getBX();
444 <<
"+++ Bx of first LCT candidate, " << bx
446 <<
"); skipping it... +++\n";
450 if (((secondALCT != bestALCT) || (secondCLCT != bestCLCT)) &&
455 int bx = lct.
getBX();
461 <<
"+++ Bx of second LCT candidate, " << bx
463 <<
"); skipping it... +++\n";
491 thisLCT.setCLCT(cLCT);
498 const int kPatternBitWidth = 4;
501 unsigned int pattern = (
abs(ptn) & ((1<<kPatternBitWidth)-1));
520 if (pattern == 1) quality = 3;
527 if (!a4 && !c4) quality = 5;
528 else if ( a4 && !c4) quality = 6;
529 else if (!a4 && c4) quality = 7;
530 else if ( a4 && c4) {
535 if (pattern == 2 || pattern == 3) quality = 11;
536 else if (pattern == 4 || pattern == 5) quality = 12;
537 else if (pattern == 6 || pattern == 7) quality = 13;
538 else if (pattern == 8 || pattern == 9) quality = 14;
539 else if (pattern == 10) quality = 15;
542 <<
"+++ findQuality: Unexpected CLCT pattern id = " 543 << pattern <<
"+++\n";
557 static const unsigned int max_mpc_block_me1a = 1 << 1;
558 static const unsigned int max_alct_trig_enable = 1 << 1;
559 static const unsigned int max_clct_trig_enable = 1 << 1;
560 static const unsigned int max_match_trig_enable = 1 << 1;
561 static const unsigned int max_match_trig_window_size = 1 << 4;
562 static const unsigned int max_tmb_l1a_window_size = 1 << 4;
568 <<
", exceeds max allowed, " << max_mpc_block_me1a-1 <<
" +++\n" 569 <<
"+++ Try to proceed with the default value, mpc_block_me1a=" 576 <<
", exceeds max allowed, " << max_alct_trig_enable-1 <<
" +++\n" 577 <<
"+++ Try to proceed with the default value, alct_trig_enable=" 584 <<
", exceeds max allowed, " << max_clct_trig_enable-1 <<
" +++\n" 585 <<
"+++ Try to proceed with the default value, clct_trig_enable=" 592 <<
", exceeds max allowed, " << max_match_trig_enable-1 <<
" +++\n" 593 <<
"+++ Try to proceed with the default value, match_trig_enable=" 600 <<
", exceeds max allowed, " << max_match_trig_window_size-1 <<
" +++\n" 601 <<
"+++ Try to proceed with the default value, match_trig_window_size=" 608 <<
", exceeds max allowed, " << max_tmb_l1a_window_size-1 <<
" +++\n" 609 <<
"+++ Try to proceed with the default value, tmb_l1a_window_size=" 616 std::ostringstream strm;
618 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
619 strm <<
"+ TMB configuration parameters: +\n";
620 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
621 strm <<
" mpc_block_me1a [block/not block triggers which come from ME1/A] = " 623 strm <<
" alct_trig_enable [allow ALCT-only triggers] = " 625 strm <<
" clct_trig_enable [allow CLCT-only triggers] = " 627 strm <<
" match_trig_enable [allow matched ALCT-CLCT triggers] = " 629 strm <<
" match_trig_window_size [ALCT-CLCT match window width, in 25 ns] = " 631 strm <<
" tmb_l1a_window_size [L1Accept window width, in 25 ns bins] = " 633 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
634 LogDebug(
"CSCMotherboard") << strm.str();
int getQuality() const
return quality of a pattern (number of layers hit!)
T getParameter(std::string const &) const
std::vector< CSCCLCTDigi > clctV
unsigned int clct_trig_enable
unsigned int match_trig_window_size
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
static const unsigned int def_alct_trig_enable
bool isValid() const
check ALCT validity (1 - valid ALCT)
void correlateLCTs(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, int type)
static const unsigned int def_mpc_block_me1a
unsigned int tmbClctTrigEnable() const
CSCCorrelatedLCTDigi secondLCT[CSCConstants::MAX_LCT_TBINS]
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
static const unsigned int def_clct_trig_enable
int getBend() const
return bend
unsigned int mpc_block_me1a
std::vector< CSCCorrelatedLCTDigi > getLCTs() const
const unsigned theTrigChamber
unsigned int tmbTmbL1aWindowSize() const
unsigned int tmbMatchTrigWindowSize() const
static const unsigned int def_tmb_l1a_window_size
std::vector< CSCALCTDigi > alctV
int getBX() const
return BX
unsigned int tmbAlctTrigEnable() const
Abs< T >::type abs(const T &t)
unsigned int encodePattern(const int clctPattern) const
unsigned int tmb_l1a_window_size
void checkConfigParameters()
bool isValid() const
check CLCT validity (1 - valid CLCT)
unsigned int match_trig_enable
CSCCorrelatedLCTDigi constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb) const
int getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
const CSCGeometry * cscGeometry_
unsigned int tmbMpcBlockMe1a() const
edm::ParameterSet tmbParams_
int getQuality() const
return quality of a pattern
virtual void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
int getAccelerator() const
unsigned int findQuality(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT) const
int getPattern() const
return pattern
static const unsigned int def_match_trig_window_size
unsigned int alct_trig_enable
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
void dumpConfigParams() const
void setConfigParameters(const CSCDBL1TPParameters *conf)
int getKeyWG() const
return key wire group
unsigned int alctClctOffset_
static const unsigned int def_match_trig_enable
virtual std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const
void setBX(const int BX)
set BX
unsigned int tmbMatchTrigEnable() const
CSCCorrelatedLCTDigi firstLCT[CSCConstants::MAX_LCT_TBINS]