CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes
CSCMotherboard Class Reference

#include <CSCMotherboard.h>

Inheritance diagram for CSCMotherboard:
CSCBaseboard CSCGEMMotherboard

Public Member Functions

void clear ()
 
 CSCMotherboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
virtual std::vector
< CSCCorrelatedLCTDigi
readoutLCTs () const
 
CSCShowerDigi readoutShower () const
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
 
void selectLCTs ()
 
void setConfigParameters (const CSCDBL1TPParameters *conf)
 
void setESLookupTables (const CSCL1TPLookupTableCCLUT *conf)
 
void setESLookupTables (const CSCL1TPLookupTableME11ILT *conf)
 
void setESLookupTables (const CSCL1TPLookupTableME21ILT *conf)
 
 ~CSCMotherboard () override=default
 
- Public Member Functions inherited from CSCBaseboard
 CSCBaseboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCBaseboard ()
 
std::string getCSCName () const
 
CSCDetId id () const
 
void setCSCGeometry (const CSCGeometry *g)
 
virtual ~CSCBaseboard ()=default
 

Public Attributes

std::unique_ptr
< CSCAnodeLCTProcessor
alctProc
 
std::unique_ptr
< CSCCathodeLCTProcessor
clctProc
 

Protected Member Functions

void checkConfigParameters ()
 
void constructLCTs (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb, CSCCorrelatedLCTDigi &lct) const
 
void copyValidToInValid (CSCALCTDigi &, CSCALCTDigi &, CSCCLCTDigi &, CSCCLCTDigi &) const
 
void correlateLCTs (const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, CSCCorrelatedLCTDigi &bLCT, CSCCorrelatedLCTDigi &sLCT, int type) const
 
bool doesALCTCrossCLCT (const CSCALCTDigi &, const CSCCLCTDigi &) const
 
void dumpConfigParams () const
 
void encodeHighMultiplicityBits ()
 
unsigned int encodePattern (const int clctPattern) const
 
CSCALCTDigi getBXShiftedALCT (const CSCALCTDigi &) const
 
CSCCLCTDigi getBXShiftedCLCT (const CSCCLCTDigi &) const
 
