CMS 3D CMS Logo

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

#include <CSCAnodeLCTProcessor.h>

Inheritance diagram for CSCAnodeLCTProcessor:
CSCBaseboard CSCUpgradeAnodeLCTProcessor

Public Member Functions

void clear ()
 
 CSCAnodeLCTProcessor (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
std::vector< CSCALCTDigigetALCTs () const
 
CSCALCTDigi getBestALCT (int bx) const
 
unsigned getInTimeHMT () const
 
unsigned getOutTimeHMT () const
 
CSCALCTDigi getSecondALCT (int bx) const
 
std::vector< CSCALCTPreTriggerDigipreTriggerDigis () const
 
std::vector< CSCALCTDigireadoutALCTs () const
 
CSCShowerDigi readoutShower () const
 
std::vector< CSCALCTDigirun (const CSCWireDigiCollection *wiredc)
 
void run (const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS])
 
void setConfigParameters (const CSCDBL1TPParameters *conf)
 
 ~CSCAnodeLCTProcessor () 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
 

Protected Member Functions

void accelMode (const int key_wire)
 
std::vector< CSCALCTDigibestTrackSelector (const std::vector< CSCALCTDigi > &all_alcts)
 
void checkConfigParameters ()
 
void cleanWireContainer (CSCALCTDigi::WireContainer &wireHits) const
 
void clear (const int wire, const int pattern)
 
void dumpConfigParams () const
 
void dumpDigis (const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS]) const
 
void encodeHighMultiplicityBits (const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS])
 
bool getDigis (const CSCWireDigiCollection *wiredc)
 
void getDigis (const CSCWireDigiCollection *wiredc, const CSCDetId &id)
 
virtual int getTempALCTQuality (int temp_quality) const
 
virtual void ghostCancellationLogicOneWire (const int key_wire, int *ghost_cleared)
 
bool isBetterALCT (const CSCALCTDigi &lhsALCT, const CSCALCTDigi &rhsALCT) const
 
void lctSearch ()
 
void loadPatternMask ()
 
bool patternDetection (const int key_wire, std::map< int, std::map< int, CSCALCTDigi::WireContainer > > &hits_in_patterns)
 
bool preTrigger (const int key_wire, const int start_bx)
 
bool pulseExtension (const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS])
 
void readWireDigis (std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS])
 
void setDefaultConfigParameters ()
 
void setWireContainer (CSCALCTDigi &, CSCALCTDigi::WireContainer &wireHits) const
 
void showPatterns (const int key_wire)
 
void trigMode (const int key_wire)
 
- 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

unsigned int accel_mode
 
CSCPatternBank::LCTPatterns alct_pattern_ = {}
 
CSCALCTDigi bestALCT [CSCConstants::MAX_ALCT_TBINS]
 
std::vector< CSCWireDigidigiV [CSCConstants::NUM_LAYERS]
 
unsigned int drift_delay
 
int early_tbins
 
unsigned int fifo_pretrig
 
unsigned int fifo_tbins
 
int first_bx [CSCConstants::MAX_NUM_WIREGROUPS]
 
int first_bx_corrected [CSCConstants::MAX_NUM_WIREGROUPS]
 
int ghost_cancellation_bx_depth
 
bool ghost_cancellation_side_quality
 
unsigned int hit_persist
 
unsigned inTimeHMT_
 
unsigned int l1a_window_width
 
std::vector< CSCALCTDigilct_list
 
int MESelection
 
bool narrow_mask_r1
 
unsigned int nplanes_hit_accel_pattern
 
unsigned int nplanes_hit_accel_pretrig
 
unsigned int nplanes_hit_pattern
 
unsigned int nplanes_hit_pretrig
 
int numWireGroups
 
unsigned outTimeHMT_
 
unsigned int pretrig_extra_deadtime
 
PulseArray pulse_
 
int quality [CSCConstants::MAX_NUM_WIREGROUPS][CSCConstants::NUM_ALCT_PATTERNS]
 
std::unique_ptr< LCTQualityControlqualityControl_
 
CSCALCTDigi secondALCT [CSCConstants::MAX_ALCT_TBINS]
 
CSCShowerDigi shower_
 
unsigned showerMaxInTBin_
 
unsigned showerMaxOutTBin_
 
unsigned showerMinInTBin_
 
unsigned showerMinOutTBin_
 
std::vector< CSCALCTPreTriggerDigithePreTriggerDigis
 
std::vector< unsigned > thresholds_
 
unsigned int trig_mode
 
bool use_corrected_bx
 
- Protected Attributes inherited from CSCBaseboard
edm::ParameterSet alctParams_
 
edm::ParameterSet clctParams_
 
edm::ParameterSet commonParams_
 
const CSCChambercscChamber_
 
const CSCGeometrycscGeometry_
 
CSCDetId cscId_
 
bool disableME1a_
 
bool enableAlctPhase2_
 
bool gangedME1a_
 
int infoV
 
bool isME11_
 
bool isME21_
 
bool isME31_
 
bool isME41_
 
bool runCCLUT_
 
bool runME11ILT_
 
bool runME11Up_
 
bool runME21ILT_
 
bool runME21Up_
 
bool runME31Up_
 
bool runME41Up_
 
bool runPhase2_
 
edm::ParameterSet showerParams_
 
unsigned theChamber
 
std::string theCSCName_
 
const unsigned theEndcap
 
int theRegion
 
unsigned theRing
 
const unsigned theSector
 
const unsigned theStation
 
const unsigned theSubsector
 
const unsigned theTrigChamber
 
edm::ParameterSet tmbParams_
 

Static Protected Attributes

static const unsigned int def_accel_mode = 0
 
static const unsigned int def_drift_delay = 2
 
static const unsigned int def_fifo_pretrig = 10
 
static const unsigned int def_fifo_tbins = 16
 
static const unsigned int def_l1a_window_width = 7
 
static const unsigned int def_nplanes_hit_accel_pattern = 4
 
static const unsigned int def_nplanes_hit_accel_pretrig = 2
 
static const unsigned int def_nplanes_hit_pattern = 4
 
static const unsigned int def_nplanes_hit_pretrig = 2
 
static const unsigned int def_trig_mode = 2
 

Detailed Description

This class simulates the functionality of the anode LCT card. It is run by the MotherBoard and returns up to two AnodeLCTs. It can be run either in a test mode, where it is passed an array of wire times, or in normal mode where it determines the wire times from the wire digis.

This is the simulation for the Anode LCT Processor for the Level-1 Trigger. This processor consists of several stages:

  1. Pulse extension of signals coming from wires.
  2. Pretrigger for each key-wire.
  3. Pattern detector if a pretrigger is found for the given key-wire.
  4. Ghost Cancellation Logic (GCL).
  5. Best track search and promotion.
  6. Second best track search and promotion.

The inputs to the ALCT Processor are wire digis. The output is up to two ALCT digi words.

Author
Benn Tannenbaum benn@.nosp@m.phys.nosp@m.ics.u.nosp@m.cla..nosp@m.edu 13 July 1999 Numerous later improvements by Jason Mumford and Slava Valuev (see cvs in ORCA). Porting from ORCA by S. Valuev (Slava.nosp@m..Val.nosp@m.uev@c.nosp@m.ern..nosp@m.ch), May 2006.

Updates for high pileup running by Vadim Khotilovich (TAMU), December 2012

Updates for integrated local trigger with GEMs by Sven Dildick (TAMU) and Tao Huang (TAMU), April 2015

Removing usage of outdated class CSCTriggerGeometry by Sven Dildick (TAMU)

Definition at line 48 of file CSCAnodeLCTProcessor.h.

Constructor & Destructor Documentation

◆ CSCAnodeLCTProcessor()

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

Normal constructor.

Definition at line 20 of file CSCAnodeLCTProcessor.cc.

26  : CSCBaseboard(endcap, station, sector, subsector, chamber, conf) {
27  static std::atomic<bool> config_dumped{false};
28 
29  // ALCT configuration parameters.
30  fifo_tbins = alctParams_.getParameter<unsigned int>("alctFifoTbins");
31  fifo_pretrig = alctParams_.getParameter<unsigned int>("alctFifoPretrig");
32  drift_delay = alctParams_.getParameter<unsigned int>("alctDriftDelay");
33  nplanes_hit_pretrig = alctParams_.getParameter<unsigned int>("alctNplanesHitPretrig");
34  nplanes_hit_pattern = alctParams_.getParameter<unsigned int>("alctNplanesHitPattern");
35  nplanes_hit_accel_pretrig = alctParams_.getParameter<unsigned int>("alctNplanesHitAccelPretrig");
36  nplanes_hit_accel_pattern = alctParams_.getParameter<unsigned int>("alctNplanesHitAccelPattern");
37  trig_mode = alctParams_.getParameter<unsigned int>("alctTrigMode");
38  accel_mode = alctParams_.getParameter<unsigned int>("alctAccelMode");
39  l1a_window_width = alctParams_.getParameter<unsigned int>("alctL1aWindowWidth");
40 
41  hit_persist = alctParams_.getParameter<unsigned int>("alctHitPersist");
42 
43  // Verbosity level, set to 0 (no print) by default.
44  infoV = alctParams_.getParameter<int>("verbosity");
45 
46  // separate handle for early time bins
47  early_tbins = alctParams_.getParameter<int>("alctEarlyTbins");
48  if (early_tbins < 0)
50 
51  // delta BX time depth for ghostCancellationLogic
52  ghost_cancellation_bx_depth = alctParams_.getParameter<int>("alctGhostCancellationBxDepth");
53 
54  // whether to consider ALCT candidates' qualities while doing ghostCancellationLogic on +-1 wire groups
55  ghost_cancellation_side_quality = alctParams_.getParameter<bool>("alctGhostCancellationSideQuality");
56 
57  // deadtime clocks after pretrigger (extra in addition to drift_delay)
58  pretrig_extra_deadtime = alctParams_.getParameter<unsigned int>("alctPretrigDeadtime");
59 
60  // whether to use narrow pattern mask for the rings close to the beam
61  narrow_mask_r1 = alctParams_.getParameter<bool>("alctNarrowMaskForR1");
62 
63  // Check and print configuration parameters.
65  if ((infoV > 0 || (runPhase2_)) && !config_dumped) {
67  config_dumped = true;
68  }
69 
70  numWireGroups = 0; // Will be set later.
71  MESelection = (theStation < 3) ? 0 : 1;
72 
73  // whether to calculate bx as corrected_bx instead of pretrigger one
74  use_corrected_bx = false;
75  if (runPhase2_) {
76  use_corrected_bx = alctParams_.getParameter<bool>("alctUseCorrectedBx");
77  }
78 
79  // Load appropriate pattern mask.
81 
82  // quality control of stubs
83  qualityControl_ = std::make_unique<LCTQualityControl>(endcap, station, sector, subsector, chamber, conf);
84 
85  const auto& shower = showerParams_.getParameterSet("anodeShower");
86  thresholds_ = shower.getParameter<std::vector<unsigned>>("showerThresholds");
87  showerMinInTBin_ = shower.getParameter<unsigned>("showerMinInTBin");
88  showerMaxInTBin_ = shower.getParameter<unsigned>("showerMaxInTBin");
89  showerMinOutTBin_ = shower.getParameter<unsigned>("showerMinOutTBin");
90  showerMaxOutTBin_ = shower.getParameter<unsigned>("showerMaxOutTBin");
91 }

References accel_mode, CSCConstants::ALCT_EMUL_TIME_OFFSET, CSCBaseboard::alctParams_, relativeConstraints::chamber, checkConfigParameters(), drift_delay, dumpConfigParams(), early_tbins, makeMuonMisalignmentScenario::endcap, fifo_pretrig, fifo_tbins, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), ghost_cancellation_bx_depth, ghost_cancellation_side_quality, hit_persist, CSCBaseboard::infoV, l1a_window_width, loadPatternMask(), MESelection, narrow_mask_r1, nplanes_hit_accel_pattern, nplanes_hit_accel_pretrig, nplanes_hit_pattern, nplanes_hit_pretrig, numWireGroups, pretrig_extra_deadtime, qualityControl_, CSCBaseboard::runPhase2_, showerMaxInTBin_, showerMaxOutTBin_, showerMinInTBin_, showerMinOutTBin_, CSCBaseboard::showerParams_, relativeConstraints::station, CSCBaseboard::theStation, thresholds_, trig_mode, and use_corrected_bx.

◆ ~CSCAnodeLCTProcessor()

CSCAnodeLCTProcessor::~CSCAnodeLCTProcessor ( )
overridedefault

Default destructor.

Member Function Documentation

◆ accelMode()

void CSCAnodeLCTProcessor::accelMode ( const int  key_wire)
protected

Definition at line 1087 of file CSCAnodeLCTProcessor.cc.

1087  {
1088  int promotionBit = 1 << 2;
1089 
1090  switch (accel_mode) {
1091  default:
1092  case 0:
1093  // Ignore accelerator muons.
1094  if (quality[key_wire][0] > 0) {
1095  quality[key_wire][0] = 0;
1096  if (infoV > 1)
1097  LogTrace("CSCAnodeLCTProcessor") << "alctMode(): accelerator track " << key_wire << " ignored"
1098  << "\n";
1099  }
1100  break;
1101  case 1:
1102  // Prefer collision muons by adding promotion bit.
1103  if (quality[key_wire][CSCConstants::ALCT_COLLISIONA_PATTERN] > 0) {
1104  quality[key_wire][CSCConstants::ALCT_COLLISIONA_PATTERN] += promotionBit;
1105  if (infoV > 1)
1106  LogTrace("CSCAnodeLCTProcessor") << "alctMode(): collision track " << key_wire << " promoted"
1107  << "\n";
1108  }
1109  break;
1110  case 2:
1111  // Prefer accelerator muons by adding promotion bit.
1112  if (quality[key_wire][CSCConstants::ALCT_ACCELERATOR_PATTERN] > 0) {
1113  quality[key_wire][CSCConstants::ALCT_ACCELERATOR_PATTERN] += promotionBit;
1114  if (infoV > 1)
1115  LogTrace("CSCAnodeLCTProcessor") << "alctMode(): accelerator track " << key_wire << " promoted"
1116  << "\n";
1117  }
1118  break;
1119  case 3:
1120  // Ignore collision muons.
1121  if (quality[key_wire][CSCConstants::ALCT_COLLISIONA_PATTERN] > 0) {
1123  if (infoV > 1)
1124  LogTrace("CSCAnodeLCTProcessor") << "alctMode(): collision track " << key_wire << " ignored"
1125  << "\n";
1126  }
1127  break;
1128  }
1129 }

