CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
CSCMotherboardME11 Class Reference

#include <CSCMotherboardME11.h>

Inheritance diagram for CSCMotherboardME11:
CSCUpgradeMotherboard CSCMotherboard CSCBaseboard

Public Member Functions

void clear ()
 
 CSCMotherboardME11 ()
 
 CSCMotherboardME11 (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
std::vector< CSCCorrelatedLCTDigigetLCTs1a () const
 
std::vector< CSCCorrelatedLCTDigigetLCTs1b () const
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs () const override
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs (int me1ab) const
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs1a () const
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs1b () const
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc) override
 
void setConfigParameters (const CSCDBL1TPParameters *conf)
 
 ~CSCMotherboardME11 () override
 
- Public Member Functions inherited from CSCUpgradeMotherboard
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
 

Private Types

enum  { ME1B = 1, ME1A = 4 }
 

Private Member Functions

void correlateLCTsME11 (const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
 
bool doesALCTCrossCLCT (const CSCALCTDigi &a, const CSCCLCTDigi &c) const
 

Private Attributes

std::unique_ptr< CSCMotherboardLUTME11cscTmbLUT_
 
bool ignoreAlctCrossClct
 

Additional Inherited Members

- Static Public Member Functions inherited from CSCUpgradeMotherboard
static bool sortLCTsByGEMDphi (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 
static bool sortLCTsByQuality (const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
 
- Public Attributes inherited from CSCMotherboard
std::unique_ptr< CSCAnodeLCTProcessoralctProc
 
std::unique_ptr< CSCCathodeLCTProcessorclctProc
 
- Protected Types inherited from CSCMotherboard
enum  LCT_Quality {
  INVALID = 0, NO_CLCT = 1, NO_ALCT = 2, CLCT_LAYER_TRIGGER = 3,
  LOW_QUALITY = 4, MARGINAL_ANODE_CATHODE = 5, HQ_ANODE_MARGINAL_CATHODE = 6, HQ_CATHODE_MARGINAL_ANODE = 7,
  HQ_ACCEL_ALCT = 8, HQ_RESERVED_1 = 9, HQ_RESERVED_2 = 10, HQ_PATTERN_2_3 = 11,
  HQ_PATTERN_4_5 = 12, HQ_PATTERN_6_7 = 13, HQ_PATTERN_8_9 = 14, HQ_PATTERN_10 = 15
}
 
- Protected Member Functions inherited from CSCUpgradeMotherboard
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 ()
 
void checkValid (const CSCCorrelatedLCTDigi &lct) const
 
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
 
unsigned int findQuality (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 inherited from CSCUpgradeMotherboard
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
 
bool readout_earliest_2
 
CSCCorrelatedLCTDigi secondLCT [CSCConstants::MAX_LCT_TBINS]
 
unsigned int tmb_l1a_window_size
 
bool use_run3_patterns_
 
bool useHighMultiplicityBits_
 
- Protected Attributes inherited from CSCBaseboard
unsigned int alctClctOffset_
 
edm::ParameterSet alctParams_
 
edm::ParameterSet clctParams_
 
edm::ParameterSet commonParams_
 
const CSCChambercscChamber_
 
const CSCGeometrycscGeometry_
 
CSCDetId cscId_
 
bool disableME1a_
 
bool enableAlctSLHC_
 
bool gangedME1a_
 
int infoV
 
bool isME11_
 
bool isME21_
 
bool isSLHC_
 
bool runME11ILT_
 
bool runME11Up_
 
bool runME21ILT_
 
bool runME21Up_
 
bool runME31Up_
 
bool runME41Up_
 
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_
 
- 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

Extended CSCMotherboard for ME11 TMB upgrade to handle ME1b and (primarily unganged) ME1a separately

Author
Vadim Khotilovich 12 May 2009

Based on CSCMotherboard code

Definition at line 18 of file CSCMotherboardME11.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

labels for ME1a and ME1B

Enumerator
ME1B 
ME1A 

Definition at line 59 of file CSCMotherboardME11.h.

59 { ME1B = 1, ME1A = 4 };

Constructor & Destructor Documentation

◆ CSCMotherboardME11() [1/2]

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

Normal constructor.

Definition at line 15 of file CSCMotherboardME11.cc.

21  : CSCUpgradeMotherboard(endcap, station, sector, subsector, chamber, conf) {
22  if (!isSLHC_)
23  edm::LogError("CSCMotherboardME11|SetupError") << "+++ TMB constructed while isSLHC_ is not set! +++\n";
24 
25  if (!runME11Up_)
26  edm::LogError("CSCMotherboardME11|SetupError") << "+++ TMB constructed while runME11Up_ is not set! +++\n";
27 
28  cscTmbLUT_.reset(new CSCMotherboardLUTME11());
29 
30  // ignore unphysical ALCT-CLCT matches
31  ignoreAlctCrossClct = tmbParams_.getParameter<bool>("ignoreAlctCrossClct");
32 }

References cscTmbLUT_, edm::ParameterSet::getParameter(), ignoreAlctCrossClct, CSCBaseboard::isSLHC_, CSCBaseboard::runME11Up_, and CSCBaseboard::tmbParams_.

◆ CSCMotherboardME11() [2/2]

CSCMotherboardME11::CSCMotherboardME11 ( )

Constructor for use during testing.

Definition at line 34 of file CSCMotherboardME11.cc.

35  if (!isSLHC_)
36  edm::LogError("CSCMotherboardME11|SetupError") << "+++ TMB constructed while isSLHC_ is not set! +++\n";
37 
38  if (!runME11Up_)
39  edm::LogError("CSCMotherboardME11|SetupError") << "+++ TMB constructed while runME11Up_ is not set! +++\n";
40 }

References CSCBaseboard::isSLHC_, and CSCBaseboard::runME11Up_.

◆ ~CSCMotherboardME11()

CSCMotherboardME11::~CSCMotherboardME11 ( )
override

Default destructor.

Definition at line 42 of file CSCMotherboardME11.cc.

42 {}

Member Function Documentation

◆ clear()

void CSCMotherboardME11::clear ( void  )

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

Definition at line 44 of file CSCMotherboardME11.cc.

References CSCUpgradeMotherboard::clear().

Referenced by run().

◆ correlateLCTsME11()

void CSCMotherboardME11::correlateLCTsME11 ( const CSCALCTDigi bestALCT,
const CSCALCTDigi secondALCT,
const CSCCLCTDigi bestCLCT,
const CSCCLCTDigi secondCLCT,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2 
) const
private

Definition at line 330 of file CSCMotherboardME11.cc.

335  {
336  // assume that always anodeBestValid && cathodeBestValid
337  CSCALCTDigi bestALCT = bALCT;
338  CSCALCTDigi secondALCT = sALCT;
339  CSCCLCTDigi bestCLCT = bCLCT;
340  CSCCLCTDigi secondCLCT = sCLCT;
341 
342  if (ignoreAlctCrossClct) {
343  const bool anodeBestValid = bestALCT.isValid();
344  const bool anodeSecondValid = secondALCT.isValid();
345  const bool cathodeBestValid = bestCLCT.isValid();
346  const bool cathodeSecondValid = secondCLCT.isValid();
347  if (anodeBestValid and !anodeSecondValid)
348  secondALCT = bestALCT;
349  if (!anodeBestValid and anodeSecondValid)
350  bestALCT = secondALCT;
351  if (cathodeBestValid and !cathodeSecondValid)
352  secondCLCT = bestCLCT;
353  if (!cathodeBestValid and cathodeSecondValid)
354  bestCLCT = secondCLCT;
355  // ALCT-CLCT matching conditions are defined by "trig_enable" configuration
356  // parameters.
357  if ((alct_trig_enable and bestALCT.isValid()) or (clct_trig_enable and bestCLCT.isValid()) or
358  (match_trig_enable and bestALCT.isValid() and bestCLCT.isValid())) {
359  lct1 = constructLCTs(bestALCT, bestCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 1);
360  }
361  if (((secondALCT != bestALCT) or (secondCLCT != bestCLCT)) and
362  ((alct_trig_enable and secondALCT.isValid()) or (clct_trig_enable and secondCLCT.isValid()) or
363  (match_trig_enable and secondALCT.isValid() and secondCLCT.isValid()))) {
364  lct2 = constructLCTs(secondALCT, secondCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 2);
365  }
366  return;
367  } else {
368  if (secondALCT == bestALCT)
369  secondALCT.clear();
370  if (secondCLCT == bestCLCT)
371  secondCLCT.clear();
372 
373  const int ok11 = doesALCTCrossCLCT(bestALCT, bestCLCT);
374  const int ok12 = doesALCTCrossCLCT(bestALCT, secondCLCT);
375  const int ok21 = doesALCTCrossCLCT(secondALCT, bestCLCT);
376  const int ok22 = doesALCTCrossCLCT(secondALCT, secondCLCT);
377  const int code = (ok11 << 3) | (ok12 << 2) | (ok21 << 1) | (ok22);
378 
379  int dbg = 0;
380  if (dbg)
381  LogTrace("CSCMotherboardME11") << "debug correlateLCTs in ME11 " << cscId_ << std::endl
382  << "ALCT1: " << bestALCT << std::endl
383  << "ALCT2: " << secondALCT << std::endl
384  << "CLCT1: " << bestCLCT << std::endl
385  << "CLCT2: " << secondCLCT << std::endl
386  << "ok 11 12 21 22 code = " << ok11 << " " << ok12 << " " << ok21 << " " << ok22
387  << " " << code << std::endl;
388 
389  if (code == 0)
390  return;
391 
392  // LUT defines correspondence between possible ok## combinations
393  // and resulting lct1 and lct2
394  int lut[16][2] = {
395  //ok: 11 12 21 22
396  {0, 0}, // 0 0 0 0
397  {22, 0}, // 0 0 0 1
398  {21, 0}, // 0 0 1 0
399  {21, 22}, // 0 0 1 1
400  {12, 0}, // 0 1 0 0
401  {12, 22}, // 0 1 0 1
402  {12, 21}, // 0 1 1 0
403  {12, 21}, // 0 1 1 1
404  {11, 0}, // 1 0 0 0
405  {11, 22}, // 1 0 0 1
406  {11, 21}, // 1 0 1 0
407  {11, 22}, // 1 0 1 1
408  {11, 12}, // 1 1 0 0
409  {11, 22}, // 1 1 0 1
410  {11, 12}, // 1 1 1 0
411  {11, 22}, // 1 1 1 1
412  };
413 
414  if (dbg)
415  LogTrace("CSCMotherboardME11") << "lut 0 1 = " << lut[code][0] << " " << lut[code][1] << std::endl;
416 
417  switch (lut[code][0]) {
418  case 11:
419  lct1 = constructLCTs(bestALCT, bestCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 1);
420  break;
421  case 12:
422  lct1 = constructLCTs(bestALCT, secondCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 1);
423  break;
424  case 21:
425  lct1 = constructLCTs(secondALCT, bestCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 1);
426  break;
427  case 22:
428  lct1 = constructLCTs(secondALCT, secondCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 1);
429  break;
430  default:
431  return;
432  }
433 
434  if (dbg)
435  LogTrace("CSCMotherboardME11") << "lct1: " << lct1 << std::endl;
436 
437  switch (lut[code][1]) {
438  case 12:
439  lct2 = constructLCTs(bestALCT, secondCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 2);
440  if (dbg)
441  LogTrace("CSCMotherboardME11") << "lct2: " << lct2 << std::endl;
442  return;
443  case 21:
444  lct2 = constructLCTs(secondALCT, bestCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 2);
445  if (dbg)
446  LogTrace("CSCMotherboardME11") << "lct2: " << lct2 << std::endl;
447  return;
448  case 22:
449  lct2 = constructLCTs(secondALCT, secondCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 2);
450  if (dbg)
451  LogTrace("CSCMotherboardME11") << "lct2: " << lct2 << std::endl;
452  return;
453  default:
454  return;
455  }
456  if (dbg)
457  LogTrace("CSCMotherboardME11") << "out of correlateLCTsME11" << std::endl;
458 
459  return;
460  }
461 }

References CSCMotherboard::alct_trig_enable, CSCCorrelatedLCTDigi::ALCTCLCT, CSCMotherboard::clct_trig_enable, CSCALCTDigi::clear(), CSCCLCTDigi::clear(), CSCMotherboard::constructLCTs(), CSCBaseboard::cscId_, doesALCTCrossCLCT(), ignoreAlctCrossClct, CSCALCTDigi::isValid(), CSCCLCTDigi::isValid(), LogTrace, CSCMotherboard::match_trig_enable, and or.

Referenced by run().

◆ doesALCTCrossCLCT()

bool CSCMotherboardME11::doesALCTCrossCLCT ( const CSCALCTDigi a,
const CSCCLCTDigi c 
) const
private

Definition at line 326 of file CSCMotherboardME11.cc.

326  {
327  return cscTmbLUT_->doesALCTCrossCLCT(a, c, theEndcap, gangedME1a_);
328 }

References a, HltBtagPostValidation_cff::c, cscTmbLUT_, CSCBaseboard::gangedME1a_, and CSCBaseboard::theEndcap.

Referenced by correlateLCTsME11().

◆ getLCTs1a()

std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11::getLCTs1a ( ) const

Returns vectors of found correlated LCTs in ME1a and ME1b, if any.

Definition at line 306 of file CSCMotherboardME11.cc.

306  {
307  std::vector<CSCCorrelatedLCTDigi> tmpV;
308 
309  // disabled ME1a
311  return tmpV;
312 
313  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
314  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
315  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
316  const CSCCorrelatedLCTDigi& lct = allLCTs.data[bx][mbx][i];
317  if (lct.isValid() and lct.getStrip() >= CSCConstants::MAX_HALF_STRIP_ME1B) {
318  tmpV.push_back(lct);
319  }
320  }
321  }
322  } // Report all LCTs found.
323  return tmpV;
324 }

