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

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
 
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

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_
 

Additional Inherited Members

- 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
}
 
- 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::CSCUpgradeMotherboard ( unsigned  endcap,
unsigned  station,
unsigned  sector,
unsigned  subsector,
unsigned  chamber,
const edm::ParameterSet conf 
)

Definition at line 3 of file CSCUpgradeMotherboard.cc.

References CSCMotherboard::alctProc, CSCMotherboard::clct_to_alct, CSCMotherboard::clctProc, debug_luts, debug_matching, CSCMotherboard::drop_used_clcts, CSCBaseboard::enableAlctSLHC_, Even, generator_, edm::ParameterSet::getParameter(), CSCBaseboard::isSLHC_, match_earliest_alct_only, match_earliest_clct_only, max_lcts, Odd, setPrefIndex(), CSCBaseboard::theChamber, theParity, CSCBaseboard::theRing, tmb_cross_bx_algo, and CSCBaseboard::tmbParams_.

9  : // special configuration parameters for ME11 treatment
10  CSCMotherboard(endcap, station, sector, subsector, chamber, conf),
12  if (!isSLHC_)
13  edm::LogError("CSCUpgradeMotherboard|ConfigError")
14  << "+++ Upgrade CSCUpgradeMotherboard constructed while isSLHC_ is not set! +++\n";
15 
17 
18  // generate the LUTs
20 
21  // enable the upgrade processors
22  if (isSLHC_ and theRing == 1) {
23  clctProc.reset(new CSCUpgradeCathodeLCTProcessor(endcap, station, sector, subsector, chamber, conf));
24  if (enableAlctSLHC_) {
25  alctProc.reset(new CSCUpgradeAnodeLCTProcessor(endcap, station, sector, subsector, chamber, conf));
26  }
27  }
28 
29  match_earliest_alct_only = tmbParams_.getParameter<bool>("matchEarliestAlctOnly");
30  match_earliest_clct_only = tmbParams_.getParameter<bool>("matchEarliestClctOnly");
31  clct_to_alct = tmbParams_.getParameter<bool>("clctToAlct");
32  drop_used_clcts = tmbParams_.getParameter<bool>("tmbDropUsedClcts");
33  tmb_cross_bx_algo = tmbParams_.getParameter<unsigned int>("tmbCrossBxAlgorithm");
34  max_lcts = tmbParams_.getParameter<unsigned int>("maxLCTs");
35  debug_matching = tmbParams_.getParameter<bool>("debugMatching");
36  debug_luts = tmbParams_.getParameter<bool>("debugLUTs");
37 
38  setPrefIndex();
39 }
T getParameter(std::string const &) const
unsigned int match_trig_window_size
std::unique_ptr< CSCUpgradeMotherboardLUTGenerator > generator_
bool enableAlctSLHC_
Definition: CSCBaseboard.h:78
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
unsigned theChamber
Definition: CSCBaseboard.h:44
edm::ParameterSet tmbParams_
Definition: CSCBaseboard.h:65
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
unsigned theRing
Definition: CSCBaseboard.h:43
CSCUpgradeMotherboard::CSCUpgradeMotherboard ( )

Definition at line 41 of file CSCUpgradeMotherboard.cc.

References CSCBaseboard::isSLHC_, and setPrefIndex().

42  if (!isSLHC_)
43  edm::LogError("CSCUpgradeMotherboard|ConfigError")
44  << "+++ Upgrade CSCUpgradeMotherboard constructed while isSLHC_ is not set! +++\n";
45 
46  setPrefIndex();
47 }
unsigned int match_trig_window_size
CSCUpgradeMotherboard::~CSCUpgradeMotherboard ( )
override

Definition at line 245 of file CSCUpgradeMotherboard.cc.

245 {}

Member Function Documentation

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

Definition at line 122 of file CSCUpgradeMotherboard.h.

Referenced by intersection().

122  {
123  return (p.first == q.first) and (p.second == q.second);
124 }
void CSCUpgradeMotherboard::correlateLCTs ( const CSCALCTDigi bestALCT,
const CSCALCTDigi secondALCT,
const CSCCLCTDigi bestCLCT,
const CSCCLCTDigi secondCLCT,
CSCCorrelatedLCTDigi lct1,
CSCCorrelatedLCTDigi lct2 
) const
protected

Definition at line 197 of file CSCUpgradeMotherboard.cc.

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