References accel_mode, CSCConstants::ALCT_ACCELERATOR_PATTERN, CSCConstants::ALCT_COLLISIONA_PATTERN, CSCBaseboard::infoV, LogTrace, and quality.

◆ bestTrackSelector()

std::vector< CSCALCTDigi > CSCAnodeLCTProcessor::bestTrackSelector ( const std::vector< CSCALCTDigi > &  all_alcts)
protected

Definition at line 910 of file CSCAnodeLCTProcessor.cc.

910  {
913 
914  if (infoV > 1) {
915  LogTrace("CSCAnodeLCTProcessor") << all_alcts.size() << " ALCTs at the input of best-track selector: ";
916  for (const auto& p : all_alcts) {
917  if (!p.isValid())
918  continue;
919  LogTrace("CSCAnodeLCTProcessor") << p;
920  }
921  }
922 
925  for (const auto& p : all_alcts) {
926  if (!p.isValid())
927  continue;
928 
929  // Select two collision and two accelerator ALCTs with the highest
930  // quality at every bx. The search for best ALCTs is done in parallel
931  // for collision and accelerator patterns, and simultaneously for
932  // two ALCTs, tA and tB. If two or more ALCTs have equal qualities,
933  // the priority is given to the ALCT with larger wiregroup number
934  // in the search for tA (collision and accelerator), and to the ALCT
935  // with smaller wiregroup number in the search for tB.
936  int bx = p.getBX();
937  int accel = p.getAccelerator();
938  int qual = p.getQuality();
939  int wire = p.getKeyWG();
940  bool vA = tA[bx][accel].isValid();
941  bool vB = tB[bx][accel].isValid();
942  int qA = tA[bx][accel].getQuality();
943  int qB = tB[bx][accel].getQuality();
944  int wA = tA[bx][accel].getKeyWG();
945  int wB = tB[bx][accel].getKeyWG();
946  if (!vA || qual > qA || (qual == qA && wire > wA)) {
947  tA[bx][accel] = p;
948  }
949  if (!vB || qual > qB || (qual == qB && wire < wB)) {
950  tB[bx][accel] = p;
951  }
952  }
953 
954  for (int bx = 0; bx < CSCConstants::MAX_ALCT_TBINS; bx++) {
955  for (int accel = 0; accel <= 1; accel++) {
956  // Best ALCT is always tA.
957  if (tA[bx][accel].isValid()) {
958  if (infoV > 2) {
959  LogTrace("CSCAnodeLCTProcessor") << "tA: " << tA[bx][accel];
960  LogTrace("CSCAnodeLCTProcessor") << "tB: " << tB[bx][accel];
961  }
962  bestALCTs[bx][accel] = tA[bx][accel];
963 
964  // If tA exists, tB exists too.
965  if (tA[bx][accel] != tB[bx][accel] && tA[bx][accel].getQuality() == tB[bx][accel].getQuality()) {
966  secondALCTs[bx][accel] = tB[bx][accel];
967  } else {
968  // Funny part: if tA and tB are the same, or the quality of tB
969  // is inferior to the quality of tA, the second best ALCT is
970  // not tB. Instead it is the largest-wiregroup ALCT among those
971  // ALCT whose qualities are lower than the quality of the best one.
972  for (const auto& p : all_alcts) {
973  if (p.isValid() && p.getAccelerator() == accel && p.getBX() == bx &&
974  p.getQuality() < bestALCTs[bx][accel].getQuality() &&
975  p.getQuality() >= secondALCTs[bx][accel].getQuality() &&
976  p.getKeyWG() >= secondALCTs[bx][accel].getKeyWG()) {
977  secondALCTs[bx][accel] = p;
978  }
979  }
980  }
981  }
982  }
983  }
984 
985  // Fill the vector with up to four best ALCTs per bx and return it.
986  std::vector<CSCALCTDigi> fourBest;
987  for (int bx = 0; bx < CSCConstants::MAX_ALCT_TBINS; bx++) {
988  for (int i = 0; i < CSCConstants::MAX_ALCTS_PER_PROCESSOR; i++) {
989  if (bestALCTs[bx][i].isValid()) {
990  fourBest.push_back(bestALCTs[bx][i]);
991  }
992  }
993  for (int i = 0; i < CSCConstants::MAX_ALCTS_PER_PROCESSOR; i++) {
994  if (secondALCTs[bx][i].isValid()) {
995  fourBest.push_back(secondALCTs[bx][i]);
996  }
997  }
998  }
999 
1000  if (infoV > 1) {
1001  LogTrace("CSCAnodeLCTProcessor") << fourBest.size() << " ALCTs selected: ";
1002  for (const auto& p : fourBest) {
1003  LogTrace("CSCAnodeLCTProcessor") << p;
1004  }
1005  }
1006 
1007  return fourBest;
1008 }

References l1GtPatternGenerator_cfi::bx, CSCALCTDigi::getKeyWG(), CSCALCTDigi::getQuality(), mps_fire::i, CSCBaseboard::infoV, CSCALCTDigi::isValid(), sistrip::SpyUtilities::isValid(), LogTrace, CSCConstants::MAX_ALCT_TBINS, CSCConstants::MAX_ALCTS_PER_PROCESSOR, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by lctSearch().

◆ checkConfigParameters()

void CSCAnodeLCTProcessor::checkConfigParameters ( )
protected

Make sure that the parameter values are within the allowed range.

Definition at line 139 of file CSCAnodeLCTProcessor.cc.

139  {
140  // Make sure that the parameter values are within the allowed range.
141 
142  // Max expected values.
143  static const unsigned int max_fifo_tbins = 1 << 5;
144  static const unsigned int max_fifo_pretrig = 1 << 5;
145  static const unsigned int max_drift_delay = 1 << 2;
146  static const unsigned int max_nplanes_hit_pretrig = 1 << 3;
147  static const unsigned int max_nplanes_hit_pattern = 1 << 3;
148  static const unsigned int max_nplanes_hit_accel_pretrig = 1 << 3;
149  static const unsigned int max_nplanes_hit_accel_pattern = 1 << 3;
150  static const unsigned int max_trig_mode = 1 << 2;
151  static const unsigned int max_accel_mode = 1 << 2;
152  static const unsigned int max_l1a_window_width = CSCConstants::MAX_ALCT_TBINS; // 4 bits
153 
154  // Checks.
155  CSCBaseboard::checkConfigParameters(fifo_tbins, max_fifo_tbins, def_fifo_tbins, "fifo_tbins");
156  CSCBaseboard::checkConfigParameters(fifo_pretrig, max_fifo_pretrig, def_fifo_pretrig, "fifo_pretrig");
157  CSCBaseboard::checkConfigParameters(drift_delay, max_drift_delay, def_drift_delay, "drift_delay");
159  nplanes_hit_pretrig, max_nplanes_hit_pretrig, def_nplanes_hit_pretrig, "nplanes_hit_pretrig");
161  nplanes_hit_pattern, max_nplanes_hit_pattern, def_nplanes_hit_pattern, "nplanes_hit_pattern");
163  max_nplanes_hit_accel_pretrig,
165  "nplanes_hit_accel_pretrig");
167  max_nplanes_hit_accel_pattern,
169  "nplanes_hit_accel_pattern");
170  CSCBaseboard::checkConfigParameters(trig_mode, max_trig_mode, def_trig_mode, "trig_mode");
171  CSCBaseboard::checkConfigParameters(accel_mode, max_accel_mode, def_accel_mode, "accel_mode");
172  CSCBaseboard::checkConfigParameters(l1a_window_width, max_l1a_window_width, def_l1a_window_width, "l1a_window_width");
173 }

References accel_mode, CSCBaseboard::checkConfigParameters(), def_accel_mode, def_drift_delay, def_fifo_pretrig, def_fifo_tbins, def_l1a_window_width, def_nplanes_hit_accel_pattern, def_nplanes_hit_accel_pretrig, def_nplanes_hit_pattern, def_nplanes_hit_pretrig, def_trig_mode, drift_delay, fifo_pretrig, fifo_tbins, l1a_window_width, CSCConstants::MAX_ALCT_TBINS, nplanes_hit_accel_pattern, nplanes_hit_accel_pretrig, nplanes_hit_pattern, nplanes_hit_pretrig, and trig_mode.

Referenced by CSCAnodeLCTProcessor(), and setConfigParameters().

◆ cleanWireContainer()

void CSCAnodeLCTProcessor::cleanWireContainer ( CSCALCTDigi::WireContainer wireHits) const
protected

Definition at line 1324 of file CSCAnodeLCTProcessor.cc.

1324  {
1325  for (auto& p : wireHits) {
1326  p.erase(std::remove_if(p.begin(), p.end(), [](unsigned i) -> bool { return i == CSCConstants::INVALID_WIREGROUP; }),
1327  p.end());
1328  }
1329 }

References mps_fire::i, CSCConstants::INVALID_WIREGROUP, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by setWireContainer().

◆ clear() [1/2]

void CSCAnodeLCTProcessor::clear ( void  )

Clears the LCT containers.

Definition at line 175 of file CSCAnodeLCTProcessor.cc.

175  {
176  for (int bx = 0; bx < CSCConstants::MAX_ALCT_TBINS; bx++) {
177  bestALCT[bx].clear();
178  secondALCT[bx].clear();
179  }
180  lct_list.clear();
181  inTimeHMT_ = 0;
182  outTimeHMT_ = 0;
183 }

References bestALCT, l1GtPatternGenerator_cfi::bx, CSCALCTDigi::clear(), inTimeHMT_, lct_list, CSCConstants::MAX_ALCT_TBINS, outTimeHMT_, and secondALCT.

◆ clear() [2/2]

void CSCAnodeLCTProcessor::clear ( const int  wire,
const int  pattern 
)
protected

Clears the quality for a given wire and pattern if it is a ghost.

Definition at line 185 of file CSCAnodeLCTProcessor.cc.

185  {
186  /* Clear the data off of selected pattern */
189  else {
192  }
193 }

References CSCConstants::ALCT_ACCELERATOR_PATTERN, CSCConstants::ALCT_COLLISIONA_PATTERN, CSCConstants::ALCT_COLLISIONB_PATTERN, topSingleLeptonDQM_PU_cfi::pattern, and quality.

◆ dumpConfigParams()

void CSCAnodeLCTProcessor::dumpConfigParams ( ) const
protected

Dump ALCT configuration parameters.

Definition at line 1132 of file CSCAnodeLCTProcessor.cc.

1132  {
1133  std::ostringstream strm;
1134  strm << "\n";
1135  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1136  strm << "+ ALCT configuration parameters: +\n";
1137  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1138  strm << " fifo_tbins [total number of time bins in DAQ readout] = " << fifo_tbins << "\n";
1139  strm << " fifo_pretrig [start time of anode raw hits in DAQ readout] = " << fifo_pretrig << "\n";
1140  strm << " drift_delay [drift delay after pre-trigger, in 25 ns bins] = " << drift_delay << "\n";
1141  strm << " nplanes_hit_pretrig [min. number of layers hit for pre-trigger] = " << nplanes_hit_pretrig << "\n";
1142  strm << " nplanes_hit_pattern [min. number of layers hit for trigger] = " << nplanes_hit_pattern << "\n";
1143  strm << " nplanes_hit_accel_pretrig [min. number of layers hit for accel."
1144  << " pre-trig.] = " << nplanes_hit_accel_pretrig << "\n";
1145  strm << " nplanes_hit_accel_pattern [min. number of layers hit for accel."
1146  << " trigger] = " << nplanes_hit_accel_pattern << "\n";
1147  strm << " trig_mode [enabling/disabling collision/accelerator tracks] = " << trig_mode << "\n";
1148  strm << " accel_mode [preference to collision/accelerator tracks] = " << accel_mode << "\n";
1149  strm << " l1a_window_width [L1Accept window width, in 25 ns bins] = " << l1a_window_width << "\n";
1150  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1151  LogDebug("CSCAnodeLCTProcessor") << strm.str();
1152 }

References accel_mode, drift_delay, fifo_pretrig, fifo_tbins, l1a_window_width, LogDebug, nplanes_hit_accel_pattern, nplanes_hit_accel_pretrig, nplanes_hit_pattern, nplanes_hit_pretrig, and trig_mode.

Referenced by CSCAnodeLCTProcessor(), run(), and setConfigParameters().

◆ dumpDigis()

void CSCAnodeLCTProcessor::dumpDigis ( const std::vector< int >  wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS]) const
protected

Dump digis on wire groups.

Definition at line 1155 of file CSCAnodeLCTProcessor.cc.

1156  {
1157  LogDebug("CSCAnodeLCTProcessor") << theCSCName_ << " nWiregroups " << numWireGroups;
1158 
1159  std::ostringstream strstrm;
1160  for (int i_wire = 0; i_wire < numWireGroups; i_wire++) {
1161  if (i_wire % 10 == 0) {
1162  if (i_wire < 100)
1163  strstrm << i_wire / 10;
1164  else
1165  strstrm << (i_wire - 100) / 10;
1166  } else
1167  strstrm << " ";
1168  }
1169  strstrm << "\n";
1170  for (int i_wire = 0; i_wire < numWireGroups; i_wire++) {
1171  strstrm << i_wire % 10;
1172  }
1173  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
1174  strstrm << "\n";
1175  for (int i_wire = 0; i_wire < numWireGroups; i_wire++) {
1176  if (!wire[i_layer][i_wire].empty()) {
1177  std::vector<int> bx_times = wire[i_layer][i_wire];
1178  strstrm << std::hex << bx_times[0] << std::dec;
1179  } else {
1180  strstrm << ".";
1181  }
1182  }
1183  }
1184  LogTrace("CSCAnodeLCTProcessor") << strstrm.str();
1185 }

References TauDecayModes::dec, relativeConstraints::empty, LogDebug, LogTrace, CSCConstants::NUM_LAYERS, numWireGroups, and CSCBaseboard::theCSCName_.

Referenced by pulseExtension().

◆ encodeHighMultiplicityBits()

void CSCAnodeLCTProcessor::encodeHighMultiplicityBits ( const std::vector< int >  wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS])
protected

