22 static std::atomic<bool> config_dumped{
false};
50 if (
infoV > 0 && !config_dumped) {
104 static std::atomic<bool> config_dumped{
false};
115 alctProc->setConfigParameters(conf);
116 clctProc->setConfigParameters(conf);
120 if (!config_dumped) {
122 config_dumped =
true;
138 edm::LogError(
"CSCMotherboard|SetupError") <<
"+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
175 int bx_clct_matched = 0;
182 if (bunch_crossing_mask[bx_alct])
189 if (
alctProc->getBestALCT(bx_alct).isValid()) {
198 bool is_matched =
false;
212 if (
clctProc->getBestCLCT(bx_clct).getQuality() <= 3)
215 if (
clctProc->getBestCLCT(bx_clct).isValid()) {
217 LogTrace(
"CSCMotherboard") <<
"Successful ALCT-CLCT match: bx_alct = " << bx_alct
218 <<
"; bx_clct = " << bx_clct <<
"; mbx = " << mbx;
230 if (
allLCTs_(bx_alct, mbx, 0).isValid()) {
232 used_clct_mask[bx_clct] =
true;
233 bunch_crossing_mask[bx_alct] =
true;
234 bx_clct_matched = bx_clct;
244 LogTrace(
"CSCMotherboard") <<
"Unsuccessful ALCT-CLCT match (ALCT only): bx_alct = " << bx_alct
245 <<
" first ALCT " <<
alctProc->getBestALCT(bx_alct);
262 if (bx_clct >= 0 && bx_clct > bx_clct_matched) {
265 LogTrace(
"CSCMotherboard") <<
"Unsuccessful ALCT-CLCT match (CLCT only): bx_clct = " << bx_clct;
284 std::vector<CSCCorrelatedLCTDigi> tmpV;
305 if (early_tbin < 0) {
307 <<
"Early time bin (early_tbin) smaller than minimum allowed, which is 0. set early_tbin to 0.";
310 if (late_tbin > max_late_tbin) {
312 <<
"Late time bin (late_tbin) larger than maximum allowed, which is " << max_late_tbin
313 <<
". set early_tbin to max allowed";
320 for (
const auto& lct :
lctV) {
322 if (!lct.isValid()) {
326 const int bx = lct.getBX();
328 if (
bx < early_tbin) {
330 LogDebug(
"CSCMotherboard") <<
" Do not report correlated LCT on key halfstrip " << lct.getStrip()
331 <<
" and key wire " << lct.getKeyWG() <<
": found at bx " <<
bx 332 <<
", whereas the earliest allowed bx is " << early_tbin;
337 if (
bx > late_tbin) {
339 LogDebug(
"CSCMotherboard") <<
" Do not report correlated LCT on key halfstrip " << lct.getStrip()
340 <<
" and key wire " << lct.getKeyWG() <<
": found at bx " <<
bx 341 <<
", whereas the latest allowed bx is " << late_tbin;
354 if (bx_readout == -1 ||
bx == bx_readout) {
356 if (bx_readout == -1)
368 for (
const auto& lct : tmpV) {
419 if (bestCase1
or bestCase2
or bestCase3) {
439 if ((secondALCT != bestALCT)
or (secondCLCT != bestCLCT)) {
441 if (secondCase1
or secondCase2
or secondCase3) {
452 const bool anodeBestValid = bestALCT.
isValid();
453 const bool anodeSecondValid = secondALCT.
isValid();
454 const bool cathodeBestValid = bestCLCT.
isValid();
455 const bool cathodeSecondValid = secondCLCT.
isValid();
458 if (anodeBestValid && !anodeSecondValid)
459 secondALCT = bestALCT;
460 if (!anodeBestValid && anodeSecondValid)
461 bestALCT = secondALCT;
462 if (cathodeBestValid && !cathodeSecondValid)
463 secondCLCT = bestCLCT;
464 if (!cathodeBestValid && cathodeSecondValid)
465 bestCLCT = secondCLCT;
509 const int kPatternBitWidth = 4;
512 unsigned int pattern = (
abs(ptn) & ((1 << kPatternBitWidth) - 1));
522 std::vector<CSCCorrelatedLCTDigi> tempV;
534 for (
const auto& lct : tempV) {
541 for (
const auto& lct :
lctV) {
542 LogDebug(
"CSCMotherboard") <<
"Selected LCT" << lct;
551 static const unsigned int max_mpc_block_me1a = 1 << 1;
552 static const unsigned int max_alct_trig_enable = 1 << 1;
553 static const unsigned int max_clct_trig_enable = 1 << 1;
554 static const unsigned int max_match_trig_enable = 1 << 1;
555 static const unsigned int max_match_trig_window_size = 1 << 4;
556 static const unsigned int max_tmb_l1a_window_size = 1 << 4;
571 std::ostringstream strm;
573 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
574 strm <<
"+ TMB configuration parameters: +\n";
575 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
576 strm <<
" mpc_block_me1a [block/not block triggers which come from ME1/A] = " <<
mpc_block_me1a <<
"\n";
577 strm <<
" alct_trig_enable [allow ALCT-only triggers] = " <<
alct_trig_enable <<
"\n";
578 strm <<
" clct_trig_enable [allow CLCT-only triggers] = " <<
clct_trig_enable <<
"\n";
579 strm <<
" match_trig_enable [allow matched ALCT-CLCT triggers] = " <<
match_trig_enable <<
"\n";
580 strm <<
" match_trig_window_size [ALCT-CLCT match window width, in 25 ns] = " <<
match_trig_window_size <<
"\n";
581 strm <<
" tmb_l1a_window_size [L1Accept window width, in 25 ns bins] = " <<
tmb_l1a_window_size <<
"\n";
582 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
583 LogDebug(
"CSCMotherboard") << strm.str();
601 unsigned cathodeInTime =
clctProc->getInTimeHMT();
602 unsigned anodeInTime =
alctProc->getInTimeHMT();
610 inTimeHMT_ = cathodeInTime;
613 inTimeHMT_ = anodeInTime;
616 inTimeHMT_ = anodeInTime | cathodeInTime;
619 inTimeHMT_ = anodeInTime & cathodeInTime;
622 inTimeHMT_ = cathodeInTime;
bool isValid() const
check ALCT validity (1 - valid ALCT)
void matchALCTCLCT(bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
T getParameter(std::string const &) const
virtual std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const
uint16_t getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
const CSCL1TPLookupTableME11ILT * lookupTableME11ILT_
std::vector< CSCCLCTDigi > clctV
unsigned int clct_trig_enable
void setESLookupTables(const CSCL1TPLookupTableCCLUT *conf)
unsigned int encodePattern(const int clctPattern) const
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
void copyValidToInValid(CSCALCTDigi &, CSCALCTDigi &, CSCCLCTDigi &, CSCCLCTDigi &) const
unsigned int match_trig_window_size
static const unsigned int def_alct_trig_enable
void checkConfigParameters(unsigned int &var, const unsigned int var_max, const unsigned int var_def, const std::string &var_str)
uint16_t getQuality() const
return quality of a pattern (number of layers hit!)
unsigned int tmbMpcBlockMe1a() const
uint16_t getKeyStrip(const uint16_t n=2) const
static const unsigned int def_mpc_block_me1a
bool getEighthStripBit() const
get single eighth strip bit
std::vector< CSCCorrelatedLCTDigi > lctV
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
static const unsigned int def_clct_trig_enable
Log< level::Error, false > LogError
unsigned int tmbTmbL1aWindowSize() const
CSCCLCTDigi getBXShiftedCLCT(const CSCCLCTDigi &) const
void setMatchTrigWindowSize(unsigned trig_window_size)
unsigned int mpc_block_me1a
bool getQuartStripBit() const
get single quart strip bit
const unsigned theTrigChamber
void correlateLCTs(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, CSCCorrelatedLCTDigi &bLCT, CSCCorrelatedLCTDigi &sLCT, int type) const
unsigned int tmbMatchTrigWindowSize() const
std::vector< int > preferred_bx_match_
bool match_earliest_clct_only_
CSCMotherboard(unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
std::unique_ptr< CSCALCTCrossCLCT > cscOverlap_
static const unsigned int def_tmb_l1a_window_size
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
void dumpConfigParams() const
uint16_t getKeyWG() const
return key wire group
Abs< T >::type abs(const T &t)
unsigned int tmb_l1a_window_size
void checkConfigParameters()
unsigned int match_trig_enable
bool ignoreAlctCrossClct_
bool isValid() const
check CLCT validity (1 - valid CLCT)
void setBX(const uint16_t BX)
set BX
const CSCGeometry * cscGeometry_
edm::ParameterSet tmbParams_
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
bool doesALCTCrossCLCT(const CSCALCTDigi &, const CSCCLCTDigi &) const
static const unsigned int def_match_trig_window_size
unsigned int tmbMatchTrigEnable() const
uint16_t getBX() const
return BX
uint16_t getPattern() const
return pattern
unsigned int alct_trig_enable
const CSCL1TPLookupTableME21ILT * lookupTableME21ILT_
void setBX(const uint16_t bx)
set bx
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
const CSCL1TPLookupTableCCLUT * lookupTableCCLUT_
uint16_t getSlope() const
return the slope
unsigned int tmbClctTrigEnable() const
void encodeHighMultiplicityBits()
unsigned int tmbAlctTrigEnable() const
uint16_t getRun3Pattern() const
return pattern
void clear()
clear this CLCT
void clear()
clear this Shower
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
Log< level::Warning, false > LogWarning
edm::ParameterSet showerParams_
void setConfigParameters(const CSCDBL1TPParameters *conf)
std::unique_ptr< LCTQualityControl > qualityControl_
static const unsigned int def_match_trig_enable
CSCShowerDigi readoutShower() const
std::unique_ptr< LCTQualityAssignment > qualityAssignment_
void constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb, CSCCorrelatedLCTDigi &lct) const