202  {
203  CSCALCTDigi bestALCT = bALCT;
204  CSCALCTDigi secondALCT = sALCT;
205  CSCCLCTDigi bestCLCT = bCLCT;
206  CSCCLCTDigi secondCLCT = sCLCT;
207 
208  const bool anodeBestValid = bestALCT.isValid();
209  const bool anodeSecondValid = secondALCT.isValid();
210  const bool cathodeBestValid = bestCLCT.isValid();
211  const bool cathodeSecondValid = secondCLCT.isValid();
212 
213  if (anodeBestValid and !anodeSecondValid)
214  secondALCT = bestALCT;
215  if (!anodeBestValid and anodeSecondValid)
216  bestALCT = secondALCT;
217  if (cathodeBestValid and !cathodeSecondValid)
218  secondCLCT = bestCLCT;
219  if (!cathodeBestValid and cathodeSecondValid)
220  bestCLCT = secondCLCT;
221 
222  // ALCT-CLCT matching conditions are defined by "trig_enable" configuration
223  // parameters.
224  if ((alct_trig_enable and bestALCT.isValid()) or (clct_trig_enable and bestCLCT.isValid()) or
225  (match_trig_enable and bestALCT.isValid() and bestCLCT.isValid())) {
226  lct1 = constructLCTs(bestALCT, bestCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 1);
227  }
228 
229  if (((secondALCT != bestALCT) or (secondCLCT != bestCLCT)) and
230  ((alct_trig_enable and secondALCT.isValid()) or (clct_trig_enable and secondCLCT.isValid()) or
231  (match_trig_enable and secondALCT.isValid() and secondCLCT.isValid()))) {
232  lct2 = constructLCTs(secondALCT, secondCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 2);
233  }
234 }
unsigned int clct_trig_enable
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:32
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
unsigned int alct_trig_enable
void CSCUpgradeMotherboard::debugLUTs ( )

Definition at line 270 of file CSCUpgradeMotherboard.cc.

References debug_luts, generator_, CSCBaseboard::theEndcap, CSCBaseboard::theSector, CSCBaseboard::theStation, CSCBaseboard::theSubsector, and CSCBaseboard::theTrigChamber.

Referenced by CSCGEMMotherboardME11::run(), and CSCGEMMotherboardME21::run().

270  {
271  if (debug_luts)
273 }
const unsigned theEndcap
Definition: CSCBaseboard.h:37
std::unique_ptr< CSCUpgradeMotherboardLUTGenerator > generator_
const unsigned theSector
Definition: CSCBaseboard.h:39
const unsigned theTrigChamber
Definition: CSCBaseboard.h:41
const unsigned theStation
Definition: CSCBaseboard.h:38
const unsigned theSubsector
Definition: CSCBaseboard.h:40
enum CSCPart CSCUpgradeMotherboard::getCSCPart ( int  keystrip) const

get CSCPart from HS, station, ring number

Definition at line 247 of file CSCUpgradeMotherboard.cc.

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

247  {
248  if (theStation == 1 and (theRing == 1 or theRing == 4)) {
249  if (keystrip > CSCConstants::MAX_HALF_STRIP_ME1B) {
250  if (gangedME1a_)
251  return CSCPart::ME1Ag;
252  else
253  return CSCPart::ME1A;
254  } else if (keystrip <= CSCConstants::MAX_HALF_STRIP_ME1B and keystrip >= 0)
255  return CSCPart::ME1B;
256  else
257  return CSCPart::ME11;
258  } else if (theStation == 2 and theRing == 1)
259  return CSCPart::ME21;
260  else if (theStation == 3 and theRing == 1)
261  return CSCPart::ME31;
262  else if (theStation == 4 and theRing == 1)
263  return CSCPart::ME41;
264  else {
265  edm::LogError("CSCUpgradeMotherboard|Error") << " ++ getCSCPart() failed to find the CSC chamber for in case ";
266  return CSCPart::ME11; // return ME11 by default
267  }
268 }
bool gangedME1a_
Definition: CSCBaseboard.h:81
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
const unsigned theStation
Definition: CSCBaseboard.h:38
unsigned theRing
Definition: CSCBaseboard.h:43
template<class S >
void CSCUpgradeMotherboard::intersection ( const S d1,
const S d2,
S result 
) const

Definition at line 127 of file CSCUpgradeMotherboard.h.

References compare(), AlCaHLTBitMon_ParallelJobs::p, and data-class-funcs::q.

Referenced by CSCGEMMotherboard::matchingPads().

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 }
bool compare(const S &p, const S &q) const
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 237 of file CSCUpgradeMotherboard.cc.

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

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

