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

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)
 
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
 
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
 
std::vector< CSCCorrelatedLCTDigireadoutLCTs () const
 
void run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
 
void setConfigParameters (const CSCDBL1TPParameters *conf)
 
void setCSCGeometry (const CSCGeometry *g)
 
virtual ~CSCMotherboard ()=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 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
 
- Protected Attributes inherited from CSCUpgradeMotherboard
LCTContainer allLCTs
 
const CSCChambercscChamber
 
bool debug_luts
 
bool debug_matching
 
bool disableME1a
 
bool gangedME1a
 
std::unique_ptr< CSCUpgradeMotherboardLUTGeneratorgenerator_
 
bool match_earliest_alct_only
 
bool match_earliest_clct_only
 
unsigned int max_lcts
 
Parity par
 
int pref [CSCConstants::MAX_LCT_TBINS]
 
unsigned theChamber
 
unsigned theRegion
 
unsigned int tmb_cross_bx_algo
 
- Protected Attributes inherited from CSCMotherboard
unsigned int alct_trig_enable
 
unsigned int alctClctOffset
 
edm::ParameterSet alctParams_
 
std::vector< CSCALCTDigialctV
 
bool clct_to_alct
 
unsigned int clct_trig_enable
 
edm::ParameterSet clctParams_
 
std::vector< CSCCLCTDigiclctV
 
edm::ParameterSet commonParams_
 
const CSCGeometrycsc_g
 
bool drop_used_alcts
 
bool drop_used_clcts
 
int early_tbins
 
CSCCorrelatedLCTDigi firstLCT [CSCConstants::MAX_LCT_TBINS]
 
int infoV
 
bool isSLHC_
 
unsigned int match_trig_enable
 
unsigned int match_trig_window_size
 
unsigned int mpc_block_me1a
 
bool readout_earliest_2
 
bool runME11ILT_
 
bool runME21ILT_
 
bool runME3141ILT_
 
CSCCorrelatedLCTDigi secondLCT [CSCConstants::MAX_LCT_TBINS]
 
const unsigned theEndcap
 
unsigned theRing
 
const unsigned theSector
 
const unsigned theStation
 
const unsigned theSubsector
 
const unsigned theTrigChamber
 
unsigned int tmb_l1a_window_size
 
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 19 of file CSCMotherboardME11.h.

Member Enumeration Documentation

anonymous enum
private

labels for ME1a and ME1B

Enumerator
ME1B 
ME1A 

Definition at line 58 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, CSCMotherboard::isSLHC_, and CSCMotherboard::tmbParams_.

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

Constructor for use during testing.

Definition at line 31 of file CSCMotherboardME11.cc.

References CSCMotherboard::isSLHC_.

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

Default destructor.

Definition at line 39 of file CSCMotherboardME11.cc.

40 {
41 }

Member Function Documentation

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

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

Definition at line 310 of file CSCMotherboardME11.cc.

References CSCMotherboard::alct_trig_enable, CSCCorrelatedLCTDigi::ALCTCLCT, CSCTriggerNumbering::chamberFromTriggerLabels(), CSCMotherboard::clct_trig_enable, CSCALCTDigi::clear(), CSCCLCTDigi::clear(), CSCMotherboard::constructLCTs(), doesALCTCrossCLCT(), ignoreAlctCrossClct, CSCALCTDigi::isValid(), CSCCLCTDigi::isValid(), LogTrace, lumiPlot::lut, CSCMotherboard::match_trig_enable, or, CSCMotherboard::theEndcap, CSCMotherboard::theSector, CSCMotherboard::theStation, CSCMotherboard::theSubsector, and CSCMotherboard::theTrigChamber.

Referenced by run().

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

Definition at line 305 of file CSCMotherboardME11.cc.

References cscTmbLUT_, CSCUpgradeMotherboard::gangedME1a, and CSCMotherboard::theEndcap.

Referenced by correlateLCTsME11().

306 {
307  return cscTmbLUT_->doesALCTCrossCLCT(a, c, theEndcap, gangedME1a);
308 }
const unsigned theEndcap
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 283 of file CSCMotherboardME11.cc.

References CSCUpgradeMotherboard::allLCTs, CSCUpgradeMotherboard::LCTContainer::data, CSCUpgradeMotherboard::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().