void matchALCTCLCT (bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
 
- Protected Member Functions inherited from CSCBaseboard
void checkConfigParameters (unsigned int &var, const unsigned int var_max, const unsigned int var_def, const std::string &var_str)
 

Protected Attributes

unsigned int alct_trig_enable
 
std::vector< CSCALCTDigialctV
 
LCTContainer allLCTs_
 
unsigned int clct_trig_enable
 
std::vector< CSCCLCTDigiclctV
 
std::unique_ptr< CSCALCTCrossCLCTcscOverlap_
 
bool drop_used_clcts
 
int early_tbins
 
bool ignoreAlctCrossClct_
 
std::vector< CSCCorrelatedLCTDigilctV
 
const CSCL1TPLookupTableCCLUTlookupTableCCLUT_
 
const CSCL1TPLookupTableME11ILTlookupTableME11ILT_
 
const CSCL1TPLookupTableME21ILTlookupTableME21ILT_
 
bool match_earliest_clct_only_
 
unsigned int match_trig_enable
 
unsigned int match_trig_window_size
 
unsigned int mpc_block_me1a
 
std::vector< int > preferred_bx_match_
 
std::unique_ptr
< LCTQualityAssignment
qualityAssignment_
 
std::unique_ptr
< LCTQualityControl
qualityControl_
 
bool readout_earliest_2
 
CSCShowerDigi shower_
 
unsigned showerSource_
 
unsigned int tmb_l1a_window_size
 
- Protected Attributes inherited from CSCBaseboard
edm::ParameterSet alctParams_
 
edm::ParameterSet clctParams_
 
edm::ParameterSet commonParams_
 
const CSCChambercscChamber_
 
const CSCGeometrycscGeometry_
 
CSCDetId cscId_
 
bool disableME1a_
 
bool enableAlctPhase2_
 
bool gangedME1a_
 
int infoV
 
bool isME11_
 
bool isME12_
 
bool isME13_
 
bool isME21_
 
bool isME22_
 
bool isME31_
 
bool isME32_
 
bool isME41_
 
bool isME42_
 
bool runCCLUT_
 
bool runCCLUT_OTMB_
 
bool runCCLUT_TMB_
 
bool runME11ILT_
 
bool runME11Up_
 
bool runME21ILT_
 
bool runME21Up_
 
bool runME31Up_
 
bool runME41Up_
 
bool runPhase2_
 
edm::ParameterSet showerParams_
 
unsigned theChamber
 
std::string theCSCName_
 
const unsigned theEndcap
 
int theRegion
 
unsigned theRing
 
const unsigned theSector
 
const unsigned theStation
 
const unsigned theSubsector
 
const unsigned theTrigChamber
 
edm::ParameterSet tmbParams_
 

Static Protected Attributes

static const unsigned int def_alct_trig_enable = 0
 
static const unsigned int def_clct_trig_enable = 0
 
static const unsigned int def_match_trig_enable = 1
 
static const unsigned int def_match_trig_window_size = 7
 
static const unsigned int def_mpc_block_me1a = 1
 
static const unsigned int def_tmb_l1a_window_size = 7
 

Detailed Description

Correlates anode and cathode LCTs from the same chamber.

When the Trigger MotherBoard (TMB) is instantiated it instantiates an ALCT and CLCT board. The MotherBoard takes up to two LCTs from each anode and cathode LCT card and combines them into a single Correlated LCT. The output is up to two Correlated LCTs.

It can be run in either a test mode, where the arguments are a collection of wire times and arrays of halfstrip times, or for general use, with wire digi and comparator digi collections as arguments. In the latter mode, the wire & strip info is passed on the LCTProcessors, where it is decoded and converted into a convenient form. After running the anode and cathode LCTProcessors, TMB correlates the anode and cathode LCTs. At present, it simply matches the best CLCT with the best ALCT; perhaps a better algorithm will be determined in the future. The MotherBoard then determines a few more numbers (such as quality and pattern) from the ALCT and CLCT information, and constructs two correlated LCT "digis".

Author
Benn Tannenbaum 28 August 1999 benn@.nosp@m.phys.nosp@m.ics.u.nosp@m.cla..nosp@m.edu

Based on code by Nick Wisniewski (nw@it.nosp@m.s.ca.nosp@m.ltech.nosp@m..edu) and a framework by Darin Acosta (acost.nosp@m.a@ph.nosp@m.ys.uf.nosp@m.l.ed.nosp@m.u).

Numerous later improvements by Jason Mumford and Slava Valuev (see cvs in ORCA). Porting from ORCA by S. Valuev (Slava.nosp@m..Val.nosp@m.uev@c.nosp@m.ern..nosp@m.ch), May 2006.

Extended for Run-3 and Phase-2 by Vadim Khotilovich, Tao Huang and Sven Dildick

Definition at line 50 of file CSCMotherboard.h.

Constructor & Destructor Documentation

CSCMotherboard::CSCMotherboard ( unsigned  endcap,
unsigned  station,
unsigned  sector,
unsigned  subsector,
unsigned  chamber,
const edm::ParameterSet conf 
)

Normal constructor.

Definition at line 13 of file CSCMotherboard.cc.

References alct_trig_enable, alctProc, allLCTs_, checkConfigParameters(), clct_trig_enable, clctProc, cscOverlap_, drop_used_clcts, dumpConfigParams(), early_tbins, CSCBaseboard::enableAlctPhase2_, Reference_intrackfit_cff::endcap, edm::ParameterSet::getParameter(), ignoreAlctCrossClct_, CSCBaseboard::infoV, match_earliest_clct_only_, match_trig_enable, match_trig_window_size, mpc_block_me1a, preferred_bx_match_, qualityAssignment_, qualityControl_, readout_earliest_2, CSCBaseboard::runPhase2_, LCTContainer::setMatchTrigWindowSize(), CSCBaseboard::showerParams_, showerSource_, relativeConstraints::station, CSCBaseboard::theRing, tmb_l1a_window_size, and CSCBaseboard::tmbParams_.

19  : CSCBaseboard(endcap, station, sector, subsector, chamber, conf) {
20  // Normal constructor. -JM
21  // Pass ALCT, CLCT, and common parameters on to ALCT and CLCT processors.
22  static std::atomic<bool> config_dumped{false};
23 
24  mpc_block_me1a = tmbParams_.getParameter<unsigned int>("mpcBlockMe1a");
25  alct_trig_enable = tmbParams_.getParameter<unsigned int>("alctTrigEnable");
26  clct_trig_enable = tmbParams_.getParameter<unsigned int>("clctTrigEnable");
27  match_trig_enable = tmbParams_.getParameter<unsigned int>("matchTrigEnable");
28  match_trig_window_size = tmbParams_.getParameter<unsigned int>("matchTrigWindowSize");
29  tmb_l1a_window_size = // Common to CLCT and TMB
30  tmbParams_.getParameter<unsigned int>("tmbL1aWindowSize");
31 
32  // configuration handle for number of early time bins
33  early_tbins = tmbParams_.getParameter<int>("tmbEarlyTbins");
34 
35  // whether to not reuse CLCTs that were used by previous matching ALCTs
36  drop_used_clcts = tmbParams_.getParameter<bool>("tmbDropUsedClcts");
37 
38  // whether to readout only the earliest two LCTs in readout window
39  readout_earliest_2 = tmbParams_.getParameter<bool>("tmbReadoutEarliest2");
40 
41  match_earliest_clct_only_ = tmbParams_.getParameter<bool>("matchEarliestClctOnly");
42 
43  infoV = tmbParams_.getParameter<int>("verbosity");
44 
45  alctProc = std::make_unique<CSCAnodeLCTProcessor>(endcap, station, sector, subsector, chamber, conf);
46  clctProc = std::make_unique<CSCCathodeLCTProcessor>(endcap, station, sector, subsector, chamber, conf);
47 
48  // Check and print configuration parameters.
50  if (infoV > 0 && !config_dumped) {
52  config_dumped = true;
53  }
54 
55  allLCTs_.setMatchTrigWindowSize(match_trig_window_size);
56 
57  // get the preferred CLCT BX match array
58  preferred_bx_match_ = tmbParams_.getParameter<std::vector<int> >("preferredBxMatch");
59 
60  // quality assignment
61  qualityAssignment_ = std::make_unique<LCTQualityAssignment>(endcap, station, sector, subsector, chamber, conf);
62 
63  // quality control of stubs
64  qualityControl_ = std::make_unique<LCTQualityControl>(endcap, station, sector, subsector, chamber, conf);
65 
66  // shower-trigger source
67  showerSource_ = showerParams_.getParameter<unsigned>("source");
68 
69  // enable the upgrade processors for ring 1 stations
70  if (runPhase2_ and theRing == 1) {
71  clctProc = std::make_unique<CSCUpgradeCathodeLCTProcessor>(endcap, station, sector, subsector, chamber, conf);
72  if (enableAlctPhase2_) {
73  alctProc = std::make_unique<CSCUpgradeAnodeLCTProcessor>(endcap, station, sector, subsector, chamber, conf);
74  }
75  }
76 
77  // set up helper class to check if ALCT and CLCT cross
78  ignoreAlctCrossClct_ = tmbParams_.getParameter<bool>("ignoreAlctCrossClct");
79  if (!ignoreAlctCrossClct_) {
80  cscOverlap_ = std::make_unique<CSCALCTCrossCLCT>(endcap, station, theRing, ignoreAlctCrossClct_, conf);
81  }
82 }
LCTContainer allLCTs_
unsigned int clct_trig_enable
unsigned int match_trig_window_size
bool enableAlctPhase2_
Definition: CSCBaseboard.h:94
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
void setMatchTrigWindowSize(unsigned trig_window_size)
Definition: LCTContainer.h:41
unsigned int mpc_block_me1a
std::vector< int > preferred_bx_match_
bool match_earliest_clct_only_
std::unique_ptr< CSCALCTCrossCLCT > cscOverlap_
unsigned int tmb_l1a_window_size
void checkConfigParameters()
unsigned int match_trig_enable
edm::ParameterSet tmbParams_
Definition: CSCBaseboard.h:78
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
unsigned int alct_trig_enable
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
unsigned showerSource_
void dumpConfigParams() const
unsigned theRing
Definition: CSCBaseboard.h:48
edm::ParameterSet showerParams_
Definition: CSCBaseboard.h:87
std::unique_ptr< LCTQualityControl > qualityControl_
std::unique_ptr< LCTQualityAssignment > qualityAssignment_
CSCMotherboard::~CSCMotherboard ( )
overridedefault

Default destructor.

Member Function Documentation

void CSCMotherboard::checkConfigParameters ( )
protected

Make sure that the parameter values are within the allowed range.

Definition at line 547 of file CSCMotherboard.cc.

References alct_trig_enable, CSCBaseboard::checkConfigParameters(), clct_trig_enable, def_alct_trig_enable, def_clct_trig_enable, def_match_trig_enable, def_match_trig_window_size, def_mpc_block_me1a, def_tmb_l1a_window_size, match_trig_enable, match_trig_window_size, mpc_block_me1a, and tmb_l1a_window_size.

Referenced by CSCMotherboard(), and setConfigParameters().

547  {
548  // Make sure that the parameter values are within the allowed range.
549 
550  // Max expected values.
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;
557 
558  // Checks.
559  CSCBaseboard::checkConfigParameters(mpc_block_me1a, max_mpc_block_me1a, def_mpc_block_me1a, "mpc_block_me1a");
560  CSCBaseboard::checkConfigParameters(alct_trig_enable, max_alct_trig_enable, def_alct_trig_enable, "alct_trig_enable");
561  CSCBaseboard::checkConfigParameters(clct_trig_enable, max_clct_trig_enable, def_clct_trig_enable, "clct_trig_enable");
563  match_trig_enable, max_match_trig_enable, def_match_trig_enable, "match_trig_enable");
565  match_trig_window_size, max_match_trig_window_size, def_match_trig_window_size, "match_trig_window_size");
567  tmb_l1a_window_size, max_tmb_l1a_window_size, def_tmb_l1a_window_size, "tmb_l1a_window_size");
568 }
unsigned int clct_trig_enable
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)
static const unsigned int def_mpc_block_me1a
static const unsigned int def_clct_trig_enable
unsigned int mpc_block_me1a
static const unsigned int def_tmb_l1a_window_size
unsigned int tmb_l1a_window_size
unsigned int match_trig_enable
static const unsigned int def_match_trig_window_size
unsigned int alct_trig_enable
static const unsigned int def_match_trig_enable
void CSCMotherboard::clear ( void  )

