CMS 3D CMS Logo

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

#include <CSCCathodeLCTProcessor.h>

Inheritance diagram for CSCCathodeLCTProcessor:
CSCBaseboard CSCUpgradeCathodeLCTProcessor

Public Member Functions

void clear ()
 
 CSCCathodeLCTProcessor ()
 
 CSCCathodeLCTProcessor (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
CSCCLCTDigi getBestCLCT (int bx) const
 
std::vector< CSCCLCTDigigetCLCTs (unsigned nMaxCLCTs=CSCConstants::MAX_CLCTS_PER_PROCESSOR) const
 
CSCCLCTDigi getSecondCLCT (int bx) const
 
std::vector< int > preTriggerBXs () const
 
std::vector< CSCCLCTPreTriggerDigipreTriggerDigis () const
 
std::vector< CSCCLCTPreTriggerDigipreTriggerDigisME1a () const
 
std::vector< CSCCLCTPreTriggerDigipreTriggerDigisME1b () const
 
std::vector< CSCCLCTDigireadoutCLCTs (int nMaxCLCTs=CSCConstants::MAX_CLCTS_READOUT) const
 
std::vector< CSCCLCTDigireadoutCLCTsME1a (int nMaxCLCTs=CSCConstants::MAX_CLCTS_READOUT) const
 
std::vector< CSCCLCTDigireadoutCLCTsME1b (int nMaxCLCTs=CSCConstants::MAX_CLCTS_READOUT) const
 
std::vector< CSCCLCTDigirun (const CSCComparatorDigiCollection *compdc)
 
void run (const std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
 
void setConfigParameters (const CSCDBL1TPParameters *conf)
 
- 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 Types

enum  CLCT_CompCode { INVALID_HALFSTRIP = 65535 }
 
enum  CLCT_INDICES {
  CLCT_PATTERN, CLCT_BEND, CLCT_STRIP, CLCT_BX,
  CLCT_STRIP_TYPE, CLCT_QUALITY, CLCT_CFEB, CLCT_NUM_QUANTITIES = 7
}
 
typedef unsigned int PulseArray[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS]
 

Protected Member Functions

void checkConfigParameters ()
 
void checkValid (const CSCCLCTDigi &lct, unsigned max_stubs=CSCConstants::MAX_CLCTS_PER_PROCESSOR) const
 
void cleanComparatorContainer (CSCCLCTDigi::ComparatorContainer &compHits) const
 
void dumpConfigParams () const
 
void dumpDigis (const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips) const
 
virtual std::vector< CSCCLCTDigifindLCTs (const std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
 
bool getDigis (const CSCComparatorDigiCollection *compdc)
 
void getDigis (const CSCComparatorDigiCollection *compdc, const CSCDetId &id)
 
void markBusyKeys (const int best_hstrip, const int best_patid, int quality[CSCConstants::NUM_HALF_STRIPS_7CFEBS])
 
bool patternFinding (const PulseArray pulse, const int nStrips, const unsigned int bx_time, std::map< int, std::map< int, CSCCLCTDigi::ComparatorContainer > > &hits_in_patterns)
 
virtual bool preTrigger (const PulseArray pulse, const int start_bx, int &first_bx)
 
void pulseExtension (const std::vector< int > time[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips, PulseArray pulse)
 
void readComparatorDigis (std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
 
void setDefaultConfigParameters ()
 
- 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 best_pid [CSCConstants::NUM_HALF_STRIPS_7CFEBS]
 
CSCCLCTDigi bestCLCT [CSCConstants::MAX_CLCT_TBINS]
 
CSCPatternBank::CLCTPatterns clct_pattern_ = {}
 
std::vector< CSCComparatorDigidigiV [CSCConstants::NUM_LAYERS]
 
unsigned int drift_delay
 
int early_tbins
 
unsigned int fifo_pretrig
 
unsigned int fifo_tbins
 
int first_bx_corrected [CSCConstants::NUM_HALF_STRIPS_7CFEBS]
 
unsigned int hit_persist
 
PulseArray hitsCLCT [99]
 
bool ispretrig [CSCConstants::NUM_HALF_STRIPS_7CFEBS]
 
unsigned int min_separation
 
unsigned int nhits [CSCConstants::NUM_HALF_STRIPS_7CFEBS]
 
unsigned int nplanes_hit_pattern
 
unsigned int nplanes_hit_pretrig
 
int numStrips
 
unsigned int pid_thresh_pretrig
 
bool readout_earliest_2
 
CSCCLCTDigi secondCLCT [CSCConstants::MAX_CLCT_TBINS]
 
int stagger [CSCConstants::NUM_LAYERS]
 
int start_bx_shift
 
std::vector< int > thePreTriggerBXs
 
std::vector< CSCCLCTPreTriggerDigithePreTriggerDigis
 
unsigned int tmb_l1a_window_size
 
bool use_comparator_codes_
 
bool use_run3_patterns_
 
- Protected Attributes inherited from CSCBaseboard
unsigned int alctClctOffset_
 
edm::ParameterSet alctParams_
 
edm::ParameterSet clctParams_
 
edm::ParameterSet commonParams_
 
const CSCChambercscChamber_
 
const CSCGeometrycscGeometry_
 
CSCDetId cscId_
 
bool disableME1a_
 
bool enableAlctSLHC_
 
bool gangedME1a_
 
int infoV
 
bool isME11_
 
bool isME21_
 
bool isSLHC_
 
bool runME11ILT_
 
bool runME11Up_
 
bool runME21ILT_
 
bool runME21Up_
 
bool runME31Up_
 
bool runME41Up_
 
unsigned theChamber
 
std::string theCSCName_
 
const unsigned theEndcap
 
unsigned theRegion
 
unsigned theRing
 
const unsigned theSector
 
const unsigned theStation
 
const unsigned theSubsector
 
const unsigned theTrigChamber
 
edm::ParameterSet tmbParams_
 

Static Protected Attributes

static const unsigned int def_drift_delay = 2
 
static const unsigned int def_fifo_pretrig = 7
 
static const unsigned int def_fifo_tbins = 12
 
static const unsigned int def_hit_persist = 6
 
static const unsigned int def_min_separation = 10
 
static const unsigned int def_nplanes_hit_pattern = 4
 
static const unsigned int def_nplanes_hit_pretrig = 2
 
static const unsigned int def_pid_thresh_pretrig = 2
 
static const unsigned int def_tmb_l1a_window_size = 7
 

Detailed Description

This class simulates the functionality of the cathode LCT card. It is run by the MotherBoard and returns up to two CathodeLCTs. It can be run either in a test mode, where it is passed arrays of halfstrip times, or in normal mode where it determines the time and comparator information from the comparator digis.

The CathodeLCTs only come halfstrip flavors

Date
May 2001 Removed the card boundaries. Changed the Pretrigger to emulate the hardware electronic logic. Also changed the keylayer to be the 4th layer in a chamber instead of the 3rd layer from the interaction region. The code is a more realistic simulation of hardware LCT logic now. -Jason Mumford.
Author
Benn Tannenbaum UCLA 13 July 1999 benn@.nosp@m.phys.nosp@m.ics.u.nosp@m.cla..nosp@m.edu 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 40 of file CSCCathodeLCTProcessor.h.

Member Typedef Documentation

◆ PulseArray

typedef unsigned int CSCCathodeLCTProcessor::PulseArray[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS]
protected

Definition at line 104 of file CSCCathodeLCTProcessor.h.

Member Enumeration Documentation

◆ CLCT_CompCode

Enumerator
INVALID_HALFSTRIP 

Definition at line 129 of file CSCCathodeLCTProcessor.h.

129 { INVALID_HALFSTRIP = 65535 };

◆ CLCT_INDICES

Enumerator
CLCT_PATTERN 
CLCT_BEND 
CLCT_STRIP 
CLCT_BX 
CLCT_STRIP_TYPE 
CLCT_QUALITY 
CLCT_CFEB 
CLCT_NUM_QUANTITIES 

Definition at line 165 of file CSCCathodeLCTProcessor.h.

165  {
166  CLCT_PATTERN,
167  CLCT_BEND,
168  CLCT_STRIP,
169  CLCT_BX,
171  CLCT_QUALITY,
172  CLCT_CFEB,
174  };

Constructor & Destructor Documentation

◆ CSCCathodeLCTProcessor() [1/2]

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

Normal constructor.

Definition at line 22 of file CSCCathodeLCTProcessor.cc.

28  : CSCBaseboard(endcap, station, sector, subsector, chamber, conf) {
29  static std::atomic<bool> config_dumped{false};
30 
31  // CLCT configuration parameters.
32  fifo_tbins = clctParams_.getParameter<unsigned int>("clctFifoTbins");
33  hit_persist = clctParams_.getParameter<unsigned int>("clctHitPersist");
34  drift_delay = clctParams_.getParameter<unsigned int>("clctDriftDelay");
35  nplanes_hit_pretrig = clctParams_.getParameter<unsigned int>("clctNplanesHitPretrig");
36  nplanes_hit_pattern = clctParams_.getParameter<unsigned int>("clctNplanesHitPattern");
37 
38  // Not used yet.
39  fifo_pretrig = clctParams_.getParameter<unsigned int>("clctFifoPretrig");
40 
41  pid_thresh_pretrig = clctParams_.getParameter<unsigned int>("clctPidThreshPretrig");
42  min_separation = clctParams_.getParameter<unsigned int>("clctMinSeparation");
43 
44  start_bx_shift = clctParams_.getParameter<int>("clctStartBxShift");
45 
46  // Motherboard parameters: common for all configurations.
47  tmb_l1a_window_size = // Common to CLCT and TMB
48  tmbParams_.getParameter<unsigned int>("tmbL1aWindowSize");
49 
50  // separate handle for early time bins
51  early_tbins = tmbParams_.getParameter<int>("tmbEarlyTbins");
52  if (early_tbins < 0)
54 
55  // wether to readout only the earliest two LCTs in readout window
56  readout_earliest_2 = tmbParams_.getParameter<bool>("tmbReadoutEarliest2");
57 
58  // Verbosity level, set to 0 (no print) by default.
59  infoV = clctParams_.getParameter<int>("verbosity");
60 
61  use_run3_patterns_ = clctParams_.getParameter<bool>("useRun3Patterns");
62 
63  use_comparator_codes_ = clctParams_.getParameter<bool>("useComparatorCodes");
64 
65  // Check and print configuration parameters.
67  if ((infoV > 0) && !config_dumped) {
69  config_dumped = true;
70  }
71 
72  numStrips = 0; // Will be set later.
73  // Provisional, but should be OK for all stations except ME1.
74  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
75  if ((i_layer + 1) % 2 == 0)
76  stagger[i_layer] = 0;
77  else
78  stagger[i_layer] = 1;
79  }
80 
81  // which patterns should we use?
82  if (use_run3_patterns_) {
84  } else {
86  }
87 
88  thePreTriggerDigis.clear();
89 }

References checkConfigParameters(), CSCConstants::CLCT_EMUL_TIME_OFFSET, clct_pattern_, CSCPatternBank::clct_pattern_legacy_, CSCPatternBank::clct_pattern_run3_, CSCBaseboard::clctParams_, drift_delay, dumpConfigParams(), early_tbins, fifo_pretrig, fifo_tbins, edm::ParameterSet::getParameter(), hit_persist, CSCBaseboard::infoV, min_separation, nplanes_hit_pattern, nplanes_hit_pretrig, CSCConstants::NUM_LAYERS, numStrips, pid_thresh_pretrig, readout_earliest_2, stagger, start_bx_shift, thePreTriggerDigis, tmb_l1a_window_size, CSCBaseboard::tmbParams_, use_comparator_codes_, and use_run3_patterns_.

◆ CSCCathodeLCTProcessor() [2/2]

CSCCathodeLCTProcessor::CSCCathodeLCTProcessor ( )

Default constructor. Used for testing.

Definition at line 91 of file CSCCathodeLCTProcessor.cc.

91  : CSCBaseboard() {
92  // constructor for debugging.
93  static std::atomic<bool> config_dumped{false};
94 
95  // CLCT configuration parameters.
97  infoV = 2;
98 
99  early_tbins = 4;
100 
101  start_bx_shift = 0;
102 
103  // Check and print configuration parameters.
105  if (!config_dumped) {
107  config_dumped = true;
108  }
109 
111  // Should be OK for all stations except ME1.
112  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
113  if ((i_layer + 1) % 2 == 0)
114  stagger[i_layer] = 0;
115  else
116  stagger[i_layer] = 1;
117  }
118 
119  thePreTriggerDigis.clear();
120 }

References checkConfigParameters(), dumpConfigParams(), early_tbins, CSCBaseboard::infoV, CSCConstants::MAX_NUM_STRIPS, CSCConstants::NUM_LAYERS, numStrips, setDefaultConfigParameters(), stagger, start_bx_shift, and thePreTriggerDigis.

Member Function Documentation

◆ checkConfigParameters()

void CSCCathodeLCTProcessor::checkConfigParameters ( )
protected

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

Definition at line 156 of file CSCCathodeLCTProcessor.cc.

156  {
157  // Make sure that the parameter values are within the allowed range.
158 
159  // Max expected values.
160  static const unsigned int max_fifo_tbins = 1 << 5;
161  static const unsigned int max_fifo_pretrig = 1 << 5;
162  static const unsigned int max_hit_persist = 1 << 4;
163  static const unsigned int max_drift_delay = 1 << 2;
164  static const unsigned int max_nplanes_hit_pretrig = 1 << 3;
165  static const unsigned int max_nplanes_hit_pattern = 1 << 3;
166  static const unsigned int max_pid_thresh_pretrig = 1 << 4;
167  static const unsigned int max_min_separation = CSCConstants::NUM_HALF_STRIPS_7CFEBS;
168  static const unsigned int max_tmb_l1a_window_size = 1 << 4;
169 
170  // Checks.
171  CSCBaseboard::checkConfigParameters(fifo_tbins, max_fifo_tbins, def_fifo_tbins, "fifo_tbins");
172  CSCBaseboard::checkConfigParameters(fifo_pretrig, max_fifo_pretrig, def_fifo_pretrig, "fifo_pretrig");
173  CSCBaseboard::checkConfigParameters(hit_persist, max_hit_persist, def_hit_persist, "hit_persist");
174  CSCBaseboard::checkConfigParameters(drift_delay, max_drift_delay, def_drift_delay, "drift_delay");
176  nplanes_hit_pretrig, max_nplanes_hit_pretrig, def_nplanes_hit_pretrig, "nplanes_hit_pretrig");
178  nplanes_hit_pattern, max_nplanes_hit_pattern, def_nplanes_hit_pattern, "nplanes_hit_pattern");
180  pid_thresh_pretrig, max_pid_thresh_pretrig, def_pid_thresh_pretrig, "pid_thresh_pretrig");
181  CSCBaseboard::checkConfigParameters(min_separation, max_min_separation, def_min_separation, "min_separation");
183  tmb_l1a_window_size, max_tmb_l1a_window_size, def_tmb_l1a_window_size, "tmb_l1a_window_size");
184 }