237  {
238  std::vector<CSCCorrelatedLCTDigi> result;
239  allLCTs.getMatched(result);
240  if (tmb_cross_bx_algo == 2)
242  return result;
243 }
static bool sortLCTsByQuality(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
void getMatched(std::vector< CSCCorrelatedLCTDigi > &) const
Definition: LCTContainer.cc:23
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &lcts, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
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 49 of file CSCUpgradeMotherboard.cc.

References CSCBaseboard::alctClctOffset_, 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, 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().

49  {
50  clear();
51 
52  if (!(alctProc and clctProc)) {
53  if (infoV >= 0)
54  edm::LogError("CSCUpgradeMotherboard|SetupError")
55  << "+++ 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_clct_mask[20];
70  for (int c = 0; c < 20; ++c)
71  used_clct_mask[c] = 0;
72 
73  // ALCT centric matching
74  for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++) {
75  if (alctProc->getBestALCT(bx_alct).isValid()) {
76  const int bx_clct_start(bx_alct - match_trig_window_size / 2 - alctClctOffset_);
77  const int bx_clct_stop(bx_alct + match_trig_window_size / 2 - alctClctOffset_);
78 
79  if (debug_matching) {
80  LogTrace("CSCUpgradeMotherboard")
81  << "========================================================================" << std::endl;
82  LogTrace("CSCUpgradeMotherboard") << "ALCT-CLCT matching in ME34/1 chamber: " << cscId_ << std::endl;
83  LogTrace("CSCUpgradeMotherboard")
84  << "------------------------------------------------------------------------" << std::endl;
85  LogTrace("CSCUpgradeMotherboard") << "+++ Best ALCT Details: ";
86  alctProc->getBestALCT(bx_alct).print();
87  LogTrace("CSCUpgradeMotherboard") << "+++ Second ALCT Details: ";
88  alctProc->getSecondALCT(bx_alct).print();
89 
90  LogTrace("CSCUpgradeMotherboard")
91  << "------------------------------------------------------------------------" << std::endl;
92  LogTrace("CSCUpgradeMotherboard") << "Attempt ALCT-CLCT matching in ME34/13 in bx range: [" << bx_clct_start
93  << "," << bx_clct_stop << "]" << std::endl;
94  }
95 
96  // ALCT-to-CLCT
97  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
98  if (bx_clct < 0 or bx_clct >= CSCConstants::MAX_CLCT_TBINS)
99  continue;
100  if (drop_used_clcts and used_clct_mask[bx_clct])
101  continue;
102  if (clctProc->getBestCLCT(bx_clct).isValid()) {
103  if (debug_matching)
104  LogTrace("CSCUpgradeMotherboard") << "++Valid ME21 CLCT: " << clctProc->getBestCLCT(bx_clct) << std::endl;
105 
106  int mbx = bx_clct - bx_clct_start;
107  CSCUpgradeMotherboard::correlateLCTs(alctProc->getBestALCT(bx_alct),
108  alctProc->getSecondALCT(bx_alct),
109  clctProc->getBestCLCT(bx_clct),
110  clctProc->getSecondCLCT(bx_clct),
111  allLCTs(bx_alct, mbx, 0),
112  allLCTs(bx_alct, mbx, 1));
113  if (infoV > 1)
114  LogTrace("CSCUpgradeMotherboard")
115  << "Successful ALCT-CLCT match in ME21: bx_alct = " << bx_alct << "; match window: [" << bx_clct_start
116  << "; " << bx_clct_stop << "]; bx_clct = " << bx_clct << std::endl;
117  LogTrace("CSCUpgradeMotherboard") << "+++ Best CLCT Details: ";
118  clctProc->getBestCLCT(bx_clct).print();
119  LogTrace("CSCUpgradeMotherboard") << "+++ Second CLCT Details: ";
120  clctProc->getSecondCLCT(bx_clct).print();
121  if (allLCTs(bx_alct, mbx, 0).isValid()) {
122  used_clct_mask[bx_clct] += 1;
124  break;
125  }
126  }
127  }
128  }
129  }
130 
131  // reduction of nLCTs per each BX
132  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
133  // counting
134  unsigned int n = 0;
135  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
136  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
137  if (allLCTs(bx, mbx, i).isValid()) {
138  ++n;
139  if (infoV > 0) {
140  LogDebug("CSCUpgradeMotherboard")
141  << "LCT" << i + 1 << " " << bx << "/" << bx + mbx - match_trig_window_size / 2 << ": "
142  << allLCTs(bx, mbx, i) << std::endl;
143  }
144  }
145  }
146  }
147 
148  // some simple cross-bx sorting algorithms
149  if (tmb_cross_bx_algo == 1 and (n > 2)) {
150  n = 0;
151  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
152  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
153  if (allLCTs(bx, pref[mbx], i).isValid()) {
154  n++;
155  if (n > 2)
156  allLCTs(bx, pref[mbx], i).clear();
157  }
158  }
159  }
160 
161  n = 0;
162  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
163  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
164  if (allLCTs(bx, mbx, i).isValid()) {
165  n++;
166  if (infoV > 0) {
167  LogDebug("CSCUpgradeMotherboard")
168  << "LCT" << i + 1 << " " << bx << "/" << bx + mbx - match_trig_window_size / 2 << ": "
169  << allLCTs(bx, mbx, i) << std::endl;
170  }
171  }
172  }
173  }
174  if (infoV > 0 and n > 0)
175  LogDebug("CSCUpgradeMotherboard") << "bx " << bx << " nnLCT:" << n << " " << n << std::endl;
176  } // x-bx sorting
177  }
178 
179  bool first = true;
180  unsigned int n = 0;
181  for (const auto& p : readoutLCTs()) {
182  if (debug_matching and first) {
183  LogTrace("CSCUpgradeMotherboard") << "========================================================================"
184  << std::endl;
185  LogTrace("CSCUpgradeMotherboard") << "Counting the final LCTs" << std::endl;
186  LogTrace("CSCUpgradeMotherboard") << "========================================================================"
187  << std::endl;
188  first = false;
189  LogTrace("CSCUpgradeMotherboard") << "tmb_cross_bx_algo: " << tmb_cross_bx_algo << std::endl;
190  }
191  n++;
192  if (debug_matching)
193  LogTrace("CSCUpgradeMotherboard") << "LCT " << n << " " << p << std::endl;
194  }
195 }
#define LogDebug(id)
std::vector< CSCCLCTDigi > clctV
unsigned int match_trig_window_size
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
int pref[CSCConstants::MAX_LCT_TBINS]
CSCDetId cscId_
Definition: CSCBaseboard.h:50
std::vector< CSCALCTDigi > alctV
#define LogTrace(id)
const CSCGeometry * cscGeometry_
Definition: CSCBaseboard.h:58
void correlateLCTs(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const override
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
unsigned int alctClctOffset_
Definition: CSCBaseboard.h:90
void CSCUpgradeMotherboard::setPrefIndex ( )
protected

Definition at line 292 of file CSCUpgradeMotherboard.cc.

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

Referenced by CSCUpgradeMotherboard().

292  {
293  pref[0] = match_trig_window_size / 2;
294  for (unsigned int m = 2; m < match_trig_window_size; m += 2) {
295  pref[m - 1] = pref[0] - m / 2;
296  pref[m] = pref[0] + m / 2;
297  }
298 }
unsigned int match_trig_window_size
int pref[CSCConstants::MAX_LCT_TBINS]
void CSCUpgradeMotherboard::setupGeometry ( )

Definition at line 290 of file CSCUpgradeMotherboard.cc.

References CSCBaseboard::cscGeometry_, and generator_.

Referenced by CSCGEMMotherboard::setupGeometry().

290 { generator_->setCSCGeometry(cscGeometry_); }
std::unique_ptr< CSCUpgradeMotherboardLUTGenerator > generator_
const CSCGeometry * cscGeometry_
Definition: CSCBaseboard.h:58
void CSCUpgradeMotherboard::sortLCTs ( std::vector< CSCCorrelatedLCTDigi > &  lcts,
bool(*)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)  sorter 
) const

