CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
CSCUpgradeMotherboard Class Reference

#include <CSCUpgradeMotherboard.h>

Inheritance diagram for CSCUpgradeMotherboard:
CSCMotherboard CSCBaseboard CSCGEMMotherboard CSCMotherboardME11 CSCGEMMotherboardME11 CSCGEMMotherboardME21

Public Member Functions

void clear ()
 
template<class S >
bool compare (const S &p, const S &q) const
 
 CSCUpgradeMotherboard ()
 
 CSCUpgradeMotherboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
void debugLUTs ()
 
enum CSCPart getCSCPart (int keystrip) const
 
template<class S >
void intersection (const S &d1, const S &d2, S &result) const
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs () const override
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc) override
 
void setupGeometry ()
 
void sortLCTs (std::vector< CSCCorrelatedLCTDigi > &lcts, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
 
 ~CSCUpgradeMotherboard () override
 
- Public Member Functions inherited from CSCMotherboard
void clear ()
 
 CSCMotherboard ()
 
 CSCMotherboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
std::vector< CSCCorrelatedLCTDigigetLCTs () const
 
void setConfigParameters (const CSCDBL1TPParameters *conf)
 
 ~CSCMotherboard () override=default
 
- Public Member Functions inherited from CSCBaseboard
 CSCBaseboard ()
 
 CSCBaseboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
std::string getCSCName () const
 
void setCSCGeometry (const CSCGeometry *g)
 
virtual ~CSCBaseboard ()=default
 

Static Public Member Functions

static bool sortLCTsByGEMDphi (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 
static bool sortLCTsByQuality (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 

Protected Member Functions

void correlateLCTs (const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
 
void setPrefIndex ()
 
- Protected Member Functions inherited from CSCMotherboard
void checkConfigParameters ()
 
CSCCorrelatedLCTDigi constructLCTs (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb) const
 
void correlateLCTs (const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, int type)
 
void dumpConfigParams () const
 
void encodeHighMultiplicityBits (unsigned alctBits)
 
unsigned int encodePattern (const int clctPattern) const
 
LCT_Quality findQuality (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT) const
 
LCT_QualityRun3 findQualityRun3 (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT) const
 
CSCALCTDigi getBXShiftedALCT (const CSCALCTDigi &) const
 
CSCCLCTDigi getBXShiftedCLCT (const CSCCLCTDigi &) const
 
- 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

LCTContainer allLCTs
 
bool debug_luts
 
bool debug_matching
 
std::unique_ptr< CSCUpgradeMotherboardLUTGeneratorgenerator_
 
bool match_earliest_alct_only
 
bool match_earliest_clct_only
 
unsigned int max_lcts
 
int pref [CSCConstants::MAX_LCT_TBINS]
 
Parity theParity
 
unsigned int tmb_cross_bx_algo
 
- Protected Attributes inherited from CSCMotherboard
unsigned int alct_trig_enable
 
std::vector< CSCALCTDigialctV
 
bool clct_to_alct
 
unsigned int clct_trig_enable
 
std::vector< CSCCLCTDigiclctV
 
bool drop_used_alcts
 
bool drop_used_clcts
 
int early_tbins
 
CSCCorrelatedLCTDigi firstLCT [CSCConstants::MAX_LCT_TBINS]
 
unsigned int highMultiplicityBits_
 
unsigned int match_trig_enable
 
unsigned int match_trig_window_size
 
unsigned int mpc_block_me1a
 
std::unique_ptr< LCTQualityControlqualityControl_
 
bool readout_earliest_2
 
CSCCorrelatedLCTDigi secondLCT [CSCConstants::MAX_LCT_TBINS]
 
unsigned int tmb_l1a_window_size
 
bool useHighMultiplicityBits_
 
- 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 isME21_
 
bool isME31_
 
bool isME41_
 
bool runCCLUT_
 
bool runME11ILT_
 
bool runME11Up_
 
bool runME21ILT_
 
bool runME21Up_
 
bool runME31Up_
 
bool runME41Up_
 
bool runPhase2_
 
unsigned theChamber
 
std::string theCSCName_
 
const unsigned theEndcap
 
unsigned theRegion
 
unsigned theRing
 
const unsigned theSector
 
const unsigned theStation
 
const unsigned theSubsector
 
const unsigned theTrigChamber
 
edm::ParameterSet tmbParams_
 

Additional Inherited Members

- Public Attributes inherited from CSCMotherboard
std::unique_ptr< CSCAnodeLCTProcessoralctProc
 
std::unique_ptr< CSCCathodeLCTProcessorclctProc
 
- Protected Types inherited from CSCMotherboard
enum  LCT_Quality : unsigned int {
  LCT_Quality::INVALID = 0, LCT_Quality::NO_CLCT = 1, LCT_Quality::NO_ALCT = 2, LCT_Quality::CLCT_LAYER_TRIGGER = 3,
  LCT_Quality::LOW_QUALITY = 4, LCT_Quality::MARGINAL_ANODE_CATHODE = 5, LCT_Quality::HQ_ANODE_MARGINAL_CATHODE = 6, LCT_Quality::HQ_CATHODE_MARGINAL_ANODE = 7,
  LCT_Quality::HQ_ACCEL_ALCT = 8, LCT_Quality::HQ_RESERVED_1 = 9, LCT_Quality::HQ_RESERVED_2 = 10, LCT_Quality::HQ_PATTERN_2_3 = 11,
  LCT_Quality::HQ_PATTERN_4_5 = 12, LCT_Quality::HQ_PATTERN_6_7 = 13, LCT_Quality::HQ_PATTERN_8_9 = 14, LCT_Quality::HQ_PATTERN_10 = 15
}
 
enum  LCT_QualityRun3 : unsigned int { LCT_QualityRun3::INVALID = 0, LCT_QualityRun3::LowQ = 1, LCT_QualityRun3::MedQ = 2, LCT_QualityRun3::HighQ = 3 }
 
- Static Protected Attributes inherited from CSCMotherboard
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

Base class for upgrade TMBs (MEX/1) chambers, that either run the upgrade CSC-only TMB algorithm or the CSC-GEM algorithm

Author
Sven Dildick (TAMU)

Definition at line 35 of file CSCUpgradeMotherboard.h.

Constructor & Destructor Documentation

◆ CSCUpgradeMotherboard() [1/2]

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

Definition at line 5 of file CSCUpgradeMotherboard.cc.

11  : // special configuration parameters for ME11 treatment
12  CSCMotherboard(endcap, station, sector, subsector, chamber, conf),
14  if (!runPhase2_)
15  edm::LogError("CSCUpgradeMotherboard|SetupError") << "+++ TMB constructed while runPhase2_ is not set! +++\n";
16 
17  if (theRing == 1) {
18  if (theStation == 1 and !runME11Up_)
19  edm::LogError("CSCUpgradeMotherboard|SetupError") << "+++ TMB constructed while runME11Up_ is not set! +++\n";
20  if (theStation == 2 and !runME21Up_)
21  edm::LogError("CSCUpgradeMotherboard|SetupError") << "+++ TMB constructed while runME21Up_ is not set! +++\n";
22  if (theStation == 3 and !runME31Up_)
23  edm::LogError("CSCUpgradeMotherboard|SetupError") << "+++ TMB constructed while runME31Up_ is not set! +++\n";
24  if (theStation == 4 and !runME41Up_)
25  edm::LogError("CSCUpgradeMotherboard|SetupError") << "+++ TMB constructed while runME41Up_ is not set! +++\n";
26  }
27 
29 
30  // generate the LUTs
31  generator_ = std::make_unique<CSCUpgradeMotherboardLUTGenerator>();
32 
33  // enable the upgrade processors
34  if (runPhase2_ and theRing == 1) {
35  clctProc = std::make_unique<CSCUpgradeCathodeLCTProcessor>(endcap, station, sector, subsector, chamber, conf);
36  if (enableAlctPhase2_) {
37  alctProc = std::make_unique<CSCUpgradeAnodeLCTProcessor>(endcap, station, sector, subsector, chamber, conf);
38  }
39  }
40 
41  match_earliest_alct_only = tmbParams_.getParameter<bool>("matchEarliestAlctOnly");
42  match_earliest_clct_only = tmbParams_.getParameter<bool>("matchEarliestClctOnly");
43  clct_to_alct = tmbParams_.getParameter<bool>("clctToAlct");
44  drop_used_clcts = tmbParams_.getParameter<bool>("tmbDropUsedClcts");
45  tmb_cross_bx_algo = tmbParams_.getParameter<unsigned int>("tmbCrossBxAlgorithm");
46  max_lcts = tmbParams_.getParameter<unsigned int>("maxLCTs");
47  debug_matching = tmbParams_.getParameter<bool>("debugMatching");
48  debug_luts = tmbParams_.getParameter<bool>("debugLUTs");
49 
50  setPrefIndex();
51 }

References CSCMotherboard::alctProc, relativeConstraints::chamber, CSCMotherboard::clct_to_alct, CSCMotherboard::clctProc, debug_luts, debug_matching, CSCMotherboard::drop_used_clcts, CSCBaseboard::enableAlctPhase2_, makeMuonMisalignmentScenario::endcap, Even, generator_, edm::ParameterSet::getParameter(), match_earliest_alct_only, match_earliest_clct_only, max_lcts, Odd, CSCBaseboard::runME11Up_, CSCBaseboard::runME21Up_, CSCBaseboard::runME31Up_, CSCBaseboard::runME41Up_, CSCBaseboard::runPhase2_, setPrefIndex(), relativeConstraints::station, CSCBaseboard::theChamber, theParity, CSCBaseboard::theRing, CSCBaseboard::theStation, tmb_cross_bx_algo, and CSCBaseboard::tmbParams_.

◆ CSCUpgradeMotherboard() [2/2]

CSCUpgradeMotherboard::CSCUpgradeMotherboard ( )

Definition at line 53 of file CSCUpgradeMotherboard.cc.

54  if (!runPhase2_)
55  edm::LogError("CSCUpgradeMotherboard|SetupError") << "+++ TMB constructed while runPhase2_ is not set! +++\n";
56 
57  if (theRing == 1) {
58  if (theStation == 1 and !runME11Up_)
59  edm::LogError("CSCUpgradeMotherboard|SetupError") << "+++ TMB constructed while runME11Up_ is not set! +++\n";
60  if (theStation == 2 and !runME21Up_)
61  edm::LogError("CSCUpgradeMotherboard|SetupError") << "+++ TMB constructed while runME21Up_ is not set! +++\n";
62  if (theStation == 3 and !runME31Up_)
63  edm::LogError("CSCUpgradeMotherboard|SetupError") << "+++ TMB constructed while runME31Up_ is not set! +++\n";
64  if (theStation == 4 and !runME41Up_)
65  edm::LogError("CSCUpgradeMotherboard|SetupError") << "+++ TMB constructed while runME41Up_ is not set! +++\n";
66  }
67 
68  setPrefIndex();
69 }

References CSCBaseboard::runME11Up_, CSCBaseboard::runME21Up_, CSCBaseboard::runME31Up_, CSCBaseboard::runME41Up_, CSCBaseboard::runPhase2_, setPrefIndex(), CSCBaseboard::theRing, and CSCBaseboard::theStation.

◆ ~CSCUpgradeMotherboard()

CSCUpgradeMotherboard::~CSCUpgradeMotherboard ( )
override

Definition at line 277 of file CSCUpgradeMotherboard.cc.

277 {}

Member Function Documentation

◆ clear()

void CSCUpgradeMotherboard::clear ( void  )

◆ compare()

template<class S >
bool CSCUpgradeMotherboard::compare ( const S p,
const S q 
) const

Definition at line 122 of file CSCUpgradeMotherboard.h.

122  {
123  return (p.first == q.first) and (p.second == q.second);
124 }

References AlCaHLTBitMon_ParallelJobs::p, and submitPVResolutionJobs::q.

Referenced by intersection().

◆ correlateLCTs()

void CSCUpgradeMotherboard::correlateLCTs ( const CSCALCTDigi bestALCT,
const CSCALCTDigi secondALCT,
const CSCCLCTDigi bestCLCT,
const CSCCLCTDigi secondCLCT,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2 
) const
protected

Definition at line 222 of file CSCUpgradeMotherboard.cc.

227  {
228  CSCALCTDigi bestALCT = bALCT;
229  CSCALCTDigi secondALCT = sALCT;
230  CSCCLCTDigi bestCLCT = bCLCT;
231  CSCCLCTDigi secondCLCT = sCLCT;
232 
233  const bool anodeBestValid = bestALCT.isValid();
234  const bool anodeSecondValid = secondALCT.isValid();
235  const bool cathodeBestValid = bestCLCT.isValid();
236  const bool cathodeSecondValid = secondCLCT.isValid();
237 
238  if (anodeBestValid and !anodeSecondValid)
239  secondALCT = bestALCT;
240  if (!anodeBestValid and anodeSecondValid)
241  bestALCT = secondALCT;
242  if (cathodeBestValid and !cathodeSecondValid)
243  secondCLCT = bestCLCT;
244  if (!cathodeBestValid and cathodeSecondValid)
245  bestCLCT = secondCLCT;
246 
247  // ALCT-CLCT matching conditions are defined by "trig_enable" configuration
248  // parameters.
249  if ((alct_trig_enable and bestALCT.isValid()) or (clct_trig_enable and bestCLCT.isValid()) or
250  (match_trig_enable and bestALCT.isValid() and bestCLCT.isValid())) {
251  lct1 = constructLCTs(bestALCT, bestCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 1);
252  }
253 
254  if (((secondALCT != bestALCT) or (secondCLCT != bestCLCT)) and
255  ((alct_trig_enable and secondALCT.isValid()) or (clct_trig_enable and secondCLCT.isValid()) or
256  (match_trig_enable and secondALCT.isValid() and secondCLCT.isValid()))) {
257  lct2 = constructLCTs(secondALCT, secondCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 2);
258  }
259 }

References CSCMotherboard::alct_trig_enable, CSCCorrelatedLCTDigi::ALCTCLCT, CSCMotherboard::clct_trig_enable, CSCMotherboard::constructLCTs(), CSCALCTDigi::isValid(), CSCCLCTDigi::isValid(), CSCMotherboard::match_trig_enable, and or.

Referenced by run().

◆ debugLUTs()

void CSCUpgradeMotherboard::debugLUTs ( )

◆ getCSCPart()

enum CSCPart CSCUpgradeMotherboard::getCSCPart ( int  keystrip) const

get CSCPart from HS, station, ring number

Definition at line 279 of file CSCUpgradeMotherboard.cc.

279  {
280  if (theStation == 1 and (theRing == 1 or theRing == 4)) {
281  if (keystrip > CSCConstants::MAX_HALF_STRIP_ME1B) {
282  if (gangedME1a_)
283  return CSCPart::ME1Ag;
284  else
285  return CSCPart::ME1A;
286  } else if (keystrip <= CSCConstants::MAX_HALF_STRIP_ME1B and keystrip >= 0)
287  return CSCPart::ME1B;
288  else
289  return CSCPart::ME11;
290  } else if (theStation == 2 and theRing == 1)
291  return CSCPart::ME21;
292  else if (theStation == 3 and theRing == 1)
293  return CSCPart::ME31;
294  else if (theStation == 4 and theRing == 1)
295  return CSCPart::ME41;
296  else {
297  edm::LogError("CSCUpgradeMotherboard|Error") << " ++ getCSCPart() failed to find the CSC chamber for in case ";
298  return CSCPart::ME11; // return ME11 by default
299  }
300 }

References CSCBaseboard::gangedME1a_, CSCConstants::MAX_HALF_STRIP_ME1B, ME11, ME1A, ME1Ag, ME1B, ME21, ME31, ME41, or, CSCBaseboard::theRing, and CSCBaseboard::theStation.

Referenced by CSCGEMMotherboard::bestMatchingPad(), CSCGEMMotherboard::constructLCTsGEM(), and CSCGEMMotherboard::matchingPads().

◆ intersection()

template<class S >
void CSCUpgradeMotherboard::intersection ( const S d1,
const S d2,
S result 
) const

Definition at line 127 of file CSCUpgradeMotherboard.h.

127  {
128  for (const auto& p : d1) {
129  for (const auto& q : d2) {
130  if (compare(p, q)) {
131  result.push_back(p);
132  }
133  }
134  }
135 }

References compare(), d1, AlCaHLTBitMon_ParallelJobs::p, submitPVResolutionJobs::q, and mps_fire::result.

Referenced by CSCGEMMotherboard::matchingPads().

◆ readoutLCTs()

std::vector< CSCCorrelatedLCTDigi > CSCUpgradeMotherboard::readoutLCTs ( ) const
overridevirtual

Returns vector of correlated LCTs in the read-out time window, if any.

Reimplemented from CSCMotherboard.

Definition at line 262 of file CSCUpgradeMotherboard.cc.

262  {
263  std::vector<CSCCorrelatedLCTDigi> result;
265  if (tmb_cross_bx_algo == 2)
267 
268  // do a final check on the LCTs in readout
269  qualityControl_->checkMultiplicityBX(result);
270  for (const auto& lct : result) {
271  qualityControl_->checkValid(lct);
272  }
273 
274  return result;
275 }

References allLCTs, LCTContainer::getMatched(), CSCMotherboard::qualityControl_, mps_fire::result, sortLCTs(), sortLCTsByQuality(), and tmb_cross_bx_algo.

Referenced by CSCTriggerPrimitivesBuilder::build(), CSCMotherboardME11::readoutLCTs1a(), CSCMotherboardME11::readoutLCTs1b(), and run().

◆ run()

void CSCUpgradeMotherboard::run ( const CSCWireDigiCollection wiredc,
const CSCComparatorDigiCollection compdc 
)
overridevirtual

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

Reimplemented from CSCMotherboard.

Definition at line 71 of file CSCUpgradeMotherboard.cc.

71  {
72  clear();
73 
74  if (!(alctProc and clctProc)) {
75  edm::LogError("CSCUpgradeMotherboard|SetupError")
76  << "+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
77  return;
78  }
79 
80  alctProc->setCSCGeometry(cscGeometry_);
81  clctProc->setCSCGeometry(cscGeometry_);
82 
83  alctV = alctProc->run(wiredc); // run anodeLCT
84  clctV = clctProc->run(compdc); // run cathodeLCT
85 
86  // if there are no ALCTs and no CLCTs, it does not make sense to run this TMB
87  if (alctV.empty() and clctV.empty())
88  return;
89 
90  // encode high multiplicity bits
91  unsigned alctBits = alctProc->getHighMultiplictyBits();
93 
94  int used_clct_mask[20];
95  for (int c = 0; c < 20; ++c)
96  used_clct_mask[c] = 0;
97 
98  // ALCT centric matching
99  for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++) {
100  if (alctProc->getBestALCT(bx_alct).isValid()) {
101  const int bx_clct_start(bx_alct - match_trig_window_size / 2 - CSCConstants::ALCT_CLCT_OFFSET);
102  const int bx_clct_stop(bx_alct + match_trig_window_size / 2 - CSCConstants::ALCT_CLCT_OFFSET);
103 
104  if (debug_matching) {
105  LogTrace("CSCUpgradeMotherboard")
106  << "========================================================================" << std::endl;
107  LogTrace("CSCUpgradeMotherboard") << "ALCT-CLCT matching in ME34/1 chamber: " << cscId_ << std::endl;
108  LogTrace("CSCUpgradeMotherboard")
109  << "------------------------------------------------------------------------" << std::endl;
110  LogTrace("CSCUpgradeMotherboard") << "+++ Best ALCT Details: ";
111  alctProc->getBestALCT(bx_alct).print();
112  LogTrace("CSCUpgradeMotherboard") << "+++ Second ALCT Details: ";
113  alctProc->getSecondALCT(bx_alct).print();
114 
115  LogTrace("CSCUpgradeMotherboard")
116  << "------------------------------------------------------------------------" << std::endl;
117  LogTrace("CSCUpgradeMotherboard") << "Attempt ALCT-CLCT matching in ME34/13 in bx range: [" << bx_clct_start
118  << "," << bx_clct_stop << "]" << std::endl;
119  }
120 
121  // ALCT-to-CLCT
122  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
123  if (bx_clct < 0 or bx_clct >= CSCConstants::MAX_CLCT_TBINS)
124  continue;
125  if (drop_used_clcts and used_clct_mask[bx_clct])
126  continue;
127  if (clctProc->getBestCLCT(bx_clct).isValid()) {
128  if (debug_matching)
129  LogTrace("CSCUpgradeMotherboard") << "++Valid ME21 CLCT: " << clctProc->getBestCLCT(bx_clct) << std::endl;
130 
131  int mbx = bx_clct - bx_clct_start;
132  CSCUpgradeMotherboard::correlateLCTs(alctProc->getBestALCT(bx_alct),
133  alctProc->getSecondALCT(bx_alct),
134  clctProc->getBestCLCT(bx_clct),
135  clctProc->getSecondCLCT(bx_clct),
136  allLCTs(bx_alct, mbx, 0),
137  allLCTs(bx_alct, mbx, 1));
138  if (infoV > 1)
139  LogTrace("CSCUpgradeMotherboard")
140  << "Successful ALCT-CLCT match in ME21: bx_alct = " << bx_alct << "; match window: [" << bx_clct_start
141  << "; " << bx_clct_stop << "]; bx_clct = " << bx_clct << std::endl;
142  LogTrace("CSCUpgradeMotherboard") << "+++ Best CLCT Details: ";
143  clctProc->getBestCLCT(bx_clct).print();
144  LogTrace("CSCUpgradeMotherboard") << "+++ Second CLCT Details: ";
145  clctProc->getSecondCLCT(bx_clct).print();
146  if (allLCTs(bx_alct, mbx, 0).isValid()) {
147  used_clct_mask[bx_clct] += 1;
149  break;
150  }
151  }
152  }
153  }
154  }
155 
156  // reduction of nLCTs per each BX
157  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
158  // counting
159  unsigned int n = 0;
160  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
161  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
162  if (allLCTs(bx, mbx, i).isValid()) {
163  ++n;
164  if (infoV > 0) {
165  LogDebug("CSCUpgradeMotherboard")
166  << "LCT" << i + 1 << " " << bx << "/" << bx + mbx - match_trig_window_size / 2 << ": "
167  << allLCTs(bx, mbx, i) << std::endl;
168  }
169  }
170  }
171  }
172 
173  // some simple cross-bx sorting algorithms
174  if (tmb_cross_bx_algo == 1 and (n > 2)) {
175  n = 0;
176  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
177  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
178  if (allLCTs(bx, pref[mbx], i).isValid()) {
179  n++;
180  if (n > 2)
181  allLCTs(bx, pref[mbx], i).clear();
182  }
183  }
184  }
185 
186  n = 0;
187  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
188  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
189  if (allLCTs(bx, mbx, i).isValid()) {
190  n++;
191  if (infoV > 0) {
192  LogDebug("CSCUpgradeMotherboard")
193  << "LCT" << i + 1 << " " << bx << "/" << bx + mbx - match_trig_window_size / 2 << ": "
194  << allLCTs(bx, mbx, i) << std::endl;
195  }
196  }
197  }
198  }
199  if (infoV > 0 and n > 0)
200  LogDebug("CSCUpgradeMotherboard") << "bx " << bx << " nnLCT:" << n << " " << n << std::endl;
201  } // x-bx sorting
202  }
203 
204  bool first = true;
205  unsigned int n = 0;
206  for (const auto& p : readoutLCTs()) {
207  if (debug_matching and first) {
208  LogTrace("CSCUpgradeMotherboard") << "========================================================================"
209  << std::endl;
210  LogTrace("CSCUpgradeMotherboard") << "Counting the final LCTs" << std::endl;
211  LogTrace("CSCUpgradeMotherboard") << "========================================================================"
212  << std::endl;
213  first = false;
214  LogTrace("CSCUpgradeMotherboard") << "tmb_cross_bx_algo: " << tmb_cross_bx_algo << std::endl;
215  }
216  n++;
217  if (debug_matching)
218  LogTrace("CSCUpgradeMotherboard") << "LCT " << n << " " << p << std::endl;
219  }
220 }