284 {
285  std::vector<CSCCorrelatedLCTDigi> tmpV;
286 
287  // disabled ME1a
288  if (mpc_block_me1a || disableME1a) return tmpV;
289 
290  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
291  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
292  for (int i=0;i<CSCConstants::MAX_LCTS_PER_CSC;i++) {
293  const CSCCorrelatedLCTDigi& lct = allLCTs.data[bx][mbx][i];
294  if (lct.isValid() and
296  tmpV.push_back(lct);
297  }
298  }
299  }
300  } // Report all LCTs found.
301  return tmpV;
302 }
int getStrip() const
return the key halfstrip from 0,159
unsigned int match_trig_window_size
unsigned int mpc_block_me1a
CSCCorrelatedLCTDigi data[CSCConstants::MAX_LCT_TBINS][15][2]
bool isValid() const
return valid pattern bit
std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11::getLCTs1b ( ) const

Definition at line 264 of file CSCMotherboardME11.cc.

References CSCUpgradeMotherboard::allLCTs, CSCUpgradeMotherboard::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().

265 {
266  std::vector<CSCCorrelatedLCTDigi> tmpV;
267 
268  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
269  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
270  for (int i=0;i<CSCConstants::MAX_LCTS_PER_CSC;i++) {
271  const CSCCorrelatedLCTDigi& lct = allLCTs.data[bx][mbx][i];
272  if (lct.isValid() and
274  tmpV.push_back(lct);
275  }
276  }
277  }
278  }
279  return tmpV;
280 }
int getStrip() const
return the key halfstrip from 0,159
unsigned int match_trig_window_size
CSCCorrelatedLCTDigi data[CSCConstants::MAX_LCT_TBINS][15][2]
bool isValid() const
return valid pattern bit
std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11::readoutLCTs ( int  me1ab) const

Definition at line 215 of file CSCMotherboardME11.cc.

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

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

References ME1A, and CSCMotherboard::readoutLCTs().

Referenced by CSCTriggerPrimitivesBuilder::build().

201 {
202  return readoutLCTs(ME1A);
203 }
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const
std::vector< CSCCorrelatedLCTDigi > CSCMotherboardME11::readoutLCTs1b ( ) const

Definition at line 206 of file CSCMotherboardME11.cc.

References ME1B, and CSCMotherboard::readoutLCTs().

Referenced by CSCTriggerPrimitivesBuilder::build().

207 {
208  return readoutLCTs(ME1B);
209 }
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const
void CSCMotherboardME11::run ( const CSCWireDigiCollection wiredc,
const CSCComparatorDigiCollection compdc 
)

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

Definition at line 58 of file CSCMotherboardME11.cc.

References CSCMotherboard::alctClctOffset, CSCMotherboard::alctProc, CSCMotherboard::alctV, CSCUpgradeMotherboard::allLCTs, b, CSCMotherboard::clct_to_alct, CSCMotherboard::clctProc, CSCMotherboard::clctV, clear(), CSCUpgradeMotherboard::LCTContainer::clear(), correlateLCTsME11(), CSCMotherboard::csc_g, CSCMotherboard::drop_used_alcts, CSCMotherboard::drop_used_clcts, mps_fire::i, CSCMotherboard::infoV, CSCMotherboard::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, CSCUpgradeMotherboard::pref, and CSCUpgradeMotherboard::tmb_cross_bx_algo.

Referenced by CSCTriggerPrimitivesBuilder::build().

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

Set configuration parameters obtained via EventSetup mechanism.

Definition at line 50 of file CSCMotherboardME11.cc.

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

51 {
52  alctProc->setConfigParameters(conf);
53  clctProc->setConfigParameters(conf);
54  // No config. parameters in DB for the TMB itself yet.
55 }
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
std::unique_ptr< CSCAnodeLCTProcessor > alctProc

Member Data Documentation

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

Definition at line 55 of file CSCMotherboardME11.h.

Referenced by CSCMotherboardME11(), and doesALCTCrossCLCT().

bool CSCMotherboardME11::ignoreAlctCrossClct
private

Definition at line 69 of file CSCMotherboardME11.h.

Referenced by correlateLCTsME11(), and CSCMotherboardME11().