Definition at line 1339 of file CSCAnodeLCTProcessor.cc.

1340  {
1341  inTimeHMT_ = 0;
1342  outTimeHMT_ = 0;
1343 
1344  // functions for in-time and out-of-time
1345  auto inTime = [=](unsigned time) { return time >= showerMinInTBin_ and time <= showerMaxInTBin_; };
1346  auto outTime = [=](unsigned time) { return time >= showerMinOutTBin_ and time <= showerMaxOutTBin_; };
1347 
1348  // count the wires in-time and out-time
1349  unsigned hitsInTime = 0;
1350  unsigned hitsOutTime = 0;
1351  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
1352  for (int i_wire = 0; i_wire < CSCConstants::MAX_NUM_WIREGROUPS; i_wire++) {
1353  auto times = wires[i_layer][i_wire];
1354  hitsInTime += std::count_if(times.begin(), times.end(), inTime);
1355  hitsOutTime += std::count_if(times.begin(), times.end(), outTime);
1356  }
1357  }
1358 
1359  // convert station and ring number to index
1360  // index runs from 2 to 10, subtract 2
1361  unsigned csc_idx = CSCDetId::iChamberType(theStation, theRing) - 2;
1362 
1363  // loose, nominal and tight
1364  std::vector<unsigned> station_thresholds = {
1365  thresholds_[csc_idx * 3], thresholds_[csc_idx * 3 + 1], thresholds_[csc_idx * 3 + 2]};
1366 
1367  // assign the bits
1368  for (unsigned i = 0; i < station_thresholds.size(); i++) {
1369  if (hitsInTime >= station_thresholds[i]) {
1370  inTimeHMT_ = i + 1;
1371  }
1372  if (hitsOutTime >= station_thresholds[i]) {
1373  outTimeHMT_ = i + 1;
1374  }
1375  }
1376 
1377  // create a new object
1379 }

References mps_fire::i, CSCDetId::iChamberType(), inTimeHMT_, CSCConstants::MAX_NUM_WIREGROUPS, CSCConstants::NUM_LAYERS, outTimeHMT_, shower_, showerMaxInTBin_, showerMaxOutTBin_, showerMinInTBin_, showerMinOutTBin_, CSCBaseboard::theRing, CSCBaseboard::theStation, CSCBaseboard::theTrigChamber, thresholds_, protons_cff::time, and DigiDM_cff::wires.

Referenced by run().

◆ getALCTs()

std::vector< CSCALCTDigi > CSCAnodeLCTProcessor::getALCTs ( ) const

Returns vector of all found ALCTs, if any.

Definition at line 1264 of file CSCAnodeLCTProcessor.cc.

1264  {
1265  std::vector<CSCALCTDigi> tmpV;
1266  for (int bx = 0; bx < CSCConstants::MAX_ALCT_TBINS; bx++) {
1267  if (bestALCT[bx].isValid())
1268  tmpV.push_back(bestALCT[bx]);
1269  if (secondALCT[bx].isValid())
1270  tmpV.push_back(secondALCT[bx]);
1271  }
1272  return tmpV;
1273 }

References bestALCT, l1GtPatternGenerator_cfi::bx, sistrip::SpyUtilities::isValid(), CSCConstants::MAX_ALCT_TBINS, and secondALCT.

Referenced by readoutALCTs(), and run().

◆ getBestALCT()

CSCALCTDigi CSCAnodeLCTProcessor::getBestALCT ( int  bx) const

Return best/second best ALCTs

Definition at line 1275 of file CSCAnodeLCTProcessor.cc.

1275 { return bestALCT[bx]; }

References bestALCT, and l1GtPatternGenerator_cfi::bx.

◆ getDigis() [1/2]

bool CSCAnodeLCTProcessor::getDigis ( const CSCWireDigiCollection wiredc)
protected

Access routines to wire digis.

Definition at line 385 of file CSCAnodeLCTProcessor.cc.

385  {
386  // Routine for getting digis and filling digiV vector.
387  bool hasDigis = false;
388 
389  // Loop over layers and save wire digis on each one into digiV[layer].
390  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
391  digiV[i_layer].clear();
392 
393  CSCDetId detid(theEndcap, theStation, theRing, theChamber, i_layer + 1);
394  getDigis(wiredc, detid);
395 
396  // If this is ME1/1, fetch digis in corresponding ME1/A (ring=4) as well.
397  if (isME11_ && !disableME1a_) {
398  CSCDetId detid_me1a(theEndcap, theStation, 4, theChamber, i_layer + 1);
399  getDigis(wiredc, detid_me1a);
400  }
401 
402  if (!digiV[i_layer].empty()) {
403  hasDigis = true;
404  if (infoV > 1) {
405  LogTrace("CSCAnodeLCTProcessor") << "found " << digiV[i_layer].size() << " wire digi(s) in layer " << i_layer
406  << " of " << theCSCName_ << " (trig. sector " << theSector << " subsector "
407  << theSubsector << " id " << theTrigChamber << ")";
408  for (const auto& wd : digiV[i_layer]) {
409  LogTrace("CSCAnodeLCTProcessor") << " " << wd;
410  }
411  }
412  }
413  }
414 
415  return hasDigis;
416 }

References digiV, CSCBaseboard::disableME1a_, relativeConstraints::empty, CSCBaseboard::infoV, CSCBaseboard::isME11_, LogTrace, CSCConstants::NUM_LAYERS, CSCBaseboard::theChamber, CSCBaseboard::theCSCName_, CSCBaseboard::theEndcap, CSCBaseboard::theRing, CSCBaseboard::theSector, CSCBaseboard::theStation, CSCBaseboard::theSubsector, and CSCBaseboard::theTrigChamber.

Referenced by run().

◆ getDigis() [2/2]

void CSCAnodeLCTProcessor::getDigis ( const CSCWireDigiCollection wiredc,
const CSCDetId id 
)
protected

Definition at line 418 of file CSCAnodeLCTProcessor.cc.

418  {
419  CSCWireDigiCollection::Range rwired = wiredc->get(id);
420  for (CSCWireDigiCollection::const_iterator digiIt = rwired.first; digiIt != rwired.second; ++digiIt) {
421  digiV[id.layer() - 1].push_back(*digiIt);
422  }
423 }

References digiV.

◆ getInTimeHMT()

unsigned CSCAnodeLCTProcessor::getInTimeHMT ( ) const
inline

Definition at line 91 of file CSCAnodeLCTProcessor.h.

91 { return inTimeHMT_; }

References inTimeHMT_.

◆ getOutTimeHMT()

unsigned CSCAnodeLCTProcessor::getOutTimeHMT ( ) const
inline

Definition at line 92 of file CSCAnodeLCTProcessor.h.

92 { return outTimeHMT_; }

References outTimeHMT_.

◆ getSecondALCT()

CSCALCTDigi CSCAnodeLCTProcessor::getSecondALCT ( int  bx) const

Definition at line 1277 of file CSCAnodeLCTProcessor.cc.

1277 { return secondALCT[bx]; }

References l1GtPatternGenerator_cfi::bx, and secondALCT.

◆ getTempALCTQuality()

int CSCAnodeLCTProcessor::getTempALCTQuality ( int  temp_quality) const
protectedvirtual

Reimplemented in CSCUpgradeAnodeLCTProcessor.

Definition at line 1314 of file CSCAnodeLCTProcessor.cc.

1314  {
1315  int Q;
1316  if (temp_quality > 3)
1317  Q = temp_quality - 3;
1318  else
1319  Q = 0; // quality code 0 is valid!
1320 
1321  return Q;
1322 }

Referenced by patternDetection().

◆ ghostCancellationLogicOneWire()

void CSCAnodeLCTProcessor::ghostCancellationLogicOneWire ( const int  key_wire,
int *  ghost_cleared 
)
protectedvirtual

Reimplemented in CSCUpgradeAnodeLCTProcessor.

Definition at line 765 of file CSCAnodeLCTProcessor.cc.

765  {
766  for (int i_pattern = 0; i_pattern < 2; i_pattern++) {
767  ghost_cleared[i_pattern] = 0;
768  if (key_wire == 0)
769  continue; //ignore
770 
771  // Non-empty wire group.
772  int qual_this = quality[key_wire][i_pattern];
773  if (qual_this > 0) {
774  // Previous wire.
775  //int qual_prev = (key_wire > 0) ? quality[key_wire-1][i_pattern] : 0;
776  //previous ALCTs were pushed to lct_list, stop use the array quality[key_wire-1][i_pattern]
777  for (auto& p : lct_list) {
778  //ignore whether ALCT is valid or not in ghost cancellation
779  //if wiregroup 10, 11, 12 all have trigger and same quality, only wiregroup 10 can keep the trigger
780  //this met with firmware
781  if (not(p.getKeyWG() == key_wire - 1 and 1 - p.getAccelerator() == i_pattern))
782  continue;
783 
784  bool ghost_cleared_prev = false;
785  int qual_prev = p.getQuality();
786  int first_bx_prev = p.getBX();
787  if (infoV > 1)
788  LogTrace("CSCAnodeLCTProcessor")
789  << "ghost concellation logic "
790  << ((i_pattern == CSCConstants::ALCT_ACCELERATOR_PATTERN) ? "Accelerator" : "Collision") << " key_wire "
791  << key_wire << " quality " << qual_this << " bx " << first_bx[key_wire] << " previous key_wire "
792  << key_wire - 1 << " quality " << qual_prev << " bx " << first_bx[key_wire - 1];
793 
794  //int dt = first_bx[key_wire] - first_bx[key_wire-1];
795  int dt = first_bx[key_wire] - first_bx_prev;
796  // Cancel this wire
797  // 1) If the candidate at the previous wire is at the same bx
798  // clock and has better quality (or equal quality - this has
799  // been implemented only in 2004).
800  // 2) If the candidate at the previous wire is up to 4 clocks
801  // earlier, regardless of quality.
802  if (dt == 0) {
803  if (qual_prev >= qual_this)
804  ghost_cleared[i_pattern] = 1;
805  else if (qual_prev < qual_this)
806  ghost_cleared_prev = true;
807  } else if (dt > 0 && dt <= ghost_cancellation_bx_depth) {
808  if ((!ghost_cancellation_side_quality) || (qual_prev > qual_this))
809  ghost_cleared[i_pattern] = 1;
810  } else if (dt < 0 && dt * (-1) <= ghost_cancellation_bx_depth) {
811  if ((!ghost_cancellation_side_quality) || (qual_prev < qual_this))
812  ghost_cleared_prev = true;
813  }
814 
815  if (ghost_cleared[i_pattern] == 1) {
816  if (infoV > 1)
817  LogTrace("CSCAnodeLCTProcessor")
818  << ((i_pattern == CSCConstants::ALCT_ACCELERATOR_PATTERN) ? "Accelerator" : "Collision")
819  << " pattern ghost cancelled on key_wire " << key_wire << " q=" << qual_this << " by wire "
820  << key_wire - 1 << " q=" << qual_prev;
821  //cancellation for key_wire is done when ALCT is created and pushed to lct_list
822  }
823 
824  if (ghost_cleared_prev) {
825  if (infoV > 1)
826  LogTrace("CSCAnodeLCTProcessor")
827  << ((i_pattern == CSCConstants::ALCT_ACCELERATOR_PATTERN) ? "Accelerator" : "Collision")
828  << " pattern ghost cancelled on key_wire " << key_wire - 1 << " q=" << qual_prev << " by wire "
829  << key_wire << " q=" << qual_this;
830  p.setValid(0); //clean prev ALCT
831  }
832  }
833 
834  } // if qual_this > 0
835  } //i_pattern
836 }

References CSCConstants::ALCT_ACCELERATOR_PATTERN, dt, first_bx, ghost_cancellation_bx_depth, ghost_cancellation_side_quality, CSCBaseboard::infoV, lct_list, LogTrace, AlCaHLTBitMon_ParallelJobs::p, and quality.

Referenced by run().

◆ isBetterALCT()

bool CSCAnodeLCTProcessor::isBetterALCT ( const CSCALCTDigi lhsALCT,
const CSCALCTDigi rhsALCT 
) const
protected

Definition at line 1010 of file CSCAnodeLCTProcessor.cc.

1010  {
1011  bool returnValue = false;
1012 
1013  if (lhsALCT.isValid() && !rhsALCT.isValid()) {
1014  return true;
1015  }
1016 
1017  // ALCTs found at earlier bx times are ranked higher than ALCTs found at
1018  // later bx times regardless of the quality.
1019  if (lhsALCT.getBX() < rhsALCT.getBX()) {
1020  returnValue = true;
1021  }
1022  if (lhsALCT.getBX() != rhsALCT.getBX()) {
1023  return returnValue;
1024  }
1025 
1026  // First check the quality of ALCTs.
1027  const int qual1 = lhsALCT.getQuality();
1028  const int qual2 = rhsALCT.getQuality();
1029  if (qual1 > qual2) {
1030  returnValue = true;
1031  }
1032  // If qualities are the same, check accelerator bits of both ALCTs.
1033  // If they are not the same, rank according to accel_mode value.
1034  // If they are the same, keep the track selector assignment.
1035  //else if (qual1 == qual2 &&
1036  // lhsALCT.getAccelerator() != rhsALCT.getAccelerator() &&
1037  // quality[lhsALCT.getKeyWG()][1-lhsALCT.getAccelerator()] >
1038  // quality[rhsALCT.getKeyWG()][1-rhsALCT.getAccelerator()])
1039  // {returnValue = true;}
1040  else if (qual1 == qual2 && lhsALCT.getAccelerator() != rhsALCT.getAccelerator()) {
1041  if ((accel_mode == 0 || accel_mode == 1) && rhsALCT.getAccelerator() == 0)
1042  returnValue = true;
1043  if ((accel_mode == 2 || accel_mode == 3) && lhsALCT.getAccelerator() == 0)
1044  returnValue = true;
1045  }
1046 
1047  return returnValue;
1048 }

References accel_mode, CSCALCTDigi::getAccelerator(), CSCALCTDigi::getBX(), CSCALCTDigi::getQuality(), and CSCALCTDigi::isValid().

Referenced by lctSearch().

◆ lctSearch()

void CSCAnodeLCTProcessor::lctSearch ( )
protected

Definition at line 838 of file CSCAnodeLCTProcessor.cc.

