49 unsigned sector,
unsigned subsector,
52 theEndcap(endcap), theStation(station), theSector(sector),
53 theSubsector(subsector), theTrigChamber(chamber)
59 static std::atomic<bool> config_dumped{
false};
108 tmbParams_.
getParameter<
unsigned int>(
"matchTrigWindowSize");
110 tmbParams_.
getParameter<
unsigned int>(
"tmbL1aWindowSize");
134 if (infoV > 0 && !config_dumped) {
136 config_dumped =
true;
144 static std::atomic<bool> config_dumped{
false};
161 if (
infoV > 0 && !config_dumped) {
163 config_dumped =
true;
187 static std::atomic<bool> config_dumped{
false};
198 alctProc->setConfigParameters(conf);
199 clctProc->setConfigParameters(conf);
203 if (!config_dumped) {
205 config_dumped =
true;
220 <<
"+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
233 int used_alct_mask[20];
234 for (
int a=0;
a<20;++
a) used_alct_mask[
a]=0;
236 int bx_alct_matched = 0;
243 if (
clctProc->bestCLCT[bx_clct].isValid()) {
252 bool is_matched =
false;
256 for (
int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++) {
261 if (
alctProc->bestALCT[bx_alct].isValid()) {
263 <<
"Successful CLCT-ALCT match: bx_clct = " << bx_clct
264 <<
"; match window: [" << bx_alct_start <<
"; " << bx_alct_stop
265 <<
"]; bx_alct = " << bx_alct;
269 used_alct_mask[bx_alct] += 1;
271 bx_alct_matched = bx_alct;
279 <<
"Unsuccessful CLCT-ALCT match (CLCT only): bx_clct = " 280 << bx_clct <<
"; match window: [" << bx_alct_start
281 <<
"; " << bx_alct_stop <<
"]";
293 if (bx_alct >= 0 && bx_alct > bx_alct_matched) {
296 <<
"Unsuccessful CLCT-ALCT match (ALCT only): bx_alct = " 308 int used_clct_mask[20];
309 for (
int a=0;
a<20;++
a) used_clct_mask[
a]=0;
311 int bx_clct_matched = 0;
318 if (
alctProc->bestALCT[bx_alct].isValid()) {
327 bool is_matched =
false;
331 for (
int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
336 if (
clctProc->bestCLCT[bx_clct].isValid()) {
338 <<
"Successful ALCT-CLCT match: bx_alct = " << bx_alct
339 <<
"; match window: [" << bx_clct_start <<
"; " << bx_clct_stop
340 <<
"]; bx_clct = " << bx_clct;
344 used_clct_mask[bx_clct] += 1;
346 bx_clct_matched = bx_clct;
354 <<
"Unsuccessful ALCT-CLCT match (ALCT only): bx_alct = " 355 << bx_alct <<
"; match window: [" << bx_clct_start
356 <<
"; " << bx_clct_stop <<
"]";
368 if (bx_clct >= 0 && bx_clct > bx_clct_matched) {
371 <<
"Unsuccessful ALCT-CLCT match (CLCT only): bx_clct = " 399 std::vector<CSCCorrelatedLCTDigi> tmpV;
416 <<
"; in-time LCTs are not getting read-out!!! +++" <<
"\n";
421 <<
"+++ Allowed range of time bins, [0-" << late_tbins
423 <<
"+++ Set late_tbins to max allowed +++\n";
424 late_tbins = CSCConstants::MAX_LCT_TBINS-1;
432 const std::vector<CSCCorrelatedLCTDigi>& all_lcts =
getLCTs();
433 for (
auto plct = all_lcts.begin(); plct != all_lcts.end(); plct++) {
434 if (!plct->isValid())
continue;
436 int bx = (*plct).getBX();
440 <<
" Do not report correlated LCT on key halfstrip " 441 << plct->getStrip() <<
" and key wire " << plct->getKeyWG()
442 <<
": found at bx " << bx <<
", whereas the earliest allowed bx is " 448 if (bx > late_tbins) {
450 <<
" Do not report correlated LCT on key halfstrip " 451 << plct->getStrip() <<
" and key wire " << plct->getKeyWG()
452 <<
": found at bx " << bx <<
", whereas the latest allowed bx is " 461 if (bx_readout == -1 || bx == bx_readout) {
462 tmpV.push_back(*plct);
463 if (bx_readout == -1) bx_readout = bx;
467 else tmpV.push_back(*plct);
474 std::vector<CSCCorrelatedLCTDigi> tmpV;
503 bool anodeBestValid = bestALCT.
isValid();
504 bool anodeSecondValid = secondALCT.
isValid();
505 bool cathodeBestValid = bestCLCT.
isValid();
506 bool cathodeSecondValid = secondCLCT.
isValid();
508 if (anodeBestValid && !anodeSecondValid) secondALCT = bestALCT;
509 if (!anodeBestValid && anodeSecondValid) bestALCT = secondALCT;
510 if (cathodeBestValid && !cathodeSecondValid) secondCLCT = bestCLCT;
511 if (!cathodeBestValid && cathodeSecondValid) bestCLCT = secondCLCT;
519 int bx = lct.
getBX();
525 <<
"+++ Bx of first LCT candidate, " << bx
527 <<
"); skipping it... +++\n";
531 if (((secondALCT != bestALCT) || (secondCLCT != bestCLCT)) &&
536 int bx = lct.
getBX();
542 <<
"+++ Bx of second LCT candidate, " << bx
544 <<
"); skipping it... +++\n";
571 thisLCT.setCLCT(cLCT);
578 const int kPatternBitWidth = 4;
581 unsigned int pattern = (
abs(ptn) & ((1<<kPatternBitWidth)-1));
600 if (pattern == 1) quality = 3;
607 if (!a4 && !c4) quality = 5;
608 else if ( a4 && !c4) quality = 6;
609 else if (!a4 && c4) quality = 7;
610 else if ( a4 && c4) {
615 if (pattern == 2 || pattern == 3) quality = 11;
616 else if (pattern == 4 || pattern == 5) quality = 12;
617 else if (pattern == 6 || pattern == 7) quality = 13;
618 else if (pattern == 8 || pattern == 9) quality = 14;
619 else if (pattern == 10) quality = 15;
622 <<
"+++ findQuality: Unexpected CLCT pattern id = " 623 << pattern <<
"+++\n";
637 static const unsigned int max_mpc_block_me1a = 1 << 1;
638 static const unsigned int max_alct_trig_enable = 1 << 1;
639 static const unsigned int max_clct_trig_enable = 1 << 1;
640 static const unsigned int max_match_trig_enable = 1 << 1;
641 static const unsigned int max_match_trig_window_size = 1 << 4;
642 static const unsigned int max_tmb_l1a_window_size = 1 << 4;
648 <<
", exceeds max allowed, " << max_mpc_block_me1a-1 <<
" +++\n" 649 <<
"+++ Try to proceed with the default value, mpc_block_me1a=" 656 <<
", exceeds max allowed, " << max_alct_trig_enable-1 <<
" +++\n" 657 <<
"+++ Try to proceed with the default value, alct_trig_enable=" 664 <<
", exceeds max allowed, " << max_clct_trig_enable-1 <<
" +++\n" 665 <<
"+++ Try to proceed with the default value, clct_trig_enable=" 672 <<
", exceeds max allowed, " << max_match_trig_enable-1 <<
" +++\n" 673 <<
"+++ Try to proceed with the default value, match_trig_enable=" 680 <<
", exceeds max allowed, " << max_match_trig_window_size-1 <<
" +++\n" 681 <<
"+++ Try to proceed with the default value, match_trig_window_size=" 688 <<
", exceeds max allowed, " << max_tmb_l1a_window_size-1 <<
" +++\n" 689 <<
"+++ Try to proceed with the default value, tmb_l1a_window_size=" 696 std::ostringstream strm;
698 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
699 strm <<
"+ TMB configuration parameters: +\n";
700 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
701 strm <<
" mpc_block_me1a [block/not block triggers which come from ME1/A] = " 703 strm <<
" alct_trig_enable [allow ALCT-only triggers] = " 705 strm <<
" clct_trig_enable [allow CLCT-only triggers] = " 707 strm <<
" match_trig_enable [allow matched ALCT-CLCT triggers] = " 709 strm <<
" match_trig_window_size [ALCT-CLCT match window width, in 25 ns] = " 711 strm <<
" tmb_l1a_window_size [L1Accept window width, in 25 ns bins] = " 713 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
714 LogDebug(
"CSCMotherboard") << strm.str();
int getQuality() const
return quality of a pattern (number of layers hit!)
edm::ParameterSet clctParams_
T getParameter(std::string const &) const
edm::ParameterSet alctParams_
std::vector< CSCCLCTDigi > clctV
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
unsigned int clct_trig_enable
unsigned int match_trig_window_size
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
const unsigned theTrigChamber
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 alctClctOffset
unsigned int tmbClctTrigEnable() const
CSCCorrelatedLCTDigi secondLCT[CSCConstants::MAX_LCT_TBINS]
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
static const unsigned int def_clct_trig_enable
const CSCGeometry * csc_g
static int ringFromTriggerLabels(int station, int triggerCSCID)
edm::ParameterSet tmbParams_
int getBend() const
return bend
unsigned int mpc_block_me1a
std::vector< CSCCorrelatedLCTDigi > getLCTs() const
unsigned int tmbTmbL1aWindowSize() const
const unsigned theStation
unsigned int tmbMatchTrigWindowSize() const
static const unsigned int def_tmb_l1a_window_size
edm::ParameterSet commonParams_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
std::vector< CSCALCTDigi > alctV
const unsigned theSubsector
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
unsigned int tmbMpcBlockMe1a() const
int getQuality() const
return quality of a pattern
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
static const unsigned int def_match_trig_enable
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const
void setBX(const int BX)
set BX
unsigned int tmbMatchTrigEnable() const
CSCCorrelatedLCTDigi firstLCT[CSCConstants::MAX_LCT_TBINS]