References CSCConstants::ALCT_CLCT_OFFSET, CSCMotherboard::alctProc, CSCMotherboard::alctV, allLCTs, l1GtPatternGenerator_cfi::bx, HltBtagPostValidation_cff::c, CSCMotherboard::clctProc, CSCMotherboard::clctV, LCTContainer::clear(), clear(), correlateLCTs(), CSCBaseboard::cscGeometry_, CSCBaseboard::cscId_, debug_matching, CSCMotherboard::drop_used_clcts, CSCMotherboard::encodeHighMultiplicityBits(), dqmdumpme::first, mps_fire::i, CSCBaseboard::infoV, LogDebug, LogTrace, match_earliest_clct_only, CSCMotherboard::match_trig_window_size, CSCConstants::MAX_ALCT_TBINS, CSCConstants::MAX_CLCT_TBINS, CSCConstants::MAX_LCT_TBINS, CSCConstants::MAX_LCTS_PER_CSC, dqmiodumpmetadata::n, AlCaHLTBitMon_ParallelJobs::p, pref, readoutLCTs(), and tmb_cross_bx_algo.

Referenced by CSCTriggerPrimitivesBuilder::build().

◆ setPrefIndex()

void CSCUpgradeMotherboard::setPrefIndex ( )
protected

Definition at line 324 of file CSCUpgradeMotherboard.cc.