References CSCUpgradeMotherboard::allLCTs, l1GtPatternGenerator_cfi::bx, LCTContainer::data, CSCBaseboard::disableME1a_, CSCCorrelatedLCTDigi::getStrip(), mps_fire::i, CSCCorrelatedLCTDigi::isValid(), CSCMotherboard::match_trig_window_size, CSCConstants::MAX_HALF_STRIP_ME1B, CSCConstants::MAX_LCT_TBINS, CSCConstants::MAX_LCTS_PER_CSC, and CSCMotherboard::mpc_block_me1a.

Referenced by readoutLCTs().

◆ getLCTs1b()

std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11::getLCTs1b ( ) const

Definition at line 289 of file CSCMotherboardME11.cc.

289  {
290  std::vector<CSCCorrelatedLCTDigi> tmpV;
291 
292  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
293  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
294  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
295  const CSCCorrelatedLCTDigi& lct = allLCTs.data[bx][mbx][i];
296  if (lct.isValid() and lct.getStrip() < CSCConstants::MAX_HALF_STRIP_ME1B) {
297  tmpV.push_back(lct);
298  }
299  }
300  }
301  }
302  return tmpV;
303 }

References CSCUpgradeMotherboard::allLCTs, l1GtPatternGenerator_cfi::bx, LCTContainer::data, CSCCorrelatedLCTDigi::getStrip(), mps_fire::i, CSCCorrelatedLCTDigi::isValid(), CSCMotherboard::match_trig_window_size, CSCConstants::MAX_HALF_STRIP_ME1B, CSCConstants::MAX_LCT_TBINS, and CSCConstants::MAX_LCTS_PER_CSC.