838  {
839  // Best track selector selects two collision and two accelerator ALCTs
840  // with the best quality per time bin.
841  const std::vector<CSCALCTDigi>& fourBest = bestTrackSelector(lct_list);
842 
843  if (infoV > 0) {
844  int n_alct_all = 0, n_alct = 0;
845  for (const auto& p : lct_list) {
846  if (p.isValid() && p.getBX() == CSCConstants::LCT_CENTRAL_BX)
847  n_alct_all++;
848  }
849  for (const auto& p : fourBest) {
850  if (p.isValid() && p.getBX() == CSCConstants::LCT_CENTRAL_BX)
851  n_alct++;
852  }
853 
854  LogTrace("CSCAnodeLCTProcessor") << "alct_count E:" << theEndcap << "S:" << theStation << "R:" << theRing
855  << "C:" << theChamber << " all " << n_alct_all << " found " << n_alct;
856  }
857 
858  // Select two best of four per time bin, based on quality and
859  // accel_mode parameter.
860  for (const auto& p : fourBest) {
861  const int bx = p.getBX();
863  if (infoV > 0)
864  edm::LogWarning("CSCAnodeLCTProcessor|OutOfTimeALCT")
865  << "+++ Bx of ALCT candidate, " << bx << ", exceeds max allowed, " << CSCConstants::MAX_ALCT_TBINS - 1
866  << "; skipping it... +++\n";
867  continue;
868  }
869 
870  if (isBetterALCT(p, bestALCT[bx])) {
872  secondALCT[bx] = bestALCT[bx];
873  }
874  bestALCT[bx] = p;
875  } else if (isBetterALCT(p, secondALCT[bx])) {
876  secondALCT[bx] = p;
877  }
878  }
879 
880  for (int bx = 0; bx < CSCConstants::MAX_ALCT_TBINS; bx++) {
881  if (bestALCT[bx].isValid()) {
882  bestALCT[bx].setTrknmb(1);
883 
884  // check if the best ALCT is valid
885  qualityControl_->checkValidReadout(bestALCT[bx]);
886 
887  if (infoV > 0) {
888  LogDebug("CSCAnodeLCTProcessor") << bestALCT[bx] << " fullBX = " << bestALCT[bx].getFullBX() << " found in "
889  << theCSCName_ << " (sector " << theSector << " subsector " << theSubsector
890  << " trig id. " << theTrigChamber << ")"
891  << "\n";
892  }
893  if (secondALCT[bx].isValid()) {
894  secondALCT[bx].setTrknmb(2);
895 
896  // check if the second best ALCT is valid
897  qualityControl_->checkValidReadout(secondALCT[bx]);
898 
899  if (infoV > 0) {
900  LogDebug("CSCAnodeLCTProcessor")
901  << secondALCT[bx] << " fullBX = " << secondALCT[bx].getFullBX() << " found in " << theCSCName_
902  << " (sector " << theSector << " subsector " << theSubsector << " trig id. " << theTrigChamber << ")"
903  << "\n";
904  }
905  }
906  }
907  }
908 }

References bestALCT, bestTrackSelector(), l1GtPatternGenerator_cfi::bx, CSCALCTDigi::getFullBX(), CSCBaseboard::infoV, isBetterALCT(), sistrip::SpyUtilities::isValid(), CSCConstants::LCT_CENTRAL_BX, lct_list, LogDebug, LogTrace, CSCConstants::MAX_ALCT_TBINS, AlCaHLTBitMon_ParallelJobs::p, qualityControl_, secondALCT, CSCALCTDigi::setTrknmb(), CSCBaseboard::theChamber, CSCBaseboard::theCSCName_, CSCBaseboard::theEndcap, CSCBaseboard::theRing, CSCBaseboard::theSector, CSCBaseboard::theStation, CSCBaseboard::theSubsector, and CSCBaseboard::theTrigChamber.

Referenced by run().

◆ loadPatternMask()

void CSCAnodeLCTProcessor::loadPatternMask ( )
protected

Load pattern mask defined by configuration into pattern_mask

Definition at line 93 of file CSCAnodeLCTProcessor.cc.

93  {
94  // Load appropriate pattern mask.
95  if (narrow_mask_r1 && (theRing == 1 || theRing == 4)) {
97  } else {
99  }
100 }

References alct_pattern_, CSCPatternBank::alct_pattern_legacy_, CSCPatternBank::alct_pattern_r1_, narrow_mask_r1, and CSCBaseboard::theRing.

Referenced by CSCAnodeLCTProcessor().

◆ patternDetection()

bool CSCAnodeLCTProcessor::patternDetection ( const int  key_wire,
std::map< int, std::map< int, CSCALCTDigi::WireContainer > > &  hits_in_patterns 
)
protected

Definition at line 620 of file CSCAnodeLCTProcessor.cc.

621  {
622  bool trigger = false;
623  bool hit_layer[CSCConstants::NUM_LAYERS];
624  unsigned int temp_quality;
625  int this_wire, delta_wire;
626  // If nplanes_hit_accel_pattern is 0, the firmware uses the value
627  // of nplanes_hit_pattern instead.
628  const unsigned int nplanes_hit_pattern_acc =
630  const unsigned int pattern_thresh[CSCConstants::NUM_ALCT_PATTERNS] = {
631  nplanes_hit_pattern_acc, nplanes_hit_pattern, nplanes_hit_pattern};
632  const std::string ptn_label[] = {"Accelerator", "CollisionA", "CollisionB"};
633 
634  for (int i_pattern = 0; i_pattern < CSCConstants::NUM_ALCT_PATTERNS; i_pattern++) {
635  temp_quality = 0;
636 
637  // initialize the hit layers
638  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++)
639  hit_layer[i_layer] = false;
640 
641  // clear a single pattern!
642  CSCALCTDigi::WireContainer hits_single_pattern;
643  hits_single_pattern.clear();
644  hits_single_pattern.resize(CSCConstants::NUM_LAYERS);
645  for (auto& p : hits_single_pattern) {
647  }
648 
649  double num_pattern_hits = 0., times_sum = 0.;
650  std::multiset<int> mset_for_median;
651  mset_for_median.clear();
652 
653  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
654  for (int i_wire = 0; i_wire < CSCConstants::ALCT_PATTERN_WIDTH; i_wire++) {
655  // check if the hit is valid
656  if (alct_pattern_[i_pattern][i_layer][i_wire]) {
658  this_wire = delta_wire + key_wire;
659  if ((this_wire >= 0) && (this_wire < numWireGroups)) {
660  // Wait a drift_delay time later and look for layers hit in
661  // the pattern.
662  if (pulse_.isOneShotHighAtBX(i_layer, this_wire, first_bx[key_wire] + drift_delay)) {
663  // store hits in the temporary pattern vector
664  hits_single_pattern[i_layer][i_wire] = this_wire;
665 
666  // If layer has never had a hit before, then increment number
667  // of layer hits.
668  if (!hit_layer[i_layer]) {
669  temp_quality++;
670  // keep track of which layers already had hits.
671  hit_layer[i_layer] = true;
672  if (infoV > 1)
673  LogTrace("CSCAnodeLCTProcessor")
674  << "bx_time: " << first_bx[key_wire] << " pattern: " << i_pattern << " keywire: " << key_wire
675  << " layer: " << i_layer << " quality: " << temp_quality;
676  }
677 
678  // for averaged time use only the closest WGs around the key WG
679  if (abs(delta_wire) < 2) {
680  // find at what bx did pulse on this wire&layer start
681  // use hit_pesrist constraint on how far back we can go
682  int first_bx_layer = first_bx[key_wire] + drift_delay;
683  for (unsigned int dbx = 0; dbx < hit_persist; dbx++) {
684  if (pulse_.isOneShotHighAtBX(i_layer, this_wire, first_bx_layer - 1)) {
685  first_bx_layer--;
686  } else
687  break;
688  }
689  times_sum += (double)first_bx_layer;
690  num_pattern_hits += 1.;
691  mset_for_median.insert(first_bx_layer);
692  if (infoV > 2)
693  LogTrace("CSCAnodeLCTProcessor") << " 1st bx in layer: " << first_bx_layer << " sum bx: " << times_sum
694  << " #pat. hits: " << num_pattern_hits;
695  }
696  }
697  }
698  }
699  }
700  }
701 
702  // calculate median
703  const int sz = mset_for_median.size();
704  if (sz > 0) {
705  std::multiset<int>::iterator im = mset_for_median.begin();
706  if (sz > 1)
707  std::advance(im, sz / 2 - 1);
708  if (sz == 1)
709  first_bx_corrected[key_wire] = *im;
710  else if ((sz % 2) == 1)
711  first_bx_corrected[key_wire] = *(++im);
712  else
713  first_bx_corrected[key_wire] = ((*im) + (*(++im))) / 2;
714 
715 #if defined(EDM_ML_DEBUG)
716  if (infoV > 1) {
717  auto lt = LogTrace("CSCAnodeLCTProcessor")
718  << "bx=" << first_bx[key_wire] << " bx_cor=" << first_bx_corrected[key_wire] << " bxset=";
719  for (im = mset_for_median.begin(); im != mset_for_median.end(); im++) {
720  lt << " " << *im;
721  }
722  }
723 #endif
724  }
725 
726  // save the pattern information when a trigger was formed!
727  if (temp_quality >= pattern_thresh[i_pattern]) {
728  trigger = true;
729  hits_in_patterns[key_wire][i_pattern] = hits_single_pattern;
730 
731  // Quality definition changed on 22 June 2007: it no longer depends
732  // on pattern_thresh.
733  temp_quality = getTempALCTQuality(temp_quality);
734 
735  if (i_pattern == CSCConstants::ALCT_ACCELERATOR_PATTERN) {
736  // Accelerator pattern
737  quality[key_wire][CSCConstants::ALCT_ACCELERATOR_PATTERN] = temp_quality;
738  } else {
739  // Only one collision pattern (of the best quality) is reported
740  if (static_cast<int>(temp_quality) > quality[key_wire][CSCConstants::ALCT_COLLISIONA_PATTERN]) {
741  quality[key_wire][CSCConstants::ALCT_COLLISIONA_PATTERN] = temp_quality; //real quality
742  quality[key_wire][CSCConstants::ALCT_COLLISIONB_PATTERN] = i_pattern - 1; // pattern, left or right
743  }
744  }
745  if (infoV > 1) {
746  LogTrace("CSCAnodeLCTProcessor") << "Pattern found; keywire: " << key_wire << " type: " << ptn_label[i_pattern]
747  << " quality: " << temp_quality << "\n";
748  }
749  }
750  }
751  if (infoV > 1 && quality[key_wire][CSCConstants::ALCT_COLLISIONA_PATTERN] > 0) {
753  LogTrace("CSCAnodeLCTProcessor") << "Collision Pattern A is chosen"
754  << "\n";
755  else if (quality[key_wire][CSCConstants::ALCT_COLLISIONB_PATTERN] == 1)
756  LogTrace("CSCAnodeLCTProcessor") << "Collision Pattern B is chosen"
757  << "\n";
758  }
759 
760  trigMode(key_wire);
761 
762  return trigger;
763 }

References funct::abs(), CSCConstants::ALCT_ACCELERATOR_PATTERN, CSCConstants::ALCT_COLLISIONA_PATTERN, CSCConstants::ALCT_COLLISIONB_PATTERN, CSCPatternBank::alct_keywire_offset_, alct_pattern_, CSCConstants::ALCT_PATTERN_WIDTH, drift_delay, first_bx, first_bx_corrected, getTempALCTQuality(), hit_persist, CSCBaseboard::infoV, CSCConstants::INVALID_WIREGROUP, PulseArray::isOneShotHighAtBX(), LogTrace, MESelection, nplanes_hit_accel_pattern, nplanes_hit_pattern, CSCConstants::NUM_ALCT_PATTERNS, CSCConstants::NUM_LAYERS, numWireGroups, AlCaHLTBitMon_ParallelJobs::p, pulse_, quality, AlCaHLTBitMon_QueryRunRegistry::string, and trigMode().

Referenced by run().

◆ preTrigger()

bool CSCAnodeLCTProcessor::preTrigger ( const int  key_wire,
const int  start_bx 
)
protected

Definition at line 553 of file CSCAnodeLCTProcessor.cc.

553  {
554  int nPreTriggers = 0;
555 
556  unsigned int layers_hit;
557  bool hit_layer[CSCConstants::NUM_LAYERS];
558  int this_wire;
559  // If nplanes_hit_accel_pretrig is 0, the firmware uses the value
560  // of nplanes_hit_pretrig instead.
561  const unsigned int nplanes_hit_pretrig_acc =
563  const unsigned int pretrig_thresh[CSCConstants::NUM_ALCT_PATTERNS] = {
564  nplanes_hit_pretrig_acc, nplanes_hit_pretrig, nplanes_hit_pretrig};
565 
566  // Loop over bx times, accelerator and collision patterns to
567  // look for pretrigger.
568  // Stop drift_delay bx's short of fifo_tbins since at later bx's we will
569  // not have a full set of hits to start pattern search anyway.
570  unsigned int stop_bx = fifo_tbins - drift_delay;
571  for (unsigned int bx_time = start_bx; bx_time < stop_bx; bx_time++) {
572  for (int i_pattern = 0; i_pattern < CSCConstants::NUM_ALCT_PATTERNS; i_pattern++) {
573  // initialize the hit layers
574  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++)
575  hit_layer[i_layer] = false;
576  layers_hit = 0;
577 
578  // now run over all layers and wires
579  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
580  for (int i_wire = 0; i_wire < CSCConstants::ALCT_PATTERN_WIDTH; i_wire++) {
581  // check if the hit is valid
582  if (alct_pattern_[i_pattern][i_layer][i_wire]) {
583  this_wire = CSCPatternBank::alct_keywire_offset_[MESelection][i_wire] + key_wire;
584  if ((this_wire >= 0) && (this_wire < numWireGroups)) {
585  // Perform bit operation to see if pulse is 1 at a certain bx_time.
586  if (pulse_.isOneShotHighAtBX(i_layer, this_wire, bx_time)) {
587  // Store number of layers hit.
588  if (!hit_layer[i_layer]) {
589  hit_layer[i_layer] = true;
590  layers_hit++;
591  }
592 
593  // See if number of layers hit is greater than or equal to
594  // pretrig_thresh.
595  if (layers_hit >= pretrig_thresh[i_pattern]) {
596  first_bx[key_wire] = bx_time;
597  if (infoV > 1) {
598  LogTrace("CSCAnodeLCTProcessor") << "Pretrigger was satisfied for wire: " << key_wire
599  << " pattern: " << i_pattern << " bx_time: " << bx_time;
600  }
601  // make a new pre-trigger
602  nPreTriggers++;
603  // make a new pre-trigger digi
604  // useful for calculating DAQ rates
605  thePreTriggerDigis.emplace_back(
606  CSCALCTPreTriggerDigi(1, layers_hit - 3, 0, 0, this_wire, bx_time, nPreTriggers));
607  return true;
608  }
609  }
610  }
611  }
612  }
613  }
614  }
615  }
616  // If the pretrigger was never satisfied, then return false.
617  return false;
618 }

