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 (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCMotherboardME11 ()
 
std::vector< CSCCorrelatedLCTDigigetLCTs1a () const
 
std::vector< CSCCorrelatedLCTDigigetLCTs1b () const
 
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 (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCUpgradeMotherboard ()
 
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 (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCMotherboard ()
 
std::vector< CSCCorrelatedLCTDigigetLCTs () const
 
void setConfigParameters (const CSCDBL1TPParameters *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
 
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 ()
 
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
 
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 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 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
 
- 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 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
private

labels for ME1a and ME1B

Enumerator
ME1B 
ME1A 

Definition at line 59 of file CSCMotherboardME11.h.

Constructor & Destructor Documentation

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.

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

21  : CSCUpgradeMotherboard(endcap, station, sector, subsector, chamber, conf) {
22  if (!isSLHC_)
23  edm::LogError("CSCMotherboardME11|ConfigError")
24  << "+++ Upgrade CSCMotherboardME11 constructed while isSLHC_ is not set! +++\n";
25 
26  cscTmbLUT_.reset(new CSCMotherboardLUTME11());
27 
28  // ignore unphysical ALCT-CLCT matches
29  ignoreAlctCrossClct = tmbParams_.getParameter<bool>("ignoreAlctCrossClct");
30 }
T getParameter(std::string const &) const
std::unique_ptr< CSCMotherboardLUTME11 > cscTmbLUT_
edm::ParameterSet tmbParams_
Definition: CSCBaseboard.h:65
CSCMotherboardME11::CSCMotherboardME11 ( )

Constructor for use during testing.

Definition at line 32 of file CSCMotherboardME11.cc.

References CSCBaseboard::isSLHC_.

33  if (!isSLHC_)
34  edm::LogError("CSCMotherboardME11|ConfigError")
35  << "+++ Upgrade CSCMotherboardME11 constructed while isSLHC_ is not set! +++\n";
36 }
CSCMotherboardME11::~CSCMotherboardME11 ( )
override

Default destructor.

Definition at line 38 of file CSCMotherboardME11.cc.

38 {}

Member Function Documentation

void CSCMotherboardME11::clear ( void  )

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

Definition at line 40 of file CSCMotherboardME11.cc.

References CSCUpgradeMotherboard::clear().

Referenced by run().

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

Definition at line 317 of file CSCMotherboardME11.cc.

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().

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

Definition at line 313 of file CSCMotherboardME11.cc.

References cscTmbLUT_, CSCBaseboard::gangedME1a_, and CSCBaseboard::theEndcap.

Referenced by correlateLCTsME11().

313  {
314  return cscTmbLUT_->doesALCTCrossCLCT(a, c, theEndcap, gangedME1a_);
315 }
const unsigned theEndcap
Definition: CSCBaseboard.h:37
bool gangedME1a_
Definition: CSCBaseboard.h:81
std::unique_ptr< CSCMotherboardLUTME11 > cscTmbLUT_
std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11::getLCTs1a ( ) const

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

Definition at line 293 of file CSCMotherboardME11.cc.

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().

293  {
294  std::vector<CSCCorrelatedLCTDigi> tmpV;
295 
296  // disabled ME1a
298  return tmpV;
299 
300  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
301  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
302  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
303  const CSCCorrelatedLCTDigi& lct = allLCTs.data[bx][mbx][i];
304  if (lct.isValid() and lct.getStrip() >= CSCConstants::MAX_HALF_STRIP_ME1B) {
305  tmpV.push_back(lct);
306  }
307  }
308  }
309  } // Report all LCTs found.
310  return tmpV;
311 }
int getStrip() const
return the key halfstrip from 0,159
unsigned int match_trig_window_size
bool disableME1a_
Definition: CSCBaseboard.h:81
unsigned int mpc_block_me1a
bool isValid() const
return valid pattern bit
CSCCorrelatedLCTDigi data[CSCConstants::MAX_LCT_TBINS][CSCConstants::MAX_MATCH_WINDOW_SIZE][CSCConstants::MAX_LCTS_PER_CSC]
Definition: LCTContainer.h:43
std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11::getLCTs1b ( ) const

Definition at line 276 of file CSCMotherboardME11.cc.

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().

276  {
277  std::vector<CSCCorrelatedLCTDigi> tmpV;
278 
279  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
280  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
281  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
282  const CSCCorrelatedLCTDigi& lct = allLCTs.data[bx][mbx][i];
283  if (lct.isValid() and lct.getStrip() < CSCConstants::MAX_HALF_STRIP_ME1B) {
284  tmpV.push_back(lct);
285  }
286  }
287  }
288  }
289  return tmpV;
290 }
int getStrip() const
return the key halfstrip from 0,159
unsigned int match_trig_window_size
bool isValid() const
return valid pattern bit
CSCCorrelatedLCTDigi data[CSCConstants::MAX_LCT_TBINS][CSCConstants::MAX_MATCH_WINDOW_SIZE][CSCConstants::MAX_LCTS_PER_CSC]
Definition: LCTContainer.h:43
std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11::readoutLCTs ( int  me1ab) const

Definition at line 227 of file CSCMotherboardME11.cc.

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

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

Definition at line 220 of file CSCMotherboardME11.cc.

References ME1A, and CSCUpgradeMotherboard::readoutLCTs().

Referenced by CSCTriggerPrimitivesBuilder::build().

220 { return readoutLCTs(ME1A); }
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const override
std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11::readoutLCTs1b ( ) const

Definition at line 222 of file CSCMotherboardME11.cc.

References ME1B, and CSCUpgradeMotherboard::readoutLCTs().

Referenced by CSCTriggerPrimitivesBuilder::build().

222 { return readoutLCTs(ME1B); }
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const override
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 49 of file CSCMotherboardME11.cc.

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, mps_fire::i, CSCBaseboard::infoV, CSCBaseboard::isSLHC_, 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().

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

Set configuration parameters obtained via EventSetup mechanism.

Definition at line 43 of file CSCMotherboardME11.cc.

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

43  {
44  alctProc->setConfigParameters(conf);
45  clctProc->setConfigParameters(conf);
46  // No config. parameters in DB for the TMB itself yet.
47 }
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
std::unique_ptr< CSCAnodeLCTProcessor > alctProc

Member Data Documentation

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

Definition at line 56 of file CSCMotherboardME11.h.

Referenced by CSCMotherboardME11(), and doesALCTCrossCLCT().

bool CSCMotherboardME11::ignoreAlctCrossClct
private

Definition at line 70 of file CSCMotherboardME11.h.

Referenced by correlateLCTsME11(), and CSCMotherboardME11().