Referenced by readoutLCTs().

◆ readoutLCTs() [1/2]

std::vector< CSCCorrelatedLCTDigi > CSCUpgradeMotherboard::readoutLCTs
override

Definition at line 260 of file CSCUpgradeMotherboard.cc.

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

◆ readoutLCTs() [2/2]

std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11::readoutLCTs ( int  me1ab) const

Definition at line 234 of file CSCMotherboardME11.cc.

234  {
235  std::vector<CSCCorrelatedLCTDigi> tmpV;
236 
237  // The start time of the L1A*LCT coincidence window should be related
238  // to the fifo_pretrig parameter, but I am not completely sure how.
239  // Just choose it such that the window is centered at bx=7. This may
240  // need further tweaking if the value of tmb_l1a_window_size changes.
241  //static int early_tbins = 4;
242  // The number of LCT bins in the read-out is given by the
243  // tmb_l1a_window_size parameter, forced to be odd
244  const int lct_bins = (tmb_l1a_window_size % 2 == 0) ? tmb_l1a_window_size + 1 : tmb_l1a_window_size;
245  const int late_tbins = early_tbins + lct_bins;
246 
247  // Start from the vector of all found correlated LCTs and select
248  // those within the LCT*L1A coincidence window.
249  int bx_readout = -1;
250  std::vector<CSCCorrelatedLCTDigi> all_lcts;
251  if (me1ab == ME1A)
252  all_lcts = getLCTs1a();
253  if (me1ab == ME1B)
254  all_lcts = getLCTs1b();
255  std::vector<CSCCorrelatedLCTDigi>::const_iterator plct = all_lcts.begin();
256  for (; plct != all_lcts.end(); plct++) {
257  if (!plct->isValid())
258  continue;
259 
260  int bx = (*plct).getBX();
261  // Skip LCTs found too early relative to L1Accept.
262  if (bx <= early_tbins)
263  continue;
264 
265  // Skip LCTs found too late relative to L1Accept.
266  if (bx > late_tbins)
267  continue;
268 
269  // If (readout_earliest_2) take only LCTs in the earliest bx in the read-out window:
270  // in digi->raw step, LCTs have to be packed into the TMB header, and
271  // currently there is room just for two.
272  if (readout_earliest_2 && (bx_readout == -1 || bx == bx_readout)) {
273  tmpV.push_back(*plct);
274  if (bx_readout == -1)
275  bx_readout = bx;
276  } else
277  tmpV.push_back(*plct);
278  }
279 
280  // do a final check on the LCTs in readout
281  for (const auto& lct : tmpV) {
282  checkValid(lct);
283  }
284 
285  return tmpV;
286 }