References CSCPatternBank::alct_keywire_offset_, alct_pattern_, CSCConstants::ALCT_PATTERN_WIDTH, drift_delay, fifo_tbins, first_bx, CSCBaseboard::infoV, PulseArray::isOneShotHighAtBX(), LogTrace, MESelection, nplanes_hit_accel_pretrig, nplanes_hit_pretrig, CSCConstants::NUM_ALCT_PATTERNS, CSCConstants::NUM_LAYERS, numWireGroups, pulse_, and thePreTriggerDigis.

Referenced by run().

◆ preTriggerDigis()

std::vector<CSCALCTPreTriggerDigi> CSCAnodeLCTProcessor::preTriggerDigis ( ) const
inline

read out pre-ALCTs

Definition at line 84 of file CSCAnodeLCTProcessor.h.

84 { return thePreTriggerDigis; }

References thePreTriggerDigis.

◆ pulseExtension()

bool CSCAnodeLCTProcessor::pulseExtension ( const std::vector< int >  wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS])
protected

Definition at line 482 of file CSCAnodeLCTProcessor.cc.

483  {
484  bool chamber_empty = true;
485  int i_wire, i_layer, digi_num;
486 
487  const unsigned bits_in_pulse = pulse_.bitsInPulse();
488 
489  // Clear pulse array. This array will be used as a bit representation of
490  // hit times. For example: if strip[1][2] has a value of 3, then 1 shifted
491  // left 3 will be bit pattern of pulse[1][2]. This would make the pattern
492  // look like 0000000000001000. Then add on additional bits to signify
493  // the duration of a signal (hit_persist, formerly bx_width) to simulate
494  // the TMB's drift delay. So for the same pulse[1][2] with a hit_persist
495  // of 3 would look like 0000000000111000. This is similating the digital
496  // one-shot in the TMB.
497  pulse_.clear();
498 
499  for (i_wire = 0; i_wire < numWireGroups; i_wire++) {
500  first_bx[i_wire] = -999;
501  first_bx_corrected[i_wire] = -999;
502  for (int j = 0; j < 3; j++)
503  quality[i_wire][j] = -999;
504  }
505 
506  for (i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
507  digi_num = 0;
508  for (i_wire = 0; i_wire < numWireGroups; i_wire++) {
509  if (!wire[i_layer][i_wire].empty()) {
510  std::vector<int> bx_times = wire[i_layer][i_wire];
511  for (unsigned int i = 0; i < bx_times.size(); i++) {
512  // Check that min and max times are within the allowed range.
513  if (bx_times[i] < 0 || bx_times[i] + hit_persist >= bits_in_pulse) {
514  if (infoV > 0)
515  edm::LogWarning("CSCAnodeLCTProcessor|OutOfTimeDigi")
516  << "+++ BX time of wire digi (wire = " << i_wire << " layer = " << i_layer << ") bx = " << bx_times[i]
517  << " is not within the range (0-" << bits_in_pulse
518  << "] allowed for pulse extension. Skip this digi! +++\n";
519  continue;
520  }
521 
522  // Found at least one in-time digi; set chamber_empty to false
523  if (chamber_empty)
524  chamber_empty = false;
525 
526  // make the pulse
527  pulse_.extend(i_layer, i_wire, bx_times[i], hit_persist);
528 
529  // Debug information.
530  if (infoV > 1) {
531  LogTrace("CSCAnodeLCTProcessor") << "Wire digi: layer " << i_layer << " digi #" << ++digi_num
532  << " wire group " << i_wire << " time " << bx_times[i];
533  if (infoV > 2) {
534  std::ostringstream strstrm;
535  for (int i = 1; i <= 32; i++) {
536  strstrm << pulse_.oneShotAtBX(i_layer, i_wire, 32 - i);
537  }
538  LogTrace("CSCAnodeLCTProcessor") << " Pulse: " << strstrm.str();
539  }
540  }
541  }
542  }
543  }
544  }
545 
546  if (infoV > 1 && !chamber_empty) {
547  dumpDigis(wire);
548  }
549 
550  return chamber_empty;
551 }

References PulseArray::bitsInPulse(), PulseArray::clear(), dumpDigis(), relativeConstraints::empty, PulseArray::extend(), first_bx, first_bx_corrected, hit_persist, mps_fire::i, CSCBaseboard::infoV, dqmiolumiharvest::j, LogTrace, CSCConstants::NUM_LAYERS, numWireGroups, PulseArray::oneShotAtBX(), pulse_, and quality.

Referenced by run().

◆ readoutALCTs()

std::vector< CSCALCTDigi > CSCAnodeLCTProcessor::readoutALCTs ( ) const

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

Definition at line 1189 of file CSCAnodeLCTProcessor.cc.

1189  {
1190  std::vector<CSCALCTDigi> tmpV;
1191 
1192  // The number of LCT bins in the read-out is given by the
1193  // l1a_window_width parameter, but made even by setting the LSB of
1194  // l1a_window_width to 0.
1195  const int lct_bins = l1a_window_width;
1196  static std::atomic<int> late_tbins{early_tbins + lct_bins};
1197 
1198  static std::atomic<int> ifois{0};
1199  if (ifois == 0) {
1200  if (infoV >= 0 && early_tbins < 0) {
1201  edm::LogWarning("CSCAnodeLCTProcessor|SuspiciousParameters")
1202  << "+++ fifo_pretrig = " << fifo_pretrig << "; in-time ALCTs are not getting read-out!!! +++"
1203  << "\n";
1204  }
1205 
1206  if (late_tbins > CSCConstants::MAX_ALCT_TBINS - 1) {
1207  if (infoV >= 0)
1208  edm::LogWarning("CSCAnodeLCTProcessor|SuspiciousParameters")
1209  << "+++ Allowed range of time bins, [0-" << late_tbins << "] exceeds max allowed, "
1210  << CSCConstants::MAX_ALCT_TBINS - 1 << " +++\n"
1211  << "+++ Set late_tbins to max allowed +++\n";
1212  late_tbins = CSCConstants::MAX_ALCT_TBINS - 1;
1213  }
1214  ifois = 1;
1215  }
1216 
1217  // Start from the vector of all found ALCTs and select those within
1218  // the ALCT*L1A coincidence window.
1219  const std::vector<CSCALCTDigi>& all_alcts = getALCTs();
1220  for (const auto& p : all_alcts) {
1221  if (!p.isValid())
1222  continue;
1223 
1224  int bx = p.getBX();
1225  // Skip ALCTs found too early relative to L1Accept.
1226  if (bx <= early_tbins) {
1227  if (infoV > 1)
1228  LogDebug("CSCAnodeLCTProcessor") << " Do not report ALCT on keywire " << p.getKeyWG() << ": found at bx " << bx
1229  << ", whereas the earliest allowed bx is " << early_tbins + 1;
1230  continue;
1231  }
1232 
1233  // Skip ALCTs found too late relative to L1Accept.
1234  if (bx > late_tbins) {
1235  if (infoV > 1)
1236  LogDebug("CSCAnodeLCTProcessor") << " Do not report ALCT on keywire " << p.getKeyWG() << ": found at bx " << bx
1237  << ", whereas the latest allowed bx is " << late_tbins;
1238  continue;
1239  }
1240 
1241  tmpV.push_back(p);
1242  }
1243 
1244  // shift the BX from 8 to 3
1245  // ALCTs in real data have the central BX in bin 3
1246  // which is the middle of the 7BX wide L1A window
1247  // ALCTs used in the TMB emulator have central BX at bin 8
1248  // but right before we put emulated ALCTs in the event, we shift the BX
1249  // by -5 to make sure they are compatible with real data ALCTs!
1250  for (auto& p : tmpV) {
1251  p.setBX(p.getBX() - (CSCConstants::LCT_CENTRAL_BX - l1a_window_width / 2));
1252  }
1253 
1254  // do a final check on the ALCTs in readout
1255  qualityControl_->checkMultiplicityBX(tmpV);
1256  for (const auto& alct : tmpV) {
1257  qualityControl_->checkValid(alct);
1258  }
1259 
1260  return tmpV;
1261 }

References l1GtPatternGenerator_cfi::bx, early_tbins, fifo_pretrig, getALCTs(), CSCBaseboard::infoV, l1a_window_width, CSCConstants::LCT_CENTRAL_BX, LogDebug, CSCConstants::MAX_ALCT_TBINS, AlCaHLTBitMon_ParallelJobs::p, and qualityControl_.

◆ readoutShower()

CSCShowerDigi CSCAnodeLCTProcessor::readoutShower ( ) const

Returns shower bits

Definition at line 1280 of file CSCAnodeLCTProcessor.cc.

1280 { return shower_; }

References shower_.

◆ readWireDigis()

void CSCAnodeLCTProcessor::readWireDigis ( std::vector< int >  wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS])
protected

Definition at line 425 of file CSCAnodeLCTProcessor.cc.

426  {
427  // Loop over all 6 layers.
428  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
429  // Loop over all digis in the layer and find the wireGroup and bx
430  // time for each.
431  for (const auto& wd : digiV[i_layer]) {
432  int i_wire = wd.getWireGroup() - 1;
433  std::vector<int> bx_times = wd.getTimeBinsOn();
434 
435  // Check that the wires and times are appropriate.
436  if (i_wire < 0 || i_wire >= numWireGroups) {
437  if (infoV >= 0)
438  edm::LogWarning("CSCAnodeLCTProcessor|WrongInput")
439  << "+++ Found wire digi with wrong wire number = " << i_wire << " (max wires = " << numWireGroups
440  << "); skipping it... +++\n";
441  continue;
442  }
443  // Accept digis in expected time window. Total number of time
444  // bins in DAQ readout is given by fifo_tbins, which thus
445  // determines the maximum length of time interval. Anode raw
446  // hits in DAQ readout start (fifo_pretrig - 6) clocks before
447  // L1Accept. If times earlier than L1Accept were recorded, we
448  // use them since they can modify the ALCTs found later, via
449  // ghost-cancellation logic.
450  int last_time = -999;
451  if (bx_times.size() == fifo_tbins) {
452  wire[i_layer][i_wire].push_back(0);
453  wire[i_layer][i_wire].push_back(6);
454  } else {
455  for (unsigned int i = 0; i < bx_times.size(); i++) {
456  // Find rising edge change
457  if (i > 0 && bx_times[i] == (bx_times[i - 1] + 1))
458  continue;
459  if (bx_times[i] < static_cast<int>(fifo_tbins)) {
460  if (infoV > 2)
461  LogTrace("CSCAnodeLCTProcessor")
462  << "Digi on layer " << i_layer << " wire " << i_wire << " at time " << bx_times[i];
463 
464  // Finally save times of hit wires. One shot module will
465  // not restart if a new pulse comes before the expiration
466  // of the 6-bx period.
467  if (last_time < 0 || ((bx_times[i] - last_time) >= 6)) {
468  wire[i_layer][i_wire].push_back(bx_times[i]);
469  last_time = bx_times[i];
470  }
471  } else {
472  if (infoV > 1)
473  LogTrace("CSCAnodeLCTProcessor") << "+++ Skipping wire digi: wire = " << i_wire << " layer = " << i_layer
474  << ", bx = " << bx_times[i] << " +++";
475  }
476  }
477  }
478  }
479  }
480 }

References digiV, fifo_tbins, mps_fire::i, CSCBaseboard::infoV, LogTrace, CSCConstants::NUM_LAYERS, and numWireGroups.

Referenced by run().

◆ run() [1/2]

std::vector< CSCALCTDigi > CSCAnodeLCTProcessor::run ( const CSCWireDigiCollection wiredc)

Definition at line 195 of file CSCAnodeLCTProcessor.cc.

195  {
196  static std::atomic<bool> config_dumped{false};
197  if ((infoV > 0 || (runPhase2_)) && !config_dumped) {
199  config_dumped = true;
200  }
201 
202  // Get the number of wire groups for the given chamber. Do it only once
203  // per chamber.
204  if (numWireGroups <= 0 or numWireGroups > CSCConstants::MAX_NUM_WIREGROUPS) {
205  if (cscChamber_) {
208  edm::LogError("CSCAnodeLCTProcessor|SetupError")
209  << "+++ Number of wire groups, " << numWireGroups << " found in " << theCSCName_ << " (sector " << theSector
210  << " subsector " << theSubsector << " trig id. " << theTrigChamber << ")"
211  << " exceeds max expected, " << CSCConstants::MAX_NUM_WIREGROUPS << " +++\n"
212  << "+++ CSC geometry looks garbled; no emulation possible +++\n";
213  numWireGroups = -1;
214  }
215  } else {
216  edm::LogError("CSCAnodeLCTProcessor|SetupError")
217  << "+++ " << theCSCName_ << " (sector " << theSector << " subsector " << theSubsector << " trig id. "
218  << theTrigChamber << ")"
219  << " is not defined in current geometry! +++\n"
220  << "+++ CSC geometry looks garbled; no emulation possible +++\n";
221  numWireGroups = -1;
222  }
223  }
224 
225  if (numWireGroups <= 0 or (unsigned) numWireGroups > qualityControl_->get_csc_max_wiregroup(theStation, theRing)) {
226  edm::LogError("CSCAnodeLCTProcessor|SetupError")
227  << "+++ " << theCSCName_ << " (sector " << theSector << " subsector " << theSubsector << " trig id. "
228  << theTrigChamber << "):"
229  << " numWireGroups = " << numWireGroups << "; ALCT emulation skipped! +++";
230  std::vector<CSCALCTDigi> emptyV;
231  return emptyV;
232  }
233 
234  // Get wire digis in this chamber from wire digi collection.
235  bool hasDigis = getDigis(wiredc);
236 
237  if (hasDigis) {
238  // First get wiregroup times from the wire digis.
239  std::vector<int> wireGroupTimes[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS];
240  readWireDigis(wireGroupTimes);
241 
242  // Pass an array of wire times on to another run() doing the LCT search.
243  // If the number of layers containing digis is smaller than that
244  // required to trigger, quit right away.
245  const unsigned int min_layers =
249 
250  unsigned int layersHit = 0;
251  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
252  for (int i_wire = 0; i_wire < numWireGroups; i_wire++) {
253  if (!wireGroupTimes[i_layer][i_wire].empty()) {
254  layersHit++;
255  break;
256  }
257  }
258  }
259  if (layersHit >= min_layers)
260  run(wireGroupTimes);
261  // Get the high multiplicity bits in this chamber
262  encodeHighMultiplicityBits(wireGroupTimes);
263  }
264 
265  // Return vector of all found ALCTs.
266  return getALCTs();
267 }