References CSCBaseboard::checkConfigParameters(), def_drift_delay, def_fifo_pretrig, def_fifo_tbins, def_hit_persist, def_min_separation, def_nplanes_hit_pattern, def_nplanes_hit_pretrig, def_pid_thresh_pretrig, def_tmb_l1a_window_size, drift_delay, fifo_pretrig, fifo_tbins, hit_persist, min_separation, nplanes_hit_pattern, nplanes_hit_pretrig, CSCConstants::NUM_HALF_STRIPS_7CFEBS, pid_thresh_pretrig, and tmb_l1a_window_size.

Referenced by CSCCathodeLCTProcessor(), and setConfigParameters().

◆ checkValid()

void CSCCathodeLCTProcessor::checkValid ( const CSCCLCTDigi lct,
unsigned  max_stubs = CSCConstants::MAX_CLCTS_PER_PROCESSOR 
) const
protected

Definition at line 1075 of file CSCCathodeLCTProcessor.cc.

1075  {
1076  const unsigned max_strip = csctp::get_csc_max_halfstrip(theStation, theRing);
1077  const auto& [min_pattern, max_pattern] = csctp::get_csc_min_max_pattern(use_run3_patterns_);
1078  const auto& [min_cfeb, max_cfeb] = csctp::get_csc_min_max_cfeb(theStation, theRing);
1079  const unsigned max_quality = csctp::get_csc_clct_max_quality();
1080  unsigned errors = 0;
1081 
1082  // CLCT must be valid
1083  if (!clct.isValid()) {
1084  edm::LogError("CSCCathodeLCTProcessor") << "CSCLCTDigi with invalid bit set: " << clct.isValid();
1085  errors++;
1086  }
1087 
1088  // CLCT number is 1 or max
1089  if (clct.getTrknmb() < 1 or clct.getTrknmb() > max_stubs) {
1090  edm::LogError("CSCCathodeLCTProcessor")
1091  << "CSCLCTDigi with invalid track number: " << clct.getTrknmb() << "; allowed [1," << max_stubs << "]";
1092  errors++;
1093  }
1094 
1095  // CLCT quality must be valid
1096  // CLCTs require at least 4 layers hit
1097  // Run-3: ME1/1 CLCTs require only 3 layers
1098  // Run-4: ME2/1 CLCTs require only 3 layers
1099  if (clct.getQuality() < nplanes_hit_pattern or clct.getQuality() > max_quality) {
1100  edm::LogError("CSCCathodeLCTProcessor")
1101  << "CSCLCTDigi with invalid quality: " << clct.getQuality() << "; allowed [0," << max_quality << "]";
1102  ;
1103  errors++;
1104  }
1105 
1106  // CLCT half-strip must be within bounds
1107  if (clct.getStrip() >= CSCConstants::NUM_HALF_STRIPS_PER_CFEB) {
1108  edm::LogError("CSCCathodeLCTProcessor") << "CSCLCTDigi with invalid half-strip: " << clct.getStrip()
1109  << "; allowed [0, " << CSCConstants::NUM_HALF_STRIPS_PER_CFEB - 1 << "]";
1110  errors++;
1111  }
1112 
1113  // CLCT key half-strip must be within bounds
1114  if (clct.getKeyStrip() >= max_strip) {
1115  edm::LogError("CSCCathodeLCTProcessor")
1116  << "CSCLCTDigi with invalid key half-strip: " << clct.getKeyStrip() << "; allowed [0, " << max_strip - 1 << "]";
1117  errors++;
1118  }
1119 
1120  // CLCT with out-of-time BX
1121  if (clct.getBX() >= CSCConstants::MAX_CLCT_TBINS) {
1122  edm::LogError("CSCCathodeLCTProcessor") << "CSCLCTDigi with invalid BX: " << clct.getBX() << "; allowed [0, "
1123  << CSCConstants::MAX_CLCT_TBINS - 1 << "]";
1124  errors++;
1125  }
1126 
1127  // CLCT with neither left nor right bending
1128  if (clct.getBend() > 1) {
1129  edm::LogError("CSCCathodeLCTProcessor")
1130  << "CSCLCTDigi with invalid bending: " << clct.getBend() << "; allowed [0,1]";
1131  errors++;
1132  }
1133 
1134  // CLCT with an invalid pattern ID
1135  if (clct.getPattern() < min_pattern or clct.getPattern() > max_pattern) {
1136  edm::LogError("CSCCathodeLCTProcessor") << "CSCLCTDigi with invalid pattern ID: " << clct.getPattern()
1137  << "; allowed [" << min_pattern << ", " << max_pattern << "]";
1138  errors++;
1139  }
1140 
1141  // CLCT with an invalid CFEB ID
1142  if (clct.getCFEB() < min_cfeb or clct.getCFEB() > max_cfeb) {
1143  edm::LogError("CSCCathodeLCTProcessor") << "CSCLCTDigi with invalid CFEB ID: " << clct.getCFEB() << "; allowed ["
1144  << min_cfeb << ", " << max_cfeb << "]";
1145  errors++;
1146  }
1147 
1148  if (use_run3_patterns_) {
1149  // CLCT comparator code is invalid
1150  if (clct.getCompCode() < 0 or clct.getCompCode() >= std::pow(2, 12)) {
1151  edm::LogError("CSCCathodeLCTProcessor") << "CSCLCTDigi with invalid comparator code: " << clct.getCompCode()
1152  << "; allowed [0, " << std::pow(2, 12) - 1 << "]";
1153  errors++;
1154  }
1155 
1156  unsigned max_quartstrip = csctp::get_csc_max_quartstrip(theStation, theRing);
1157  unsigned max_eightstrip = csctp::get_csc_max_eightstrip(theStation, theRing);
1158 
1159  // CLCT key half-strip must be within bounds
1160  if (clct.getKeyStrip(4) >= max_quartstrip) {
1161  edm::LogError("CSCCathodeLCTProcessor") << "CSCLCTDigi with invalid key quart-strip: " << clct.getKeyStrip(4)
1162  << "; allowed [0, " << max_quartstrip - 1 << "]";
1163  errors++;
1164  }
1165 
1166  // CLCT key half-strip must be within bounds
1167  if (clct.getKeyStrip(8) >= max_eightstrip) {
1168  edm::LogError("CSCCathodeLCTProcessor") << "CSCLCTDigi with invalid key eight-strip: " << clct.getKeyStrip(8)
1169  << "; allowed [0, " << max_eightstrip - 1 << "]";
1170  errors++;
1171  }
1172  }
1173 
1174  if (errors > 0) {
1175  edm::LogError("CSCCathodeLCTProcessor") << "Faulty CLCT: " << cscId_ << " " << clct << "\n errors " << errors;
1176  }
1177 }

References CSCBaseboard::cscId_, MessageLogger_cfi::errors, csctp::get_csc_clct_max_quality(), csctp::get_csc_max_eightstrip(), csctp::get_csc_max_halfstrip(), csctp::get_csc_max_quartstrip(), csctp::get_csc_min_max_cfeb(), csctp::get_csc_min_max_pattern(), CSCCLCTDigi::getBend(), CSCCLCTDigi::getBX(), CSCCLCTDigi::getCFEB(), CSCCLCTDigi::getCompCode(), CSCCLCTDigi::getKeyStrip(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getQuality(), CSCCLCTDigi::getStrip(), CSCCLCTDigi::getTrknmb(), CSCCLCTDigi::isValid(), CSCConstants::MAX_CLCT_TBINS, nplanes_hit_pattern, CSCConstants::NUM_HALF_STRIPS_PER_CFEB, or, funct::pow(), CSCBaseboard::theRing, CSCBaseboard::theStation, and use_run3_patterns_.

Referenced by readoutCLCTs(), and run().

◆ cleanComparatorContainer()

void CSCCathodeLCTProcessor::cleanComparatorContainer ( CSCCLCTDigi::ComparatorContainer compHits) const
protected

Definition at line 1003 of file CSCCathodeLCTProcessor.cc.

1003  {
1004  for (auto& p : compHits) {
1005  p.erase(std::remove_if(
1006  p.begin(), p.end(), [](unsigned i) -> bool { return i == CSCCathodeLCTProcessor::INVALID_HALFSTRIP; }),
1007  p.end());
1008  }
1009 }

References mps_fire::i, INVALID_HALFSTRIP, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by CSCUpgradeCathodeLCTProcessor::findLCTs(), and findLCTs().

◆ clear()

void CSCCathodeLCTProcessor::clear ( void  )

Clears the LCT containers.

Definition at line 186 of file CSCCathodeLCTProcessor.cc.

186  {
187  thePreTriggerDigis.clear();
188  thePreTriggerBXs.clear();
189  for (int bx = 0; bx < CSCConstants::MAX_CLCT_TBINS; bx++) {
190  bestCLCT[bx].clear();
191  secondCLCT[bx].clear();
192  }
193 }

References bestCLCT, simKBmtfDigis_cfi::bx, CSCCLCTDigi::clear(), CSCConstants::MAX_CLCT_TBINS, secondCLCT, thePreTriggerBXs, and thePreTriggerDigis.

◆ dumpConfigParams()

void CSCCathodeLCTProcessor::dumpConfigParams ( ) const
protected

Dump CLCT configuration parameters.

Definition at line 1015 of file CSCCathodeLCTProcessor.cc.

1015  {
1016  std::ostringstream strm;
1017  strm << "\n";
1018  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1019  strm << "+ CLCT configuration parameters: +\n";
1020  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1021  strm << " fifo_tbins [total number of time bins in DAQ readout] = " << fifo_tbins << "\n";
1022  strm << " fifo_pretrig [start time of cathode raw hits in DAQ readout] = " << fifo_pretrig << "\n";
1023  strm << " hit_persist [duration of signal pulse, in 25 ns bins] = " << hit_persist << "\n";
1024  strm << " drift_delay [time after pre-trigger before TMB latches LCTs] = " << drift_delay << "\n";
1025  strm << " nplanes_hit_pretrig [min. number of layers hit for pre-trigger] = " << nplanes_hit_pretrig << "\n";
1026  strm << " nplanes_hit_pattern [min. number of layers hit for trigger] = " << nplanes_hit_pattern << "\n";
1027  strm << " pid_thresh_pretrig [lower threshold on pattern id] = " << pid_thresh_pretrig << "\n";
1028  strm << " min_separation [region of busy key strips] = " << min_separation << "\n";
1029  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1030  LogDebug("CSCCathodeLCTProcessor") << strm.str();
1031 }

References drift_delay, fifo_pretrig, fifo_tbins, hit_persist, LogDebug, min_separation, nplanes_hit_pattern, nplanes_hit_pretrig, and pid_thresh_pretrig.

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

◆ dumpDigis()

void CSCCathodeLCTProcessor::dumpDigis ( const std::vector< int >  strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
const int  nStrips 
) const
protected

Dump half-strip digis

Definition at line 1034 of file CSCCathodeLCTProcessor.cc.

1036  {
1037  LogDebug("CSCCathodeLCTProcessor") << theCSCName_ << " strip type: half-strip, nStrips " << nStrips;
1038 
1039  std::ostringstream strstrm;
1040  for (int i_strip = 0; i_strip < nStrips; i_strip++) {
1041  if (i_strip % 10 == 0) {
1042  if (i_strip < 100)
1043  strstrm << i_strip / 10;
1044  else
1045  strstrm << (i_strip - 100) / 10;
1046  } else
1047  strstrm << " ";
1048  if ((i_strip + 1) % CSCConstants::NUM_HALF_STRIPS_PER_CFEB == 0)
1049  strstrm << " ";
1050  }
1051  strstrm << "\n";
1052  for (int i_strip = 0; i_strip < nStrips; i_strip++) {
1053  strstrm << i_strip % 10;
1054  if ((i_strip + 1) % CSCConstants::NUM_HALF_STRIPS_PER_CFEB == 0)
1055  strstrm << " ";
1056  }
1057  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
1058  strstrm << "\n";
1059  for (int i_strip = 0; i_strip < nStrips; i_strip++) {
1060  if (!strip[i_layer][i_strip].empty()) {
1061  std::vector<int> bx_times = strip[i_layer][i_strip];
1062  // Dump only the first in time.
1063  strstrm << std::hex << bx_times[0] << std::dec;
1064  } else {
1065  strstrm << "-";
1066  }
1067  if ((i_strip + 1) % CSCConstants::NUM_HALF_STRIPS_PER_CFEB == 0)
1068  strstrm << " ";
1069  }
1070  }
1071  LogTrace("CSCCathodeLCTProcessor") << strstrm.str();
1072 }