Clears correlated LCT and passes clear signal on to cathode and anode LCT processors.

Definition at line 84 of file CSCMotherboard.cc.

References alctProc, alctV, allLCTs_, clctProc, clctV, CSCShowerDigi::clear(), LCTContainer::clear(), lctV, and shower_.

Referenced by CSCGEMMotherboard::clear(), and run().

84  {
85  // clear the processors
86  if (alctProc)
87  alctProc->clear();
88  if (clctProc)
89  clctProc->clear();
90 
91  // clear the ALCT and CLCT containers
92  alctV.clear();
93  clctV.clear();
94  lctV.clear();
95 
96  allLCTs_.clear();
97 
98  // reset the shower trigger
99  shower_.clear();
100 }
LCTContainer allLCTs_
std::vector< CSCCLCTDigi > clctV
std::vector< CSCCorrelatedLCTDigi > lctV
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
std::vector< CSCALCTDigi > alctV
CSCShowerDigi shower_
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
void clear()
clear this Shower
void CSCMotherboard::constructLCTs ( const CSCALCTDigi aLCT,
const CSCCLCTDigi cLCT,
int  type,
int  trknmb,
CSCCorrelatedLCTDigi lct 
) const
protected

Definition at line 477 of file CSCMotherboard.cc.

References makePileupJSON::bx, encodePattern(), CSCCLCTDigi::getBend(), CSCALCTDigi::getBX(), CSCCLCTDigi::getBX(), getBXShiftedALCT(), getBXShiftedCLCT(), CSCCLCTDigi::getEighthStripBit(), CSCCLCTDigi::getKeyStrip(), CSCALCTDigi::getKeyWG(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getQuartStripBit(), CSCCLCTDigi::getRun3Pattern(), CSCCLCTDigi::getSlope(), CSCALCTDigi::isValid(), qualityAssignment_, CSCBaseboard::runCCLUT_, CSCCorrelatedLCTDigi::setALCT(), CSCCorrelatedLCTDigi::setBend(), CSCCorrelatedLCTDigi::setBX(), CSCCorrelatedLCTDigi::setBX0(), CSCCorrelatedLCTDigi::setCLCT(), CSCCorrelatedLCTDigi::setCSCID(), CSCCorrelatedLCTDigi::setEighthStripBit(), CSCCorrelatedLCTDigi::setMPCLink(), CSCCorrelatedLCTDigi::setPattern(), CSCCorrelatedLCTDigi::setQuality(), CSCCorrelatedLCTDigi::setQuartStripBit(), CSCCorrelatedLCTDigi::setRun3(), CSCCorrelatedLCTDigi::setRun3Pattern(), CSCCorrelatedLCTDigi::setSlope(), CSCCorrelatedLCTDigi::setStrip(), CSCCorrelatedLCTDigi::setSyncErr(), CSCCorrelatedLCTDigi::setTrknmb(), CSCCorrelatedLCTDigi::setType(), CSCCorrelatedLCTDigi::setValid(), CSCCorrelatedLCTDigi::setWireGroup(), and CSCBaseboard::theTrigChamber.

Referenced by correlateLCTs().

478  {
479  thisLCT.setValid(true);
480  thisLCT.setType(type);
481  // make sure to shift the ALCT BX from 8 to 3 and the CLCT BX from 8 to 7!
482  thisLCT.setALCT(getBXShiftedALCT(aLCT));
483  thisLCT.setCLCT(getBXShiftedCLCT(cLCT));
484  thisLCT.setPattern(encodePattern(cLCT.getPattern()));
485  thisLCT.setMPCLink(0);
486  thisLCT.setBX0(0);
487  thisLCT.setSyncErr(0);
488  thisLCT.setCSCID(theTrigChamber);
489  thisLCT.setTrknmb(trknmb);
490  thisLCT.setWireGroup(aLCT.getKeyWG());
491  thisLCT.setStrip(cLCT.getKeyStrip());
492  thisLCT.setBend(cLCT.getBend());
493  // Bunch crossing: get it from cathode LCT if anode LCT is not there.
494  int bx = aLCT.isValid() ? aLCT.getBX() : cLCT.getBX();
495  thisLCT.setBX(bx);
496  thisLCT.setQuality(qualityAssignment_->findQuality(aLCT, cLCT));
497  if (runCCLUT_) {
498  thisLCT.setRun3(true);
499  // 4-bit slope value derived with the CCLUT algorithm
500  thisLCT.setSlope(cLCT.getSlope());
501  thisLCT.setQuartStripBit(cLCT.getQuartStripBit());
502  thisLCT.setEighthStripBit(cLCT.getEighthStripBit());
503  thisLCT.setRun3Pattern(cLCT.getRun3Pattern());
504  }
505 }
uint16_t getRun3Pattern() const
return pattern
Definition: CSCCLCTDigi.h:68
uint16_t getBX() const
return BX
Definition: CSCCLCTDigi.h:123
uint16_t getBend() const
Definition: CSCCLCTDigi.h:93
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
CSCCLCTDigi getBXShiftedCLCT(const CSCCLCTDigi &) const
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:40
uint16_t getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:73
uint16_t getKeyStrip(const uint16_t n=2) const
Definition: CSCCLCTDigi.cc:107
const unsigned theTrigChamber
Definition: CSCBaseboard.h:46
bool getEighthStripBit() const
get single eighth strip bit
Definition: CSCCLCTDigi.h:114
unsigned int encodePattern(const int clctPattern) const
uint16_t getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:67
uint16_t getSlope() const
return the slope
Definition: CSCCLCTDigi.h:74
uint16_t getPattern() const
return pattern
Definition: CSCCLCTDigi.h:62
bool getQuartStripBit() const
get single quart strip bit
Definition: CSCCLCTDigi.h:108
std::unique_ptr< LCTQualityAssignment > qualityAssignment_
void CSCMotherboard::copyValidToInValid ( CSCALCTDigi bestALCT,
CSCALCTDigi secondALCT,
CSCCLCTDigi bestCLCT,
CSCCLCTDigi secondCLCT 
) const
protected

Definition at line 447 of file CSCMotherboard.cc.

References CSCALCTDigi::isValid(), and CSCCLCTDigi::isValid().

Referenced by correlateLCTs(), and CSCGEMMotherboard::correlateLCTsGEM().

450  {
451  // check which ALCTs and CLCTs are valid
452  const bool anodeBestValid = bestALCT.isValid();
453  const bool anodeSecondValid = secondALCT.isValid();
454  const bool cathodeBestValid = bestCLCT.isValid();
455  const bool cathodeSecondValid = secondCLCT.isValid();
456 
457  // copy the valid ALCT/CLCT information to the valid ALCT/CLCT
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;
466 }
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:40
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:50
void CSCMotherboard::correlateLCTs ( const CSCALCTDigi bestALCT,
const CSCALCTDigi secondALCT,
const CSCCLCTDigi bestCLCT,
const CSCCLCTDigi secondCLCT,
CSCCorrelatedLCTDigi bLCT,
CSCCorrelatedLCTDigi sLCT,
int  type 
) const
protected

Definition at line 377 of file CSCMotherboard.cc.

References alct_trig_enable, clct_trig_enable, CSCCLCTDigi::clear(), constructLCTs(), copyValidToInValid(), doesALCTCrossCLCT(), CSCCLCTDigi::getQuality(), CSCALCTDigi::isValid(), CSCCLCTDigi::isValid(), match_trig_enable, and or.

Referenced by matchALCTCLCT().

383  {
384  CSCALCTDigi bestALCT = bALCT;
385  CSCALCTDigi secondALCT = sALCT;
386  CSCCLCTDigi bestCLCT = bCLCT;
387  CSCCLCTDigi secondCLCT = sCLCT;
388 
389  // extra check to make sure that both CLCTs have at least 4 layers
390  // for regular ALCT-CLCT type LCTs. A check was already done on the
391  // best CLCT, but not yet on the second best CLCT. The check on best
392  // CLCT is repeated for completeness
393  if (bestCLCT.getQuality() <= 3)
394  bestCLCT.clear();
395  if (secondCLCT.getQuality() <= 3)
396  secondCLCT.clear();
397 
398  // check which ALCTs and CLCTs are valid
399  // if the best ALCT/CLCT is valid, but the second ALCT/CLCT is not,
400  // the information is copied over
401  copyValidToInValid(bestALCT, secondALCT, bestCLCT, secondCLCT);
402 
403  // ALCT-only LCTs
404  const bool bestCase1(alct_trig_enable and bestALCT.isValid());
405  // CLCT-only LCTs
406  const bool bestCase2(clct_trig_enable and bestCLCT.isValid());
407  /*
408  Normal case: ALCT-CLCT matched LCTs. We require ALCT and CLCT to be valid.
409  Optionally, we can check if the ALCT cross the CLCT. This check will always return true
410  for a valid ALCT-CLCT pair in non-ME1/1 chambers. For ME1/1 chambers, it returns true,
411  only when the ALCT-CLCT pair crosses and when the parameter "checkAlctCrossClct" is set to True.
412  It is recommended to keep "checkAlctCrossClct" set to False, so that the EMTF receives
413  all information, even if it's unphysical.
414  */
415  const bool bestCase3(match_trig_enable and bestALCT.isValid() and bestCLCT.isValid() and
416  doesALCTCrossCLCT(bestALCT, bestCLCT));
417 
418  // at least one of the cases must be valid
419  if (bestCase1 or bestCase2 or bestCase3) {
420  constructLCTs(bestALCT, bestCLCT, type, 1, bLCT);
421  }
422 
423  // ALCT-only LCTs
424  const bool secondCase1(alct_trig_enable and secondALCT.isValid());
425  // CLCT-only LCTs
426  const bool secondCase2(clct_trig_enable and secondCLCT.isValid());
427  /*
428  Normal case: ALCT-CLCT matched LCTs. We require ALCT and CLCT to be valid.
429  Optionally, we can check if the ALCT cross the CLCT. This check will always return true
430  for a valid ALCT-CLCT pair in non-ME1/1 chambers. For ME1/1 chambers, it returns true,
431  only when the ALCT-CLCT pair crosses and when the parameter "checkAlctCrossClct" is set to True.
432  It is recommended to keep "checkAlctCrossClct" set to False, so that the EMTF receives
433  all information, even if it's unphysical.
434  */
435  const bool secondCase3(match_trig_enable and secondALCT.isValid() and secondCLCT.isValid() and
436  doesALCTCrossCLCT(secondALCT, secondCLCT));
437 
438  // at least one component must be different in order to consider the secondLCT
439  if ((secondALCT != bestALCT) or (secondCLCT != bestCLCT)) {
440  // at least one of the cases must be valid
441  if (secondCase1 or secondCase2 or secondCase3) {
442  constructLCTs(secondALCT, secondCLCT, type, 2, sLCT);
443  }
444  }
445 }
unsigned int clct_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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:40
void copyValidToInValid(CSCALCTDigi &, CSCALCTDigi &, CSCCLCTDigi &, CSCCLCTDigi &) const
bool doesALCTCrossCLCT(const CSCALCTDigi &, const CSCCLCTDigi &) const
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:50
unsigned int match_trig_enable
void constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb, CSCCorrelatedLCTDigi &lct) const
unsigned int alct_trig_enable
void clear()
clear this CLCT
Definition: CSCCLCTDigi.cc:73
uint16_t getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTDigi.h:56
bool CSCMotherboard::doesALCTCrossCLCT ( const CSCALCTDigi alct,
const CSCCLCTDigi clct 
) const
protected

