22 static std::atomic<bool> config_dumped{
false};
50 if (
infoV > 0 && !config_dumped) {
113 static std::atomic<bool> config_dumped{
false};
124 alctProc->setConfigParameters(conf);
125 clctProc->setConfigParameters(conf);
129 if (!config_dumped) {
131 config_dumped =
true;
149 edm::LogError(
"CSCMotherboard|SetupError") <<
"+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
185 int bx_clct_matched = 0;
191 if (
alctProc->getBestALCT(bx_alct).isValid()) {
200 bool is_matched =
false;
214 if (
clctProc->getBestCLCT(bx_clct).getQuality() <= 3)
217 if (
clctProc->getBestCLCT(bx_clct).isValid()) {
219 LogTrace(
"CSCMotherboard") <<
"Successful ALCT-CLCT match: bx_alct = " << bx_alct
220 <<
"; bx_clct = " << bx_clct <<
"; mbx = " << mbx;
232 if (
allLCTs_(bx_alct, mbx, 0).isValid()) {
234 used_clct_mask[bx_clct] =
true;
235 bx_clct_matched = bx_clct;
245 LogTrace(
"CSCMotherboard") <<
"Unsuccessful ALCT-CLCT match (ALCT only): bx_alct = " << bx_alct
246 <<
" first ALCT " <<
alctProc->getBestALCT(bx_alct);
263 if (bx_clct >= 0 && bx_clct > bx_clct_matched) {
266 LogTrace(
"CSCMotherboard") <<
"Unsuccessful ALCT-CLCT match (CLCT only): bx_clct = " << bx_clct;
285 std::vector<CSCCorrelatedLCTDigi> tmpV;
306 if (early_tbin < 0) {
308 <<
"Early time bin (early_tbin) smaller than minimum allowed, which is 0. set early_tbin to 0.";
311 if (late_tbin > max_late_tbin) {
313 <<
"Late time bin (late_tbin) larger than maximum allowed, which is " << max_late_tbin
314 <<
". set early_tbin to max allowed";
321 for (
const auto& lct :
lctV) {
323 if (!lct.isValid()) {
327 const int bx = lct.getBX();
329 if (
bx < early_tbin) {
331 LogDebug(
"CSCMotherboard") <<
" Do not report correlated LCT on key halfstrip " << lct.getStrip()
332 <<
" and key wire " << lct.getKeyWG() <<
": found at bx " <<
bx 333 <<
", whereas the earliest allowed bx is " << early_tbin;
338 if (
bx > late_tbin) {
340 LogDebug(
"CSCMotherboard") <<
" Do not report correlated LCT on key halfstrip " << lct.getStrip()
341 <<
" and key wire " << lct.getKeyWG() <<
": found at bx " <<
bx 342 <<
", whereas the latest allowed bx is " << late_tbin;
355 if (bx_readout == -1 ||
bx == bx_readout) {
357 if (bx_readout == -1)
369 for (
const auto& lct : tmpV) {
382 std::vector<CSCShowerDigi> showerOut;
440 if (bestCase1
or bestCase2
or bestCase3) {
460 if ((secondALCT != bestALCT)
or (secondCLCT != bestCLCT)) {
462 if (secondCase1
or secondCase2
or secondCase3)
470 secondALCT = bestALCT;
476 secondCLCT = bestCLCT;
520 const int kPatternBitWidth = 4;
523 unsigned int pattern = (
abs(ptn) & ((1 << kPatternBitWidth) - 1));
533 std::vector<CSCCorrelatedLCTDigi> tempV;
545 for (
const auto& lct : tempV) {
552 for (
const auto& lct :
lctV) {
553 LogDebug(
"CSCMotherboard") <<
"Selected LCT" << lct;
562 static const unsigned int max_mpc_block_me1a = 1 << 1;
563 static const unsigned int max_alct_trig_enable = 1 << 1;
564 static const unsigned int max_clct_trig_enable = 1 << 1;
565 static const unsigned int max_match_trig_enable = 1 << 1;
566 static const unsigned int max_match_trig_window_size = 1 << 4;
567 static const unsigned int max_tmb_l1a_window_size = 1 << 4;
583 std::ostringstream strm;
585 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
586 strm <<
"+ TMB configuration parameters: +\n";
587 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
588 strm <<
" mpc_block_me1a [block/not block triggers which come from ME1/A] = " <<
mpc_block_me1a <<
"\n";
589 strm <<
" alct_trig_enable [allow ALCT-only triggers] = " <<
alct_trig_enable <<
"\n";
590 strm <<
" clct_trig_enable [allow CLCT-only triggers] = " <<
clct_trig_enable <<
"\n";
591 strm <<
" match_trig_enable [allow matched ALCT-CLCT triggers] = " <<
match_trig_enable <<
"\n";
592 strm <<
" match_trig_window_size [ALCT-CLCT match window width, in 25 ns] = " <<
match_trig_window_size <<
"\n";
593 strm <<
" tmb_l1a_window_size [L1Accept window width, in 25 ns bins] = " <<
tmb_l1a_window_size <<
"\n";
594 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
595 LogDebug(
"CSCMotherboard") << strm.str();
614 ashower = anode_showers[
bx];
622 if (cathode_showers[cbx].
isValid() and not used_cshower_mask[cbx]) {
623 cshower = cathode_showers[cbx];
624 used_cshower_mask[cbx] =
true;
629 cshower = cathode_showers[
bx];
632 unsigned matchHMT = 0;
653 CSCShowerDigi::ShowerType::kLCTShower,
664 auto cshowers_v =
clctProc->getAllShower();
665 auto ashowers_v =
alctProc->getAllShower();
667 std::copy(cshowers_v.begin(), cshowers_v.end(), cathode_showers);
668 std::copy(ashowers_v.begin(), ashowers_v.end(), anode_showers);
673 std::copy(std::begin(cathode_showers), std::end(cathode_showers), std::begin(
showers_));
676 std::copy(std::begin(anode_showers), std::end(anode_showers), std::begin(
showers_));
685 std::copy(std::begin(anode_showers), std::end(anode_showers), std::begin(
showers_));
bool isValid() const
check ALCT validity (1 - valid ALCT)
T getParameter(std::string const &) const
unsigned thisShowerSource_
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 getComparatorNHits() const
CSCShowerDigi showers_[CSCConstants::MAX_LCT_TBINS]
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
void matchShowers(CSCShowerDigi *anode_showers, CSCShowerDigi *cathode_showers, bool andlogic)
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
static const unsigned int def_clct_trig_enable
Log< level::Error, false > LogError
unsigned short iChamberType() const
unsigned int tmbTmbL1aWindowSize() const
bool isLooseInTime() 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
bool isTightInTime() 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)
std::vector< unsigned > showerSource_
bool isNominalInTime() const
void setBX(const uint16_t BX)
set BX
const CSCGeometry * cscGeometry_
edm::ParameterSet tmbParams_
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
uint16_t getCSCID() const
bool doesALCTCrossCLCT(const CSCALCTDigi &, const CSCCLCTDigi &) const
const unsigned theStation
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
uint16_t getWireNHits() const
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
std::vector< CSCShowerDigi > readoutShower() const
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
std::unique_ptr< LCTQualityAssignment > qualityAssignment_
void constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb, CSCCorrelatedLCTDigi &lct) const