References TauDecayModes::dec, relativeConstraints::empty, LogDebug, LogTrace, me0TriggerPseudoDigis_cff::nStrips, CSCConstants::NUM_HALF_STRIPS_PER_CFEB, CSCConstants::NUM_LAYERS, digitizers_cfi::strip, and CSCBaseboard::theCSCName_.

Referenced by CSCUpgradeCathodeLCTProcessor::findLCTs(), and findLCTs().

◆ findLCTs()

std::vector< CSCCLCTDigi > CSCCathodeLCTProcessor::findLCTs ( const std::vector< int >  halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
protectedvirtual

Reimplemented in CSCUpgradeCathodeLCTProcessor.

Definition at line 523 of file CSCCathodeLCTProcessor.cc.

524  {
525  std::vector<CSCCLCTDigi> lctList;
526 
527  // Max. number of half-strips for this chamber.
528  const int maxHalfStrips = 2 * numStrips + 1;
529 
530  if (infoV > 1)
531  dumpDigis(halfstrip, maxHalfStrips);
532 
533  // 2 possible LCTs per CSC x 7 LCT quantities
536 
537  // Fire half-strip one-shots for hit_persist bx's (4 bx's by default).
538  pulseExtension(halfstrip, maxHalfStrips, pulse);
539 
540  unsigned int start_bx = start_bx_shift;
541  // Stop drift_delay bx's short of fifo_tbins since at later bx's we will
542  // not have a full set of hits to start pattern search anyway.
543  unsigned int stop_bx = fifo_tbins - drift_delay;
544  // Allow for more than one pass over the hits in the time window.
545  while (start_bx < stop_bx) {
546  // All half-strip pattern envelopes are evaluated simultaneously, on every
547  // clock cycle.
548  int first_bx = 999;
549  bool pre_trig = preTrigger(pulse, start_bx, first_bx);
550 
551  // If any of half-strip envelopes has enough layers hit in it, TMB
552  // will pre-trigger.
553  if (pre_trig) {
554  thePreTriggerBXs.push_back(first_bx);
555  if (infoV > 1)
556  LogTrace("CSCCathodeLCTProcessor") << "..... pretrigger at bx = " << first_bx << "; waiting drift delay .....";
557 
558  // TMB latches LCTs drift_delay clocks after pretrigger.
559  // in the configuration the drift_delay is set to 2bx by default
560  // this is the time that is required for the electrons to drift to the
561  // cathode strips. 15ns drift time --> 45 ns is 3 sigma for the delay
562  // this corresponds to 2bx
563  int latch_bx = first_bx + drift_delay;
564 
565  // define a new pattern map
566  // for each key half strip, and for each pattern, store the 2D collection of fired comparator digis
567  std::map<int, std::map<int, CSCCLCTDigi::ComparatorContainer>> hits_in_patterns;
568  hits_in_patterns.clear();
569 
570  // We check if there is at least one key half strip for which at least
571  // one pattern id has at least the minimum number of hits
572  bool hits_in_time = patternFinding(pulse, maxHalfStrips, latch_bx, hits_in_patterns);
573  if (infoV > 1) {
574  if (hits_in_time) {
575  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < maxHalfStrips; hstrip++) {
576  if (nhits[hstrip] > 0) {
577  LogTrace("CSCCathodeLCTProcessor")
578  << " bx = " << std::setw(2) << latch_bx << " --->"
579  << " halfstrip = " << std::setw(3) << hstrip << " best pid = " << std::setw(2) << best_pid[hstrip]
580  << " nhits = " << nhits[hstrip];
581  }
582  }
583  }
584  }
585  // This trigger emulator does not have an active CFEB flag for DAQ (csc trigger hardware: AFF)
586  // This is a fundamental difference with the firmware where the TMB prepares the DAQ to
587  // read out the chamber
588 
589  // The pattern finder runs continuously, so another pre-trigger
590  // could occur already at the next bx.
591 
592  // Quality for sorting.
594  int best_halfstrip[CSCConstants::MAX_CLCTS_PER_PROCESSOR];
595  int best_quality[CSCConstants::MAX_CLCTS_PER_PROCESSOR];
596 
597  for (int ilct = 0; ilct < CSCConstants::MAX_CLCTS_PER_PROCESSOR; ilct++) {
598  best_halfstrip[ilct] = -1;
599  best_quality[ilct] = 0;
600  }
601 
602  // Calculate quality from pattern id and number of hits, and
603  // simultaneously select best-quality LCT.
604  if (hits_in_time) {
605  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < maxHalfStrips; hstrip++) {
606  // The bend-direction bit pid[0] is ignored (left and right
607  // bends have equal quality).
608  quality[hstrip] = (best_pid[hstrip] & 14) | (nhits[hstrip] << 5);
609  if (quality[hstrip] > best_quality[0]) {
610  best_halfstrip[0] = hstrip;
611  best_quality[0] = quality[hstrip];
612  }
613  if (infoV > 1 && quality[hstrip] > 0) {
614  LogTrace("CSCCathodeLCTProcessor")
615  << " 1st CLCT: halfstrip = " << std::setw(3) << hstrip << " quality = " << std::setw(3)
616  << quality[hstrip] << " nhits = " << std::setw(3) << nhits[hstrip] << " pid = " << std::setw(3)
617  << best_pid[hstrip] << " best halfstrip = " << std::setw(3) << best_halfstrip[0]
618  << " best quality = " << std::setw(3) << best_quality[0];
619  }
620  }
621  }
622 
623  // If 1st best CLCT is found, look for the 2nd best.
624  if (best_halfstrip[0] >= 0) {
625  // Mark keys near best CLCT as busy by setting their quality to
626  // zero, and repeat the search.
627  markBusyKeys(best_halfstrip[0], best_pid[best_halfstrip[0]], quality);
628 
629  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < maxHalfStrips; hstrip++) {
630  if (quality[hstrip] > best_quality[1]) {
631  best_halfstrip[1] = hstrip;
632  best_quality[1] = quality[hstrip];
633  }
634  if (infoV > 1 && quality[hstrip] > 0) {
635  LogTrace("CSCCathodeLCTProcessor")
636  << " 2nd CLCT: halfstrip = " << std::setw(3) << hstrip << " quality = " << std::setw(3)
637  << quality[hstrip] << " nhits = " << std::setw(3) << nhits[hstrip] << " pid = " << std::setw(3)
638  << best_pid[hstrip] << " best halfstrip = " << std::setw(3) << best_halfstrip[1]
639  << " best quality = " << std::setw(3) << best_quality[1];
640  }
641  }
642 
643  // Pattern finder.
644  for (int ilct = 0; ilct < CSCConstants::MAX_CLCTS_PER_PROCESSOR; ilct++) {
645  int best_hs = best_halfstrip[ilct];
646  if (best_hs >= 0 && nhits[best_hs] >= nplanes_hit_pattern) {
647  keystrip_data[ilct][CLCT_PATTERN] = best_pid[best_hs];
648  keystrip_data[ilct][CLCT_BEND] =
650  // Remove stagger if any.
651  keystrip_data[ilct][CLCT_STRIP] = best_hs - stagger[CSCConstants::KEY_CLCT_LAYER - 1];
652  keystrip_data[ilct][CLCT_BX] = first_bx;
653  keystrip_data[ilct][CLCT_STRIP_TYPE] = 1; // obsolete
654  keystrip_data[ilct][CLCT_QUALITY] = nhits[best_hs];
655  keystrip_data[ilct][CLCT_CFEB] = keystrip_data[ilct][CLCT_STRIP] / CSCConstants::NUM_HALF_STRIPS_PER_CFEB;
656  int halfstrip_in_cfeb = keystrip_data[ilct][CLCT_STRIP] -
657  CSCConstants::NUM_HALF_STRIPS_PER_CFEB * keystrip_data[ilct][CLCT_CFEB];
658 
659  if (infoV > 1)
660  LogTrace("CSCCathodeLCTProcessor")
661  << " Final selection: ilct " << ilct << " key halfstrip " << keystrip_data[ilct][CLCT_STRIP]
662  << " quality " << keystrip_data[ilct][CLCT_QUALITY] << " pattern "
663  << keystrip_data[ilct][CLCT_PATTERN] << " bx " << keystrip_data[ilct][CLCT_BX];
664 
665  CSCCLCTDigi thisLCT(1,
666  keystrip_data[ilct][CLCT_QUALITY],
667  keystrip_data[ilct][CLCT_PATTERN],
668  keystrip_data[ilct][CLCT_STRIP_TYPE],
669  keystrip_data[ilct][CLCT_BEND],
670  halfstrip_in_cfeb,
671  keystrip_data[ilct][CLCT_CFEB],
672  keystrip_data[ilct][CLCT_BX]);
673 
674  // get the comparator hits for this pattern
675  auto compHits = hits_in_patterns[best_hs][keystrip_data[ilct][CLCT_PATTERN]];
676 
677  // purge the comparator digi collection from the obsolete "65535" entries...
678  cleanComparatorContainer(compHits);
679 
680  // set the hit collection
681  thisLCT.setHits(compHits);
682 
683  // useful debugging
684  if (infoV > 1) {
685  LogTrace("CSCCathodeLCTProcessor") << " Final selection: ilct " << ilct << " " << thisLCT << std::endl;
686  }
687 
688  // put the CLCT into the collection
689  lctList.push_back(thisLCT);
690  }
691  }
692  } //find CLCT, end of best_halfstrip[0] >= 0
693 
694  // If there is a trigger, CLCT pre-trigger state machine
695  // checks the number of hits that lie within a pattern template
696  // at every bx, and waits for it to drop below threshold.
697  // The search for CLCTs resumes only when the number of hits
698  // drops below threshold.
699  start_bx = fifo_tbins;
700  // Stop checking drift_delay bx's short of fifo_tbins since
701  // at later bx's we won't have a full set of hits for a
702  // pattern search anyway.
703  unsigned int stop_time = fifo_tbins - drift_delay;
704  for (unsigned int bx = latch_bx + 1; bx < stop_time; bx++) {
705  bool return_to_idle = true;
706  bool hits_in_time = patternFinding(pulse, maxHalfStrips, bx, hits_in_patterns);
707  if (hits_in_time) {
708  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < maxHalfStrips; hstrip++) {
709  // the dead-time is done at the pre-trigger, not at the trigger
710  if (nhits[hstrip] >= nplanes_hit_pretrig) {
711  if (infoV > 1)
712  LogTrace("CSCCathodeLCTProcessor") << " State machine busy at bx = " << bx;
713  return_to_idle = false;
714  break;
715  }
716  }
717  }
718  if (return_to_idle) {
719  if (infoV > 1)
720  LogTrace("CSCCathodeLCTProcessor") << " State machine returns to idle state at bx = " << bx;
721  start_bx = bx;
722  break;
723  }
724  }
725  } //pre_trig
726  else {
727  start_bx = first_bx + 1; // no dead time
728  }
729  }
730 
731  return lctList;
732 } // findLCTs -- TMB-07 version.

References best_pid, simKBmtfDigis_cfi::bx, CLCT_BEND, CLCT_BX, CLCT_CFEB, CLCT_NUM_QUANTITIES, CLCT_PATTERN, clct_pattern_, CSCConstants::CLCT_PATTERN_WIDTH, CLCT_QUALITY, CLCT_STRIP, CLCT_STRIP_TYPE, cleanComparatorContainer(), drift_delay, dumpDigis(), fifo_tbins, CSCBaseboard::infoV, CSCConstants::KEY_CLCT_LAYER, LogTrace, markBusyKeys(), CSCConstants::MAX_CLCTS_PER_PROCESSOR, nhits, nplanes_hit_pattern, nplanes_hit_pretrig, CSCConstants::NUM_HALF_STRIPS_7CFEBS, CSCConstants::NUM_HALF_STRIPS_PER_CFEB, CSCConstants::NUM_LAYERS, numStrips, patternFinding(), preTrigger(), pulse(), pulseExtension(), qcdUeDQM_cfi::quality, CSCCLCTDigi::setHits(), stagger, start_bx_shift, and thePreTriggerBXs.

Referenced by CSCUpgradeCathodeLCTProcessor::findLCTs(), and run().

◆ getBestCLCT()

CSCCLCTDigi CSCCathodeLCTProcessor::getBestCLCT ( int  bx) const

get best/second best CLCT Note: CLCT has BX shifted

Definition at line 1332 of file CSCCathodeLCTProcessor.cc.

1332  {
1333  CSCCLCTDigi lct = bestCLCT[bx];
1334  lct.setBX(lct.getBX() + alctClctOffset_);
1335  return lct;
1336 }

References CSCBaseboard::alctClctOffset_, bestCLCT, simKBmtfDigis_cfi::bx, CSCCLCTDigi::getBX(), and CSCCLCTDigi::setBX().

◆ getCLCTs()

std::vector< CSCCLCTDigi > CSCCathodeLCTProcessor::getCLCTs ( unsigned  nMaxCLCTs = CSCConstants::MAX_CLCTS_PER_PROCESSOR) const

