|
|
Go to the documentation of this file.
22 static std::atomic<bool> config_dumped{
false};
57 if (
infoV > 0 && !config_dumped) {
65 static std::atomic<bool> config_dumped{
false};
82 if (
infoV > 0 && !config_dumped) {
108 static std::atomic<bool> config_dumped{
false};
119 alctProc->setConfigParameters(conf);
120 clctProc->setConfigParameters(conf);
124 if (!config_dumped) {
126 config_dumped =
true;
136 edm::LogError(
"CSCMotherboard|SetupError") <<
"+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
152 unsigned alctBits =
alctProc->getHighMultiplictyBits();
157 int used_alct_mask[20];
158 for (
int a = 0;
a < 20; ++
a)
159 used_alct_mask[
a] = 0;
161 int bx_alct_matched = 0;
167 if (
clctProc->getBestCLCT(bx_clct).isValid()) {
176 bool is_matched =
false;
180 for (
int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++) {
186 if (
alctProc->getBestALCT(bx_alct).isValid()) {
188 LogTrace(
"CSCMotherboard") <<
"Successful CLCT-ALCT match: bx_clct = " << bx_clct <<
"; match window: ["
189 << bx_alct_start <<
"; " << bx_alct_stop <<
"]; bx_alct = " << bx_alct;
195 used_alct_mask[bx_alct] += 1;
197 bx_alct_matched = bx_alct;
205 LogTrace(
"CSCMotherboard") <<
"Unsuccessful CLCT-ALCT match (CLCT only): bx_clct = " << bx_clct
206 <<
" first ALCT " <<
clctProc->getBestCLCT(bx_clct) <<
"; match window: ["
207 << bx_alct_start <<
"; " << bx_alct_stop <<
"]";
221 if (bx_alct >= 0 && bx_alct > bx_alct_matched) {
224 LogTrace(
"CSCMotherboard") <<
"Unsuccessful CLCT-ALCT match (ALCT only): bx_alct = " << bx_alct;
237 int used_clct_mask[20];
238 for (
int a = 0;
a < 20; ++
a)
239 used_clct_mask[
a] = 0;
241 int bx_clct_matched = 0;
247 if (
alctProc->getBestALCT(bx_alct).isValid()) {
256 bool is_matched =
false;
260 for (
int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
266 if (
clctProc->getBestCLCT(bx_clct).isValid()) {
268 LogTrace(
"CSCMotherboard") <<
"Successful ALCT-CLCT match: bx_alct = " << bx_alct <<
"; match window: ["
269 << bx_clct_start <<
"; " << bx_clct_stop <<
"]; bx_clct = " << bx_clct;
275 used_clct_mask[bx_clct] += 1;
277 bx_clct_matched = bx_clct;
285 LogTrace(
"CSCMotherboard") <<
"Unsuccessful ALCT-CLCT match (ALCT only): bx_alct = " << bx_alct
286 <<
" first ALCT " <<
alctProc->getBestALCT(bx_alct) <<
"; match window: ["
287 << bx_clct_start <<
"; " << bx_clct_stop <<
"]";
302 if (bx_clct >= 0 && bx_clct > bx_clct_matched) {
305 LogTrace(
"CSCMotherboard") <<
"Unsuccessful ALCT-CLCT match (CLCT only): bx_clct = " << bx_clct;
332 std::vector<CSCCorrelatedLCTDigi> tmpV;
348 <<
"+++ early_tbins = " <<
early_tbins <<
"; in-time LCTs are not getting read-out!!! +++"
355 <<
"+++ Allowed range of time bins, [0-" << late_tbins <<
"] exceeds max allowed, "
357 <<
"+++ Set late_tbins to max allowed +++\n";
366 const std::vector<CSCCorrelatedLCTDigi>& all_lcts =
getLCTs();
367 for (
auto plct = all_lcts.begin(); plct != all_lcts.end(); plct++) {
368 if (!plct->isValid())
371 int bx = (*plct).getBX();
375 LogDebug(
"CSCMotherboard") <<
" Do not report correlated LCT on key halfstrip " << plct->getStrip()
376 <<
" and key wire " << plct->getKeyWG() <<
": found at bx " <<
bx
377 <<
", whereas the earliest allowed bx is " <<
early_tbins + 1;
382 if (
bx > late_tbins) {
384 LogDebug(
"CSCMotherboard") <<
" Do not report correlated LCT on key halfstrip " << plct->getStrip()
385 <<
" and key wire " << plct->getKeyWG() <<
": found at bx " <<
bx
386 <<
", whereas the latest allowed bx is " << late_tbins;
394 if (bx_readout == -1 ||
bx == bx_readout) {
395 tmpV.push_back(*plct);
396 if (bx_readout == -1)
402 tmpV.push_back(*plct);
406 for (
const auto& lct : tmpV) {
415 std::vector<CSCCorrelatedLCTDigi> tmpV;
436 bool anodeBestValid = bestALCT.
isValid();
437 bool anodeSecondValid = secondALCT.
isValid();
438 bool cathodeBestValid = bestCLCT.
isValid();
439 bool cathodeSecondValid = secondCLCT.
isValid();
441 if (anodeBestValid && !anodeSecondValid)
442 secondALCT = bestALCT;
443 if (!anodeBestValid && anodeSecondValid)
444 bestALCT = secondALCT;
445 if (cathodeBestValid && !cathodeSecondValid)
446 secondCLCT = bestCLCT;
447 if (!cathodeBestValid && cathodeSecondValid)
448 bestCLCT = secondCLCT;
461 <<
"+++ Bx of first LCT candidate, " <<
bx <<
", is not within the allowed range, [0-"
466 if (((secondALCT != bestALCT) || (secondCLCT != bestCLCT)) &&
476 <<
"+++ Bx of second LCT candidate, " <<
bx <<
", is not within the allowed range, [0-"
523 const int kPatternBitWidth = 4;
526 unsigned int pattern = (
abs(ptn) & ((1 << kPatternBitWidth) - 1));
578 <<
"+++ findQuality: Unexpected CLCT pattern id = " <<
pattern <<
"+++\n";
591 static const unsigned int max_mpc_block_me1a = 1 << 1;
592 static const unsigned int max_alct_trig_enable = 1 << 1;
593 static const unsigned int max_clct_trig_enable = 1 << 1;
594 static const unsigned int max_match_trig_enable = 1 << 1;
595 static const unsigned int max_match_trig_window_size = 1 << 4;
596 static const unsigned int max_tmb_l1a_window_size = 1 << 4;
611 std::ostringstream strm;
613 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
614 strm <<
"+ TMB configuration parameters: +\n";
615 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
616 strm <<
" mpc_block_me1a [block/not block triggers which come from ME1/A] = " <<
mpc_block_me1a <<
"\n";
617 strm <<
" alct_trig_enable [allow ALCT-only triggers] = " <<
alct_trig_enable <<
"\n";
618 strm <<
" clct_trig_enable [allow CLCT-only triggers] = " <<
clct_trig_enable <<
"\n";
619 strm <<
" match_trig_enable [allow matched ALCT-CLCT triggers] = " <<
match_trig_enable <<
"\n";
620 strm <<
" match_trig_window_size [ALCT-CLCT match window width, in 25 ns] = " <<
match_trig_window_size <<
"\n";
621 strm <<
" tmb_l1a_window_size [L1Accept window width, in 25 ns bins] = " <<
tmb_l1a_window_size <<
"\n";
622 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
623 LogDebug(
"CSCMotherboard") << strm.str();
659 edm::LogError(
"CSCMotherboard") <<
"CSCCorrelatedLCTDigi with invalid bit set: " << lct.
isValid();
666 <<
"; allowed [1,2]";
673 <<
"; allowed [0,15]";
679 edm::LogError(
"CSCMotherboard") <<
"CSCCorrelatedLCTDigi with invalid half-strip: " << lct.
getStrip()
680 <<
"; allowed [0, " << max_strip <<
"]";
685 if (lct.
getStrip(4) >= max_quartstrip) {
686 edm::LogError(
"CSCMotherboard") <<
"CSCCorrelatedLCTDigi with invalid key quart-strip: " << lct.
getStrip(4)
687 <<
"; allowed [0, " << max_quartstrip - 1 <<
"]";
692 if (lct.
getStrip(8) >= max_eightstrip) {
693 edm::LogError(
"CSCMotherboard") <<
"CSCCorrelatedLCTDigi with invalid key eight-strip: " << lct.
getStrip(8)
694 <<
"; allowed [0, " << max_eightstrip - 1 <<
"]";
700 edm::LogError(
"CSCMotherboard") <<
"CSCCorrelatedLCTDigi with invalid wire-group: " << lct.
getKeyWG()
701 <<
"; allowed [0, " << max_wire <<
"]";
707 edm::LogError(
"CSCMotherboard") <<
"CSCCorrelatedLCTDigi with invalid BX: " << lct.
getBX() <<
"; allowed [0, "
714 edm::LogError(
"CSCMotherboard") <<
"CSCCorrelatedLCTDigi with invalid bending: " << lct.
getBend()
722 edm::LogError(
"CSCMotherboard") <<
"CSCCorrelatedLCTDigi with invalid CSCID: " << lct.
getBend() <<
"; allowed ["
731 <<
"; allowed [" << min_pattern <<
", " << max_pattern <<
"]";
738 edm::LogError(
"CSCMotherboard") <<
"CSCCorrelatedLCTDigi with invalid type (SIM): " << lct.
getType()
747 edm::LogError(
"CSCMotherboard") <<
"CSCCorrelatedLCTDigi with invalid type (SIM) in this station: "
756 edm::LogError(
"CSCMotherboard") <<
"CSCCorrelatedLCTDigi with invalid type (SIM) with GEM-CSC trigger not on: "
virtual void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
uint16_t getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
unsigned int match_trig_window_size
edm::ParameterSet clctParams_
void checkValid(const CSCCorrelatedLCTDigi &lct) const
static const unsigned int def_clct_trig_enable
unsigned int mpc_block_me1a
const CSCGeometry * cscGeometry_
CSCCorrelatedLCTDigi secondLCT[CSCConstants::MAX_LCT_TBINS]
bool useHighMultiplicityBits_
edm::ParameterSet tmbParams_
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
void correlateLCTs(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, int type)
const unsigned theStation
unsigned int findQuality(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT) const
std::pair< unsigned, unsigned > get_csc_min_max_pattern(bool isRun3)
unsigned int tmbClctTrigEnable() const
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
unsigned get_csc_max_wire(int station, int ring)
void checkConfigParameters()
std::vector< CSCCLCTDigi > clctV
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
uint16_t getKeyWG() const
return key wire group
uint16_t getQuality() const
return quality of a pattern (number of layers hit!)
uint16_t getBend() const
return bend
unsigned get_csc_max_quartstrip(int station, int ring)
std::vector< CSCALCTDigi > alctV
CSCCorrelatedLCTDigi constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb) const
unsigned int tmbMatchTrigWindowSize() const
uint16_t getKeyStrip(uint16_t n=2) const
unsigned int alctClctOffset_
void dumpConfigParams() const
unsigned get_csc_lct_max_quality()
static const unsigned int def_tmb_l1a_window_size
void setBX(const uint16_t BX)
set BX
uint16_t getQuality() const
return quality of a pattern
unsigned int tmbMatchTrigEnable() const
static int minTriggerCscId()
unsigned get_csc_max_halfstrip(int station, int ring)
std::vector< CSCCorrelatedLCTDigi > getLCTs() const
bool isValid() const
check CLCT validity (1 - valid CLCT)
unsigned int tmbTmbL1aWindowSize() const
unsigned int tmbAlctTrigEnable() const
uint16_t getBX() const
return BX
void encodeHighMultiplicityBits(unsigned alctBits)
virtual std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const
CSCCLCTDigi getBXShiftedCLCT(const CSCCLCTDigi &) const
T getParameter(std::string const &) const
unsigned int tmb_l1a_window_size
unsigned get_csc_max_eightstrip(int station, int ring)
uint16_t getAccelerator() const
void setConfigParameters(const CSCDBL1TPParameters *conf)
unsigned int highMultiplicityBits_
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
void setBX(const uint16_t bx)
set bx
unsigned int encodePattern(const int clctPattern) const
static int maxTriggerCscId()
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
Abs< T >::type abs(const T &t)
unsigned int match_trig_enable
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
uint16_t getPattern() const
return pattern
CSCCorrelatedLCTDigi firstLCT[CSCConstants::MAX_LCT_TBINS]