324  {
325  pref[0] = match_trig_window_size / 2;
326  for (unsigned int m = 2; m < match_trig_window_size; m += 2) {
327  pref[m - 1] = pref[0] - m / 2;
328  pref[m] = pref[0] + m / 2;
329  }
330 }

References visualization-live-secondInstance_cfg::m, CSCMotherboard::match_trig_window_size, and pref.

Referenced by CSCUpgradeMotherboard().

◆ setupGeometry()

void CSCUpgradeMotherboard::setupGeometry ( )

Definition at line 322 of file CSCUpgradeMotherboard.cc.

322 { generator_->setCSCGeometry(cscGeometry_); }

References CSCBaseboard::cscGeometry_, and generator_.

Referenced by CSCGEMMotherboard::setupGeometry().

◆ sortLCTs()

void CSCUpgradeMotherboard::sortLCTs ( std::vector< CSCCorrelatedLCTDigi > &  lcts,
bool(*)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)  sorter 
) const

Definition at line 315 of file CSCUpgradeMotherboard.cc.

316  {
317  std::sort(lcts.begin(), lcts.end(), *sorter);
318  if (lcts.size() > max_lcts)
319  lcts.erase(lcts.begin() + max_lcts, lcts.end());
320 }

References max_lcts, and MCScenario_CRAFT1_22X::sorter().