References CSCBaseboard::cscChamber_, dumpConfigParams(), relativeConstraints::empty, encodeHighMultiplicityBits(), CSCLayer::geometry(), getALCTs(), getDigis(), CSCBaseboard::infoV, CSCChamber::layer(), CSCConstants::MAX_NUM_WIREGROUPS, nplanes_hit_accel_pattern, nplanes_hit_pattern, CSCConstants::NUM_LAYERS, CSCLayerGeometry::numberOfWireGroups(), numWireGroups, or, qualityControl_, readWireDigis(), CSCBaseboard::runPhase2_, CSCBaseboard::theCSCName_, CSCBaseboard::theRing, CSCBaseboard::theSector, CSCBaseboard::theStation, CSCBaseboard::theSubsector, and CSCBaseboard::theTrigChamber.

◆ run() [2/2]

void CSCAnodeLCTProcessor::run ( const std::vector< int >  wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS])

Definition at line 269 of file CSCAnodeLCTProcessor.cc.

269  {
270  bool trigger = false;
271 
272  // initialize the pulse array.
274 
275  // Check if there are any in-time hits and do the pulse extension.
276  bool chamber_empty = pulseExtension(wire);
277 
278  // define a new pattern map
279  // for each key wiregroup, and for each pattern, store the 2D collection of fired wiregroup digis
280  std::map<int, std::map<int, CSCALCTDigi::WireContainer>> hits_in_patterns;
281  hits_in_patterns.clear();
282 
283  // Only do the rest of the processing if chamber is not empty.
284  // Stop drift_delay bx's short of fifo_tbins since at later bx's we will
285  // not have a full set of hits to start pattern search anyway.
286  unsigned int stop_bx = fifo_tbins - drift_delay;
287  if (!chamber_empty) {
288  for (int i_wire = 0; i_wire < numWireGroups; i_wire++) {
289  // extra check to make sure only valid wires are processed
290  const unsigned max_wire = qualityControl_->get_csc_max_wiregroup(theStation, theRing);
291  if (unsigned(i_wire) >= max_wire)
292  continue;
293 
294  unsigned int start_bx = 0;
295  // Allow for more than one pass over the hits in the time window.
296  while (start_bx < stop_bx) {
297  if (preTrigger(i_wire, start_bx)) {
298  if (infoV > 2)
299  showPatterns(i_wire);
300  if (patternDetection(i_wire, hits_in_patterns)) {
301  trigger = true;
302  int ghost_cleared[2] = {0, 0};
303  /*
304  In older versions of the ALCT emulation, the ghost cancellation was performed after
305  the ALCTs were found. In December 2018, it became clear that during the study of data
306  and emulation comparison on 2018 data, a small disagreement between data and emulation
307  was found. The changes we implemented then allow re-triggering on one wiregroup after
308  some dead time once an earlier ALCT was constructed built on this wiregroup. Before this
309  commit the ALCT processor would prohibit the wiregroup from triggering in one event after
310  an ALCT was found on that wiregroup. In the firwmare, the wiregroup with ALCT is only dead
311  for a few BX before it can be triggered by next muon. The implementation of ghost cancellation
312  logic was changed to accommodate the re-triggering change while the idea of ghost cancellation
313  logic is kept the same.
314  */
315  ghostCancellationLogicOneWire(i_wire, ghost_cleared);
316 
317  int bx = (use_corrected_bx) ? first_bx_corrected[i_wire] : first_bx[i_wire];
319  edm::LogError("CSCAnodeLCTProcessor")
320  << " bx of valid trigger : " << bx << " > max allowed value " << CSCConstants::MAX_ALCT_TBINS;
321 
322  //acceleration mode
323  if (quality[i_wire][0] > 0 and bx < CSCConstants::MAX_ALCT_TBINS) {
324  int valid = (ghost_cleared[0] == 0) ? 1 : 0; //cancelled, valid=0, otherwise it is 1
325  CSCALCTDigi newALCT(valid, quality[i_wire][0], 1, 0, i_wire, bx);
326 
327  // set the wire digis for this pattern
328  setWireContainer(newALCT, hits_in_patterns[i_wire][0]);
329 
330  lct_list.emplace_back(newALCT);
331  if (infoV > 1)
332  LogTrace("CSCAnodeLCTProcessor") << "Add one ALCT to list " << lct_list.back();
333  }
334 
335  //collision mode
337  int valid = (ghost_cleared[CSCConstants::ALCT_COLLISIONA_PATTERN] == 0)
338  ? 1
339  : 0; //cancelled, valid=0, otherwise it is 1
340 
341  CSCALCTDigi newALCT(valid,
343  0,
345  i_wire,
346  bx);
347 
348  // set the wire digis for this pattern
349  setWireContainer(newALCT, hits_in_patterns[i_wire][CSCConstants::ALCT_COLLISIONA_PATTERN]);
350 
351  lct_list.emplace_back(newALCT);
352  if (infoV > 1)
353  LogTrace("CSCAnodeLCTProcessor") << "Add one ALCT to list " << lct_list.back();
354  }
355 
356  //break;
357  // Assume that the earliest time when another pre-trigger can
358  // occur in case pattern detection failed is bx_pretrigger+4:
359  // this seems to match the data.
360  start_bx = first_bx[i_wire] + drift_delay + pretrig_extra_deadtime;
361  } else {
362  //only pretrigger, no trigger ==> no dead time, continue to find next pretrigger
363  start_bx = first_bx[i_wire] + 1;
364  }
365  } else { //no pretrigger, skip this wiregroup
366  break;
367  }
368  } // end of while
369  }
370  }
371 
372  // Do the rest only if there is at least one trigger candidate.
373  if (trigger) {
374  /* In Run-1 and Run-2, the ghost cancellation was done after the trigger.
375  In the firmware however, the ghost cancellation is done during the trigger
376  on each wiregroup in parallel. For Run-3 and beyond, the ghost cancellation is
377  implemented per wiregroup earlier in the code. See function
378  "ghostCancellationLogicOneWire". There used to be a function ghostCancellationLogic
379  call here.
380  */
381  lctSearch();
382  }
383 }

References CSCConstants::ALCT_COLLISIONA_PATTERN, CSCConstants::ALCT_COLLISIONB_PATTERN, l1GtPatternGenerator_cfi::bx, drift_delay, fifo_tbins, first_bx, first_bx_corrected, ghostCancellationLogicOneWire(), CSCBaseboard::infoV, PulseArray::initialize(), lct_list, lctSearch(), LogTrace, CSCConstants::MAX_ALCT_TBINS, numWireGroups, patternDetection(), pretrig_extra_deadtime, preTrigger(), pulse_, pulseExtension(), quality, qualityControl_, setWireContainer(), showPatterns(), CSCBaseboard::theRing, CSCBaseboard::theStation, use_corrected_bx, and RunInfoPI::valid.

◆ setConfigParameters()

void CSCAnodeLCTProcessor::setConfigParameters ( const CSCDBL1TPParameters conf)

Sets configuration parameters obtained via EventSetup mechanism.

Definition at line 117 of file CSCAnodeLCTProcessor.cc.

117  {
118  static std::atomic<bool> config_dumped{false};
119 
120  fifo_tbins = conf->alctFifoTbins();
121  fifo_pretrig = conf->alctFifoPretrig();
122  drift_delay = conf->alctDriftDelay();
127  trig_mode = conf->alctTrigMode();
128  accel_mode = conf->alctAccelMode();
130 
131  // Check and print configuration parameters.
133  if (!config_dumped) {
135  config_dumped = true;
136  }
137 }

References accel_mode, CSCDBL1TPParameters::alctAccelMode(), CSCDBL1TPParameters::alctDriftDelay(), CSCDBL1TPParameters::alctFifoPretrig(), CSCDBL1TPParameters::alctFifoTbins(), CSCDBL1TPParameters::alctL1aWindowWidth(), CSCDBL1TPParameters::alctNplanesHitAccelPattern(), CSCDBL1TPParameters::alctNplanesHitAccelPretrig(), CSCDBL1TPParameters::alctNplanesHitPattern(), CSCDBL1TPParameters::alctNplanesHitPretrig(), CSCDBL1TPParameters::alctTrigMode(), checkConfigParameters(), drift_delay, dumpConfigParams(), fifo_pretrig, fifo_tbins, l1a_window_width, nplanes_hit_accel_pattern, nplanes_hit_accel_pretrig, nplanes_hit_pattern, nplanes_hit_pretrig, and trig_mode.

◆ setDefaultConfigParameters()

void CSCAnodeLCTProcessor::setDefaultConfigParameters ( )
protected

◆ setWireContainer()

void CSCAnodeLCTProcessor::setWireContainer ( CSCALCTDigi alct,
CSCALCTDigi::WireContainer wireHits 
) const
protected

Definition at line 1331 of file CSCAnodeLCTProcessor.cc.

1331  {
1332  // clean the wire digi container
1333  cleanWireContainer(wireHits);
1334 
1335  // set the hit container
1336  alct.setHits(wireHits);
1337 }

References cleanWireContainer(), and CSCALCTDigi::setHits().

Referenced by run().

◆ showPatterns()

void CSCAnodeLCTProcessor::showPatterns ( const int  key_wire)
protected

Definition at line 1285 of file CSCAnodeLCTProcessor.cc.

1285  {
1286  /* Method to test the pretrigger */
1287  for (int i_pattern = 0; i_pattern < CSCConstants::NUM_ALCT_PATTERNS; i_pattern++) {
1288  std::ostringstream strstrm_header;
1289  LogTrace("CSCAnodeLCTProcessor") << "\n"
1290  << "Pattern: " << i_pattern << " Key wire: " << key_wire;
1291  for (int i = 1; i <= 32; i++) {
1292  strstrm_header << ((32 - i) % 10);
1293  }
1294  LogTrace("CSCAnodeLCTProcessor") << strstrm_header.str();
1295  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
1296  for (int i_wire = 0; i_wire < CSCConstants::ALCT_PATTERN_WIDTH; i_wire++) {
1297  // check if the hit is valid
1298  if (alct_pattern_[i_pattern][i_layer][i_wire]) {
1299  std::ostringstream strstrm_pulse;
1300  int this_wire = CSCPatternBank::alct_keywire_offset_[MESelection][i_wire] + key_wire;
1301  if (this_wire >= 0 && this_wire < numWireGroups) {
1302  for (int i = 1; i <= 32; i++) {
1303  strstrm_pulse << pulse_.oneShotAtBX(i_layer, this_wire, 32 - i);
1304  }
1305  LogTrace("CSCAnodeLCTProcessor") << strstrm_pulse.str() << " on layer " << i_layer << " wire " << this_wire;
1306  }
1307  }
1308  }
1309  }
1310  LogTrace("CSCAnodeLCTProcessor") << "-------------------------------------------";
1311  }
1312 }

References CSCPatternBank::alct_keywire_offset_, alct_pattern_, CSCConstants::ALCT_PATTERN_WIDTH, mps_fire::i, LogTrace, MESelection, CSCConstants::NUM_ALCT_PATTERNS, CSCConstants::NUM_LAYERS, numWireGroups, PulseArray::oneShotAtBX(), and pulse_.

Referenced by run().

◆ trigMode()

void CSCAnodeLCTProcessor::trigMode ( const int  key_wire)
protected

Definition at line 1050 of file CSCAnodeLCTProcessor.cc.

1050  {
1051  switch (trig_mode) {
1052  default:
1053  case 0:
1054  // Enables both collision and accelerator tracks
1055  break;
1056  case 1:
1057  // Disables collision tracks
1058  if (quality[key_wire][CSCConstants::ALCT_COLLISIONA_PATTERN] > 0) {
1060  if (infoV > 1)
1061  LogTrace("CSCAnodeLCTProcessor") << "trigMode(): collision track " << key_wire << " disabled"
1062  << "\n";
1063  }
1064  break;
1065  case 2:
1066  // Disables accelerator tracks
1067  if (quality[key_wire][CSCConstants::ALCT_ACCELERATOR_PATTERN] > 0) {
1069  if (infoV > 1)
1070  LogTrace("CSCAnodeLCTProcessor") << "trigMode(): accelerator track " << key_wire << " disabled"
1071  << "\n";
1072  }
1073  break;
1074  case 3:
1075  // Disables collision track if there is an accelerator track found
1076  // in the same wire group at the same time
1077  if (quality[key_wire][0] > 0 && quality[key_wire][CSCConstants::ALCT_COLLISIONA_PATTERN] > 0) {
1079  if (infoV > 1)
1080  LogTrace("CSCAnodeLCTProcessor") << "trigMode(): collision track " << key_wire << " disabled"
1081  << "\n";
1082  }
1083  break;
1084  }
1085 }

References CSCConstants::ALCT_ACCELERATOR_PATTERN, CSCConstants::ALCT_COLLISIONA_PATTERN, CSCBaseboard::infoV, LogTrace, quality, and trig_mode.

Referenced by patternDetection().

Member Data Documentation

◆ accel_mode

unsigned int CSCAnodeLCTProcessor::accel_mode
protected

◆ alct_pattern_

CSCPatternBank::LCTPatterns CSCAnodeLCTProcessor::alct_pattern_ = {}
protected

Chosen pattern mask.

Definition at line 181 of file CSCAnodeLCTProcessor.h.

Referenced by loadPatternMask(), patternDetection(), preTrigger(), and showPatterns().

◆ bestALCT