References l1GtPatternGenerator_cfi::bx, CSCMotherboard::checkValid(), CSCMotherboard::early_tbins, getLCTs1a(), getLCTs1b(), ME1A, ME1B, CSCMotherboard::readout_earliest_2, and CSCMotherboard::tmb_l1a_window_size.

◆ readoutLCTs1a()

std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11::readoutLCTs1a ( ) const

Definition at line 227 of file CSCMotherboardME11.cc.

227 { return readoutLCTs(ME1A); }

References ME1A, and CSCUpgradeMotherboard::readoutLCTs().

Referenced by CSCTriggerPrimitivesBuilder::build().

◆ readoutLCTs1b()

std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11::readoutLCTs1b ( ) const

Definition at line 229 of file CSCMotherboardME11.cc.

229 { return readoutLCTs(ME1B); }

References ME1B, and CSCUpgradeMotherboard::readoutLCTs().

Referenced by CSCTriggerPrimitivesBuilder::build().

◆ run()

void CSCMotherboardME11::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 53 of file CSCMotherboardME11.cc.

53  {
54  clear();
55 
56  // Check for existing processors
57  if (!(alctProc && clctProc)) {
58  edm::LogError("CSCMotherboardME11|SetupError") << "+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
59  return;
60  }
61 
62  alctProc->setCSCGeometry(cscGeometry_);
63  clctProc->setCSCGeometry(cscGeometry_);
64 
65  alctV = alctProc->run(wiredc); // run anodeLCT
66  clctV = clctProc->run(compdc); // run cathodeLCT
67 
68  // if there are no ALCTs and no CLCTs, it does not make sense to run this TMB
69  if (alctV.empty() and clctV.empty())
70  return;
71 
72  // encode high multiplicity bits
73  unsigned alctBits = alctProc->getHighMultiplictyBits();
75 
76  int used_alct_mask[20];
77  int used_clct_mask[20];
78  for (int b = 0; b < 20; b++)
79  used_alct_mask[b] = used_clct_mask[b] = 0;
80 
81  // CLCT-centric CLCT-to-ALCT matching
82  if (clct_to_alct) {
83  for (int bx_clct = 0; bx_clct < CSCConstants::MAX_CLCT_TBINS; bx_clct++) {
84  if (clctProc->getBestCLCT(bx_clct).isValid()) {
85  bool is_matched = false;
86  const int bx_alct_start = bx_clct - match_trig_window_size / 2 + alctClctOffset_;
87  const int bx_alct_stop = bx_clct + match_trig_window_size / 2 + alctClctOffset_;
88  for (int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++) {
89  if (bx_alct < 0 || bx_alct >= CSCConstants::MAX_ALCT_TBINS)
90  continue;
91  if (drop_used_alcts && used_alct_mask[bx_alct])
92  continue;
93  if (alctProc->getBestALCT(bx_alct).isValid()) {
94  if (infoV > 1)
95  LogTrace("CSCMotherboardME11")
96  << "Successful CLCT-ALCT match in ME11: bx_clct = " << bx_clct << "; match window: [" << bx_alct_start
97  << "; " << bx_alct_stop << "]; bx_alct = " << bx_alct;
98  int mbx = bx_alct_stop - bx_alct;
99  correlateLCTsME11(alctProc->getBestALCT(bx_alct),
100  alctProc->getSecondALCT(bx_alct),
101  clctProc->getBestCLCT(bx_clct),
102  clctProc->getSecondCLCT(bx_clct),
103  allLCTs(bx_alct, mbx, 0),
104  allLCTs(bx_alct, mbx, 1));
105  if (allLCTs(bx_alct, mbx, 0).isValid()) {
106  used_alct_mask[bx_alct] += 1;
108  break;
109  }
110  }
111  }
112  // Do not report CLCT-only LCT for ME11
113  if (!is_matched) {
114  if (infoV > 1)
115  LogTrace("CSCMotherboard") << "Unsuccessful ALCT-CLCT match (CLCT only): bx_clct = " << bx_clct
116  << " first CLCT " << clctProc->getBestCLCT(bx_clct) << "; match window: ["
117  << bx_alct_start << "; " << bx_alct_stop << "]";
118  }
119  }
120  } // end of CLCT-centric matching
121 
122  // ALCT-centric ALCT-to-CLCT matching
123  } else {
124  for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++) {
125  if (alctProc->getBestALCT(bx_alct).isValid()) {
126  const int bx_clct_start = bx_alct - match_trig_window_size / 2 - alctClctOffset_;
127  const int bx_clct_stop = bx_alct + match_trig_window_size / 2 - alctClctOffset_;
128 
129  // matching in ME11
130  bool is_matched = false;
131  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
132  if (bx_clct < 0 || bx_clct >= CSCConstants::MAX_CLCT_TBINS)
133  continue;
134  if (drop_used_clcts && used_clct_mask[bx_clct])
135  continue;
136  if (clctProc->getBestCLCT(bx_clct).isValid()) {
137  if (infoV > 1)
138  LogTrace("CSCMotherboardME11")
139  << "Successful ALCT-CLCT match in ME11: bx_alct = " << bx_alct << "; match window: [" << bx_clct_start
140  << "; " << bx_clct_stop << "]; bx_clct = " << bx_clct;
141  int mbx = bx_clct - bx_clct_start;
142  correlateLCTsME11(alctProc->getBestALCT(bx_alct),
143  alctProc->getSecondALCT(bx_alct),
144  clctProc->getBestCLCT(bx_clct),
145  clctProc->getSecondCLCT(bx_clct),
146  allLCTs(bx_alct, mbx, 0),
147  allLCTs(bx_alct, mbx, 1));
148  if (allLCTs(bx_alct, mbx, 0).isValid()) {
149  is_matched = true;
150  used_clct_mask[bx_clct] += 1;
152  break;
153  }
154  }
155  }
156  if (!is_matched) {
157  if (infoV > 1)
158  LogTrace("CSCMotherboard") << "Unsuccessful ALCT-CLCT match (ALCT only): bx_alct = " << bx_alct
159  << " first ALCT " << alctProc->getBestALCT(bx_alct) << "; match window: ["
160  << bx_clct_start << "; " << bx_clct_stop << "]";
161  }
162  }
163  } // end of ALCT-centric matching
164  }
165 
166  // reduction of nLCTs per each BX
167  //add similar cross bx algorithm to standard TMB in next step
168  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
169  // counting
170  unsigned int nlct = 0;
171  unsigned int nbx = 0;
172  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
173  bool hasLCT = false;
174  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
175  if (allLCTs(bx, mbx, i).isValid()) {
176  nlct++;
177  hasLCT = true;
178  if (infoV > 0) {
179  LogDebug("CSCMotherboardME11") << "LCT" << i + 1 << " " << bx << "/"
180  << bx + mbx - match_trig_window_size / 2 << ": " << allLCTs(bx, mbx, i);
181  }
182  }
183  }
184  if (hasLCT)
185  nbx++;
186  }
187  if (infoV > 0 && nlct > 0)
188  LogDebug("CSCMotherboardME11") << "bx " << bx << " nLCT: " << nlct << " total mbx with LCTs " << nbx;
189 
190  // some simple cross-bx sorting algorithms
191  if (tmb_cross_bx_algo == 1 and (nlct > 2 or nbx > 1)) {
192  nbx = 0;
193  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
194  nlct = 0;
195  bool hasLCT = false;
196  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
197  if (allLCTs(bx, pref[mbx], i).isValid()) {
198  nlct++;
199  hasLCT = true;
200  if (nlct > CSCConstants::MAX_LCTS_PER_CSC or nbx > 0)
201  allLCTs(bx, pref[mbx], i).clear();
202  }
203  }
204  if (hasLCT)
205  nbx++;
206  }
207 
208  if (infoV > 0)
209  LogDebug("CSCMotherboardME11") << "After x-bx sorting:";
210  nlct = 0;
211  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
212  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
213  if (allLCTs(bx, mbx, i).isValid()) {
214  nlct++;
215  if (infoV > 0) {
216  LogDebug("CSCMotherboardME11") << "LCT" << i + 1 << " " << bx << "/"
217  << bx + mbx - match_trig_window_size / 2 << ": " << allLCTs(bx, mbx, i);
218  }
219  }
220  }
221  if (infoV > 0 && nlct > 0)
222  LogDebug("CSCMotherboardME11") << "bx " << bx << " nnLCT: " << nlct;
223  } // x-bx sorting
224  } // end of for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++)
225 }