Returns vector of all found CLCTs, if any.

Definition at line 1316 of file CSCCathodeLCTProcessor.cc.

1316  {
1317  std::vector<CSCCLCTDigi> tmpV;
1318  for (int bx = 0; bx < CSCConstants::MAX_CLCT_TBINS; bx++) {
1319  if (bestCLCT[bx].isValid())
1320  tmpV.push_back(bestCLCT[bx]);
1321  if (secondCLCT[bx].isValid())
1322  tmpV.push_back(secondCLCT[bx]);
1323  }
1324  return tmpV;
1325 }

References bestCLCT, simKBmtfDigis_cfi::bx, CSCConstants::MAX_CLCT_TBINS, and secondCLCT.

Referenced by readoutCLCTs(), and run().

◆ getDigis() [1/2]

bool CSCCathodeLCTProcessor::getDigis ( const CSCComparatorDigiCollection compdc)
protected

Access routines to comparator digis.

Definition at line 382 of file CSCCathodeLCTProcessor.cc.

382  {
383  bool noDigis = true;
384 
385  // Loop over layers and save comparator digis on each one into digiV[layer].
386  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
387  digiV[i_layer].clear();
388 
389  CSCDetId detid(theEndcap, theStation, theRing, theChamber, i_layer + 1);
390  getDigis(compdc, detid);
391 
392  if (isME11_ && !disableME1a_) {
393  CSCDetId detid_me1a(theEndcap, theStation, 4, theChamber, i_layer + 1);
394  getDigis(compdc, detid_me1a);
395  }
396 
397  if (!digiV[i_layer].empty()) {
398  noDigis = false;
399  if (infoV > 1) {
400  LogTrace("CSCCathodeLCTProcessor") << "found " << digiV[i_layer].size() << " comparator digi(s) in layer "
401  << i_layer << " of " << detid.chamberName() << " (trig. sector " << theSector
402  << " subsector " << theSubsector << " id " << theTrigChamber << ")";
403  }
404  }
405  }
406 
407  return noDigis;
408 }

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

Referenced by run().

◆ getDigis() [2/2]

void CSCCathodeLCTProcessor::getDigis ( const CSCComparatorDigiCollection compdc,
const CSCDetId id 
)
protected

Definition at line 410 of file CSCCathodeLCTProcessor.cc.

410  {
411  const bool me1a = (id.station() == 1) && (id.ring() == 4);
412  const CSCComparatorDigiCollection::Range rcompd = compdc->get(id);
413  for (CSCComparatorDigiCollection::const_iterator digiIt = rcompd.first; digiIt != rcompd.second; ++digiIt) {
414  const unsigned int origStrip = digiIt->getStrip();
415  const unsigned int maxStripsME1a =
417  // this special case can only be reached in MC
418  // in real data, the comparator digis have always ring==1
419  if (me1a && origStrip <= maxStripsME1a && !disableME1a_) {
420  // Move ME1/A comparators from CFEB=0 to CFEB=4 if this has not
421  // been done already.
422  CSCComparatorDigi digi_corr(
423  origStrip + CSCConstants::MAX_NUM_STRIPS_ME1B, digiIt->getComparator(), digiIt->getTimeBinWord());
424  digiV[id.layer() - 1].push_back(digi_corr);
425  } else {
426  digiV[id.layer() - 1].push_back(*digiIt);
427  }
428  }
429 }

References digiV, CSCBaseboard::disableME1a_, CSCBaseboard::gangedME1a_, CSCConstants::MAX_NUM_STRIPS_ME1A_GANGED, CSCConstants::MAX_NUM_STRIPS_ME1A_UNGANGED, CSCConstants::MAX_NUM_STRIPS_ME1B, and relativeConstraints::ring.

◆ getSecondCLCT()

CSCCLCTDigi CSCCathodeLCTProcessor::getSecondCLCT ( int  bx) const

Definition at line 1338 of file CSCCathodeLCTProcessor.cc.

1338  {
1339  CSCCLCTDigi lct = secondCLCT[bx];
1340  lct.setBX(lct.getBX() + alctClctOffset_);
1341  return lct;
1342 }

References CSCBaseboard::alctClctOffset_, simKBmtfDigis_cfi::bx, CSCCLCTDigi::getBX(), secondCLCT, and CSCCLCTDigi::setBX().

◆ markBusyKeys()

void CSCCathodeLCTProcessor::markBusyKeys ( const int  best_hstrip,
const int  best_patid,
int  quality[CSCConstants::NUM_HALF_STRIPS_7CFEBS] 
)
protected

Definition at line 990 of file CSCCathodeLCTProcessor.cc.

992  {
993  int nspan = min_separation;
994  int pspan = min_separation;
995 
996  for (int hstrip = best_hstrip - nspan; hstrip <= best_hstrip + pspan; hstrip++) {
997  if (hstrip >= 0 && hstrip < CSCConstants::NUM_HALF_STRIPS_7CFEBS) {
998  quality[hstrip] = 0;
999  }
1000  }
1001 } // markBusyKeys -- TMB-07 version.

References min_separation, CSCConstants::NUM_HALF_STRIPS_7CFEBS, and qcdUeDQM_cfi::quality.

Referenced by CSCUpgradeCathodeLCTProcessor::findLCTs(), and findLCTs().

◆ patternFinding()

bool CSCCathodeLCTProcessor::patternFinding ( const PulseArray  pulse,
const int  nStrips,
const unsigned int  bx_time,
std::map< int, std::map< int, CSCCLCTDigi::ComparatorContainer > > &  hits_in_patterns 
)
protected

Definition at line 843 of file CSCCathodeLCTProcessor.cc.

847  {
848  if (bx_time >= fifo_tbins)
849  return false;
850 
851  // This loop is a quick check of a number of layers hit at bx_time: since
852  // most of the time it is 0, this check helps to speed-up the execution
853  // substantially.
854  unsigned int layers_hit = 0;
855  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
856  for (int i_hstrip = 0; i_hstrip < nStrips; i_hstrip++) {
857  if (((pulse[i_layer][i_hstrip] >> bx_time) & 1) == 1) {
858  layers_hit++;
859  break;
860  }
861  }
862  }
863  if (layers_hit < nplanes_hit_pretrig)
864  return false;
865 
866  for (int key_hstrip = 0; key_hstrip < nStrips; key_hstrip++) {
867  best_pid[key_hstrip] = 0;
868  nhits[key_hstrip] = 0;
869  first_bx_corrected[key_hstrip] = -999;
870  }
871 
872  bool hit_layer[CSCConstants::NUM_LAYERS];
873 
874  // Loop over candidate key strips.
875  for (int key_hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; key_hstrip < nStrips; key_hstrip++) {
876  // Loop over patterns and look for hits matching each pattern.
877  for (unsigned int pid = clct_pattern_.size() - 1; pid >= pid_thresh_pretrig; pid--) {
878  layers_hit = 0;
879  // clear all layers
880  for (int ilayer = 0; ilayer < CSCConstants::NUM_LAYERS; ilayer++) {
881  hit_layer[ilayer] = false;
882  }
883 
884  // clear a single pattern!
885  CSCCLCTDigi::ComparatorContainer hits_single_pattern;
886  hits_single_pattern.resize(6);
887  for (auto& p : hits_single_pattern) {
889  }
890 
891  // clear all medians
892  double num_pattern_hits = 0., times_sum = 0.;
893  std::multiset<int> mset_for_median;
894  mset_for_median.clear();
895 
896  // Loop over halfstrips in trigger pattern mask and calculate the
897  // "absolute" halfstrip number for each.
898  for (int this_layer = 0; this_layer < CSCConstants::NUM_LAYERS; this_layer++) {
899  for (int strip_num = 0; strip_num < CSCConstants::CLCT_PATTERN_WIDTH; strip_num++) {
900  // ignore "0" half-strips in the pattern
901  if (clct_pattern_[pid][this_layer][strip_num] == 0)
902  continue;
903 
904  // the current strip is the key half-strip plus the offset (can be negative or positive)
905  int this_strip = CSCPatternBank::clct_pattern_offset_[strip_num] + key_hstrip;
906 
907  // current strip should be valid of course
908  if (this_strip >= 0 && this_strip < nStrips) {
909  if (infoV > 3) {
910  LogTrace("CSCCathodeLCTProcessor") << " In patternFinding: key_strip = " << key_hstrip << " pid = " << pid
911  << " layer = " << this_layer << " strip = " << this_strip << std::endl;
912  }
913  // Determine if "one shot" is high at this bx_time
914  if (((pulse[this_layer][this_strip] >> bx_time) & 1) == 1) {
915  if (hit_layer[this_layer] == false) {
916  hit_layer[this_layer] = true;
917  layers_hit++; // determines number of layers hit
918  // add this strip in this layer to the pattern we are currently considering
919  hits_single_pattern[this_layer][strip_num] = this_strip - stagger[this_layer];
920  }
921 
922  // find at what bx did pulse on this halsfstrip & layer have started
923  // use hit_persist constraint on how far back we can go
924  int first_bx_layer = bx_time;
925  for (unsigned int dbx = 0; dbx < hit_persist; dbx++) {
926  if (((pulse[this_layer][this_strip] >> (first_bx_layer - 1)) & 1) == 1)
927  first_bx_layer--;
928  else
929  break;
930  }
931  times_sum += (double)first_bx_layer;
932  num_pattern_hits += 1.;
933  mset_for_median.insert(first_bx_layer);
934  if (infoV > 2)
935  LogTrace("CSCCathodeLCTProcessor") << " 1st bx in layer: " << first_bx_layer << " sum bx: " << times_sum
936  << " #pat. hits: " << num_pattern_hits;
937  }
938  }
939  } // end loop over strips in pretrigger pattern
940  } // end loop over layers
941 
942  // save the pattern information when a trigger was formed!
943  if (layers_hit >= nplanes_hit_pattern) {
944  hits_in_patterns[key_hstrip][pid] = hits_single_pattern;
945  }
946 
947  // determine the current best pattern!
948  if (layers_hit > nhits[key_hstrip]) {
949  best_pid[key_hstrip] = pid;
950  nhits[key_hstrip] = layers_hit;
951 
952  // calculate median
953  const int sz = mset_for_median.size();
954  if (sz > 0) {
955  std::multiset<int>::iterator im = mset_for_median.begin();
956  if (sz > 1)
957  std::advance(im, sz / 2 - 1);
958  if (sz == 1)
959  first_bx_corrected[key_hstrip] = *im;
960  else if ((sz % 2) == 1)
961  first_bx_corrected[key_hstrip] = *(++im);
962  else
963  first_bx_corrected[key_hstrip] = ((*im) + (*(++im))) / 2;
964 
965 #if defined(EDM_ML_DEBUG)
966  //LogTrace only ever prints if EDM_ML_DEBUG is defined
967  if (infoV > 1) {
968  auto lt = LogTrace("CSCCathodeLCTProcessor")
969  << "bx=" << bx_time << " bx_cor=" << first_bx_corrected[key_hstrip] << " bxset=";
970  for (im = mset_for_median.begin(); im != mset_for_median.end(); im++) {
971  lt << " " << *im;
972  }
973  }
974 #endif
975  }
976  // Do not loop over the other (worse) patterns if max. numbers of
977  // hits is found.
978  if (nhits[key_hstrip] == CSCConstants::NUM_LAYERS)
979  break;
980  }
981  } // end loop over pid
982  } // end loop over candidate key strips
983 
984  // At this point there exists at least one halfstrip for which at least one pattern
985  // has at least 3 layers --> definition of a pre-trigger
986  return true;
987 } // patternFinding -- TMB-07 version.

References best_pid, clct_pattern_, CSCPatternBank::clct_pattern_offset_, CSCConstants::CLCT_PATTERN_WIDTH, fifo_tbins, first_bx_corrected, hit_persist, CSCBaseboard::infoV, INVALID_HALFSTRIP, CSCConstants::KEY_CLCT_LAYER, LogTrace, nhits, nplanes_hit_pattern, nplanes_hit_pretrig, me0TriggerPseudoDigis_cff::nStrips, CSCConstants::NUM_LAYERS, AlCaHLTBitMon_ParallelJobs::p, pid_thresh_pretrig, pulse(), and stagger.

Referenced by CSCUpgradeCathodeLCTProcessor::findLCTs(), findLCTs(), CSCUpgradeCathodeLCTProcessor::preTrigger(), and preTrigger().

◆ preTrigger()

bool CSCCathodeLCTProcessor::preTrigger ( const PulseArray  pulse,
const int  start_bx,
int &  first_bx 
)
protectedvirtual

Reimplemented in CSCUpgradeCathodeLCTProcessor.

Definition at line 781 of file CSCCathodeLCTProcessor.cc.