Definition at line 468 of file CSCMotherboard.cc.

References cscOverlap_, and ignoreAlctCrossClct_.

Referenced by correlateLCTs().

468  {
470  return true;
471  else
472  return cscOverlap_->doesALCTCrossCLCT(alct, clct);
473 }
std::unique_ptr< CSCALCTCrossCLCT > cscOverlap_
void CSCMotherboard::dumpConfigParams ( ) const
protected

Dump TMB/MPC configuration parameters.

Definition at line 570 of file CSCMotherboard.cc.

References alct_trig_enable, clct_trig_enable, LogDebug, match_trig_enable, match_trig_window_size, mpc_block_me1a, and tmb_l1a_window_size.

Referenced by CSCMotherboard(), and setConfigParameters().

570  {
571  std::ostringstream strm;
572  strm << "\n";
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();
584 }
unsigned int clct_trig_enable
unsigned int match_trig_window_size
unsigned int mpc_block_me1a
unsigned int tmb_l1a_window_size
unsigned int match_trig_enable
unsigned int alct_trig_enable
#define LogDebug(id)
void CSCMotherboard::encodeHighMultiplicityBits ( )
protected

Definition at line 598 of file CSCMotherboard.cc.

References alctProc, clctProc, shower_, showerSource_, and CSCBaseboard::theTrigChamber.