References CSCBaseboard::alctClctOffset_, CSCMotherboard::alctProc, CSCMotherboard::alctV, CSCUpgradeMotherboard::allLCTs, b, l1GtPatternGenerator_cfi::bx, CSCMotherboard::clct_to_alct, CSCMotherboard::clctProc, CSCMotherboard::clctV, LCTContainer::clear(), clear(), correlateLCTsME11(), CSCBaseboard::cscGeometry_, CSCMotherboard::drop_used_alcts, CSCMotherboard::drop_used_clcts, CSCMotherboard::encodeHighMultiplicityBits(), mps_fire::i, CSCBaseboard::infoV, LogDebug, LogTrace, CSCUpgradeMotherboard::match_earliest_alct_only, CSCUpgradeMotherboard::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, or, CSCUpgradeMotherboard::pref, and CSCUpgradeMotherboard::tmb_cross_bx_algo.

Referenced by CSCTriggerPrimitivesBuilder::build().

◆ setConfigParameters()

void CSCMotherboardME11::setConfigParameters ( const CSCDBL1TPParameters conf)

Set configuration parameters obtained via EventSetup mechanism.

Definition at line 47 of file CSCMotherboardME11.cc.

47  {
48  alctProc->setConfigParameters(conf);
49  clctProc->setConfigParameters(conf);
50  // No config. parameters in DB for the TMB itself yet.
51 }

