|
|
Go to the documentation of this file.
22 static std::atomic<bool> config_dumped{
false};
50 if (
infoV > 0 && !config_dumped) {
102 static std::atomic<bool> config_dumped{
false};
113 alctProc->setConfigParameters(conf);
114 clctProc->setConfigParameters(conf);
118 if (!config_dumped) {
120 config_dumped =
true;
130 edm::LogError(
"CSCMotherboard|SetupError") <<
"+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
153 int bx_clct_matched = 0;
159 if (
alctProc->getBestALCT(bx_alct).isValid()) {
168 bool is_matched =
false;
179 if (
clctProc->getBestCLCT(bx_clct).isValid()) {
181 LogTrace(
"CSCMotherboard") <<
"Successful ALCT-CLCT match: bx_alct = " << bx_alct
182 <<
"; bx_clct = " << bx_clct <<
"; mbx = " << mbx;
194 if (
allLCTs_(bx_alct, mbx, 0).isValid()) {
196 used_clct_mask[bx_clct] =
true;
206 LogTrace(
"CSCMotherboard") <<
"Unsuccessful ALCT-CLCT match (ALCT only): bx_alct = " << bx_alct
207 <<
" first ALCT " <<
alctProc->getBestALCT(bx_alct);
224 if (bx_clct >= 0 && bx_clct > bx_clct_matched) {
227 LogTrace(
"CSCMotherboard") <<
"Unsuccessful ALCT-CLCT match (CLCT only): bx_clct = " << bx_clct;
249 std::vector<CSCCorrelatedLCTDigi> tmpV;
270 bool debugTimeBins =
true;
272 if (early_tbin < 0) {
274 <<
"Early time bin (early_tbin) smaller than minimum allowed, which is 0. set early_tbin to 0.";
277 if (late_tbin > max_late_tbin) {
279 <<
"Late time bin (late_tbin) larger than maximum allowed, which is " << max_late_tbin
280 <<
". set early_tbin to max allowed";
283 debugTimeBins =
false;
289 for (
const auto& lct :
lctV) {
291 if (!lct.isValid()) {
295 const int bx = lct.getBX();
297 if (
bx < early_tbin) {
299 LogDebug(
"CSCMotherboard") <<
" Do not report correlated LCT on key halfstrip " << lct.getStrip()
300 <<
" and key wire " << lct.getKeyWG() <<
": found at bx " <<
bx
301 <<
", whereas the earliest allowed bx is " << early_tbin;
306 if (
bx > late_tbin) {
308 LogDebug(
"CSCMotherboard") <<
" Do not report correlated LCT on key halfstrip " << lct.getStrip()
309 <<
" and key wire " << lct.getKeyWG() <<
": found at bx " <<
bx
310 <<
", whereas the latest allowed bx is " << late_tbin;
323 if (bx_readout == -1 ||
bx == bx_readout) {
325 if (bx_readout == -1)
337 for (
const auto& lct : tmpV) {
374 cscOverlap_->doesALCTCrossCLCT(bestALCT, bestCLCT));
377 if (bestCase1
or bestCase2
or bestCase3) {
394 cscOverlap_->doesALCTCrossCLCT(secondALCT, secondCLCT));
397 if ((secondALCT != bestALCT)
or (secondCLCT != bestCLCT)) {
399 if (secondCase1
or secondCase2
or secondCase3) {
410 const bool anodeBestValid = bestALCT.
isValid();
411 const bool anodeSecondValid = secondALCT.
isValid();
412 const bool cathodeBestValid = bestCLCT.
isValid();
413 const bool cathodeSecondValid = secondCLCT.
isValid();
416 if (anodeBestValid && !anodeSecondValid)
417 secondALCT = bestALCT;
418 if (!anodeBestValid && anodeSecondValid)
419 bestALCT = secondALCT;
420 if (cathodeBestValid && !cathodeSecondValid)
421 secondCLCT = bestCLCT;
422 if (!cathodeBestValid && cathodeSecondValid)
423 bestCLCT = secondCLCT;
460 const int kPatternBitWidth = 4;
463 unsigned int pattern = (
abs(ptn) & ((1 << kPatternBitWidth) - 1));
473 std::vector<CSCCorrelatedLCTDigi> tempV;
485 for (
const auto& lct : tempV) {
492 for (
const auto& lct :
lctV) {
493 LogDebug(
"CSCMotherboard") <<
"Selected LCT" << lct;
502 static const unsigned int max_mpc_block_me1a = 1 << 1;
503 static const unsigned int max_alct_trig_enable = 1 << 1;
504 static const unsigned int max_clct_trig_enable = 1 << 1;
505 static const unsigned int max_match_trig_enable = 1 << 1;
506 static const unsigned int max_match_trig_window_size = 1 << 4;
507 static const unsigned int max_tmb_l1a_window_size = 1 << 4;
522 std::ostringstream strm;
524 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
525 strm <<
"+ TMB configuration parameters: +\n";
526 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
527 strm <<
" mpc_block_me1a [block/not block triggers which come from ME1/A] = " <<
mpc_block_me1a <<
"\n";
528 strm <<
" alct_trig_enable [allow ALCT-only triggers] = " <<
alct_trig_enable <<
"\n";
529 strm <<
" clct_trig_enable [allow CLCT-only triggers] = " <<
clct_trig_enable <<
"\n";
530 strm <<
" match_trig_enable [allow matched ALCT-CLCT triggers] = " <<
match_trig_enable <<
"\n";
531 strm <<
" match_trig_window_size [ALCT-CLCT match window width, in 25 ns] = " <<
match_trig_window_size <<
"\n";
532 strm <<
" tmb_l1a_window_size [L1Accept window width, in 25 ns bins] = " <<
tmb_l1a_window_size <<
"\n";
533 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
534 LogDebug(
"CSCMotherboard") << strm.str();
552 unsigned cathodeInTime =
clctProc->getInTimeHMT();
553 unsigned cathodeOutTime =
clctProc->getOutTimeHMT();
554 unsigned anodeInTime =
alctProc->getInTimeHMT();
555 unsigned anodeOutTime =
alctProc->getOutTimeHMT();
559 unsigned outTimeHMT_;
564 inTimeHMT_ = cathodeInTime;
565 outTimeHMT_ = cathodeOutTime;
568 inTimeHMT_ = anodeInTime;
569 outTimeHMT_ = anodeOutTime;
572 inTimeHMT_ = anodeInTime | cathodeInTime;
573 outTimeHMT_ = anodeOutTime | cathodeOutTime;
576 inTimeHMT_ = cathodeInTime;
577 outTimeHMT_ = cathodeOutTime;
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
uint16_t getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
std::unique_ptr< LCTQualityControl > qualityControl_
CSCShowerDigi readoutShower() const
unsigned int match_trig_window_size
void copyValidToInValid(CSCALCTDigi &, CSCALCTDigi &, CSCCLCTDigi &, CSCCLCTDigi &) const
CSCMotherboard(unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
static const unsigned int def_clct_trig_enable
unsigned int mpc_block_me1a
const CSCGeometry * cscGeometry_
std::vector< CSCCorrelatedLCTDigi > lctV
edm::ParameterSet tmbParams_
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
unsigned int tmbClctTrigEnable() const
bool getEighthStripBit() const
get single eighth strip bit
static const unsigned int def_alct_trig_enable
unsigned int clct_trig_enable
void checkConfigParameters(unsigned int &var, const unsigned int var_max, const unsigned int var_def, const std::string &var_str)
unsigned int tmbMpcBlockMe1a() const
uint16_t getKeyStrip(const uint16_t n=2) const
Log< level::Warning, false > LogWarning
void checkConfigParameters()
std::vector< CSCCLCTDigi > clctV
bool match_earliest_clct_only_
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
uint16_t getKeyWG() const
return key wire group
void correlateLCTs(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, CSCCorrelatedLCTDigi &bLCT, CSCCorrelatedLCTDigi &sLCT, int type) const
bool getQuartStripBit() const
get single quart strip bit
std::vector< CSCALCTDigi > alctV
unsigned int tmbMatchTrigWindowSize() const
edm::ParameterSet showerParams_
void dumpConfigParams() const
static const unsigned int def_tmb_l1a_window_size
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
void setBX(const uint16_t BX)
set BX
std::unique_ptr< CSCALCTCrossCLCT > cscOverlap_
void clear()
clear this Shower
unsigned int tmbMatchTrigEnable() const
std::vector< int > preferred_bx_match_
bool isValid() const
check CLCT validity (1 - valid CLCT)
unsigned int tmbTmbL1aWindowSize() const
Log< level::Error, false > LogError
uint16_t getSlope() const
return the slope
unsigned int tmbAlctTrigEnable() const
uint16_t getBX() const
return BX
virtual std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const
CSCCLCTDigi getBXShiftedCLCT(const CSCCLCTDigi &) const
unsigned int tmb_l1a_window_size
void setConfigParameters(const CSCDBL1TPParameters *conf)
unsigned int alct_trig_enable
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
const unsigned theTrigChamber
T getParameter(std::string const &) const
void setBX(const uint16_t bx)
set bx
unsigned int encodePattern(const int clctPattern) const
void constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb, CSCCorrelatedLCTDigi &lct) const
static const unsigned int def_match_trig_window_size
bool isValid() const
check ALCT validity (1 - valid ALCT)
static const unsigned int def_mpc_block_me1a
static const unsigned int def_match_trig_enable
void setMatchTrigWindowSize(unsigned trig_window_size)
Abs< T >::type abs(const T &t)
unsigned int match_trig_enable
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
uint16_t getPattern() const
return pattern
void encodeHighMultiplicityBits()
std::unique_ptr< LCTQualityAssignment > qualityAssignment_
uint16_t getRun3Pattern() const
return pattern