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";
174 int bx_clct_matched = 0;
180 if (
alctProc->getBestALCT(bx_alct).isValid()) {
189 bool is_matched =
false;
203 if (
clctProc->getBestCLCT(bx_clct).getQuality() <= 3)
206 if (
clctProc->getBestCLCT(bx_clct).isValid()) {
208 LogTrace(
"CSCMotherboard") <<
"Successful ALCT-CLCT match: bx_alct = " << bx_alct
209 <<
"; bx_clct = " << bx_clct <<
"; mbx = " << mbx;
221 if (
allLCTs_(bx_alct, mbx, 0).isValid()) {
223 used_clct_mask[bx_clct] =
true;
224 bx_clct_matched = bx_clct;
234 LogTrace(
"CSCMotherboard") <<
"Unsuccessful ALCT-CLCT match (ALCT only): bx_alct = " << bx_alct
235 <<
" first ALCT " <<
alctProc->getBestALCT(bx_alct);
252 if (bx_clct >= 0 && bx_clct > bx_clct_matched) {
255 LogTrace(
"CSCMotherboard") <<
"Unsuccessful ALCT-CLCT match (CLCT only): bx_clct = " << bx_clct;
274 std::vector<CSCCorrelatedLCTDigi> tmpV;
295 if (early_tbin < 0) {
297 <<
"Early time bin (early_tbin) smaller than minimum allowed, which is 0. set early_tbin to 0.";
300 if (late_tbin > max_late_tbin) {
302 <<
"Late time bin (late_tbin) larger than maximum allowed, which is " << max_late_tbin
303 <<
". set early_tbin to max allowed";
310 for (
const auto& lct :
lctV) {
312 if (!lct.isValid()) {
316 const int bx = lct.getBX();
318 if (
bx < early_tbin) {
320 LogDebug(
"CSCMotherboard") <<
" Do not report correlated LCT on key halfstrip " << lct.getStrip()
321 <<
" and key wire " << lct.getKeyWG() <<
": found at bx " <<
bx 322 <<
", whereas the earliest allowed bx is " << early_tbin;
327 if (
bx > late_tbin) {
329 LogDebug(
"CSCMotherboard") <<
" Do not report correlated LCT on key halfstrip " << lct.getStrip()
330 <<
" and key wire " << lct.getKeyWG() <<
": found at bx " <<
bx 331 <<
", whereas the latest allowed bx is " << late_tbin;
344 if (bx_readout == -1 ||
bx == bx_readout) {
346 if (bx_readout == -1)
358 for (
const auto& lct : tmpV) {
412 if (bestCase1
or bestCase2
or bestCase3) {
432 if ((secondALCT != bestALCT)
or (secondCLCT != bestCLCT)) {
434 if (secondCase1
or secondCase2
or secondCase3)
442 secondALCT = bestALCT;
448 secondCLCT = bestCLCT;
492 const int kPatternBitWidth = 4;
495 unsigned int pattern = (
abs(ptn) & ((1 << kPatternBitWidth) - 1));
505 std::vector<CSCCorrelatedLCTDigi> tempV;
517 for (
const auto& lct : tempV) {
524 for (
const auto& lct :
lctV) {
525 LogDebug(
"CSCMotherboard") <<
"Selected LCT" << lct;
534 static const unsigned int max_mpc_block_me1a = 1 << 1;
535 static const unsigned int max_alct_trig_enable = 1 << 1;
536 static const unsigned int max_clct_trig_enable = 1 << 1;
537 static const unsigned int max_match_trig_enable = 1 << 1;
538 static const unsigned int max_match_trig_window_size = 1 << 4;
539 static const unsigned int max_tmb_l1a_window_size = 1 << 4;
554 std::ostringstream strm;
556 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
557 strm <<
"+ TMB configuration parameters: +\n";
558 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
559 strm <<
" mpc_block_me1a [block/not block triggers which come from ME1/A] = " <<
mpc_block_me1a <<
"\n";
560 strm <<
" alct_trig_enable [allow ALCT-only triggers] = " <<
alct_trig_enable <<
"\n";
561 strm <<
" clct_trig_enable [allow CLCT-only triggers] = " <<
clct_trig_enable <<
"\n";
562 strm <<
" match_trig_enable [allow matched ALCT-CLCT triggers] = " <<
match_trig_enable <<
"\n";
563 strm <<
" match_trig_window_size [ALCT-CLCT match window width, in 25 ns] = " <<
match_trig_window_size <<
"\n";
564 strm <<
" tmb_l1a_window_size [L1Accept window width, in 25 ns bins] = " <<
tmb_l1a_window_size <<
"\n";
565 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
566 LogDebug(
"CSCMotherboard") << strm.str();
584 unsigned cathodeInTime =
clctProc->getInTimeHMT();
585 unsigned anodeInTime =
alctProc->getInTimeHMT();
593 inTimeHMT_ = cathodeInTime;
596 inTimeHMT_ = anodeInTime;
599 inTimeHMT_ = anodeInTime | cathodeInTime;
602 inTimeHMT_ = anodeInTime & cathodeInTime;
605 inTimeHMT_ = cathodeInTime;
bool isValid() const
check ALCT validity (1 - valid ALCT)
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)
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
void copyValidToInValidALCT(CSCALCTDigi &, CSCALCTDigi &) 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_
void copyValidToInValidCLCT(CSCCLCTDigi &, CSCCLCTDigi &) const
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