References CSCMotherboard::alctProc, and CSCMotherboard::clctProc.

Member Data Documentation

◆ cscTmbLUT_

std::unique_ptr<CSCMotherboardLUTME11> CSCMotherboardME11::cscTmbLUT_
private

Definition at line 56 of file CSCMotherboardME11.h.

Referenced by CSCMotherboardME11(), and doesALCTCrossCLCT().

◆ ignoreAlctCrossClct

bool CSCMotherboardME11::ignoreAlctCrossClct
private

Definition at line 70 of file CSCMotherboardME11.h.

Referenced by correlateLCTsME11(), and CSCMotherboardME11().

CSCMotherboardME11::ME1B
Definition: CSCMotherboardME11.h:59
mps_fire.i
i
Definition: mps_fire.py:355
CSCBaseboard::theEndcap
const unsigned theEndcap
Definition: CSCBaseboard.h:42
CSCMotherboard::match_trig_window_size
unsigned int match_trig_window_size
Definition: CSCMotherboard.h:99
CSCMotherboard::checkValid
void checkValid(const CSCCorrelatedLCTDigi &lct) const
Definition: CSCMotherboard.cc:647
CSCMotherboard::mpc_block_me1a
unsigned int mpc_block_me1a
Definition: CSCMotherboard.h:97
CSCMotherboard::drop_used_alcts
bool drop_used_alcts
Definition: CSCMotherboard.h:102
CSCBaseboard::cscGeometry_
const CSCGeometry * cscGeometry_
Definition: CSCBaseboard.h:64
CSCBaseboard::isSLHC_
bool isSLHC_
Definition: CSCBaseboard.h:83
CSCConstants::MAX_ALCT_TBINS
Definition: CSCConstants.h:62
CSCBaseboard::tmbParams_
edm::ParameterSet tmbParams_
Definition: CSCBaseboard.h:71
relativeConstraints.station
station
Definition: relativeConstraints.py:67
CSCMotherboard::alctProc
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
Definition: CSCMotherboard.h:75
CSCBaseboard::disableME1a_
bool disableME1a_
Definition: CSCBaseboard.h:87
CSCCorrelatedLCTDigi::getStrip
uint16_t getStrip(uint16_t n=2) const
return the key halfstrip from 0,159
Definition: CSCCorrelatedLCTDigi.cc:66
CSCUpgradeMotherboard::clear
void clear()
Definition: CSCUpgradeMotherboard.cc:329
CSCALCTDigi::clear
void clear()
clear this ALCT
Definition: CSCALCTDigi.cc:43
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
CSCMotherboardME11::getLCTs1b
std::vector< CSCCorrelatedLCTDigi > getLCTs1b() const
Definition: CSCMotherboardME11.cc:289
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
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCCLCTDigi
Definition: CSCCLCTDigi.h:17
CSCCorrelatedLCTDigi::ALCTCLCT
Definition: CSCCorrelatedLCTDigi.h:160
CSCMotherboardME11::correlateLCTsME11
void correlateLCTsME11(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
Definition: CSCMotherboardME11.cc:330
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:105
LCTContainer::getMatched
void getMatched(std::vector< CSCCorrelatedLCTDigi > &) const
Definition: LCTContainer.cc:23
CSCMotherboard::alctV
std::vector< CSCALCTDigi > alctV
Definition: CSCMotherboard.h:83
CSCConstants::MAX_LCTS_PER_CSC
Definition: CSCConstants.h:73
CSCMotherboard::constructLCTs
CSCCorrelatedLCTDigi constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb) const
Definition: CSCMotherboard.cc:484
CSCUpgradeMotherboard::readoutLCTs
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const override
Definition: CSCUpgradeMotherboard.cc:260
CSCMotherboardME11::cscTmbLUT_
std::unique_ptr< CSCMotherboardLUTME11 > cscTmbLUT_
Definition: CSCMotherboardME11.h:56
CSCMotherboardME11::getLCTs1a
std::vector< CSCCorrelatedLCTDigi > getLCTs1a() const
Definition: CSCMotherboardME11.cc:306
CSCUpgradeMotherboard::match_earliest_clct_only
bool match_earliest_clct_only
Definition: CSCUpgradeMotherboard.h:106
CSCBaseboard::alctClctOffset_
unsigned int alctClctOffset_
Definition: CSCBaseboard.h:96
CSCConstants::MAX_LCT_TBINS
Definition: CSCConstants.h:63
CSCMotherboardME11::ME1A
Definition: CSCMotherboardME11.h:59
CSCBaseboard::gangedME1a_
bool gangedME1a_
Definition: CSCBaseboard.h:87
b
double b
Definition: hdecay.h:118
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::LogError
Definition: MessageLogger.h:183
a
double a
Definition: hdecay.h:119
LCTContainer::clear
void clear()
Definition: LCTContainer.cc:31
CSCMotherboardLUTME11
Definition: CSCUpgradeMotherboardLUT.h:15
CSCMotherboardME11::clear
void clear()
Definition: CSCMotherboardME11.cc:44
CSCConstants::MAX_HALF_STRIP_ME1B
Definition: CSCConstants.h:39
CSCMotherboard::early_tbins
int early_tbins
Definition: CSCMotherboard.h:108
CSCCLCTDigi::isValid
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:45
CSCUpgradeMotherboard::sortLCTs
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &lcts, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
Definition: CSCUpgradeMotherboard.cc:312
CSCUpgradeMotherboard::pref
int pref[CSCConstants::MAX_LCT_TBINS]
Definition: CSCUpgradeMotherboard.h:103
CSCUpgradeMotherboard::match_earliest_alct_only
bool match_earliest_alct_only
Definition: CSCUpgradeMotherboard.h:105
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
CSCMotherboardME11::ignoreAlctCrossClct
bool ignoreAlctCrossClct
Definition: CSCMotherboardME11.h:70
CSCUpgradeMotherboard::CSCUpgradeMotherboard
CSCUpgradeMotherboard()
Definition: CSCUpgradeMotherboard.cc:51
CSCMotherboard::readout_earliest_2
bool readout_earliest_2
Definition: CSCMotherboard.h:111
CSCMotherboard::drop_used_clcts
bool drop_used_clcts
Definition: CSCMotherboard.h:105
CSCMotherboard::encodeHighMultiplicityBits
void encodeHighMultiplicityBits(unsigned alctBits)
Definition: CSCMotherboard.cc:638
CSCUpgradeMotherboard::sortLCTsByQuality
static bool sortLCTsByQuality(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
Definition: CSCUpgradeMotherboard.cc:304
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
CSCUpgradeMotherboard::allLCTs
LCTContainer allLCTs
Definition: CSCUpgradeMotherboard.h:98
CSCMotherboard::tmb_l1a_window_size
unsigned int tmb_l1a_window_size
Definition: CSCMotherboard.h:99
CSCCLCTDigi::clear
void clear()
clear this CLCT
Definition: CSCCLCTDigi.cc:68
CSCALCTDigi
Definition: CSCALCTDigi.h:16
CSCMotherboard::alct_trig_enable
unsigned int alct_trig_enable
Definition: CSCMotherboard.h:98
CSCConstants::MAX_CLCT_TBINS
Definition: CSCConstants.h:61
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::cscId_
CSCDetId cscId_
Definition: CSCBaseboard.h:56
CSCALCTDigi::isValid
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:37
CSCMotherboard::clct_to_alct
bool clct_to_alct
Definition: CSCMotherboard.h:115
mps_fire.result
result
Definition: mps_fire.py:303
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
CSCMotherboard::match_trig_enable
unsigned int match_trig_enable
Definition: CSCMotherboard.h:98
CSCCorrelatedLCTDigi::isValid
bool isValid() const
return valid pattern bit
Definition: CSCCorrelatedLCTDigi.h:50
LCTContainer::data
CSCCorrelatedLCTDigi data[CSCConstants::MAX_LCT_TBINS][CSCConstants::MAX_MATCH_WINDOW_SIZE][CSCConstants::MAX_LCTS_PER_CSC]
Definition: LCTContainer.h:43
CSCCorrelatedLCTDigi
Definition: CSCCorrelatedLCTDigi.h:19
CSCMotherboardME11::doesALCTCrossCLCT
bool doesALCTCrossCLCT(const CSCALCTDigi &a, const CSCCLCTDigi &c) const
Definition: CSCMotherboardME11.cc:326
CSCBaseboard::infoV
int infoV
Definition: CSCBaseboard.h:62