781  {
782  if (infoV > 1)
783  LogTrace("CSCCathodeLCTProcessor") << "....................PreTrigger...........................";
784 
785  // Max. number of half-strips for this chamber.
786  const int nStrips = 2 * numStrips + 1;
787 
788  int nPreTriggers = 0;
789 
790  bool pre_trig = false;
791  // Now do a loop over bx times to see (if/when) track goes over threshold
792  for (unsigned int bx_time = start_bx; bx_time < fifo_tbins; bx_time++) {
793  // For any given bunch-crossing, start at the lowest keystrip and look for
794  // the number of separate layers in the pattern for that keystrip that have
795  // pulses at that bunch-crossing time. Do the same for the next keystrip,
796  // etc. Then do the entire process again for the next bunch-crossing, etc
797  // until you find a pre-trigger.
798 
799  std::map<int, std::map<int, CSCCLCTDigi::ComparatorContainer>> hits_in_patterns;
800  hits_in_patterns.clear();
801 
802  bool hits_in_time = patternFinding(pulse, nStrips, bx_time, hits_in_patterns);
803  if (hits_in_time) {
804  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < nStrips; hstrip++) {
805  if (infoV > 1) {
806  if (nhits[hstrip] > 0) {
807  LogTrace("CSCCathodeLCTProcessor")
808  << " bx = " << std::setw(2) << bx_time << " --->"
809  << " halfstrip = " << std::setw(3) << hstrip << " best pid = " << std::setw(2) << best_pid[hstrip]
810  << " nhits = " << nhits[hstrip];
811  }
812  }
813  ispretrig[hstrip] = false;
814  if (nhits[hstrip] >= nplanes_hit_pretrig && best_pid[hstrip] >= pid_thresh_pretrig) {
815  pre_trig = true;
816  ispretrig[hstrip] = true;
817 
818  // write each pre-trigger to output
819  nPreTriggers++;
820  const int bend =
822  const int halfstrip = hstrip % CSCConstants::NUM_HALF_STRIPS_PER_CFEB;
823  const int cfeb = hstrip / CSCConstants::NUM_HALF_STRIPS_PER_CFEB;
825  1, nhits[hstrip], best_pid[hstrip], 1, bend, halfstrip, cfeb, bx_time, nPreTriggers, 0));
826  }
827  }
828 
829  if (pre_trig) {
830  first_bx = bx_time; // bx at time of pretrigger
831  return true;
832  }
833  }
834  } // end loop over bx times
835 
836  if (infoV > 1)
837  LogTrace("CSCCathodeLCTProcessor") << "no pretrigger, returning \n";
838  first_bx = fifo_tbins;
839  return false;
840 } // preTrigger -- TMB-07 version.

References trklet::bend(), best_pid, clct_pattern_, CSCConstants::CLCT_PATTERN_WIDTH, fifo_tbins, CSCBaseboard::infoV, ispretrig, CSCConstants::KEY_CLCT_LAYER, LogTrace, nhits, nplanes_hit_pretrig, me0TriggerPseudoDigis_cff::nStrips, CSCConstants::NUM_HALF_STRIPS_PER_CFEB, CSCConstants::NUM_LAYERS, numStrips, patternFinding(), pid_thresh_pretrig, pulse(), stagger, and thePreTriggerDigis.

Referenced by findLCTs(), and CSCUpgradeCathodeLCTProcessor::preTrigger().

◆ preTriggerBXs()

std::vector<int> CSCCathodeLCTProcessor::preTriggerBXs ( ) const
inline

Definition at line 80 of file CSCCathodeLCTProcessor.h.

80 { return thePreTriggerBXs; }

References thePreTriggerBXs.

◆ preTriggerDigis()

std::vector<CSCCLCTPreTriggerDigi> CSCCathodeLCTProcessor::preTriggerDigis ( ) const
inline

read out CLCTs in ME1a , ME1b

Definition at line 83 of file CSCCathodeLCTProcessor.h.

83 { return thePreTriggerDigis; }

References thePreTriggerDigis.

Referenced by preTriggerDigisME1a(), and preTriggerDigisME1b().

◆ preTriggerDigisME1a()

std::vector< CSCCLCTPreTriggerDigi > CSCCathodeLCTProcessor::preTriggerDigisME1a ( ) const

Definition at line 1293 of file CSCCathodeLCTProcessor.cc.

1293  {
1294  std::vector<CSCCLCTPreTriggerDigi> tmpV;
1295  if (not(theStation == 1 and (theRing == 1 or theRing == 4)))
1296  return tmpV;
1297  const std::vector<CSCCLCTPreTriggerDigi>& allPretriggerdigis = preTriggerDigis();
1298  for (const auto& preclct : allPretriggerdigis)
1299  if (preclct.getCFEB() >= 4)
1300  tmpV.push_back(preclct);
1301  return tmpV;
1302 }

References or, preTriggerDigis(), CSCBaseboard::theRing, and CSCBaseboard::theStation.

◆ preTriggerDigisME1b()

std::vector< CSCCLCTPreTriggerDigi > CSCCathodeLCTProcessor::preTriggerDigisME1b ( ) const

Definition at line 1304 of file CSCCathodeLCTProcessor.cc.

1304  {
1305  std::vector<CSCCLCTPreTriggerDigi> tmpV;
1306  if (not(theStation == 1 and (theRing == 1 or theRing == 4)))
1307  return tmpV;
1308  const std::vector<CSCCLCTPreTriggerDigi>& allPretriggerdigis = preTriggerDigis();
1309  for (const auto& preclct : allPretriggerdigis)
1310  if (preclct.getCFEB() < 4)
1311  tmpV.push_back(preclct);
1312  return tmpV;
1313 }

References or, preTriggerDigis(), CSCBaseboard::theRing, and CSCBaseboard::theStation.

◆ pulseExtension()

void CSCCathodeLCTProcessor::pulseExtension ( const std::vector< int >  time[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
const int  nStrips,
PulseArray  pulse 
)
protected

Definition at line 735 of file CSCCathodeLCTProcessor.cc.

738  {
739  static const unsigned int bits_in_pulse = 8 * sizeof(pulse[0][0]);
740 
741  // Clear pulse array. This array will be used as a bit representation of
742  // hit times. For example: if strip[1][2] has a value of 3, then 1 shifted
743  // left 3 will be bit pattern of pulse[1][2]. This would make the pattern
744  // look like 0000000000001000. Then add on additional bits to signify
745  // the duration of a signal (hit_persist, formerly bx_width) to simulate
746  // the TMB's drift delay. So for the same pulse[1][2] with a hit_persist
747  // of 3 would look like 0000000000111000. This is similating the digital
748  // one-shot in the TMB.
749  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++)
750  for (int i_strip = 0; i_strip < nStrips; i_strip++)
751  pulse[i_layer][i_strip] = 0;
752 
753  // Loop over all layers and halfstrips.
754  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
755  for (int i_strip = 0; i_strip < nStrips; i_strip++) {
756  // If there is a hit, simulate digital one-shot persistence starting
757  // in the bx of the initial hit. Fill this into pulse[][].
758  if (!time[i_layer][i_strip].empty()) {
759  std::vector<int> bx_times = time[i_layer][i_strip];
760  for (unsigned int i = 0; i < bx_times.size(); i++) {
761  // Check that min and max times are within the allowed range.
762  if (bx_times[i] < 0 || bx_times[i] + hit_persist >= bits_in_pulse) {
763  if (infoV > 0)
764  edm::LogWarning("L1CSCTPEmulatorOutOfTimeDigi")
765  << "+++ BX time of comparator digi (halfstrip = " << i_strip << " layer = " << i_layer
766  << ") bx = " << bx_times[i] << " is not within the range (0-" << bits_in_pulse
767  << "] allowed for pulse extension. Skip this digi! +++\n";
768  continue;
769  }
770  if (bx_times[i] >= start_bx_shift) {
771  for (unsigned int bx = bx_times[i]; bx < bx_times[i] + hit_persist; ++bx)
772  pulse[i_layer][i_strip] = pulse[i_layer][i_strip] | (1 << bx);
773  }
774  }
775  }
776  }
777  }
778 } // pulseExtension.

References simKBmtfDigis_cfi::bx, relativeConstraints::empty, hit_persist, mps_fire::i, CSCBaseboard::infoV, me0TriggerPseudoDigis_cff::nStrips, CSCConstants::NUM_LAYERS, pulse(), start_bx_shift, and ntuplemaker::time.

Referenced by CSCUpgradeCathodeLCTProcessor::findLCTs(), and findLCTs().

◆ readComparatorDigis()

void CSCCathodeLCTProcessor::readComparatorDigis ( std::vector< int >  halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
protected

Definition at line 431 of file CSCCathodeLCTProcessor.cc.

432  {
433  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
434  int i_digi = 0; // digi counter, for dumps.
435  for (std::vector<CSCComparatorDigi>::iterator pld = digiV[i_layer].begin(); pld != digiV[i_layer].end();
436  pld++, i_digi++) {
437  // Dump raw digi info.
438  if (infoV > 1) {
439  std::ostringstream strstrm;
440  strstrm << "Comparator digi: comparator = " << pld->getComparator() << " strip #" << pld->getStrip()
441  << " time bins on:";
442  std::vector<int> bx_times = pld->getTimeBinsOn();
443  for (unsigned int tbin = 0; tbin < bx_times.size(); tbin++)
444  strstrm << " " << bx_times[tbin];
445  LogTrace("CSCCathodeLCTProcessor") << strstrm.str();
446  }
447 
448  // Get comparator: 0/1 for left/right halfstrip for each comparator
449  // that fired.
450  int thisComparator = pld->getComparator();
451  if (thisComparator != 0 && thisComparator != 1) {
452  if (infoV >= 0)
453  edm::LogWarning("L1CSCTPEmulatorWrongInput")
454  << "+++ station " << theStation << " ring " << theRing << " chamber " << theChamber
455  << " Found comparator digi with wrong comparator value = " << thisComparator << "; skipping it... +++\n";
456  continue;
457  }
458 
459  // Get strip number.
460  int thisStrip = pld->getStrip() - 1; // count from 0
461  if (thisStrip < 0 || thisStrip >= numStrips) {
462  if (infoV >= 0)
463  edm::LogWarning("L1CSCTPEmulatorWrongInput")
464  << "+++ station " << theStation << " ring " << theRing << " chamber " << theChamber
465  << " Found comparator digi with wrong strip number = " << thisStrip << " (max strips = " << numStrips
466  << "); skipping it... +++\n";
467  continue;
468  }
469  // 2*strip: convert strip to 1/2 strip
470  // comp : comparator output
471  // stagger: stagger for this layer
472  int thisHalfstrip = 2 * thisStrip + thisComparator + stagger[i_layer];
473  if (thisHalfstrip >= 2 * numStrips + 1) {
474  if (infoV >= 0)
475  edm::LogWarning("L1CSCTPEmulatorWrongInput")
476  << "+++ station " << theStation << " ring " << theRing << " chamber " << theChamber
477  << " Found wrong halfstrip number = " << thisHalfstrip << "; skipping this digi... +++\n";
478  continue;
479  }
480 
481  // Get bx times on this digi and check that they are within the bounds.
482  std::vector<int> bx_times = pld->getTimeBinsOn();
483  for (unsigned int i = 0; i < bx_times.size(); i++) {
484  // Total number of time bins in DAQ readout is given by fifo_tbins,
485  // which thus determines the maximum length of time interval.
486  //
487  // In data, only the CLCT in the time bin that was matched with L1A are read out
488  // while comparator digi is read out by 12 time bin, which includes 12 time bin info
489  // in other word, CLCTs emulated from comparator digis usually showed the OTMB behavior in 12 time bin
490  // while CLCT from data only showed 1 time bin OTMB behavior
491  // the CLCT emulated from comparator digis usually is centering at time bin 7 (BX7) and
492  // it is definitly safe to ignore any CLCTs in bx 0 or 1 and those CLCTs will never impacts on any triggers
493  if (bx_times[i] > 1 && bx_times[i] < static_cast<int>(fifo_tbins)) {
494  if (i == 0 || (i > 0 && bx_times[i] - bx_times[i - 1] >= static_cast<int>(hit_persist))) {
495  // A later hit on the same strip is ignored during the
496  // number of clocks defined by the "hit_persist" parameter
497  // (i.e., 6 bx's by default).
498  if (infoV > 1)
499  LogTrace("CSCCathodeLCTProcessor")
500  << "Comp digi: layer " << i_layer + 1 << " digi #" << i_digi + 1 << " strip " << thisStrip
501  << " halfstrip " << thisHalfstrip << " time " << bx_times[i] << " comparator " << thisComparator
502  << " stagger " << stagger[i_layer];
503  halfstrip[i_layer][thisHalfstrip].push_back(bx_times[i]);
504  } else if (i > 0) {
505  if (infoV > 1)
506  LogTrace("CSCCathodeLCTProcessor")
507  << "+++ station " << theStation << " ring " << theRing << " chamber " << theChamber
508  << " Skipping comparator digi: strip = " << thisStrip << ", layer = " << i_layer + 1
509  << ", bx = " << bx_times[i] << ", bx of previous hit = " << bx_times[i - 1];
510  }
511  } else {
512  if (infoV > 1)
513  LogTrace("CSCCathodeLCTProcessor") << "+++ station " << theStation << " ring " << theRing << " chamber "
514  << theChamber << "+++ Skipping comparator digi: strip = " << thisStrip
515  << ", layer = " << i_layer + 1 << ", bx = " << bx_times[i] << " +++";
516  }
517  }
518  }
519  }
520 }

References begin, digiV, fifo_tbins, hit_persist, mps_fire::i, CSCBaseboard::infoV, LogTrace, CSCConstants::NUM_LAYERS, numStrips, stagger, CSCBaseboard::theChamber, CSCBaseboard::theRing, and CSCBaseboard::theStation.

Referenced by run().

◆ readoutCLCTs()

std::vector< CSCCLCTDigi > CSCCathodeLCTProcessor::readoutCLCTs ( int  nMaxCLCTs = CSCConstants::MAX_CLCTS_READOUT) const

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

Definition at line 1181 of file CSCCathodeLCTProcessor.cc.