Referenced by CSCGEMMotherboard::run(), and run().

598  {
599  // get the high multiplicity
600  // for anode this reflects what is already in the anode CSCShowerDigi object
601  unsigned cathodeInTime = clctProc->getInTimeHMT();
602  unsigned anodeInTime = alctProc->getInTimeHMT();
603 
604  // assign the bits
605  unsigned inTimeHMT_;
606 
607  // set the value according to source
608  switch (showerSource_) {
609  case 0:
610  inTimeHMT_ = cathodeInTime;
611  break;
612  case 1:
613  inTimeHMT_ = anodeInTime;
614  break;
615  case 2:
616  inTimeHMT_ = anodeInTime | cathodeInTime;
617  break;
618  case 3:
619  inTimeHMT_ = anodeInTime & cathodeInTime;
620  break;
621  default:
622  inTimeHMT_ = cathodeInTime;
623  break;
624  };
625 
626  // create a new object
627  shower_ = CSCShowerDigi(inTimeHMT_, 0, theTrigChamber);
628 }
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
const unsigned theTrigChamber
Definition: CSCBaseboard.h:46
CSCShowerDigi shower_
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
unsigned showerSource_
unsigned int CSCMotherboard::encodePattern ( const int  clctPattern) const
protected

Definition at line 508 of file CSCMotherboard.cc.

References funct::abs().

Referenced by constructLCTs(), and CSCGEMMotherboard::constructLCTsGEM().