Definition at line 283 of file CSCUpgradeMotherboard.cc.

References max_lcts, and MCScenario_CRAFT1_22X::sorter().

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

284  {
285  std::sort(lcts.begin(), lcts.end(), *sorter);
286  if (lcts.size() > max_lcts)
287  lcts.erase(lcts.begin() + max_lcts, lcts.end());
288 }
bool CSCUpgradeMotherboard::sortLCTsByGEMDphi ( const CSCCorrelatedLCTDigi lct1,
const CSCCorrelatedLCTDigi lct2 
)
static

Definition at line 279 of file CSCUpgradeMotherboard.cc.

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

279  {
280  return true;
281 }
bool CSCUpgradeMotherboard::sortLCTsByQuality ( const CSCCorrelatedLCTDigi lct1,
const CSCCorrelatedLCTDigi lct2 
)
static

Methods to sort the LCTs

Definition at line 275 of file CSCUpgradeMotherboard.cc.

References CSCCorrelatedLCTDigi::getQuality().

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

275  {
276  return lct1.getQuality() > lct2.getQuality();
277 }
int getQuality() const
return the 4 bit Correlated LCT Quality

Member Data Documentation

LCTContainer CSCUpgradeMotherboard::allLCTs
protected
bool CSCUpgradeMotherboard::debug_luts
protected

Definition at line 118 of file CSCUpgradeMotherboard.h.

Referenced by CSCUpgradeMotherboard(), and debugLUTs().

bool CSCUpgradeMotherboard::debug_matching
protected
std::unique_ptr<CSCUpgradeMotherboardLUTGenerator> CSCUpgradeMotherboard::generator_
protected
bool CSCUpgradeMotherboard::match_earliest_alct_only
protected

Definition at line 105 of file CSCUpgradeMotherboard.h.

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

bool CSCUpgradeMotherboard::match_earliest_clct_only
protected
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().

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

Parity CSCUpgradeMotherboard::theParity
protected
unsigned int CSCUpgradeMotherboard::tmb_cross_bx_algo
protected