1181  {
1182  std::vector<CSCCLCTDigi> tmpV;
1183 
1184  // The start time of the L1A*CLCT coincidence window should be
1185  // related to the fifo_pretrig parameter, but I am not completely
1186  // sure how. For now, just choose it such that the window is
1187  // centered at bx=7. This may need further tweaking if the value of
1188  // tmb_l1a_window_size changes.
1189 
1190  // The number of CLCT bins in the read-out is given by the
1191  // tmb_l1a_window_size parameter, but made even by setting the LSB
1192  // of tmb_l1a_window_size to 0.
1193  //
1194  static std::atomic<int> lct_bins;
1195  lct_bins = (tmb_l1a_window_size % 2 == 0) ? tmb_l1a_window_size : tmb_l1a_window_size - 1;
1196  static std::atomic<int> late_tbins;
1197  late_tbins = early_tbins + lct_bins;
1198 
1199  static std::atomic<int> ifois{0};
1200  if (ifois == 0) {
1201  if (infoV >= 0 && early_tbins < 0) {
1202  edm::LogWarning("L1CSCTPEmulatorSuspiciousParameters")
1203  << "+++ early_tbins = " << early_tbins << "; in-time CLCTs are not getting read-out!!! +++"
1204  << "\n";
1205  }
1206 
1207  if (late_tbins > CSCConstants::MAX_CLCT_TBINS - 1) {
1208  if (infoV >= 0)
1209  edm::LogWarning("L1CSCTPEmulatorSuspiciousParameters")
1210  << "+++ Allowed range of time bins, [0-" << late_tbins << "] exceeds max allowed, "
1211  << CSCConstants::MAX_CLCT_TBINS - 1 << " +++\n"
1212  << "+++ Set late_tbins to max allowed +++\n";
1213  late_tbins = CSCConstants::MAX_CLCT_TBINS - 1;
1214  }
1215  ifois = 1;
1216  }
1217 
1218  // Start from the vector of all found CLCTs and select those within
1219  // the CLCT*L1A coincidence window.
1220  int bx_readout = -1;
1221  const std::vector<CSCCLCTDigi>& all_lcts = getCLCTs(nMaxCLCTs);
1222  for (const auto& p : all_lcts) {
1223  // only consider valid CLCTs
1224  if (!p.isValid())
1225  continue;
1226 
1227  const int bx = p.getBX();
1228  // Skip CLCTs found too early relative to L1Accept.
1229  if (bx <= early_tbins) {
1230  if (infoV > 1)
1231  LogDebug("CSCCathodeLCTProcessor")
1232  << " Do not report CLCT on key halfstrip " << p.getKeyStrip() << ": found at bx " << bx
1233  << ", whereas the earliest allowed bx is " << early_tbins + 1;
1234  continue;
1235  }
1236 
1237  // Skip CLCTs found too late relative to L1Accept.
1238  if (bx > late_tbins) {
1239  if (infoV > 1)
1240  LogDebug("CSCCathodeLCTProcessor")
1241  << " Do not report CLCT on key halfstrip " << p.getKeyStrip() << ": found at bx " << bx
1242  << ", whereas the latest allowed bx is " << late_tbins;
1243  continue;
1244  }
1245 
1246  // If (readout_earliest_2) take only CLCTs in the earliest bx in the read-out window:
1247  // in digi->raw step, LCTs have to be packed into the TMB header, and
1248  // currently there is room just for two.
1249  if (readout_earliest_2) {
1250  if (bx_readout == -1 || bx == bx_readout) {
1251  tmpV.push_back(p);
1252  if (bx_readout == -1)
1253  bx_readout = bx;
1254  }
1255  } else
1256  tmpV.push_back(p);
1257  }
1258 
1259  // do a final check on the CLCTs in readout
1260  for (const auto& clct : tmpV) {
1261  checkValid(clct, nMaxCLCTs);
1262  }
1263 
1264  return tmpV;
1265 }

References simKBmtfDigis_cfi::bx, checkValid(), early_tbins, getCLCTs(), CSCBaseboard::infoV, LogDebug, CSCConstants::MAX_CLCT_TBINS, AlCaHLTBitMon_ParallelJobs::p, readout_earliest_2, and tmb_l1a_window_size.

Referenced by readoutCLCTsME1a(), and readoutCLCTsME1b().

◆ readoutCLCTsME1a()

std::vector< CSCCLCTDigi > CSCCathodeLCTProcessor::readoutCLCTsME1a ( int  nMaxCLCTs = CSCConstants::MAX_CLCTS_READOUT) const

Definition at line 1269 of file CSCCathodeLCTProcessor.cc.

1269  {
1270  std::vector<CSCCLCTDigi> tmpV;
1271  if (not(theStation == 1 and (theRing == 1 or theRing == 4)))
1272  return tmpV;
1273  const std::vector<CSCCLCTDigi>& allCLCTs = readoutCLCTs(nMaxCLCTs);
1274  for (const auto& clct : allCLCTs)
1275  if (clct.getCFEB() >= 4)
1276  tmpV.push_back(clct);
1277  return tmpV;
1278 }

References or, readoutCLCTs(), CSCBaseboard::theRing, and CSCBaseboard::theStation.

◆ readoutCLCTsME1b()

std::vector< CSCCLCTDigi > CSCCathodeLCTProcessor::readoutCLCTsME1b ( int  nMaxCLCTs = CSCConstants::MAX_CLCTS_READOUT) const

Definition at line 1282 of file CSCCathodeLCTProcessor.cc.

1282  {
1283  std::vector<CSCCLCTDigi> tmpV;
1284  if (not(theStation == 1 and (theRing == 1 or theRing == 4)))
1285  return tmpV;
1286  const std::vector<CSCCLCTDigi>& allCLCTs = readoutCLCTs(nMaxCLCTs);
1287  for (const auto& clct : allCLCTs)
1288  if (clct.getCFEB() < 4)
1289  tmpV.push_back(clct);
1290  return tmpV;
1291 }

References or, readoutCLCTs(), CSCBaseboard::theRing, and CSCBaseboard::theStation.

◆ run() [1/2]

std::vector< CSCCLCTDigi > CSCCathodeLCTProcessor::run ( const CSCComparatorDigiCollection compdc)

Runs the LCT processor code. Called in normal running – gets info from a collection of comparator digis.

Definition at line 195 of file CSCCathodeLCTProcessor.cc.

195  {
196  // This is the version of the run() function that is called when running
197  // over the entire detector. It gets the comparator & timing info from the
198  // comparator digis and then passes them on to another run() function.
199 
200  static std::atomic<bool> config_dumped{false};
201  if ((infoV > 0) && !config_dumped) {
203  config_dumped = true;
204  }
205 
206  // Get the number of strips and stagger of layers for the given chamber.
207  // Do it only once per chamber.
208  if (numStrips <= 0 or numStrips > CSCConstants::MAX_NUM_STRIPS_7CFEBS) {
209  if (cscChamber_) {
211  // ME1/a is known to the readout hardware as strips 65-80 of ME1/1.
212  // Still need to decide whether we do any special adjustments to
213  // reconstruct LCTs in this region (3:1 ganged strips); for now, we
214  // simply allow for hits in ME1/a and apply standard reconstruction
215  // to them.
216  // For SLHC ME1/1 is set to have 4 CFEBs in ME1/b and 3 CFEBs in ME1/a
217  if (isME11_) {
218  if (theRing == 4) {
219  edm::LogError("CSCCathodeLCTProcessor|SetupError")
220  << "+++ Invalid ring number for this processor " << theRing << " was set in the config."
221  << " +++\n"
222  << "+++ CSC geometry looks garbled; no emulation possible +++\n";
223  }
224  if (!disableME1a_ && theRing == 1 && !gangedME1a_)
226  if (!disableME1a_ && theRing == 1 && gangedME1a_)
228  if (disableME1a_ && theRing == 1)
230  }
231 
233  edm::LogError("CSCCathodeLCTProcessor|SetupError")
234  << "+++ Number of strips, " << numStrips << " found in " << theCSCName_ << " (sector " << theSector
235  << " subsector " << theSubsector << " trig id. " << theTrigChamber << ")"
236  << " exceeds max expected, " << CSCConstants::MAX_NUM_STRIPS_7CFEBS << " +++\n"
237  << "+++ CSC geometry looks garbled; no emulation possible +++\n";
238  numStrips = -1;
239  }
240  // The strips for a given layer may be offset from the adjacent layers.
241  // This was done in order to improve resolution. We need to find the
242  // 'staggering' for each layer and make necessary conversions in our
243  // arrays. -JM
244  // In the TMB-07 firmware, half-strips in odd layers (layers are
245  // counted as ly0-ly5) are shifted by -1 half-strip, whereas in
246  // the previous firmware versions half-strips in even layers
247  // were shifted by +1 half-strip. This difference is due to a
248  // change from ly3 to ly2 in the choice of the key layer, and
249  // the intention to keep half-strips in the key layer unchanged.
250  // In the emulator, we use the old way for both cases, to avoid
251  // negative half-strip numbers. This will necessitate a
252  // subtraction of 1 half-strip for TMB-07 later on. -SV.
253  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
254  stagger[i_layer] = (cscChamber_->layer(i_layer + 1)->geometry()->stagger() + 1) / 2;
255  }
256  } else {
257  edm::LogError("CSCCathodeLCTProcessor|ConfigError")
258  << " " << theCSCName_ << " (sector " << theSector << " subsector " << theSubsector << " trig id. "
259  << theTrigChamber << ")"
260  << " is not defined in current geometry! +++\n"
261  << "+++ CSC geometry looks garbled; no emulation possible +++\n";
262  numStrips = -1;
263  }
264  }
265 
267  edm::LogError("CSCCathodeLCTProcessor|ConfigError")
268  << " " << theCSCName_ << " (sector " << theSector << " subsector " << theSubsector << " trig id. "
269  << theTrigChamber << "):"
270  << " numStrips = " << numStrips << "; CLCT emulation skipped! +++";
271  std::vector<CSCCLCTDigi> emptyV;
272  return emptyV;
273  }
274 
275  // Get comparator digis in this chamber.
276  bool noDigis = getDigis(compdc);
277 
278  if (!noDigis) {
279  // Get halfstrip times from comparator digis.
281  readComparatorDigis(halfstrip);
282 
283  // Pass arrays of halfstrips on to another run() doing the
284  // LCT search.
285  // If the number of layers containing digis is smaller than that
286  // required to trigger, quit right away. (If LCT-based digi suppression
287  // is implemented one day, this condition will have to be changed
288  // to the number of planes required to pre-trigger.)
289  unsigned int layersHit = 0;
290  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
291  for (int i_hstrip = 0; i_hstrip < CSCConstants::NUM_HALF_STRIPS_7CFEBS; i_hstrip++) {
292  if (!halfstrip[i_layer][i_hstrip].empty()) {
293  layersHit++;
294  break;
295  }
296  }
297  }
298  // Run the algorithm only if the probability for the pre-trigger
299  // to fire is not null. (Pre-trigger decisions are used for the
300  // strip read-out conditions in DigiToRaw.)
301  if (layersHit >= nplanes_hit_pretrig)
302  run(halfstrip);
303  }
304 
305  // Return vector of CLCTs.
306  std::vector<CSCCLCTDigi> tmpV = getCLCTs();
307 
308  // shift the BX from 7 to 8
309  // the unpacked real data CLCTs have central BX at bin 7
310  // however in simulation the central BX is bin 8
311  // to make a proper comparison with ALCTs we need
312  // CLCT and ALCT to have the central BX in the same bin
313  // this shift does not affect the readout of the CLCTs
314  // emulated CLCTs put in the event should be centered at bin 7 (as in data)
315  for (auto& p : tmpV) {
316  p.setBX(p.getBX() + alctClctOffset_);
317  }
318 
319  return tmpV;
320 }

References CSCBaseboard::alctClctOffset_, CSCBaseboard::cscChamber_, CSCBaseboard::disableME1a_, dumpConfigParams(), relativeConstraints::empty, CSCBaseboard::gangedME1a_, CSCLayer::geometry(), csctp::get_csc_max_halfstrip(), getCLCTs(), getDigis(), CSCBaseboard::infoV, CSCBaseboard::isME11_, CSCChamber::layer(), CSCConstants::MAX_NUM_STRIPS, CSCConstants::MAX_NUM_STRIPS_7CFEBS, CSCConstants::MAX_NUM_STRIPS_ME1B, nplanes_hit_pretrig, CSCConstants::NUM_HALF_STRIPS_7CFEBS, CSCConstants::NUM_LAYERS, CSCLayerGeometry::numberOfStrips(), numStrips, or, AlCaHLTBitMon_ParallelJobs::p, readComparatorDigis(), CSCLayerGeometry::stagger(), stagger, CSCBaseboard::theCSCName_, CSCBaseboard::theRing, CSCBaseboard::theSector, CSCBaseboard::theStation, CSCBaseboard::theSubsector, and CSCBaseboard::theTrigChamber.

◆ run() [2/2]

void CSCCathodeLCTProcessor::run ( const std::vector< int >  halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])

Called in test mode and by the run(compdc) function; does the actual LCT finding.

Definition at line 322 of file CSCCathodeLCTProcessor.cc.