Referenced by CSCGEMMotherboardME21::readoutLCTs(), readoutLCTs(), and CSCGEMMotherboardME11::sortLCTs().

◆ sortLCTsByGEMDphi()

bool CSCUpgradeMotherboard::sortLCTsByGEMDphi ( const CSCCorrelatedLCTDigi lct1,
const CSCCorrelatedLCTDigi lct2 
)
static

Definition at line 311 of file CSCUpgradeMotherboard.cc.

311  {
312  return true;
313 }

Referenced by CSCGEMMotherboardME21::readoutLCTs(), and CSCGEMMotherboardME11::readoutLCTsME11().

◆ sortLCTsByQuality()

bool CSCUpgradeMotherboard::sortLCTsByQuality ( const CSCCorrelatedLCTDigi lct1,
const CSCCorrelatedLCTDigi lct2 
)
static

Methods to sort the LCTs

Definition at line 307 of file CSCUpgradeMotherboard.cc.

307  {
308  return lct1.getQuality() > lct2.getQuality();
309 }

References CSCCorrelatedLCTDigi::getQuality().

Referenced by CSCGEMMotherboardME21::readoutLCTs(), readoutLCTs(), and CSCGEMMotherboardME11::readoutLCTsME11().

Member Data Documentation

◆ allLCTs