CSCALCTDigi CSCAnodeLCTProcessor::bestALCT[CSCConstants::MAX_ALCT_TBINS]
protected

Best LCTs in this chamber, as found by the processor. In old ALCT algorithms, up to two best ALCT per Level-1 accept window had been reported. In the ALCT-2006 algorithms, up to two best ALCTs PER EVERY TIME BIN in Level-1 accept window are reported.

Definition at line 103 of file CSCAnodeLCTProcessor.h.

Referenced by clear(), getALCTs(), getBestALCT(), and lctSearch().

◆ def_accel_mode

const unsigned int CSCAnodeLCTProcessor::def_accel_mode = 0
staticprotected

Definition at line 174 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

◆ def_drift_delay

const unsigned int CSCAnodeLCTProcessor::def_drift_delay = 2
staticprotected

Definition at line 170 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

◆ def_fifo_pretrig

const unsigned int CSCAnodeLCTProcessor::def_fifo_pretrig = 10
staticprotected

Definition at line 169 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

◆ def_fifo_tbins

const unsigned int CSCAnodeLCTProcessor::def_fifo_tbins = 16
staticprotected

Default values of configuration parameters.

Definition at line 169 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

◆ def_l1a_window_width

const unsigned int CSCAnodeLCTProcessor::def_l1a_window_width = 7
staticprotected

Definition at line 175 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

◆ def_nplanes_hit_accel_pattern

const unsigned int CSCAnodeLCTProcessor::def_nplanes_hit_accel_pattern = 4
staticprotected

Definition at line 173 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

◆ def_nplanes_hit_accel_pretrig

const unsigned int CSCAnodeLCTProcessor::def_nplanes_hit_accel_pretrig = 2
staticprotected

Definition at line 172 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

◆ def_nplanes_hit_pattern

const unsigned int CSCAnodeLCTProcessor::def_nplanes_hit_pattern = 4
staticprotected

Definition at line 171 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

◆ def_nplanes_hit_pretrig

const unsigned int CSCAnodeLCTProcessor::def_nplanes_hit_pretrig = 2
staticprotected

Definition at line 171 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

◆ def_trig_mode

const unsigned int CSCAnodeLCTProcessor::def_trig_mode = 2
staticprotected

Definition at line 174 of file CSCAnodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

◆ digiV

std::vector<CSCWireDigi> CSCAnodeLCTProcessor::digiV[CSCConstants::NUM_LAYERS]
protected

Definition at line 123 of file CSCAnodeLCTProcessor.h.

Referenced by getDigis(), and readWireDigis().

◆ drift_delay

unsigned int CSCAnodeLCTProcessor::drift_delay
protected

◆ early_tbins

int CSCAnodeLCTProcessor::early_tbins
protected

Phase2: separate handle for early time bins

Definition at line 150 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), and readoutALCTs().

◆ fifo_pretrig

unsigned int CSCAnodeLCTProcessor::fifo_pretrig
protected

◆ fifo_tbins

unsigned int CSCAnodeLCTProcessor::fifo_tbins
protected

◆ first_bx

int CSCAnodeLCTProcessor::first_bx[CSCConstants::MAX_NUM_WIREGROUPS]
protected

◆ first_bx_corrected

int CSCAnodeLCTProcessor::first_bx_corrected[CSCConstants::MAX_NUM_WIREGROUPS]
protected

◆ ghost_cancellation_bx_depth

int CSCAnodeLCTProcessor::ghost_cancellation_bx_depth
protected

Phase2: delta BX time depth for ghostCancellationLogic

Definition at line 153 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), CSCUpgradeAnodeLCTProcessor::ghostCancellationLogicOneWire(), and ghostCancellationLogicOneWire().

◆ ghost_cancellation_side_quality

bool CSCAnodeLCTProcessor::ghost_cancellation_side_quality
protected

Phase2: whether to consider ALCT candidates' qualities while doing ghostCancellationLogic on +-1 wire groups

Definition at line 157 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), CSCUpgradeAnodeLCTProcessor::ghostCancellationLogicOneWire(), and ghostCancellationLogicOneWire().

◆ hit_persist

unsigned int CSCAnodeLCTProcessor::hit_persist
protected

Phase2: hit persistency length

Definition at line 147 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), patternDetection(), and pulseExtension().

◆ inTimeHMT_

unsigned CSCAnodeLCTProcessor::inTimeHMT_
protected

Definition at line 132 of file CSCAnodeLCTProcessor.h.

Referenced by clear(), encodeHighMultiplicityBits(), and getInTimeHMT().

◆ l1a_window_width

unsigned int CSCAnodeLCTProcessor::l1a_window_width
protected

◆ lct_list

std::vector<CSCALCTDigi> CSCAnodeLCTProcessor::lct_list
protected

◆ MESelection

int CSCAnodeLCTProcessor::MESelection
protected

◆ narrow_mask_r1

bool CSCAnodeLCTProcessor::narrow_mask_r1
protected

Phase2: whether to use narrow pattern mask for the rings close to the beam

Definition at line 166 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), and loadPatternMask().

◆ nplanes_hit_accel_pattern

unsigned int CSCAnodeLCTProcessor::nplanes_hit_accel_pattern
protected

◆ nplanes_hit_accel_pretrig

unsigned int CSCAnodeLCTProcessor::nplanes_hit_accel_pretrig
protected

◆ nplanes_hit_pattern

unsigned int CSCAnodeLCTProcessor::nplanes_hit_pattern
protected

◆ nplanes_hit_pretrig

unsigned int CSCAnodeLCTProcessor::nplanes_hit_pretrig
protected

◆ numWireGroups

int CSCAnodeLCTProcessor::numWireGroups
protected

◆ outTimeHMT_

unsigned CSCAnodeLCTProcessor::outTimeHMT_
protected

Definition at line 133 of file CSCAnodeLCTProcessor.h.

Referenced by clear(), encodeHighMultiplicityBits(), and getOutTimeHMT().

◆ pretrig_extra_deadtime

unsigned int CSCAnodeLCTProcessor::pretrig_extra_deadtime
protected

Phase2: deadtime clocks after pretrigger (extra in addition to drift_delay)

Definition at line 160 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), and run().

◆ pulse_

PulseArray CSCAnodeLCTProcessor::pulse_
protected

◆ quality

int CSCAnodeLCTProcessor::quality[CSCConstants::MAX_NUM_WIREGROUPS][CSCConstants::NUM_ALCT_PATTERNS]
protected

◆ qualityControl_

std::unique_ptr<LCTQualityControl> CSCAnodeLCTProcessor::qualityControl_
protected

Definition at line 178 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), lctSearch(), readoutALCTs(), and run().

◆ secondALCT

CSCALCTDigi CSCAnodeLCTProcessor::secondALCT[CSCConstants::MAX_ALCT_TBINS]
protected

Second best LCTs in this chamber, as found by the processor.

Definition at line 106 of file CSCAnodeLCTProcessor.h.

Referenced by clear(), getALCTs(), getSecondALCT(), and lctSearch().

◆ shower_

CSCShowerDigi CSCAnodeLCTProcessor::shower_
protected

Definition at line 110 of file CSCAnodeLCTProcessor.h.

Referenced by encodeHighMultiplicityBits(), and readoutShower().

◆ showerMaxInTBin_

unsigned CSCAnodeLCTProcessor::showerMaxInTBin_
protected

Definition at line 136 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), and encodeHighMultiplicityBits().

◆ showerMaxOutTBin_

unsigned CSCAnodeLCTProcessor::showerMaxOutTBin_
protected

Definition at line 138 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), and encodeHighMultiplicityBits().

◆ showerMinInTBin_

unsigned CSCAnodeLCTProcessor::showerMinInTBin_
protected

Definition at line 135 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), and encodeHighMultiplicityBits().

◆ showerMinOutTBin_

unsigned CSCAnodeLCTProcessor::showerMinOutTBin_
protected

Definition at line 137 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), and encodeHighMultiplicityBits().

◆ thePreTriggerDigis

std::vector<CSCALCTPreTriggerDigi> CSCAnodeLCTProcessor::thePreTriggerDigis
protected

Definition at line 127 of file CSCAnodeLCTProcessor.h.

Referenced by preTrigger(), and preTriggerDigis().

◆ thresholds_

std::vector<unsigned> CSCAnodeLCTProcessor::thresholds_
protected

Definition at line 134 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), and encodeHighMultiplicityBits().

◆ trig_mode

unsigned int CSCAnodeLCTProcessor::trig_mode
protected

◆ use_corrected_bx

bool CSCAnodeLCTProcessor::use_corrected_bx
protected

Phase2: whether to use corrected_bx instead of pretrigger BX

Definition at line 163 of file CSCAnodeLCTProcessor.h.

Referenced by CSCAnodeLCTProcessor(), CSCUpgradeAnodeLCTProcessor::ghostCancellationLogicOneWire(), and run().