323  {
324  // This version of the run() function can either be called in a standalone
325  // test, being passed the halfstrip times, or called by the
326  // run() function above. It uses the findLCTs() method to find vectors
327  // of LCT candidates. These candidates are sorted and the best two per bx
328  // are returned.
329  std::vector<CSCCLCTDigi> CLCTlist = findLCTs(halfstrip);
330 
331  // LCT sorting.
332  if (CLCTlist.size() > 1)
333  sort(CLCTlist.begin(), CLCTlist.end(), std::greater<CSCCLCTDigi>());
334 
335  for (const auto& p : CLCTlist) {
336  const int bx = p.getBX();
338  if (infoV > 0)
339  edm::LogWarning("L1CSCTPEmulatorOutOfTimeCLCT")
340  << "+++ Bx of CLCT candidate, " << bx << ", exceeds max allowed, " << CSCConstants::MAX_CLCT_TBINS - 1
341  << "; skipping it... +++\n";
342  continue;
343  }
344 
345  if (!bestCLCT[bx].isValid()) {
346  bestCLCT[bx] = p;
347  } else if (!secondCLCT[bx].isValid()) {
348  secondCLCT[bx] = p;
349  }
350  }
351 
352  for (int bx = 0; bx < CSCConstants::MAX_CLCT_TBINS; bx++) {
353  if (bestCLCT[bx].isValid()) {
354  bestCLCT[bx].setTrknmb(1);
355 
356  // check if the LCT is valid
358 
359  if (infoV > 0)
360  LogDebug("CSCCathodeLCTProcessor")
362  << " (sector " << theSector << " subsector " << theSubsector << " trig id. " << theTrigChamber << ")"
363  << "\n";
364  }
365  if (secondCLCT[bx].isValid()) {
366  secondCLCT[bx].setTrknmb(2);
367 
368  // check if the LCT is valid
370 
371  if (infoV > 0)
372  LogDebug("CSCCathodeLCTProcessor")
374  << " (sector " << theSector << " subsector " << theSubsector << " trig id. " << theTrigChamber << ")"
375  << "\n";
376  }
377  }
378  // Now that we have our best CLCTs, they get correlated with the best
379  // ALCTs and then get sent to the MotherBoard. -JM
380 }

References bestCLCT, simKBmtfDigis_cfi::bx, CSCDetId::chamberName(), checkValid(), findLCTs(), CSCBaseboard::infoV, LogDebug, CSCConstants::MAX_CLCT_TBINS, AlCaHLTBitMon_ParallelJobs::p, secondCLCT, CSCCLCTDigi::setTrknmb(), CSCBaseboard::theChamber, CSCBaseboard::theEndcap, CSCBaseboard::theRing, CSCBaseboard::theSector, CSCBaseboard::theStation, CSCBaseboard::theSubsector, and CSCBaseboard::theTrigChamber.

◆ setConfigParameters()

void CSCCathodeLCTProcessor::setConfigParameters ( const CSCDBL1TPParameters conf)

◆ setDefaultConfigParameters()

void CSCCathodeLCTProcessor::setDefaultConfigParameters ( )
protected

Member Data Documentation

◆ best_pid

unsigned int CSCCathodeLCTProcessor::best_pid[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
protected

◆ bestCLCT

CSCCLCTDigi CSCCathodeLCTProcessor::bestCLCT[CSCConstants::MAX_CLCT_TBINS]
protected

Best LCT in this chamber, as found by the processor.

Definition at line 89 of file CSCCathodeLCTProcessor.h.

Referenced by clear(), getBestCLCT(), getCLCTs(), and run().

◆ clct_pattern_

CSCPatternBank::CLCTPatterns CSCCathodeLCTProcessor::clct_pattern_ = {}
protected

◆ def_drift_delay

const unsigned int CSCCathodeLCTProcessor::def_drift_delay = 2
staticprotected

Definition at line 211 of file CSCCathodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

◆ def_fifo_pretrig

const unsigned int CSCCathodeLCTProcessor::def_fifo_pretrig = 7
staticprotected

Definition at line 210 of file CSCCathodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

◆ def_fifo_tbins

const unsigned int CSCCathodeLCTProcessor::def_fifo_tbins = 12
staticprotected

Default values of configuration parameters.

Definition at line 210 of file CSCCathodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

◆ def_hit_persist

const unsigned int CSCCathodeLCTProcessor::def_hit_persist = 6
staticprotected

Definition at line 211 of file CSCCathodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

◆ def_min_separation

const unsigned int CSCCathodeLCTProcessor::def_min_separation = 10
staticprotected

Definition at line 214 of file CSCCathodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

◆ def_nplanes_hit_pattern

const unsigned int CSCCathodeLCTProcessor::def_nplanes_hit_pattern = 4
staticprotected

Definition at line 213 of file CSCCathodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

◆ def_nplanes_hit_pretrig

const unsigned int CSCCathodeLCTProcessor::def_nplanes_hit_pretrig = 2
staticprotected

Definition at line 212 of file CSCCathodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

◆ def_pid_thresh_pretrig

const unsigned int CSCCathodeLCTProcessor::def_pid_thresh_pretrig = 2
staticprotected

Definition at line 214 of file CSCCathodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

◆ def_tmb_l1a_window_size

const unsigned int CSCCathodeLCTProcessor::def_tmb_l1a_window_size = 7
staticprotected

Definition at line 215 of file CSCCathodeLCTProcessor.h.

Referenced by checkConfigParameters(), and setDefaultConfigParameters().

◆ digiV

std::vector<CSCComparatorDigi> CSCCathodeLCTProcessor::digiV[CSCConstants::NUM_LAYERS]
protected

Definition at line 182 of file CSCCathodeLCTProcessor.h.

Referenced by getDigis(), and readComparatorDigis().

◆ drift_delay

unsigned int CSCCathodeLCTProcessor::drift_delay
protected

◆ early_tbins

int CSCCathodeLCTProcessor::early_tbins
protected

VK: separate handle for early time bins

Definition at line 197 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), and readoutCLCTs().

◆ fifo_pretrig

unsigned int CSCCathodeLCTProcessor::fifo_pretrig
protected

◆ fifo_tbins

unsigned int CSCCathodeLCTProcessor::fifo_tbins
protected

◆ first_bx_corrected