LCTContainer CSCUpgradeMotherboard::allLCTs
protected

◆ debug_luts

bool CSCUpgradeMotherboard::debug_luts
protected

Definition at line 118 of file CSCUpgradeMotherboard.h.

Referenced by CSCUpgradeMotherboard(), and debugLUTs().

◆ debug_matching

bool CSCUpgradeMotherboard::debug_matching
protected

◆ generator_

std::unique_ptr<CSCUpgradeMotherboardLUTGenerator> CSCUpgradeMotherboard::generator_
protected

◆ match_earliest_alct_only

bool CSCUpgradeMotherboard::match_earliest_alct_only
protected

Definition at line 105 of file CSCUpgradeMotherboard.h.

Referenced by CSCUpgradeMotherboard(), and CSCMotherboardME11::run().

◆ match_earliest_clct_only

bool CSCUpgradeMotherboard::match_earliest_clct_only
protected

◆ max_lcts

unsigned int CSCUpgradeMotherboard::max_lcts
protected

maximum lcts per BX in MEX1: 2, 3, 4 or 999

Definition at line 112 of file CSCUpgradeMotherboard.h.

Referenced by CSCUpgradeMotherboard(), CSCGEMMotherboardME11::sortLCTs(), and sortLCTs().

◆ pref

int CSCUpgradeMotherboard::pref[CSCConstants::MAX_LCT_TBINS]
protected