PulseArray::bitsInPulse
unsigned bitsInPulse() const
Definition: PulseArray.cc:25
CSCALCTDigi::getBX
uint16_t getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:73
CSCAnodeLCTProcessor::nplanes_hit_accel_pattern
unsigned int nplanes_hit_accel_pattern
Definition: CSCAnodeLCTProcessor.h:143
CSCAnodeLCTProcessor::narrow_mask_r1
bool narrow_mask_r1
Definition: CSCAnodeLCTProcessor.h:166
CSCAnodeLCTProcessor::readWireDigis
void readWireDigis(std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS])
Definition: CSCAnodeLCTProcessor.cc:425
mps_fire.i
i
Definition: mps_fire.py:428
CSCBaseboard::theEndcap
const unsigned theEndcap
Definition: CSCBaseboard.h:41
CSCAnodeLCTProcessor::pretrig_extra_deadtime
unsigned int pretrig_extra_deadtime
Definition: CSCAnodeLCTProcessor.h:160
CSCAnodeLCTProcessor::nplanes_hit_pattern
unsigned int nplanes_hit_pattern
Definition: CSCAnodeLCTProcessor.h:143
CSCChamber::layer
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
Definition: CSCChamber.cc:30
CSCAnodeLCTProcessor::thresholds_
std::vector< unsigned > thresholds_
Definition: CSCAnodeLCTProcessor.h:134
CSCAnodeLCTProcessor::getALCTs
std::vector< CSCALCTDigi > getALCTs() const
Definition: CSCAnodeLCTProcessor.cc:1264
CSCAnodeLCTProcessor::setWireContainer
void setWireContainer(CSCALCTDigi &, CSCALCTDigi::WireContainer &wireHits) const
Definition: CSCAnodeLCTProcessor.cc:1331
CSCDBL1TPParameters::alctNplanesHitPattern
unsigned int alctNplanesHitPattern() const
Definition: CSCDBL1TPParameters.h:32
CSCBaseboard::cscChamber_
const CSCChamber * cscChamber_
Definition: CSCBaseboard.h:66
CSCBaseboard::theSector
const unsigned theSector
Definition: CSCBaseboard.h:43
CSCAnodeLCTProcessor::def_drift_delay
static const unsigned int def_drift_delay
Definition: CSCAnodeLCTProcessor.h:170
CSCAnodeLCTProcessor::getTempALCTQuality
virtual int getTempALCTQuality(int temp_quality) const
Definition: CSCAnodeLCTProcessor.cc:1314
CSCAnodeLCTProcessor::hit_persist
unsigned int hit_persist
Definition: CSCAnodeLCTProcessor.h:147
CSCAnodeLCTProcessor::qualityControl_
std::unique_ptr< LCTQualityControl > qualityControl_
Definition: CSCAnodeLCTProcessor.h:178
PulseArray::extend
void extend(const unsigned layer, const unsigned channel, const unsigned bx, const unsigned hit_persist)
Definition: PulseArray.cc:27
CSCConstants::MAX_ALCT_TBINS
Definition: CSCConstants.h:127
relativeConstraints.station
station
Definition: relativeConstraints.py:67
DigiDM_cff.wires
wires
Definition: DigiDM_cff.py:33
CSCBaseboard::disableME1a_
bool disableME1a_
Definition: CSCBaseboard.h:91
CSCBaseboard::theStation
const unsigned theStation
Definition: CSCBaseboard.h:42
CSCAnodeLCTProcessor::encodeHighMultiplicityBits
void encodeHighMultiplicityBits(const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS])
Definition: CSCAnodeLCTProcessor.cc:1339
CSCShowerDigi
Definition: CSCShowerDigi.h:9
CSCAnodeLCTProcessor::run
std::vector< CSCALCTDigi > run(const CSCWireDigiCollection *wiredc)
Definition: CSCAnodeLCTProcessor.cc:195
CSCAnodeLCTProcessor::MESelection
int MESelection
Definition: CSCAnodeLCTProcessor.h:117
CSCDBL1TPParameters::alctTrigMode
unsigned int alctTrigMode() const
Definition: CSCDBL1TPParameters.h:41
CSCPatternBank::alct_pattern_legacy_
static const LCTPatterns alct_pattern_legacy_
Definition: CSCPatternBank.h:25
CSCALCTDigi::clear
void clear()
clear this ALCT
Definition: CSCALCTDigi.cc:49
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
CSCBaseboard::theCSCName_
std::string theCSCName_
Definition: CSCBaseboard.h:84
CSCAnodeLCTProcessor::early_tbins
int early_tbins
Definition: CSCAnodeLCTProcessor.h:150
CSCConstants::LCT_CENTRAL_BX
Definition: CSCConstants.h:148
CSCAnodeLCTProcessor::showPatterns
void showPatterns(const int key_wire)
Definition: CSCAnodeLCTProcessor.cc:1285
CSCAnodeLCTProcessor::trig_mode
unsigned int trig_mode
Definition: CSCAnodeLCTProcessor.h:144
protons_cff.time
time
Definition: protons_cff.py:35
CSCAnodeLCTProcessor::loadPatternMask
void loadPatternMask()
Definition: CSCAnodeLCTProcessor.cc:93
CSCConstants::INVALID_WIREGROUP
Definition: CSCConstants.h:52
CSCConstants::NUM_ALCT_PATTERNS
Definition: CSCConstants.h:107
CSCAnodeLCTProcessor::checkConfigParameters
void checkConfigParameters()
Definition: CSCAnodeLCTProcessor.cc:139
CSCAnodeLCTProcessor::def_nplanes_hit_accel_pretrig
static const unsigned int def_nplanes_hit_accel_pretrig
Definition: CSCAnodeLCTProcessor.h:172
CSCConstants::ALCT_COLLISIONA_PATTERN
Definition: CSCConstants.h:110
CSCAnodeLCTProcessor::def_fifo_tbins
static const unsigned int def_fifo_tbins
Definition: CSCAnodeLCTProcessor.h:169
CSCAnodeLCTProcessor::def_accel_mode
static const unsigned int def_accel_mode
Definition: CSCAnodeLCTProcessor.h:174
CSCBaseboard::checkConfigParameters
void checkConfigParameters(unsigned int &var, const unsigned int var_max, const unsigned int var_def, const std::string &var_str)
Definition: CSCBaseboard.cc:94
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCDetId::iChamberType
unsigned short iChamberType() const
Definition: CSCDetId.h:96
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
CSCAnodeLCTProcessor::dumpConfigParams
void dumpConfigParams() const
Definition: CSCAnodeLCTProcessor.cc:1132
CSCAnodeLCTProcessor::l1a_window_width
unsigned int l1a_window_width
Definition: CSCAnodeLCTProcessor.h:144
MuonDigiCollection::const_iterator
std::vector< DigiType >::const_iterator const_iterator
Definition: MuonDigiCollection.h:94
CSCConstants::ALCT_COLLISIONB_PATTERN
Definition: CSCConstants.h:111
CSCDBL1TPParameters::alctNplanesHitPretrig
unsigned int alctNplanesHitPretrig() const
Definition: CSCDBL1TPParameters.h:29
dt
float dt
Definition: AMPTWrapper.h:136
CSCAnodeLCTProcessor::trigMode
void trigMode(const int key_wire)
Definition: CSCAnodeLCTProcessor.cc:1050
CSCALCTDigi::getKeyWG
uint16_t getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:67
CSCAnodeLCTProcessor::accel_mode
unsigned int accel_mode
Definition: CSCAnodeLCTProcessor.h:144
CSCAnodeLCTProcessor::preTrigger
bool preTrigger(const int key_wire, const int start_bx)
Definition: CSCAnodeLCTProcessor.cc:553
CSCAnodeLCTProcessor::outTimeHMT_
unsigned outTimeHMT_
Definition: CSCAnodeLCTProcessor.h:133
CSCAnodeLCTProcessor::first_bx_corrected
int first_bx_corrected[CSCConstants::MAX_NUM_WIREGROUPS]
Definition: CSCAnodeLCTProcessor.h:120
CSCAnodeLCTProcessor::pulse_
PulseArray pulse_
Definition: CSCAnodeLCTProcessor.h:108
CSCAnodeLCTProcessor::lct_list
std::vector< CSCALCTDigi > lct_list
Definition: CSCAnodeLCTProcessor.h:125
CSCAnodeLCTProcessor::showerMinOutTBin_
unsigned showerMinOutTBin_
Definition: CSCAnodeLCTProcessor.h:137
CSCAnodeLCTProcessor::def_fifo_pretrig
static const unsigned int def_fifo_pretrig
Definition: CSCAnodeLCTProcessor.h:169
CSCDBL1TPParameters::alctNplanesHitAccelPretrig
unsigned int alctNplanesHitAccelPretrig() const
Definition: CSCDBL1TPParameters.h:35
CSCDBL1TPParameters::alctFifoPretrig
unsigned int alctFifoPretrig() const
Definition: CSCDBL1TPParameters.h:23
CSCPatternBank::alct_pattern_r1_
static const LCTPatterns alct_pattern_r1_
Definition: CSCPatternBank.h:28
CSCBaseboard::showerParams_
edm::ParameterSet showerParams_
Definition: CSCBaseboard.h:81
CSCAnodeLCTProcessor::def_nplanes_hit_pattern
static const unsigned int def_nplanes_hit_pattern
Definition: CSCAnodeLCTProcessor.h:171
CSCConstants::NUM_LAYERS
Definition: CSCConstants.h:103
CSCDBL1TPParameters::alctAccelMode
unsigned int alctAccelMode() const
Definition: CSCDBL1TPParameters.h:44
CSCAnodeLCTProcessor::drift_delay
unsigned int drift_delay
Definition: CSCAnodeLCTProcessor.h:141
CSCAnodeLCTProcessor::pulseExtension
bool pulseExtension(const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS])
Definition: CSCAnodeLCTProcessor.cc:482
CSCBaseboard::theSubsector
const unsigned theSubsector
Definition: CSCBaseboard.h:44
CSCLayer::geometry
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:44
CSCAnodeLCTProcessor::thePreTriggerDigis
std::vector< CSCALCTPreTriggerDigi > thePreTriggerDigis
Definition: CSCAnodeLCTProcessor.h:127
CSCAnodeLCTProcessor::inTimeHMT_
unsigned inTimeHMT_
Definition: CSCAnodeLCTProcessor.h:132
sistrip::SpyUtilities::isValid
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
Definition: SiStripSpyUtilities.cc:124
CSCALCTDigi::getQuality
uint16_t getQuality() const
return quality of a pattern
Definition: CSCALCTDigi.h:46
CSCConstants::ALCT_EMUL_TIME_OFFSET
Definition: CSCConstants.h:36
CSCAnodeLCTProcessor::showerMaxInTBin_
unsigned showerMaxInTBin_
Definition: CSCAnodeLCTProcessor.h:136
CSCAnodeLCTProcessor::shower_
CSCShowerDigi shower_
Definition: CSCAnodeLCTProcessor.h:110
CSCBaseboard::runPhase2_
bool runPhase2_
Definition: CSCBaseboard.h:87
CSCAnodeLCTProcessor::secondALCT
CSCALCTDigi secondALCT[CSCConstants::MAX_ALCT_TBINS]
Definition: CSCAnodeLCTProcessor.h:106
CSCDBL1TPParameters::alctDriftDelay
unsigned int alctDriftDelay() const
Definition: CSCDBL1TPParameters.h:26
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
CSCPatternBank::alct_keywire_offset_
static const int alct_keywire_offset_[2][CSCConstants::ALCT_PATTERN_WIDTH]
Definition: CSCPatternBank.h:21
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CSCAnodeLCTProcessor::ghostCancellationLogicOneWire
virtual void ghostCancellationLogicOneWire(const int key_wire, int *ghost_cleared)
Definition: CSCAnodeLCTProcessor.cc:765
CSCConstants::MAX_ALCTS_PER_PROCESSOR
Definition: CSCConstants.h:135
CSCAnodeLCTProcessor::bestTrackSelector
std::vector< CSCALCTDigi > bestTrackSelector(const std::vector< CSCALCTDigi > &all_alcts)
Definition: CSCAnodeLCTProcessor.cc:910
CSCBaseboard::CSCBaseboard
CSCBaseboard()
Definition: CSCBaseboard.cc:81
CSCDetId
Definition: CSCDetId.h:26
CSCAnodeLCTProcessor::def_l1a_window_width
static const unsigned int def_l1a_window_width
Definition: CSCAnodeLCTProcessor.h:175
PulseArray::isOneShotHighAtBX
bool isOneShotHighAtBX(const unsigned layer, const unsigned channel, const unsigned bx) const
Definition: PulseArray.cc:37
CSCAnodeLCTProcessor::use_corrected_bx
bool use_corrected_bx
Definition: CSCAnodeLCTProcessor.h:163
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
CSCAnodeLCTProcessor::numWireGroups
int numWireGroups
Definition: CSCAnodeLCTProcessor.h:116
CSCAnodeLCTProcessor::fifo_pretrig
unsigned int fifo_pretrig
Definition: CSCAnodeLCTProcessor.h:141
CSCAnodeLCTProcessor::ghost_cancellation_side_quality
bool ghost_cancellation_side_quality
Definition: CSCAnodeLCTProcessor.h:157
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
CSCBaseboard::theChamber
unsigned theChamber
Definition: CSCBaseboard.h:48
CSCALCTDigi::getFullBX
uint16_t getFullBX() const
return 12-bit full BX.
Definition: CSCALCTDigi.h:85
CSCAnodeLCTProcessor::isBetterALCT
bool isBetterALCT(const CSCALCTDigi &lhsALCT, const CSCALCTDigi &rhsALCT) const
Definition: CSCAnodeLCTProcessor.cc:1010
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCALCTPreTriggerDigi
Definition: CSCALCTPreTriggerDigi.h:13
CSCAnodeLCTProcessor::def_nplanes_hit_pretrig
static const unsigned int def_nplanes_hit_pretrig
Definition: CSCAnodeLCTProcessor.h:171
CSCAnodeLCTProcessor::showerMaxOutTBin_
unsigned showerMaxOutTBin_
Definition: CSCAnodeLCTProcessor.h:138
CSCAnodeLCTProcessor::cleanWireContainer
void cleanWireContainer(CSCALCTDigi::WireContainer &wireHits) const
Definition: CSCAnodeLCTProcessor.cc:1324
CSCConstants::ALCT_ACCELERATOR_PATTERN
Definition: CSCConstants.h:109
CSCALCTDigi::getAccelerator
uint16_t getAccelerator() const
Definition: CSCALCTDigi.h:53
CSCAnodeLCTProcessor::alct_pattern_
CSCPatternBank::LCTPatterns alct_pattern_
Definition: CSCAnodeLCTProcessor.h:181
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
CSCDBL1TPParameters::alctL1aWindowWidth
unsigned int alctL1aWindowWidth() const
Definition: CSCDBL1TPParameters.h:47
CSCALCTDigi
Definition: CSCALCTDigi.h:17
CSCAnodeLCTProcessor::def_nplanes_hit_accel_pattern
static const unsigned int def_nplanes_hit_accel_pattern
Definition: CSCAnodeLCTProcessor.h:173
CSCALCTDigi::WireContainer
std::vector< std::vector< uint16_t > > WireContainer
Definition: CSCALCTDigi.h:21
CSCAnodeLCTProcessor::def_trig_mode
static const unsigned int def_trig_mode
Definition: CSCAnodeLCTProcessor.h:174
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
CSCAnodeLCTProcessor::patternDetection
bool patternDetection(const int key_wire, std::map< int, std::map< int, CSCALCTDigi::WireContainer > > &hits_in_patterns)
Definition: CSCAnodeLCTProcessor.cc:620
MuonDigiCollection::Range
std::pair< const_iterator, const_iterator > Range
Definition: MuonDigiCollection.h:95
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
CSCBaseboard::theTrigChamber
const unsigned theTrigChamber
Definition: CSCBaseboard.h:45
CSCAnodeLCTProcessor::nplanes_hit_pretrig
unsigned int nplanes_hit_pretrig
Definition: CSCAnodeLCTProcessor.h:142
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CSCDBL1TPParameters::alctNplanesHitAccelPattern
unsigned int alctNplanesHitAccelPattern() const
Definition: CSCDBL1TPParameters.h:38
PulseArray::oneShotAtBX
bool oneShotAtBX(const unsigned layer, const unsigned channel, const unsigned bx) const
Definition: PulseArray.cc:33
CSCALCTDigi::isValid
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:40
trigger
Definition: HLTPrescaleTableCond.h:8
CSCAnodeLCTProcessor::first_bx
int first_bx[CSCConstants::MAX_NUM_WIREGROUPS]
Definition: CSCAnodeLCTProcessor.h:119
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
RunInfoPI::valid
Definition: RunInfoPayloadInspectoHelper.h:16
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
PulseArray::clear
void clear()
Definition: PulseArray.cc:14
CSCAnodeLCTProcessor::ghost_cancellation_bx_depth
int ghost_cancellation_bx_depth
Definition: CSCAnodeLCTProcessor.h:153
CSCAnodeLCTProcessor::getDigis
bool getDigis(const CSCWireDigiCollection *wiredc)
Definition: CSCAnodeLCTProcessor.cc:385
CSCAnodeLCTProcessor::dumpDigis
void dumpDigis(const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS]) const
Definition: CSCAnodeLCTProcessor.cc:1155
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
CSCAnodeLCTProcessor::showerMinInTBin_
unsigned showerMinInTBin_
Definition: CSCAnodeLCTProcessor.h:135
CSCALCTDigi::setTrknmb
void setTrknmb(const uint16_t number)
Set track number (1,2) after sorting ALCTs.
Definition: CSCALCTDigi.h:82
CSCAnodeLCTProcessor::quality
int quality[CSCConstants::MAX_NUM_WIREGROUPS][CSCConstants::NUM_ALCT_PATTERNS]
Definition: CSCAnodeLCTProcessor.h:122
CSCAnodeLCTProcessor::lctSearch
void lctSearch()
Definition: CSCAnodeLCTProcessor.cc:838
CSCAnodeLCTProcessor::bestALCT
CSCALCTDigi bestALCT[CSCConstants::MAX_ALCT_TBINS]
Definition: CSCAnodeLCTProcessor.h:103
CSCLayerGeometry::numberOfWireGroups
int numberOfWireGroups() const
Definition: CSCLayerGeometry.h:76
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
CSCBaseboard::isME11_
bool isME11_
Definition: CSCBaseboard.h:51
PulseArray::initialize
void initialize(unsigned numberOfChannels)
Definition: PulseArray.cc:5
CSCDBL1TPParameters::alctFifoTbins
unsigned int alctFifoTbins() const
Definition: CSCDBL1TPParameters.h:20
CSCAnodeLCTProcessor::nplanes_hit_accel_pretrig
unsigned int nplanes_hit_accel_pretrig
Definition: CSCAnodeLCTProcessor.h:142
CSCALCTDigi::setHits
void setHits(const WireContainer &hits)
Definition: CSCALCTDigi.h:120
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128
CSCAnodeLCTProcessor::fifo_tbins
unsigned int fifo_tbins
Definition: CSCAnodeLCTProcessor.h:141
CSCAnodeLCTProcessor::digiV
std::vector< CSCWireDigi > digiV[CSCConstants::NUM_LAYERS]
Definition: CSCAnodeLCTProcessor.h:123
CSCBaseboard::alctParams_
edm::ParameterSet alctParams_
Definition: CSCBaseboard.h:75
CSCConstants::ALCT_PATTERN_WIDTH
Definition: CSCConstants.h:108
CSCConstants::MAX_NUM_WIREGROUPS
Definition: CSCConstants.h:51
CSCBaseboard::infoV
int infoV
Definition: CSCBaseboard.h:63
CSCBaseboard::theRing
unsigned theRing
Definition: CSCBaseboard.h:47