508  {
509  const int kPatternBitWidth = 4;
510 
511  // In the TMB07 firmware, LCT pattern is just a 4-bit CLCT pattern.
512  unsigned int pattern = (abs(ptn) & ((1 << kPatternBitWidth) - 1));
513 
514  return pattern;
515 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
CSCALCTDigi CSCMotherboard::getBXShiftedALCT ( const CSCALCTDigi aLCT) const
protected

Definition at line 586 of file CSCMotherboard.cc.

References CSCConstants::ALCT_CENTRAL_BX, CSCALCTDigi::getBX(), CSCConstants::LCT_CENTRAL_BX, and CSCALCTDigi::setBX().

Referenced by constructLCTs(), and CSCGEMMotherboard::constructLCTsGEM().

586  {
587  CSCALCTDigi aLCT_shifted = aLCT;
588  aLCT_shifted.setBX(aLCT_shifted.getBX() - (CSCConstants::LCT_CENTRAL_BX - CSCConstants::ALCT_CENTRAL_BX));
589  return aLCT_shifted;
590 }
uint16_t getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:73
void setBX(const uint16_t BX)
set BX
Definition: CSCALCTDigi.h:76
CSCCLCTDigi CSCMotherboard::getBXShiftedCLCT ( const CSCCLCTDigi cLCT) const
protected

Definition at line 592 of file CSCMotherboard.cc.

References CSCConstants::ALCT_CLCT_OFFSET, CSCCLCTDigi::getBX(), and CSCCLCTDigi::setBX().

Referenced by constructLCTs(), and CSCGEMMotherboard::constructLCTsGEM().

592  {
593  CSCCLCTDigi cLCT_shifted = cLCT;
594  cLCT_shifted.setBX(cLCT_shifted.getBX() - CSCConstants::ALCT_CLCT_OFFSET);
595  return cLCT_shifted;
596 }
uint16_t getBX() const
return BX
Definition: CSCCLCTDigi.h:123
void setBX(const uint16_t bx)
set bx
Definition: CSCCLCTDigi.h:129
void CSCMotherboard::matchALCTCLCT ( bool  bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
protected

Definition at line 170 of file CSCMotherboard.cc.

References CSCConstants::ALCT_CLCT_OFFSET, alct_trig_enable, CSCCorrelatedLCTDigi::ALCTCLCT, CSCCorrelatedLCTDigi::ALCTONLY, alctProc, allLCTs_, clct_trig_enable, CSCCorrelatedLCTDigi::CLCTONLY, clctProc, correlateLCTs(), drop_used_clcts, CSCBaseboard::infoV, LogTrace, match_earliest_clct_only_, match_trig_window_size, CSCConstants::MAX_ALCT_TBINS, CSCConstants::MAX_CLCT_TBINS, and preferred_bx_match_.

Referenced by CSCGEMMotherboard::run(), and run().

170  {
171  // array to mask CLCTs
172  bool used_clct_mask[CSCConstants::MAX_CLCT_TBINS] = {false};
173 
174  // Step 3: ALCT-centric ALCT-to-CLCT matching
175  int bx_clct_matched = 0; // bx of last matched CLCT
176  for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++) {
177  // do not consider LCT building in this BX if the mask was set
178  // this check should have no effect on the regular LCT finding
179  // it does play a role in the LCT finding for GEM-CSC ILTs
180  // namely, if a GEM-CSC ILT was found a bunch crossing, the
181  // algorithm would skip the bunch crossing for regular LCT finding
182  if (bunch_crossing_mask[bx_alct])
183  continue;
184 
185  // There should be at least one valid CLCT or ALCT for a
186  // correlated LCT to be formed. Decision on whether to reject
187  // non-complete LCTs (and if yes of which type) is made further
188  // upstream.
189  if (alctProc->getBestALCT(bx_alct).isValid()) {
190  // Look for CLCTs within the match-time window. The window is
191  // centered at the ALCT bx; therefore, we make an assumption
192  // that anode and cathode hits are perfectly synchronized. This
193  // is always true for MC, but only an approximation when the
194  // data is analyzed (which works fairly good as long as wide
195  // windows are used). To get rid of this assumption, one would
196  // need to access "full BX" words, which are not readily
197  // available.
198  bool is_matched = false;
199  // loop on the preferred "delta BX" array
200  for (unsigned mbx = 0; mbx < match_trig_window_size; mbx++) {
201  // evaluate the preffered CLCT BX, taking into account that there is an offset in the simulation
202  unsigned bx_clct = bx_alct + preferred_bx_match_[mbx] - CSCConstants::ALCT_CLCT_OFFSET;
203  // check that the CLCT BX is valid
204  if (bx_clct >= CSCConstants::MAX_CLCT_TBINS)
205  continue;
206  // do not consider previously matched CLCTs
207  if (drop_used_clcts && used_clct_mask[bx_clct])
208  continue;
209  // only consider >=4 layer CLCTs for ALCT-CLCT type LCTs
210  // this condition is lowered to >=3 layers for CLCTs in the
211  // matchALCTCLCTGEM function
212  if (clctProc->getBestCLCT(bx_clct).getQuality() <= 3)
213  continue;
214  // a valid CLCT with sufficient layers!
215  if (clctProc->getBestCLCT(bx_clct).isValid()) {
216  if (infoV > 1)
217  LogTrace("CSCMotherboard") << "Successful ALCT-CLCT match: bx_alct = " << bx_alct
218  << "; bx_clct = " << bx_clct << "; mbx = " << mbx;
219  // now correlate the ALCT and CLCT into LCT.
220  // smaller mbx means more preferred!
221  correlateLCTs(alctProc->getBestALCT(bx_alct),
222  alctProc->getSecondALCT(bx_alct),
223  clctProc->getBestCLCT(bx_clct),
224  clctProc->getSecondCLCT(bx_clct),
225  allLCTs_(bx_alct, mbx, 0),
226  allLCTs_(bx_alct, mbx, 1),
228  // when the first LCT is valid, you can mask the matched CLCT and/or
229  // move on to the next ALCT if match_earliest_clct_only_ is set to true
230  if (allLCTs_(bx_alct, mbx, 0).isValid()) {
231  is_matched = true;
232  used_clct_mask[bx_clct] = true;
233  bunch_crossing_mask[bx_alct] = true;
234  bx_clct_matched = bx_clct;
236  break;
237  }
238  }
239  }
240  // No CLCT within the match time interval found: report ALCT-only LCT
241  // (use dummy CLCTs).
242  if (!is_matched) {
243  if (infoV > 1)
244  LogTrace("CSCMotherboard") << "Unsuccessful ALCT-CLCT match (ALCT only): bx_alct = " << bx_alct
245  << " first ALCT " << alctProc->getBestALCT(bx_alct);
246  if (alct_trig_enable)
247  correlateLCTs(alctProc->getBestALCT(bx_alct),
248  alctProc->getSecondALCT(bx_alct),
249  clctProc->getBestCLCT(bx_alct),
250  clctProc->getSecondCLCT(bx_alct),
251  allLCTs_(bx_alct, 0, 0),
252  allLCTs_(bx_alct, 0, 1),
254  }
255  }
256  // No valid ALCTs; attempt to make CLCT-only LCT. Use only CLCTs
257  // which have zeroth chance to be matched at later cathode times.
258  // (I am not entirely sure this perfectly matches the firmware logic.)
259  // Use dummy ALCTs.
260  else {
261  int bx_clct = bx_alct - match_trig_window_size / 2;
262  if (bx_clct >= 0 && bx_clct > bx_clct_matched) {
263  if (clctProc->getBestCLCT(bx_clct).isValid() and clct_trig_enable) {
264  if (infoV > 1)
265  LogTrace("CSCMotherboard") << "Unsuccessful ALCT-CLCT match (CLCT only): bx_clct = " << bx_clct;
266  correlateLCTs(alctProc->getBestALCT(bx_alct),
267  alctProc->getSecondALCT(bx_alct),
268  clctProc->getBestCLCT(bx_clct),
269  clctProc->getSecondCLCT(bx_clct),
270  allLCTs_(bx_clct, 0, 0),
271  allLCTs_(bx_clct, 0, 1),
273  }
274  }
275  }
276  }
277 }
LCTContainer allLCTs_
unsigned int clct_trig_enable
unsigned int match_trig_window_size
void correlateLCTs(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, CSCCorrelatedLCTDigi &bLCT, CSCCorrelatedLCTDigi &sLCT, int type) const
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
#define LogTrace(id)
std::vector< int > preferred_bx_match_
bool match_earliest_clct_only_
unsigned int alct_trig_enable
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
std::vector< CSCCorrelatedLCTDigi > CSCMotherboard::readoutLCTs ( ) const
virtual

Definition at line 282 of file CSCMotherboard.cc.

References makePileupJSON::bx, CSCBaseboard::infoV, CSCBaseboard::isME11_, CSCConstants::LCT_CENTRAL_BX, lctV, LogDebug, CSCConstants::MAX_HALF_STRIP_ME1B, CSCConstants::MAX_LCT_TBINS, mpc_block_me1a, qualityControl_, readout_earliest_2, and tmb_l1a_window_size.

Referenced by CSCTriggerPrimitivesBuilder::build().

282  {
283  // temporary container for further selection
284  std::vector<CSCCorrelatedLCTDigi> tmpV;
285 
286  /*
287  LCTs in the BX window [early_tbin,...,late_tbin] are considered good for physics
288  The central LCT BX is time bin 8.
289  For tmb_l1a_window_size set to 7 (Run-1, Run-2), the window is [5, 6, 7, 8, 9, 10, 11]
290  For tmb_l1a_window_size set to 5 (Run-3), the window is [6, 7, 8, 9, 10]
291  For tmb_l1a_window_size set to 3 (Run-4?), the window is [ 7, 8, 9]
292  */
293  const unsigned delta_tbin = tmb_l1a_window_size / 2;
294  int early_tbin = CSCConstants::LCT_CENTRAL_BX - delta_tbin;
295  int late_tbin = CSCConstants::LCT_CENTRAL_BX + delta_tbin;
296  /*
297  Special case for an even-numbered time-window,
298  For instance tmb_l1a_window_size set to 6: [5, 6, 7, 8, 9, 10]
299  */
300  if (tmb_l1a_window_size % 2 == 0)
301  late_tbin = CSCConstants::LCT_CENTRAL_BX + delta_tbin - 1;
302  const int max_late_tbin = CSCConstants::MAX_LCT_TBINS - 1;
303 
304  // debugging messages when early_tbin or late_tbin has a suspicious value
305  if (early_tbin < 0) {
306  edm::LogWarning("CSCMotherboard|SuspiciousParameters")
307  << "Early time bin (early_tbin) smaller than minimum allowed, which is 0. set early_tbin to 0.";
308  early_tbin = 0;
309  }
310  if (late_tbin > max_late_tbin) {
311  edm::LogWarning("CSCMotherboard|SuspiciousParameters")
312  << "Late time bin (late_tbin) larger than maximum allowed, which is " << max_late_tbin
313  << ". set early_tbin to max allowed";
314  late_tbin = CSCConstants::MAX_LCT_TBINS - 1;
315  }
316 
317  // Start from the vector of all found correlated LCTs and select
318  // those within the LCT*L1A coincidence window.
319  int bx_readout = -1;
320  for (const auto& lct : lctV) {
321  // extra check on invalid LCTs
322  if (!lct.isValid()) {
323  continue;
324  }
325 
326  const int bx = lct.getBX();
327  // Skip LCTs found too early relative to L1Accept.
328  if (bx < early_tbin) {
329  if (infoV > 1)
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;
333  continue;
334  }
335 
336  // Skip LCTs found too late relative to L1Accept.
337  if (bx > late_tbin) {
338  if (infoV > 1)
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;
342  continue;
343  }
344 
345  // Do not report LCTs found in ME1/A if mpc_block_me1a is set.
346  if (mpc_block_me1a and isME11_ and lct.getStrip() > CSCConstants::MAX_HALF_STRIP_ME1B) {
347  continue;
348  }
349 
350  // If (readout_earliest_2) take only LCTs in the earliest bx in the read-out window:
351  // in digi->raw step, LCTs have to be packed into the TMB header, and
352  // currently there is room just for two.
353  if (readout_earliest_2) {
354  if (bx_readout == -1 || bx == bx_readout) {
355  tmpV.push_back(lct);
356  if (bx_readout == -1)
357  bx_readout = bx;
358  }
359  }
360  // if readout_earliest_2 == false, save all LCTs
361  else {
362  tmpV.push_back(lct);
363  }
364  }
365 
366  // do a final check on the LCTs in readout
367  qualityControl_->checkMultiplicityBX(tmpV);
368  for (const auto& lct : tmpV) {
369  qualityControl_->checkValid(lct);
370  }
371 
372  return tmpV;
373 }
std::vector< CSCCorrelatedLCTDigi > lctV
unsigned int mpc_block_me1a
unsigned int tmb_l1a_window_size
Log< level::Warning, false > LogWarning
std::unique_ptr< LCTQualityControl > qualityControl_
#define LogDebug(id)
CSCShowerDigi CSCMotherboard::readoutShower ( ) const

Returns shower bits

Definition at line 375 of file CSCMotherboard.cc.

References shower_.

Referenced by CSCTriggerPrimitivesBuilder::build().

375 { return shower_; }
CSCShowerDigi shower_
void CSCMotherboard::run ( const CSCWireDigiCollection wiredc,
const CSCComparatorDigiCollection compdc 
)

Run function for normal usage. Runs cathode and anode LCT processors, takes results and correlates into CorrelatedLCT.

Definition at line 132 of file CSCMotherboard.cc.

References alctProc, alctV, clctProc, clctV, clear(), CSCBaseboard::cscGeometry_, encodeHighMultiplicityBits(), lookupTableCCLUT_, matchALCTCLCT(), CSCConstants::MAX_ALCT_TBINS, CSCBaseboard::runCCLUT_, and selectLCTs().

Referenced by CSCTriggerPrimitivesBuilder::build().

132  {
133  // Step 1: Setup
134  clear();
135 
136  // Check for existing processors
137  if (!(alctProc && clctProc)) {
138  edm::LogError("CSCMotherboard|SetupError") << "+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
139  return;
140  }
141 
142  // set geometry
143  alctProc->setCSCGeometry(cscGeometry_);
144  clctProc->setCSCGeometry(cscGeometry_);
145 
146  // set CCLUT parameters if necessary
147  if (runCCLUT_) {
148  clctProc->setESLookupTables(lookupTableCCLUT_);
149  }
150 
151  // Step 2: Run the processors
152  alctV = alctProc->run(wiredc); // run anodeLCT
153  clctV = clctProc->run(compdc); // run cathodeLCT
154 
155  // Step 2b: encode high multiplicity bits (independent of LCT construction)
157 
158  // if there are no ALCTs and no CLCTs, it does not make sense to run this TMB
159  if (alctV.empty() and clctV.empty())
160  return;
161 
162  // step 3: match the ALCTs to the CLCTs
163  bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS] = {false};
164  matchALCTCLCT(bunch_crossing_mask);
165 
166  // Step 4: Select at most 2 LCTs per BX
167  selectLCTs();
168 }
void matchALCTCLCT(bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
std::vector< CSCCLCTDigi > clctV
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
Log< level::Error, false > LogError
std::vector< CSCALCTDigi > alctV
const CSCGeometry * cscGeometry_
Definition: CSCBaseboard.h:71
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
const CSCL1TPLookupTableCCLUT * lookupTableCCLUT_
void encodeHighMultiplicityBits()
void CSCMotherboard::selectLCTs ( )

Definition at line 517 of file CSCMotherboard.cc.

References allLCTs_, makePileupJSON::bx, mps_fire::i, CSCBaseboard::infoV, sistrip::SpyUtilities::isValid(), lctV, LogDebug, match_trig_window_size, CSCConstants::MAX_LCT_TBINS, and CSCConstants::MAX_LCTS_PER_CSC.

Referenced by CSCGEMMotherboard::run(), and run().

517  {
518  // in each of the LCT time bins
519  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
520  unsigned nLCTs = 0;
521 
522  std::vector<CSCCorrelatedLCTDigi> tempV;
523  // check each of the preferred combinations
524  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
525  // select at most 2
526  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
527  if (allLCTs_(bx, mbx, i).isValid() and nLCTs < 2) {
528  tempV.push_back(allLCTs_(bx, mbx, i));
529  ++nLCTs;
530  }
531  }
532  }
533  // store the best 2
534  for (const auto& lct : tempV) {
535  lctV.push_back(lct);
536  }
537  }
538 
539  // Show the pre-selected LCTs. They're not final yet. Some selection is done in the readoutLCTs function
540  if (infoV > 0) {
541  for (const auto& lct : lctV) {
542  LogDebug("CSCMotherboard") << "Selected LCT" << lct;
543  }
544  }
545 }
LCTContainer allLCTs_
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
unsigned int match_trig_window_size
std::vector< CSCCorrelatedLCTDigi > lctV
#define LogDebug(id)
void CSCMotherboard::setConfigParameters ( const CSCDBL1TPParameters conf)

Set configuration parameters obtained via EventSetup mechanism.

Definition at line 103 of file CSCMotherboard.cc.

References alct_trig_enable, alctProc, checkConfigParameters(), clct_trig_enable, clctProc, dumpConfigParams(), match_trig_enable, match_trig_window_size, mpc_block_me1a, tmb_l1a_window_size, CSCDBL1TPParameters::tmbAlctTrigEnable(), CSCDBL1TPParameters::tmbClctTrigEnable(), CSCDBL1TPParameters::tmbMatchTrigEnable(), CSCDBL1TPParameters::tmbMatchTrigWindowSize(), CSCDBL1TPParameters::tmbMpcBlockMe1a(), and CSCDBL1TPParameters::tmbTmbL1aWindowSize().

103  {
104  static std::atomic<bool> config_dumped{false};
105 
106  // Config. parameters for the TMB itself.
113 
114  // Config. paramteres for ALCT and CLCT processors.
115  alctProc->setConfigParameters(conf);
116  clctProc->setConfigParameters(conf);
117 
118  // Check and print configuration parameters.
120  if (!config_dumped) {
122  config_dumped = true;
123  }
124 }
unsigned int clct_trig_enable
unsigned int match_trig_window_size
unsigned int tmbClctTrigEnable() const
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
unsigned int mpc_block_me1a
unsigned int tmbTmbL1aWindowSize() const
unsigned int tmbMatchTrigWindowSize() const
unsigned int tmbAlctTrigEnable() const
unsigned int tmb_l1a_window_size
void checkConfigParameters()
unsigned int match_trig_enable
unsigned int tmbMpcBlockMe1a() const
unsigned int alct_trig_enable
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
void dumpConfigParams() const
unsigned int tmbMatchTrigEnable() const
void CSCMotherboard::setESLookupTables ( const CSCL1TPLookupTableCCLUT conf)

Definition at line 126 of file CSCMotherboard.cc.

References lookupTableCCLUT_.

126 { lookupTableCCLUT_ = conf; }
const CSCL1TPLookupTableCCLUT * lookupTableCCLUT_
void CSCMotherboard::setESLookupTables ( const CSCL1TPLookupTableME11ILT conf)

Definition at line 128 of file CSCMotherboard.cc.

References lookupTableME11ILT_.

128 { lookupTableME11ILT_ = conf; }
const CSCL1TPLookupTableME11ILT * lookupTableME11ILT_
void CSCMotherboard::setESLookupTables ( const CSCL1TPLookupTableME21ILT conf)

Definition at line 130 of file CSCMotherboard.cc.

References lookupTableME21ILT_.

130 { lookupTableME21ILT_ = conf; }
const CSCL1TPLookupTableME21ILT * lookupTableME21ILT_

Member Data Documentation

unsigned int CSCMotherboard::alct_trig_enable
protected
std::unique_ptr<CSCAnodeLCTProcessor> CSCMotherboard::alctProc
std::vector<CSCALCTDigi> CSCMotherboard::alctV
protected

Definition at line 117 of file CSCMotherboard.h.

Referenced by clear(), CSCGEMMotherboard::run(), and run().

LCTContainer CSCMotherboard::allLCTs_
protected

Container with all LCTs prior to sorting and selecting.

Definition at line 121 of file CSCMotherboard.h.

Referenced by clear(), CSCMotherboard(), CSCGEMMotherboard::matchALCT2GEM(), matchALCTCLCT(), CSCGEMMotherboard::matchALCTCLCTGEM(), CSCGEMMotherboard::matchCLCT2GEM(), and selectLCTs().

unsigned int CSCMotherboard::clct_trig_enable
protected
std::unique_ptr<CSCCathodeLCTProcessor> CSCMotherboard::clctProc
std::vector<CSCCLCTDigi> CSCMotherboard::clctV
protected

Definition at line 118 of file CSCMotherboard.h.

Referenced by clear(), CSCGEMMotherboard::run(), and run().

std::unique_ptr<CSCALCTCrossCLCT> CSCMotherboard::cscOverlap_
protected

Definition at line 179 of file CSCMotherboard.h.

Referenced by CSCMotherboard(), and doesALCTCrossCLCT().

const unsigned int CSCMotherboard::def_alct_trig_enable = 0
staticprotected

Definition at line 163 of file CSCMotherboard.h.

Referenced by checkConfigParameters().

const unsigned int CSCMotherboard::def_clct_trig_enable = 0
staticprotected

Definition at line 163 of file CSCMotherboard.h.

Referenced by checkConfigParameters().

const unsigned int CSCMotherboard::def_match_trig_enable = 1
staticprotected

Definition at line 164 of file CSCMotherboard.h.

Referenced by checkConfigParameters().

const unsigned int CSCMotherboard::def_match_trig_window_size = 7
staticprotected

Definition at line 164 of file CSCMotherboard.h.

Referenced by checkConfigParameters().

const unsigned int CSCMotherboard::def_mpc_block_me1a = 1
staticprotected

Default values of configuration parameters.

Definition at line 162 of file CSCMotherboard.h.

Referenced by checkConfigParameters().

const unsigned int CSCMotherboard::def_tmb_l1a_window_size = 7
staticprotected

Definition at line 165 of file CSCMotherboard.h.

Referenced by checkConfigParameters().

bool CSCMotherboard::drop_used_clcts
protected

Phase2: whether to not reuse CLCTs that were used by previous matching ALCTs

Definition at line 138 of file CSCMotherboard.h.

Referenced by CSCMotherboard(), matchALCTCLCT(), CSCGEMMotherboard::matchALCTCLCTGEM(), and CSCGEMMotherboard::matchCLCT2GEM().

int CSCMotherboard::early_tbins
protected

Phase2: separate handle for early time bins

Definition at line 141 of file CSCMotherboard.h.

Referenced by CSCMotherboard().

bool CSCMotherboard::ignoreAlctCrossClct_
protected

Definition at line 152 of file CSCMotherboard.h.

Referenced by CSCMotherboard(), and doesALCTCrossCLCT().

std::vector<CSCCorrelatedLCTDigi> CSCMotherboard::lctV
protected

Definition at line 124 of file CSCMotherboard.h.

Referenced by clear(), readoutLCTs(), and selectLCTs().

const CSCL1TPLookupTableCCLUT* CSCMotherboard::lookupTableCCLUT_
protected

Definition at line 112 of file CSCMotherboard.h.

Referenced by CSCGEMMotherboard::run(), run(), and setESLookupTables().

const CSCL1TPLookupTableME11ILT* CSCMotherboard::lookupTableME11ILT_
protected

Definition at line 113 of file CSCMotherboard.h.

Referenced by CSCGEMMotherboard::run(), and setESLookupTables().

const CSCL1TPLookupTableME21ILT* CSCMotherboard::lookupTableME21ILT_
protected

Definition at line 114 of file CSCMotherboard.h.

Referenced by CSCGEMMotherboard::run(), and setESLookupTables().

bool CSCMotherboard::match_earliest_clct_only_
protected
unsigned int CSCMotherboard::match_trig_enable
protected
unsigned int CSCMotherboard::match_trig_window_size
protected
unsigned int CSCMotherboard::mpc_block_me1a
protected

Configuration parameters.

Definition at line 133 of file CSCMotherboard.h.

Referenced by checkConfigParameters(), CSCMotherboard(), dumpConfigParams(), readoutLCTs(), and setConfigParameters().

std::vector<int> CSCMotherboard::preferred_bx_match_
protected
std::unique_ptr<LCTQualityAssignment> CSCMotherboard::qualityAssignment_
protected
std::unique_ptr<LCTQualityControl> CSCMotherboard::qualityControl_
protected

Definition at line 171 of file CSCMotherboard.h.

Referenced by CSCMotherboard(), and readoutLCTs().

bool CSCMotherboard::readout_earliest_2
protected

Phase2: whether to readout only the earliest two LCTs in readout window

Definition at line 144 of file CSCMotherboard.h.

Referenced by CSCMotherboard(), and readoutLCTs().

CSCShowerDigi CSCMotherboard::shower_
protected

Definition at line 126 of file CSCMotherboard.h.

Referenced by clear(), encodeHighMultiplicityBits(), and readoutShower().

unsigned CSCMotherboard::showerSource_
protected

Definition at line 150 of file CSCMotherboard.h.

Referenced by CSCMotherboard(), and encodeHighMultiplicityBits().

unsigned int CSCMotherboard::tmb_l1a_window_size
protected