"preferential" index array in matching window for cross-BX sorting

Definition at line 103 of file CSCUpgradeMotherboard.h.

Referenced by CSCGEMMotherboardME21::run(), CSCMotherboardME11::run(), run(), and setPrefIndex().

◆ theParity

Parity CSCUpgradeMotherboard::theParity
protected

◆ tmb_cross_bx_algo

unsigned int CSCUpgradeMotherboard::tmb_cross_bx_algo
protected
CSCMotherboard::qualityControl_
std::unique_ptr< LCTQualityControl > qualityControl_
Definition: CSCMotherboard.h:128
ME11
Definition: CSCUpgradeMotherboardLUT.h:12
mps_fire.i
i
Definition: mps_fire.py:428
CSCBaseboard::theEndcap
const unsigned theEndcap
Definition: CSCBaseboard.h:42
CSCMotherboard::match_trig_window_size
unsigned int match_trig_window_size
Definition: CSCMotherboard.h:99
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
CSCBaseboard::theSector
const unsigned theSector
Definition: CSCBaseboard.h:44
ME41
Definition: CSCUpgradeMotherboardLUT.h:12
CSCBaseboard::cscGeometry_
const CSCGeometry * cscGeometry_
Definition: CSCBaseboard.h:66
CSCConstants::MAX_ALCT_TBINS
Definition: CSCConstants.h:64
CSCBaseboard::tmbParams_
edm::ParameterSet tmbParams_
Definition: CSCBaseboard.h:73
relativeConstraints.station
station
Definition: relativeConstraints.py:67
CSCMotherboard::alctProc
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
Definition: CSCMotherboard.h:75
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CSCBaseboard::theStation
const unsigned theStation
Definition: CSCBaseboard.h:43
CSCUpgradeMotherboard::clear
void clear()
Definition: CSCUpgradeMotherboard.cc:332
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
CSCUpgradeMotherboard::compare
bool compare(const S &p, const S &q) const
Definition: CSCUpgradeMotherboard.h:122
CSCMotherboard::clear
void clear()
Definition: CSCMotherboard.cc:89
CSCUpgradeMotherboard::tmb_cross_bx_algo
unsigned int tmb_cross_bx_algo
Definition: CSCUpgradeMotherboard.h:109
CSCMotherboard::clct_trig_enable
unsigned int clct_trig_enable
Definition: CSCMotherboard.h:98
CSCConstants::ALCT_CLCT_OFFSET
Definition: CSCConstants.h:81
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
dqmdumpme.first
first
Definition: dqmdumpme.py:55
CSCCLCTDigi
Definition: CSCCLCTDigi.h:17
CSCCorrelatedLCTDigi::ALCTCLCT
Definition: CSCCorrelatedLCTDigi.h:196
CSCMotherboard::CSCMotherboard
CSCMotherboard()
Definition: CSCMotherboard.cc:64
CSCMotherboard::clctV
std::vector< CSCCLCTDigi > clctV
Definition: CSCMotherboard.h:84
CSCMotherboard::clctProc
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
Definition: CSCMotherboard.h:78
CSCBaseboard::runME11Up_
bool runME11Up_
Definition: CSCBaseboard.h:98
LCTContainer::getMatched
void getMatched(std::vector< CSCCorrelatedLCTDigi > &) const
Definition: LCTContainer.cc:23
ME31
Definition: CSCUpgradeMotherboardLUT.h:12
CSCMotherboard::alctV
std::vector< CSCALCTDigi > alctV
Definition: CSCMotherboard.h:83
CSCConstants::MAX_LCTS_PER_CSC
Definition: CSCConstants.h:75
CSCMotherboard::constructLCTs
CSCCorrelatedLCTDigi constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb) const
Definition: CSCMotherboard.cc:486
CSCUpgradeMotherboard::readoutLCTs
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const override
Definition: CSCUpgradeMotherboard.cc:262
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
CSCUpgradeMotherboard::match_earliest_clct_only
bool match_earliest_clct_only
Definition: CSCUpgradeMotherboard.h:106
CSCUpgradeMotherboard::theParity
Parity theParity
Definition: CSCUpgradeMotherboard.h:92
CSCBaseboard::runME41Up_
bool runME41Up_
Definition: CSCBaseboard.h:101
CSCBaseboard::theSubsector
const unsigned theSubsector
Definition: CSCBaseboard.h:45
CSCConstants::MAX_LCT_TBINS
Definition: CSCConstants.h:65
CSCBaseboard::gangedME1a_
bool gangedME1a_
Definition: CSCBaseboard.h:89
CSCBaseboard::runME31Up_
bool runME31Up_
Definition: CSCBaseboard.h:100
CSCBaseboard::runME21Up_
bool runME21Up_
Definition: CSCBaseboard.h:99
CSCBaseboard::runPhase2_
bool runPhase2_
Definition: CSCBaseboard.h:85
CSCUpgradeMotherboard::correlateLCTs
void correlateLCTs(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
Definition: CSCUpgradeMotherboard.cc:222
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
ME1A
Definition: CSCUpgradeMotherboardLUT.h:12
LCTContainer::clear
void clear()
Definition: LCTContainer.cc:31
CSCUpgradeMotherboard::debug_matching
bool debug_matching
Definition: CSCUpgradeMotherboard.h:115
CSCBaseboard::enableAlctPhase2_
bool enableAlctPhase2_
Definition: CSCBaseboard.h:86
CSCConstants::MAX_HALF_STRIP_ME1B
Definition: CSCConstants.h:39
CSCCLCTDigi::isValid
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:50
CSCUpgradeMotherboard::sortLCTs
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &lcts, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
Definition: CSCUpgradeMotherboard.cc:315
CSCUpgradeMotherboard::pref
int pref[CSCConstants::MAX_LCT_TBINS]
Definition: CSCUpgradeMotherboard.h:103
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
CSCUpgradeMotherboard::match_earliest_alct_only
bool match_earliest_alct_only
Definition: CSCUpgradeMotherboard.h:105
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
CSCBaseboard::theChamber
unsigned theChamber
Definition: CSCBaseboard.h:49
CSCMotherboard::drop_used_clcts
bool drop_used_clcts
Definition: CSCMotherboard.h:105
CSCMotherboard::encodeHighMultiplicityBits
void encodeHighMultiplicityBits(unsigned alctBits)
Definition: CSCMotherboard.cc:709
CSCUpgradeMotherboard::sortLCTsByQuality
static bool sortLCTsByQuality(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
Definition: CSCUpgradeMotherboard.cc:307
MCScenario_CRAFT1_22X.sorter
def sorter(a, b)
Definition: MCScenario_CRAFT1_22X.py:97
CSCUpgradeMotherboard::allLCTs
LCTContainer allLCTs
Definition: CSCUpgradeMotherboard.h:98
ME1Ag
Definition: CSCUpgradeMotherboardLUT.h:12
CSCALCTDigi
Definition: CSCALCTDigi.h:17
CSCMotherboard::alct_trig_enable
unsigned int alct_trig_enable
Definition: CSCMotherboard.h:98
CSCUpgradeMotherboard::setPrefIndex
void setPrefIndex()
Definition: CSCUpgradeMotherboard.cc:324
Odd
Definition: CSCUpgradeMotherboardLUT.h:13
CSCConstants::MAX_CLCT_TBINS
Definition: CSCConstants.h:63
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
or
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
Definition: Activities.doc:12
CSCBaseboard::theTrigChamber
const unsigned theTrigChamber
Definition: CSCBaseboard.h:46
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CSCBaseboard::cscId_
CSCDetId cscId_
Definition: CSCBaseboard.h:58
CSCALCTDigi::isValid
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:40
CSCMotherboard::clct_to_alct
bool clct_to_alct
Definition: CSCMotherboard.h:115
CSCUpgradeMotherboard::debug_luts
bool debug_luts
Definition: CSCUpgradeMotherboard.h:118
mps_fire.result
result
Definition: mps_fire.py:311
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
CSCMotherboard::match_trig_enable
unsigned int match_trig_enable
Definition: CSCMotherboard.h:98
Even
Definition: CSCUpgradeMotherboardLUT.h:13
CSCUpgradeMotherboard::generator_
std::unique_ptr< CSCUpgradeMotherboardLUTGenerator > generator_
Definition: CSCUpgradeMotherboard.h:100
CSCCorrelatedLCTDigi::getQuality
uint16_t getQuality() const
return the Quality
Definition: CSCCorrelatedLCTDigi.h:58
CSCUpgradeMotherboard::max_lcts
unsigned int max_lcts
Definition: CSCUpgradeMotherboard.h:112
d1
static constexpr float d1
Definition: L1EGammaCrystalsEmulatorProducer.cc:84
ME21
Definition: CSCUpgradeMotherboardLUT.h:12
ME1B
Definition: CSCUpgradeMotherboardLUT.h:12
CSCBaseboard::infoV
int infoV
Definition: CSCBaseboard.h:64
CSCBaseboard::theRing
unsigned theRing
Definition: CSCBaseboard.h:48