int CSCCathodeLCTProcessor::first_bx_corrected[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
protected

◆ hit_persist

unsigned int CSCCathodeLCTProcessor::hit_persist
protected

◆ hitsCLCT

PulseArray CSCCathodeLCTProcessor::hitsCLCT[99]
protected

Definition at line 207 of file CSCCathodeLCTProcessor.h.

◆ ispretrig

bool CSCCathodeLCTProcessor::ispretrig[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
protected

◆ min_separation

unsigned int CSCCathodeLCTProcessor::min_separation
protected

◆ nhits

unsigned int CSCCathodeLCTProcessor::nhits[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
protected

◆ nplanes_hit_pattern

unsigned int CSCCathodeLCTProcessor::nplanes_hit_pattern
protected

◆ nplanes_hit_pretrig

unsigned int CSCCathodeLCTProcessor::nplanes_hit_pretrig
protected

◆ numStrips

int CSCCathodeLCTProcessor::numStrips
protected

◆ pid_thresh_pretrig

unsigned int CSCCathodeLCTProcessor::pid_thresh_pretrig
protected

◆ readout_earliest_2

bool CSCCathodeLCTProcessor::readout_earliest_2
protected

VK: whether to readout only the earliest two LCTs in readout window

Definition at line 200 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), and readoutCLCTs().

◆ secondCLCT

CSCCLCTDigi CSCCathodeLCTProcessor::secondCLCT[CSCConstants::MAX_CLCT_TBINS]
protected

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

Definition at line 92 of file CSCCathodeLCTProcessor.h.

Referenced by clear(), getCLCTs(), getSecondCLCT(), and run().

◆ stagger

int CSCCathodeLCTProcessor::stagger[CSCConstants::NUM_LAYERS]
protected

◆ start_bx_shift

int CSCCathodeLCTProcessor::start_bx_shift
protected

VK: some quick and dirty fix to reduce CLCT deadtime

Definition at line 194 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor(), CSCUpgradeCathodeLCTProcessor::findLCTs(), findLCTs(), and pulseExtension().

◆ thePreTriggerBXs

std::vector<int> CSCCathodeLCTProcessor::thePreTriggerBXs
protected

Definition at line 183 of file CSCCathodeLCTProcessor.h.

Referenced by clear(), findLCTs(), and preTriggerBXs().

◆ thePreTriggerDigis

std::vector<CSCCLCTPreTriggerDigi> CSCCathodeLCTProcessor::thePreTriggerDigis
protected

◆ tmb_l1a_window_size

unsigned int CSCCathodeLCTProcessor::tmb_l1a_window_size
protected

◆ use_comparator_codes_

bool CSCCathodeLCTProcessor::use_comparator_codes_
protected

Definition at line 204 of file CSCCathodeLCTProcessor.h.

Referenced by CSCCathodeLCTProcessor().

◆ use_run3_patterns_

bool CSCCathodeLCTProcessor::use_run3_patterns_
protected

Definition at line 203 of file CSCCathodeLCTProcessor.h.

Referenced by checkValid(), and CSCCathodeLCTProcessor().

CSCCathodeLCTProcessor::markBusyKeys
void markBusyKeys(const int best_hstrip, const int best_patid, int quality[CSCConstants::NUM_HALF_STRIPS_7CFEBS])
Definition: CSCCathodeLCTProcessor.cc:990
CSCCLCTDigi::setTrknmb
void setTrknmb(const uint16_t number)
Set track number (1,2) after sorting CLCTs.
Definition: CSCCLCTDigi.h:116
mps_fire.i
i
Definition: mps_fire.py:355
CSCBaseboard::theEndcap
const unsigned theEndcap
Definition: CSCBaseboard.h:42
CSCBaseboard::clctParams_
edm::ParameterSet clctParams_
Definition: CSCBaseboard.h:77
CSCChamber::layer
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
Definition: CSCChamber.cc:30
CSCCathodeLCTProcessor::stagger
int stagger[CSCConstants::NUM_LAYERS]
Definition: CSCCathodeLCTProcessor.h:180
CSCBaseboard::cscChamber_
const CSCChamber * cscChamber_
Definition: CSCBaseboard.h:65
CSCBaseboard::theSector
const unsigned theSector
Definition: CSCBaseboard.h:44
CSCCathodeLCTProcessor::dumpConfigParams
void dumpConfigParams() const
Definition: CSCCathodeLCTProcessor.cc:1015
CSCBaseboard::tmbParams_
edm::ParameterSet tmbParams_
Definition: CSCBaseboard.h:71
relativeConstraints.station
station
Definition: relativeConstraints.py:67
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
CSCBaseboard::disableME1a_
bool disableME1a_
Definition: CSCBaseboard.h:87
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CSCCathodeLCTProcessor::fifo_tbins
unsigned int fifo_tbins
Definition: CSCCathodeLCTProcessor.h:187
CSCCathodeLCTProcessor::dumpDigis
void dumpDigis(const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips) const
Definition: CSCCathodeLCTProcessor.cc:1034
CSCBaseboard::theStation
const unsigned theStation
Definition: CSCBaseboard.h:43
csctp::get_csc_min_max_pattern
std::pair< unsigned, unsigned > get_csc_min_max_pattern(bool isRun3)
Definition: CSCLCTTools.cc:76
CSCDBL1TPParameters::clctNplanesHitPattern
unsigned int clctNplanesHitPattern() const
Definition: CSCDBL1TPParameters.h:65
CSCDBL1TPParameters::clctPidThreshPretrig
unsigned int clctPidThreshPretrig() const
Definition: CSCDBL1TPParameters.h:68
CSCBaseboard::theCSCName_
std::string theCSCName_
Definition: CSCBaseboard.h:80
pulse
double pulse(double x, double y, double z, double t)
Definition: SiStripPulseShape.cc:49
CSCPatternBank::clct_pattern_legacy_
static const CLCTPatterns clct_pattern_legacy_
Definition: CSCPatternBank.h:42
CSCCathodeLCTProcessor::readComparatorDigis
void readComparatorDigis(std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
Definition: CSCCathodeLCTProcessor.cc:431
CSCCathodeLCTProcessor::use_comparator_codes_
bool use_comparator_codes_
Definition: CSCCathodeLCTProcessor.h:204
MessageLogger_cfi.errors
errors
Definition: MessageLogger_cfi.py:18
CSCCathodeLCTProcessor::readoutCLCTs
std::vector< CSCCLCTDigi > readoutCLCTs(int nMaxCLCTs=CSCConstants::MAX_CLCTS_READOUT) const
Definition: CSCCathodeLCTProcessor.cc:1181
CSCCathodeLCTProcessor::CLCT_PATTERN
Definition: CSCCathodeLCTProcessor.h:166
CSCCathodeLCTProcessor::getDigis
bool getDigis(const CSCComparatorDigiCollection *compdc)
Definition: CSCCathodeLCTProcessor.cc:382
CSCDBL1TPParameters::clctFifoTbins
unsigned int clctFifoTbins() const
Definition: CSCDBL1TPParameters.h:50
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:89
CSCCathodeLCTProcessor::def_nplanes_hit_pattern
static const unsigned int def_nplanes_hit_pattern
Definition: CSCCathodeLCTProcessor.h:213
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
csctp::get_csc_min_max_cfeb
std::pair< unsigned, unsigned > get_csc_min_max_cfeb(int station, int ring)
Definition: CSCLCTTools.cc:65
CSCCathodeLCTProcessor::def_drift_delay
static const unsigned int def_drift_delay
Definition: CSCCathodeLCTProcessor.h:211
CSCCLCTDigi
Definition: CSCCLCTDigi.h:17
CSCConstants::MAX_CLCTS_PER_PROCESSOR
Definition: CSCConstants.h:67
CSCCathodeLCTProcessor::early_tbins
int early_tbins
Definition: CSCCathodeLCTProcessor.h:197
MuonDigiCollection::const_iterator
std::vector< DigiType >::const_iterator const_iterator
Definition: MuonDigiCollection.h:94
simKBmtfDigis_cfi.bx
bx
Definition: simKBmtfDigis_cfi.py:55
CSCCathodeLCTProcessor::def_fifo_tbins
static const unsigned int def_fifo_tbins
Definition: CSCCathodeLCTProcessor.h:210
CSCDBL1TPParameters::clctDriftDelay
unsigned int clctDriftDelay() const
Definition: CSCDBL1TPParameters.h:59
CSCCathodeLCTProcessor::thePreTriggerDigis
std::vector< CSCCLCTPreTriggerDigi > thePreTriggerDigis
Definition: CSCCathodeLCTProcessor.h:184
CSCConstants::MAX_NUM_STRIPS
Definition: CSCConstants.h:24
CSCCathodeLCTProcessor::readout_earliest_2
bool readout_earliest_2
Definition: CSCCathodeLCTProcessor.h:200
CSCCathodeLCTProcessor::INVALID_HALFSTRIP
Definition: CSCCathodeLCTProcessor.h:129
csctp::get_csc_max_quartstrip
unsigned get_csc_max_quartstrip(int station, int ring)
Definition: CSCLCTTools.cc:61
CSCCathodeLCTProcessor::checkValid
void checkValid(const CSCCLCTDigi &lct, unsigned max_stubs=CSCConstants::MAX_CLCTS_PER_PROCESSOR) const
Definition: CSCCathodeLCTProcessor.cc:1075
CSCCathodeLCTProcessor::pulseExtension
void pulseExtension(const std::vector< int > time[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips, PulseArray pulse)
Definition: CSCCathodeLCTProcessor.cc:735
errors
Definition: errors.py:1
CSCCathodeLCTProcessor::ispretrig
bool ispretrig[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
Definition: CSCCathodeLCTProcessor.h:158
CSCCathodeLCTProcessor::bestCLCT
CSCCLCTDigi bestCLCT[CSCConstants::MAX_CLCT_TBINS]
Definition: CSCCathodeLCTProcessor.h:89
CSCCathodeLCTProcessor::findLCTs
virtual std::vector< CSCCLCTDigi > findLCTs(const std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
Definition: CSCCathodeLCTProcessor.cc:523
CSCConstants::NUM_LAYERS
Definition: CSCConstants.h:46
CSCBaseboard::alctClctOffset_
unsigned int alctClctOffset_
Definition: CSCBaseboard.h:96
CSCCathodeLCTProcessor::first_bx_corrected
int first_bx_corrected[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
Definition: CSCCathodeLCTProcessor.h:155
CSCDBL1TPParameters::clctMinSeparation
unsigned int clctMinSeparation() const
Definition: CSCDBL1TPParameters.h:71
CSCPatternBank::clct_pattern_run3_
static const CLCTPatterns clct_pattern_run3_
Definition: CSCPatternBank.h:45
CSCDBL1TPParameters::clctHitPersist
unsigned int clctHitPersist() const
Definition: CSCDBL1TPParameters.h:56
CSCConstants::MAX_NUM_STRIPS_ME1B
Definition: CSCConstants.h:40
CSCCLCTPreTriggerDigi
Definition: CSCCLCTPreTriggerDigi.h:15
CSCCathodeLCTProcessor::thePreTriggerBXs
std::vector< int > thePreTriggerBXs
Definition: CSCCathodeLCTProcessor.h:183
CSCComparatorDigi
Definition: CSCComparatorDigi.h:16
CSCCathodeLCTProcessor::def_fifo_pretrig
static const unsigned int def_fifo_pretrig
Definition: CSCCathodeLCTProcessor.h:210
CSCCathodeLCTProcessor::def_hit_persist
static const unsigned int def_hit_persist
Definition: CSCCathodeLCTProcessor.h:211
CSCCathodeLCTProcessor::use_run3_patterns_
bool use_run3_patterns_
Definition: CSCCathodeLCTProcessor.h:203
CSCBaseboard::theSubsector
const unsigned theSubsector
Definition: CSCBaseboard.h:45
CSCLayer::geometry
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:44
CSCCathodeLCTProcessor::preTrigger
virtual bool preTrigger(const PulseArray pulse, const int start_bx, int &first_bx)
Definition: CSCCathodeLCTProcessor.cc:781
CSCBaseboard::gangedME1a_
bool gangedME1a_
Definition: CSCBaseboard.h:87
CSCCathodeLCTProcessor::nhits
unsigned int nhits[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
Definition: CSCCathodeLCTProcessor.h:153
CSCCathodeLCTProcessor::def_min_separation
static const unsigned int def_min_separation
Definition: CSCCathodeLCTProcessor.h:214
CSCCathodeLCTProcessor::numStrips
int numStrips
Definition: CSCCathodeLCTProcessor.h:177
edm::LogWarning
Definition: MessageLogger.h:141
CSCCathodeLCTProcessor::CLCT_CFEB
Definition: CSCCathodeLCTProcessor.h:172
CSCCathodeLCTProcessor::run
std::vector< CSCCLCTDigi > run(const CSCComparatorDigiCollection *compdc)
Definition: CSCCathodeLCTProcessor.cc:195
CSCCathodeLCTProcessor::CLCT_STRIP
Definition: CSCCathodeLCTProcessor.h:168
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
CSCCLCTDigi::ComparatorContainer
std::vector< std::vector< uint16_t > > ComparatorContainer
Definition: CSCCLCTDigi.h:19
edm::LogError
Definition: MessageLogger.h:183
CSCCathodeLCTProcessor::preTriggerDigis
std::vector< CSCCLCTPreTriggerDigi > preTriggerDigis() const
Definition: CSCCathodeLCTProcessor.h:83
CSCDBL1TPParameters::clctNplanesHitPretrig
unsigned int clctNplanesHitPretrig() const
Definition: CSCDBL1TPParameters.h:62
CSCCathodeLCTProcessor::CLCT_BEND
Definition: CSCCathodeLCTProcessor.h:167
csctp::get_csc_max_halfstrip
unsigned get_csc_max_halfstrip(int station, int ring)
Definition: CSCLCTTools.cc:39
CSCCathodeLCTProcessor::CLCT_QUALITY
Definition: CSCCathodeLCTProcessor.h:171
CSCCathodeLCTProcessor::secondCLCT
CSCCLCTDigi secondCLCT[CSCConstants::MAX_CLCT_TBINS]
Definition: CSCCathodeLCTProcessor.h:92
CSCBaseboard::CSCBaseboard
CSCBaseboard()
Definition: CSCBaseboard.cc:76
CSCDetId
Definition: CSCDetId.h:26
CSCCathodeLCTProcessor::digiV
std::vector< CSCComparatorDigi > digiV[CSCConstants::NUM_LAYERS]
Definition: CSCCathodeLCTProcessor.h:182
CSCConstants::MAX_NUM_STRIPS_7CFEBS
Definition: CSCConstants.h:25
CSCCathodeLCTProcessor::def_pid_thresh_pretrig
static const unsigned int def_pid_thresh_pretrig
Definition: CSCCathodeLCTProcessor.h:214
CSCCathodeLCTProcessor::tmb_l1a_window_size
unsigned int tmb_l1a_window_size
Definition: CSCCathodeLCTProcessor.h:191
CSCLayerGeometry::stagger
int stagger() const
Definition: CSCLayerGeometry.h:124
CSCCathodeLCTProcessor::def_nplanes_hit_pretrig
static const unsigned int def_nplanes_hit_pretrig
Definition: CSCCathodeLCTProcessor.h:212
CSCCathodeLCTProcessor::hit_persist
unsigned int hit_persist
Definition: CSCCathodeLCTProcessor.h:188
CSCBaseboard::theChamber
unsigned theChamber
Definition: CSCBaseboard.h:49
CSCCathodeLCTProcessor::pid_thresh_pretrig
unsigned int pid_thresh_pretrig
Definition: CSCCathodeLCTProcessor.h:190
CSCCathodeLCTProcessor::PulseArray
unsigned int PulseArray[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS]
Definition: CSCCathodeLCTProcessor.h:104
CSCCathodeLCTProcessor::setDefaultConfigParameters
void setDefaultConfigParameters()
Definition: CSCCathodeLCTProcessor.cc:122
CSCCLCTDigi::getBX
uint16_t getBX() const
return BX
Definition: CSCCLCTDigi.h:99
me0TriggerPseudoDigis_cff.nStrips
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
Definition: me0TriggerPseudoDigis_cff.py:26
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
CSCCathodeLCTProcessor::def_tmb_l1a_window_size
static const unsigned int def_tmb_l1a_window_size
Definition: CSCCathodeLCTProcessor.h:215
CSCCathodeLCTProcessor::fifo_pretrig
unsigned int fifo_pretrig
Definition: CSCCathodeLCTProcessor.h:187
CSCCathodeLCTProcessor::best_pid
unsigned int best_pid[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
Definition: CSCCathodeLCTProcessor.h:150
CSCCathodeLCTProcessor::start_bx_shift
int start_bx_shift
Definition: CSCCathodeLCTProcessor.h:194
csctp::get_csc_max_eightstrip
unsigned get_csc_max_eightstrip(int station, int ring)
Definition: CSCLCTTools.cc:63
CSCCathodeLCTProcessor::clct_pattern_
CSCPatternBank::CLCTPatterns clct_pattern_
Definition: CSCCathodeLCTProcessor.h:161
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
trklet::bend
double bend(double r, double rinv, double stripPitch)
Definition: Util.h:160
CSCConstants::MAX_NUM_STRIPS_ME1A_GANGED
Definition: CSCConstants.h:41
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
CSCCLCTDigi::clear
void clear()
clear this CLCT
Definition: CSCCLCTDigi.cc:68
CSCDetId::chamberName
std::string chamberName() const
Definition: CSCDetId.cc:67
CSCCathodeLCTProcessor::patternFinding
bool patternFinding(const PulseArray pulse, const int nStrips, const unsigned int bx_time, std::map< int, std::map< int, CSCCLCTDigi::ComparatorContainer > > &hits_in_patterns)
Definition: CSCCathodeLCTProcessor.cc:843
CSCCathodeLCTProcessor::nplanes_hit_pretrig
unsigned int nplanes_hit_pretrig
Definition: CSCCathodeLCTProcessor.h:189
CSCConstants::KEY_CLCT_LAYER
Definition: CSCConstants.h:46
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
CSCDBL1TPParameters::clctFifoPretrig
unsigned int clctFifoPretrig() const
Definition: CSCDBL1TPParameters.h:53
CSCConstants::MAX_CLCT_TBINS
Definition: CSCConstants.h:61
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
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:46
CSCCLCTDigi::setBX
void setBX(const uint16_t bx)
set bx
Definition: CSCCLCTDigi.h:102
csctp::get_csc_clct_max_quality
unsigned get_csc_clct_max_quality()
Definition: CSCLCTTools.cc:99
CSCBaseboard::cscId_
CSCDetId cscId_
Definition: CSCBaseboard.h:56
CSCConstants::MAX_NUM_STRIPS_ME1A_UNGANGED
Definition: CSCConstants.h:42
CSCConstants::NUM_HALF_STRIPS_7CFEBS
Definition: CSCConstants.h:28
CSCCathodeLCTProcessor::min_separation
unsigned int min_separation
Definition: CSCCathodeLCTProcessor.h:190
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
CSCConstants::CLCT_PATTERN_WIDTH
Definition: CSCConstants.h:52
CSCLayerGeometry::numberOfStrips
int numberOfStrips() const
Definition: CSCLayerGeometry.h:66
ntuplemaker.time
time
Definition: ntuplemaker.py:310
CSCCathodeLCTProcessor::getCLCTs
std::vector< CSCCLCTDigi > getCLCTs(unsigned nMaxCLCTs=CSCConstants::MAX_CLCTS_PER_PROCESSOR) const
Definition: CSCCathodeLCTProcessor.cc:1316
CSCConstants::NUM_HALF_STRIPS_PER_CFEB
Definition: CSCConstants.h:32
CSCCathodeLCTProcessor::checkConfigParameters
void checkConfigParameters()
Definition: CSCCathodeLCTProcessor.cc:156
CSCCathodeLCTProcessor::CLCT_STRIP_TYPE
Definition: CSCCathodeLCTProcessor.h:170
CSCCathodeLCTProcessor::drift_delay
unsigned int drift_delay
Definition: CSCCathodeLCTProcessor.h:188
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
CSCCathodeLCTProcessor::nplanes_hit_pattern
unsigned int nplanes_hit_pattern
Definition: CSCCathodeLCTProcessor.h:189
begin
#define begin
Definition: vmac.h:32
CSCBaseboard::isME11_
bool isME11_
Definition: CSCBaseboard.h:52
CSCCathodeLCTProcessor::CLCT_BX
Definition: CSCCathodeLCTProcessor.h:169
CSCPatternBank::clct_pattern_offset_
static const int clct_pattern_offset_[CSCConstants::CLCT_PATTERN_WIDTH]
Definition: CSCPatternBank.h:48
CSCConstants::CLCT_EMUL_TIME_OFFSET
Definition: CSCConstants.h:18
CSCCathodeLCTProcessor::cleanComparatorContainer
void cleanComparatorContainer(CSCCLCTDigi::ComparatorContainer &compHits) const
Definition: CSCCathodeLCTProcessor.cc:1003
CSCCathodeLCTProcessor::CLCT_NUM_QUANTITIES
Definition: CSCCathodeLCTProcessor.h:173
CSCBaseboard::infoV
int infoV
Definition: CSCBaseboard.h:62
CSCBaseboard::theRing
unsigned theRing
Definition: CSCBaseboard.h:48