CMS 3D CMS Logo

CSCCathodeLCTProcessor.cc
Go to the documentation of this file.
2 
3 #include <iomanip>
4 #include <memory>
5 
6 // Default values of configuration parameters.
7 const unsigned int CSCCathodeLCTProcessor::def_fifo_tbins = 12;
8 const unsigned int CSCCathodeLCTProcessor::def_fifo_pretrig = 7;
9 const unsigned int CSCCathodeLCTProcessor::def_hit_persist = 6;
10 const unsigned int CSCCathodeLCTProcessor::def_drift_delay = 2;
14 const unsigned int CSCCathodeLCTProcessor::def_min_separation = 10;
16 
17 //----------------
18 // Constructors --
19 //----------------
20 
22  unsigned station,
23  unsigned sector,
24  unsigned subsector,
25  unsigned chamber,
26  const edm::ParameterSet& conf)
27  : CSCBaseboard(endcap, station, sector, subsector, chamber, conf) {
28  static std::atomic<bool> config_dumped{false};
29 
30  // CLCT configuration parameters.
31  fifo_tbins = clctParams_.getParameter<unsigned int>("clctFifoTbins");
32  hit_persist = clctParams_.getParameter<unsigned int>("clctHitPersist");
33  drift_delay = clctParams_.getParameter<unsigned int>("clctDriftDelay");
34  nplanes_hit_pretrig = clctParams_.getParameter<unsigned int>("clctNplanesHitPretrig");
35  nplanes_hit_pattern = clctParams_.getParameter<unsigned int>("clctNplanesHitPattern");
36 
37  // Not used yet.
38  fifo_pretrig = clctParams_.getParameter<unsigned int>("clctFifoPretrig");
39 
40  pid_thresh_pretrig = clctParams_.getParameter<unsigned int>("clctPidThreshPretrig");
41  min_separation = clctParams_.getParameter<unsigned int>("clctMinSeparation");
42 
43  start_bx_shift = clctParams_.getParameter<int>("clctStartBxShift");
44 
45  // Motherboard parameters: common for all configurations.
46  tmb_l1a_window_size = // Common to CLCT and TMB
47  tmbParams_.getParameter<unsigned int>("tmbL1aWindowSize");
48 
49  /*
50  In Summer 2021 the CLCT readout function was updated so that the
51  window is based on a number of time bins around the central CLCT
52  time BX7. In the past the window was based on early_tbins and late_tbins.
53  The parameter is kept, but is not used.
54  */
55  early_tbins = tmbParams_.getParameter<int>("tmbEarlyTbins");
56  if (early_tbins < 0)
58 
59  // wether to readout only the earliest two LCTs in readout window
60  readout_earliest_2 = tmbParams_.getParameter<bool>("tmbReadoutEarliest2");
61 
62  // Verbosity level, set to 0 (no print) by default.
63  infoV = clctParams_.getParameter<int>("verbosity");
64 
65  // Do not exclude pattern 0 and 1 when the Run-3 patterns are enabled!!
66  // Valid Run-3 patterns are 0,1,2,3,4
67  if (runCCLUT_) {
69  }
70 
71  // Check and print configuration parameters.
73  if ((infoV > 0) && !config_dumped) {
75  config_dumped = true;
76  }
77 
78  numStrips_ = 0; // Will be set later.
79  // Provisional, but should be OK for all stations except ME1.
80  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
81  if ((i_layer + 1) % 2 == 0)
82  stagger[i_layer] = 0;
83  else
84  stagger[i_layer] = 1;
85  }
86 
87  // which patterns should we use?
88  if (runCCLUT_) {
90  // comparator code lookup table algorithm for Phase-2
91  cclut_ = std::make_unique<ComparatorCodeLUT>(conf);
92  } else {
94  }
95 
96  const auto& shower = showerParams_.getParameterSet("cathodeShower");
97  thresholds_ = shower.getParameter<std::vector<unsigned>>("showerThresholds");
98  showerMinInTBin_ = shower.getParameter<unsigned>("showerMinInTBin");
99  showerMaxInTBin_ = shower.getParameter<unsigned>("showerMaxInTBin");
100  showerMinOutTBin_ = shower.getParameter<unsigned>("showerMinOutTBin");
101  showerMaxOutTBin_ = shower.getParameter<unsigned>("showerMaxOutTBin");
102 
103  thePreTriggerDigis.clear();
104 
105  // quality control of stubs
106  qualityControl_ = std::make_unique<LCTQualityControl>(endcap, station, sector, subsector, chamber, conf);
107 }
108 
110  // Set default values for configuration parameters.
120 }
121 
122 // Set configuration parameters obtained via EventSetup mechanism.
124  static std::atomic<bool> config_dumped{false};
125 
126  fifo_tbins = conf->clctFifoTbins();
127  fifo_pretrig = conf->clctFifoPretrig();
128  hit_persist = conf->clctHitPersist();
129  drift_delay = conf->clctDriftDelay();
134 
135  // Check and print configuration parameters.
137  if (!config_dumped) {
139  config_dumped = true;
140  }
141 }
142 
144  // Make sure that the parameter values are within the allowed range.
145 
146  // Max expected values.
147  static const unsigned int max_fifo_tbins = 1 << 5;
148  static const unsigned int max_fifo_pretrig = 1 << 5;
149  static const unsigned int max_hit_persist = 1 << 4;
150  static const unsigned int max_drift_delay = 1 << 2;
151  static const unsigned int max_nplanes_hit_pretrig = 1 << 3;
152  static const unsigned int max_nplanes_hit_pattern = 1 << 3;
153  static const unsigned int max_pid_thresh_pretrig = 1 << 4;
154  static const unsigned int max_min_separation = CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER;
155  static const unsigned int max_tmb_l1a_window_size = 1 << 4;
156 
157  // Checks.
158  CSCBaseboard::checkConfigParameters(fifo_tbins, max_fifo_tbins, def_fifo_tbins, "fifo_tbins");
159  CSCBaseboard::checkConfigParameters(fifo_pretrig, max_fifo_pretrig, def_fifo_pretrig, "fifo_pretrig");
160  CSCBaseboard::checkConfigParameters(hit_persist, max_hit_persist, def_hit_persist, "hit_persist");
161  CSCBaseboard::checkConfigParameters(drift_delay, max_drift_delay, def_drift_delay, "drift_delay");
163  nplanes_hit_pretrig, max_nplanes_hit_pretrig, def_nplanes_hit_pretrig, "nplanes_hit_pretrig");
165  nplanes_hit_pattern, max_nplanes_hit_pattern, def_nplanes_hit_pattern, "nplanes_hit_pattern");
167  pid_thresh_pretrig, max_pid_thresh_pretrig, def_pid_thresh_pretrig, "pid_thresh_pretrig");
168  CSCBaseboard::checkConfigParameters(min_separation, max_min_separation, def_min_separation, "min_separation");
170  tmb_l1a_window_size, max_tmb_l1a_window_size, def_tmb_l1a_window_size, "tmb_l1a_window_size");
171 }
172 
174  thePreTriggerDigis.clear();
175  thePreTriggerBXs.clear();
176  for (int bx = 0; bx < CSCConstants::MAX_CLCT_TBINS; bx++) {
177  bestCLCT[bx].clear();
178  secondCLCT[bx].clear();
179  }
180  inTimeHMT_ = 0;
181  outTimeHMT_ = 0;
182 }
183 
184 std::vector<CSCCLCTDigi> CSCCathodeLCTProcessor::run(const CSCComparatorDigiCollection* compdc) {
185  // This is the version of the run() function that is called when running
186  // over the entire detector. It gets the comparator & timing info from the
187  // comparator digis and then passes them on to another run() function.
188 
189  static std::atomic<bool> config_dumped{false};
190  if ((infoV > 0) && !config_dumped) {
192  config_dumped = true;
193  }
194 
195  // Get the number of strips and stagger of layers for the given chamber.
196  // Do it only once per chamber.
197  if (numStrips_ <= 0 or numStrips_ > CSCConstants::MAX_NUM_STRIPS_RUN2) {
198  if (cscChamber_) {
200 
201  // ME1/a is known to the readout hardware as strips 65-80 of ME1/1.
202  // Still need to decide whether we do any special adjustments to
203  // reconstruct LCTs in this region (3:1 ganged strips); for now, we
204  // simply allow for hits in ME1/a and apply standard reconstruction
205  // to them.
206  // For Phase2 ME1/1 is set to have 4 CFEBs in ME1/b and 3 CFEBs in ME1/a
207  if (isME11_) {
208  if (theRing == 4) {
209  edm::LogError("CSCCathodeLCTProcessor|SetupError")
210  << "+++ Invalid ring number for this processor " << theRing << " was set in the config."
211  << " +++\n"
212  << "+++ CSC geometry looks garbled; no emulation possible +++\n";
213  }
214  if (!disableME1a_ && theRing == 1 && !gangedME1a_)
216  if (!disableME1a_ && theRing == 1 && gangedME1a_)
218  if (disableME1a_ && theRing == 1)
220  }
221 
222  numHalfStrips_ = 2 * numStrips_ + 1;
224 
226  edm::LogError("CSCCathodeLCTProcessor|SetupError")
227  << "+++ Number of strips, " << numStrips_ << " found in " << theCSCName_ << " (sector " << theSector
228  << " subsector " << theSubsector << " trig id. " << theTrigChamber << ")"
229  << " exceeds max expected, " << CSCConstants::MAX_NUM_STRIPS_RUN2 << " +++\n"
230  << "+++ CSC geometry looks garbled; no emulation possible +++\n";
231  numStrips_ = -1;
232  numHalfStrips_ = -1;
233  numCFEBs_ = -1;
234  }
235  // The strips for a given layer may be offset from the adjacent layers.
236  // This was done in order to improve resolution. We need to find the
237  // 'staggering' for each layer and make necessary conversions in our
238  // arrays. -JM
239  // In the TMB-07 firmware, half-strips in odd layers (layers are
240  // counted as ly0-ly5) are shifted by -1 half-strip, whereas in
241  // the previous firmware versions half-strips in even layers
242  // were shifted by +1 half-strip. This difference is due to a
243  // change from ly3 to ly2 in the choice of the key layer, and
244  // the intention to keep half-strips in the key layer unchanged.
245  // In the emulator, we use the old way for both cases, to avoid
246  // negative half-strip numbers. This will necessitate a
247  // subtraction of 1 half-strip for TMB-07 later on. -SV.
248  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
249  stagger[i_layer] = (cscChamber_->layer(i_layer + 1)->geometry()->stagger() + 1) / 2;
250  }
251  } else {
252  edm::LogError("CSCCathodeLCTProcessor|ConfigError")
253  << " " << theCSCName_ << " (sector " << theSector << " subsector " << theSubsector << " trig id. "
254  << theTrigChamber << ")"
255  << " is not defined in current geometry! +++\n"
256  << "+++ CSC geometry looks garbled; no emulation possible +++\n";
257  numStrips_ = -1;
258  numHalfStrips_ = -1;
259  numCFEBs_ = -1;
260  }
261  }
262 
263  if (numStrips_ <= 0 or 2 * (unsigned)numStrips_ > qualityControl_->get_csc_max_halfstrip(theStation, theRing)) {
264  edm::LogError("CSCCathodeLCTProcessor|ConfigError")
265  << " " << theCSCName_ << " (sector " << theSector << " subsector " << theSubsector << " trig id. "
266  << theTrigChamber << "):"
267  << " numStrips_ = " << numStrips_ << "; CLCT emulation skipped! +++";
268  std::vector<CSCCLCTDigi> emptyV;
269  return emptyV;
270  }
271 
272  // Get comparator digis in this chamber.
273  bool hasDigis = getDigis(compdc);
274 
275  if (hasDigis) {
276  // Get halfstrip times from comparator digis.
278  readComparatorDigis(halfStripTimes);
279 
280  // Pass arrays of halfstrips on to another run() doing the
281  // LCT search.
282  // If the number of layers containing digis is smaller than that
283  // required to trigger, quit right away. (If LCT-based digi suppression
284  // is implemented one day, this condition will have to be changed
285  // to the number of planes required to pre-trigger.)
286  unsigned int layersHit = 0;
287  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
288  for (int i_hstrip = 0; i_hstrip < CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER; i_hstrip++) {
289  if (!halfStripTimes[i_layer][i_hstrip].empty()) {
290  layersHit++;
291  break;
292  }
293  }
294  }
295  // Run the algorithm only if the probability for the pre-trigger
296  // to fire is not null. (Pre-trigger decisions are used for the
297  // strip read-out conditions in DigiToRaw.)
298  if (layersHit >= nplanes_hit_pretrig)
299  run(halfStripTimes);
300 
301  // Get the high multiplicity bits in this chamber
302  encodeHighMultiplicityBits(halfStripTimes);
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() + CSCConstants::ALCT_CLCT_OFFSET);
317  }
318 
319  return tmpV;
320 }
321 
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 
330  // initialize the pulse array.
331  // add 1 for possible stagger
333 
334  std::vector<CSCCLCTDigi> CLCTlist = findLCTs(halfstrip);
335 
336  // LCT sorting.
337  if (CLCTlist.size() > 1)
338  sort(CLCTlist.begin(), CLCTlist.end(), std::greater<CSCCLCTDigi>());
339 
340  for (const auto& p : CLCTlist) {
341  const int bx = p.getBX();
343  if (infoV > 0)
344  edm::LogWarning("L1CSCTPEmulatorOutOfTimeCLCT")
345  << "+++ Bx of CLCT candidate, " << bx << ", exceeds max allowed, " << CSCConstants::MAX_CLCT_TBINS - 1
346  << "; skipping it... +++\n";
347  continue;
348  }
349 
350  if (!bestCLCT[bx].isValid()) {
351  bestCLCT[bx] = p;
352  } else if (!secondCLCT[bx].isValid()) {
353  secondCLCT[bx] = p;
354  }
355  }
356 
357  for (int bx = 0; bx < CSCConstants::MAX_CLCT_TBINS; bx++) {
358  if (bestCLCT[bx].isValid()) {
359  bestCLCT[bx].setTrknmb(1);
360 
361  // check if the LCT is valid
362  qualityControl_->checkValid(bestCLCT[bx]);
363 
364  if (infoV > 0)
365  LogDebug("CSCCathodeLCTProcessor")
367  << " (sector " << theSector << " subsector " << theSubsector << " trig id. " << theTrigChamber << ")"
368  << "\n";
369  }
370  if (secondCLCT[bx].isValid()) {
371  secondCLCT[bx].setTrknmb(2);
372 
373  // check if the LCT is valid
374  qualityControl_->checkValid(secondCLCT[bx]);
375 
376  if (infoV > 0)
377  LogDebug("CSCCathodeLCTProcessor")
379  << " (sector " << theSector << " subsector " << theSubsector << " trig id. " << theTrigChamber << ")"
380  << "\n";
381  }
382  }
383  // Now that we have our best CLCTs, they get correlated with the best
384  // ALCTs and then get sent to the MotherBoard. -JM
385 }
386 
388  bool hasDigis = false;
389 
390  // Loop over layers and save comparator digis on each one into digiV[layer].
391  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
392  digiV[i_layer].clear();
393 
394  CSCDetId detid(theEndcap, theStation, theRing, theChamber, i_layer + 1);
395  getDigis(compdc, detid);
396 
397  if (isME11_ && !disableME1a_) {
398  CSCDetId detid_me1a(theEndcap, theStation, 4, theChamber, i_layer + 1);
399  getDigis(compdc, detid_me1a);
400  }
401 
402  if (!digiV[i_layer].empty()) {
403  hasDigis = true;
404  if (infoV > 1) {
405  LogTrace("CSCCathodeLCTProcessor") << "found " << digiV[i_layer].size() << " comparator digi(s) in layer "
406  << i_layer << " of " << detid.chamberName() << " (trig. sector " << theSector
407  << " subsector " << theSubsector << " id " << theTrigChamber << ")";
408  }
409  }
410  }
411 
412  return hasDigis;
413 }
414 
416  const bool me1a = (id.station() == 1) && (id.ring() == 4);
417  const CSCComparatorDigiCollection::Range rcompd = compdc->get(id);
418  for (CSCComparatorDigiCollection::const_iterator digiIt = rcompd.first; digiIt != rcompd.second; ++digiIt) {
419  const unsigned int origStrip = digiIt->getStrip();
420  const unsigned int maxStripsME1a =
422  // this special case can only be reached in MC
423  // in real data, the comparator digis have always ring==1
424  if (me1a && origStrip <= maxStripsME1a && !disableME1a_) {
425  // Move ME1/A comparators from CFEB=0 to CFEB=4 if this has not
426  // been done already.
427  CSCComparatorDigi digi_corr(
428  origStrip + CSCConstants::NUM_STRIPS_ME1B, digiIt->getComparator(), digiIt->getTimeBinWord());
429  digiV[id.layer() - 1].push_back(digi_corr);
430  } else {
431  digiV[id.layer() - 1].push_back(*digiIt);
432  }
433  }
434 }
435 
438  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
439  int i_digi = 0; // digi counter, for dumps.
440  for (std::vector<CSCComparatorDigi>::iterator pld = digiV[i_layer].begin(); pld != digiV[i_layer].end();
441  pld++, i_digi++) {
442  // Dump raw digi info.
443  if (infoV > 1) {
444  std::ostringstream strstrm;
445  strstrm << "Comparator digi: comparator = " << pld->getComparator() << " strip #" << pld->getStrip()
446  << " time bins on:";
447  std::vector<int> bx_times = pld->getTimeBinsOn();
448  for (unsigned int tbin = 0; tbin < bx_times.size(); tbin++)
449  strstrm << " " << bx_times[tbin];
450  LogTrace("CSCCathodeLCTProcessor") << strstrm.str();
451  }
452 
453  // Get comparator: 0/1 for left/right halfstrip for each comparator
454  // that fired.
455  int thisComparator = pld->getComparator();
456  if (thisComparator != 0 && thisComparator != 1) {
457  if (infoV >= 0)
458  edm::LogWarning("L1CSCTPEmulatorWrongInput")
459  << "+++ station " << theStation << " ring " << theRing << " chamber " << theChamber
460  << " Found comparator digi with wrong comparator value = " << thisComparator << "; skipping it... +++\n";
461  continue;
462  }
463 
464  // Get strip number.
465  int thisStrip = pld->getStrip() - 1; // count from 0
466  if (thisStrip < 0 || thisStrip >= numStrips_) {
467  if (infoV >= 0)
468  edm::LogWarning("L1CSCTPEmulatorWrongInput")
469  << "+++ station " << theStation << " ring " << theRing << " chamber " << theChamber
470  << " Found comparator digi with wrong strip number = " << thisStrip << " (max strips = " << numStrips_
471  << "); skipping it... +++\n";
472  continue;
473  }
474  // 2*strip: convert strip to 1/2 strip
475  // comp : comparator output
476  // stagger: stagger for this layer
477  int thisHalfstrip = 2 * thisStrip + thisComparator + stagger[i_layer];
478  if (thisHalfstrip >= numHalfStrips_) {
479  if (infoV >= 0)
480  edm::LogWarning("L1CSCTPEmulatorWrongInput")
481  << "+++ station " << theStation << " ring " << theRing << " chamber " << theChamber
482  << " Found wrong halfstrip number = " << thisHalfstrip << "; skipping this digi... +++\n";
483  continue;
484  }
485 
486  // Get bx times on this digi and check that they are within the bounds.
487  std::vector<int> bx_times = pld->getTimeBinsOn();
488  for (unsigned int i = 0; i < bx_times.size(); i++) {
489  // Total number of time bins in DAQ readout is given by fifo_tbins,
490  // which thus determines the maximum length of time interval.
491  //
492  // In data, only the CLCT in the time bin that was matched with L1A are read out
493  // while comparator digi is read out by 12 time bin, which includes 12 time bin info
494  // in other word, CLCTs emulated from comparator digis usually showed the OTMB behavior in 12 time bin
495  // while CLCT from data only showed 1 time bin OTMB behavior
496  // the CLCT emulated from comparator digis usually is centering at time bin 7 (BX7) and
497  // it is definitly safe to ignore any CLCTs in bx 0 or 1 and those CLCTs will never impacts on any triggers
498  if (bx_times[i] > 1 && bx_times[i] < static_cast<int>(fifo_tbins)) {
499  if (i == 0 || (i > 0 && bx_times[i] - bx_times[i - 1] >= static_cast<int>(hit_persist))) {
500  // A later hit on the same strip is ignored during the
501  // number of clocks defined by the "hit_persist" parameter
502  // (i.e., 6 bx's by default).
503  if (infoV > 1)
504  LogTrace("CSCCathodeLCTProcessor")
505  << "Comp digi: layer " << i_layer + 1 << " digi #" << i_digi + 1 << " strip " << thisStrip
506  << " halfstrip " << thisHalfstrip << " time " << bx_times[i] << " comparator " << thisComparator
507  << " stagger " << stagger[i_layer];
508  halfstrip[i_layer][thisHalfstrip].push_back(bx_times[i]);
509  } else if (i > 0) {
510  if (infoV > 1)
511  LogTrace("CSCCathodeLCTProcessor")
512  << "+++ station " << theStation << " ring " << theRing << " chamber " << theChamber
513  << " Skipping comparator digi: strip = " << thisStrip << ", layer = " << i_layer + 1
514  << ", bx = " << bx_times[i] << ", bx of previous hit = " << bx_times[i - 1];
515  }
516  } else {
517  if (infoV > 1)
518  LogTrace("CSCCathodeLCTProcessor") << "+++ station " << theStation << " ring " << theRing << " chamber "
519  << theChamber << "+++ Skipping comparator digi: strip = " << thisStrip
520  << ", layer = " << i_layer + 1 << ", bx = " << bx_times[i] << " +++";
521  }
522  }
523  }
524  }
525 }
526 
527 // TMB-07 version.
528 std::vector<CSCCLCTDigi> CSCCathodeLCTProcessor::findLCTs(
530  std::vector<CSCCLCTDigi> lctList;
531 
532  if (infoV > 1)
533  dumpDigis(halfstrip);
534 
535  // Fire half-strip one-shots for hit_persist bx's (4 bx's by default).
536  pulseExtension(halfstrip);
537 
538  unsigned int start_bx = start_bx_shift;
539  // Stop drift_delay bx's short of fifo_tbins since at later bx's we will
540  // not have a full set of hits to start pattern search anyway.
541  unsigned int stop_bx = fifo_tbins - drift_delay;
542  // Allow for more than one pass over the hits in the time window.
543  while (start_bx < stop_bx) {
544  // temp CLCT objects
545  CSCCLCTDigi tempBestCLCT;
546  CSCCLCTDigi tempSecondCLCT;
547 
548  // All half-strip pattern envelopes are evaluated simultaneously, on every
549  // clock cycle.
550  int first_bx = 999;
551  bool pre_trig = preTrigger(start_bx, first_bx);
552 
553  // If any of half-strip envelopes has enough layers hit in it, TMB
554  // will pre-trigger.
555  if (pre_trig) {
556  thePreTriggerBXs.push_back(first_bx);
557  if (infoV > 1)
558  LogTrace("CSCCathodeLCTProcessor") << "..... pretrigger at bx = " << first_bx << "; waiting drift delay .....";
559 
560  // TMB latches LCTs drift_delay clocks after pretrigger.
561  // in the configuration the drift_delay is set to 2bx by default
562  // this is the time that is required for the electrons to drift to the
563  // cathode strips. 15ns drift time --> 45 ns is 3 sigma for the delay
564  // this corresponds to 2bx
565  int latch_bx = first_bx + drift_delay;
566 
567  // define a new pattern map
568  // for each key half strip, and for each pattern, store the 2D collection of fired comparator digis
569  std::map<int, std::map<int, CSCCLCTDigi::ComparatorContainer>> hits_in_patterns;
570  hits_in_patterns.clear();
571 
572  // We check if there is at least one key half strip for which at least
573  // one pattern id has at least the minimum number of hits
574  bool hits_in_time = patternFinding(latch_bx, hits_in_patterns);
575  if (infoV > 1) {
576  if (hits_in_time) {
577  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < numHalfStrips_; hstrip++) {
578  if (nhits[hstrip] > 0) {
579  LogTrace("CSCCathodeLCTProcessor")
580  << " bx = " << std::setw(2) << latch_bx << " --->"
581  << " halfstrip = " << std::setw(3) << hstrip << " best pid = " << std::setw(2) << best_pid[hstrip]
582  << " nhits = " << nhits[hstrip];
583  }
584  }
585  }
586  }
587  // This trigger emulator does not have an active CFEB flag for DAQ (csc trigger hardware: AFF)
588  // This is a fundamental difference with the firmware where the TMB prepares the DAQ to
589  // read out the chamber
590 
591  // The pattern finder runs continuously, so another pre-trigger
592  // could occur already at the next bx.
593 
594  // Quality for sorting.
596  int best_halfstrip[CSCConstants::MAX_CLCTS_PER_PROCESSOR];
597  int best_quality[CSCConstants::MAX_CLCTS_PER_PROCESSOR];
598 
599  for (int ilct = 0; ilct < CSCConstants::MAX_CLCTS_PER_PROCESSOR; ilct++) {
600  best_halfstrip[ilct] = -1;
601  best_quality[ilct] = 0;
602  }
603 
604  // Calculate quality from pattern id and number of hits, and
605  // simultaneously select best-quality LCT.
606  if (hits_in_time) {
607  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < numHalfStrips_; hstrip++) {
608  // The bend-direction bit pid[0] is ignored (left and right
609  // bends have equal quality).
610  quality[hstrip] = (best_pid[hstrip] & 14) | (nhits[hstrip] << 5);
611  if (quality[hstrip] > best_quality[0]) {
612  best_halfstrip[0] = hstrip;
613  best_quality[0] = quality[hstrip];
614  }
615  // temporary alias
616  const int best_hs(best_halfstrip[0]);
617  const int best_pat(best_pid[best_hs]);
618  // construct a CLCT if the trigger condition has been met
619  if (best_hs >= 0 && nhits[best_hs] >= nplanes_hit_pattern) {
620  // overwrite the current best CLCT
621  tempBestCLCT = constructCLCT(first_bx, best_hs, hits_in_patterns[best_hs][best_pat]);
622  }
623  }
624  }
625 
626  // If 1st best CLCT is found, look for the 2nd best.
627  if (best_halfstrip[0] >= 0) {
628  // Get the half-strip of the best CLCT in this BX that was put into the list.
629  // You do need to re-add the any stagger, because the busy keys are based on
630  // the pulse array which takes into account strip stagger!!!
631  const unsigned halfStripBestCLCT(tempBestCLCT.getKeyStrip() + stagger[CSCConstants::KEY_CLCT_LAYER - 1]);
632 
633  // Mark keys near best CLCT as busy by setting their quality to
634  // zero, and repeat the search.
635  markBusyKeys(halfStripBestCLCT, best_pid[halfStripBestCLCT], quality);
636 
637  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < numHalfStrips_; hstrip++) {
638  if (quality[hstrip] > best_quality[1]) {
639  best_halfstrip[1] = hstrip;
640  best_quality[1] = quality[hstrip];
641  }
642  // temporary alias
643  const int best_hs(best_halfstrip[1]);
644  const int best_pat(best_pid[best_hs]);
645  // construct a CLCT if the trigger condition has been met
646  if (best_hs >= 0 && nhits[best_hs] >= nplanes_hit_pattern) {
647  // overwrite the current second best CLCT
648  tempSecondCLCT = constructCLCT(first_bx, best_hs, hits_in_patterns[best_hs][best_pat]);
649  }
650  }
651  // add the CLCTs to the collection
652  if (tempBestCLCT.isValid()) {
653  lctList.push_back(tempBestCLCT);
654  }
655  if (tempSecondCLCT.isValid()) {
656  lctList.push_back(tempSecondCLCT);
657  }
658  } //find CLCT, end of best_halfstrip[0] >= 0
659 
660  // If there is a trigger, CLCT pre-trigger state machine
661  // checks the number of hits that lie within a pattern template
662  // at every bx, and waits for it to drop below threshold.
663  // The search for CLCTs resumes only when the number of hits
664  // drops below threshold.
665  start_bx = fifo_tbins;
666  // Stop checking drift_delay bx's short of fifo_tbins since
667  // at later bx's we won't have a full set of hits for a
668  // pattern search anyway.
669  unsigned int stop_time = fifo_tbins - drift_delay;
670  for (unsigned int bx = latch_bx + 1; bx < stop_time; bx++) {
671  bool return_to_idle = true;
672  bool hits_in_time = patternFinding(bx, hits_in_patterns);
673  if (hits_in_time) {
674  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < numHalfStrips_; hstrip++) {
675  // the dead-time is done at the pre-trigger, not at the trigger
676  if (nhits[hstrip] >= nplanes_hit_pretrig) {
677  if (infoV > 1)
678  LogTrace("CSCCathodeLCTProcessor") << " State machine busy at bx = " << bx;
679  return_to_idle = false;
680  break;
681  }
682  }
683  }
684  if (return_to_idle) {
685  if (infoV > 1)
686  LogTrace("CSCCathodeLCTProcessor") << " State machine returns to idle state at bx = " << bx;
687  start_bx = bx;
688  break;
689  }
690  }
691  } //pre_trig
692  else {
693  start_bx = first_bx + 1; // no dead time
694  }
695  }
696 
697  return lctList;
698 } // findLCTs -- TMB-07 version.
699 
700 // Common to all versions.
703  const unsigned bits_in_pulse = pulse_.bitsInPulse();
704 
705  // Clear pulse array. This array will be used as a bit representation of
706  // hit times. For example: if strip[1][2] has a value of 3, then 1 shifted
707  // left 3 will be bit pattern of pulse[1][2]. This would make the pattern
708  // look like 0000000000001000. Then add on additional bits to signify
709  // the duration of a signal (hit_persist, formerly bx_width) to simulate
710  // the TMB's drift delay. So for the same pulse[1][2] with a hit_persist
711  // of 3 would look like 0000000000111000. This is similating the digital
712  // one-shot in the TMB.
713  pulse_.clear();
714 
715  // Loop over all layers and halfstrips.
716  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
717  for (int i_strip = 0; i_strip < numHalfStrips_; i_strip++) {
718  // If there is a hit, simulate digital one-shot persistence starting
719  // in the bx of the initial hit. Fill this into pulse[][].
720  if (!time[i_layer][i_strip].empty()) {
721  std::vector<int> bx_times = time[i_layer][i_strip];
722  for (unsigned int i = 0; i < bx_times.size(); i++) {
723  // Check that min and max times are within the allowed range.
724  if (bx_times[i] < 0 || bx_times[i] + hit_persist >= bits_in_pulse) {
725  if (infoV > 0)
726  edm::LogWarning("L1CSCTPEmulatorOutOfTimeDigi")
727  << "+++ BX time of comparator digi (halfstrip = " << i_strip << " layer = " << i_layer
728  << ") bx = " << bx_times[i] << " is not within the range (0-" << bits_in_pulse
729  << "] allowed for pulse extension. Skip this digi! +++\n";
730  continue;
731  }
732  if (bx_times[i] >= start_bx_shift) {
733  pulse_.extend(i_layer, i_strip, bx_times[i], hit_persist);
734  }
735  }
736  }
737  }
738  }
739 } // pulseExtension.
740 
741 // TMB-07 version.
742 bool CSCCathodeLCTProcessor::preTrigger(const int start_bx, int& first_bx) {
743  if (infoV > 1)
744  LogTrace("CSCCathodeLCTProcessor") << "....................PreTrigger...........................";
745 
746  int nPreTriggers = 0;
747 
748  bool pre_trig = false;
749  // Now do a loop over bx times to see (if/when) track goes over threshold
750  for (unsigned int bx_time = start_bx; bx_time < fifo_tbins; bx_time++) {
751  // For any given bunch-crossing, start at the lowest keystrip and look for
752  // the number of separate layers in the pattern for that keystrip that have
753  // pulses at that bunch-crossing time. Do the same for the next keystrip,
754  // etc. Then do the entire process again for the next bunch-crossing, etc
755  // until you find a pre-trigger.
756 
757  std::map<int, std::map<int, CSCCLCTDigi::ComparatorContainer>> hits_in_patterns;
758  hits_in_patterns.clear();
759 
760  bool hits_in_time = patternFinding(bx_time, hits_in_patterns);
761  if (hits_in_time) {
762  // clear the pretriggers
764 
765  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < numHalfStrips_; hstrip++) {
766  // check the properties of the pattern on this halfstrip
767  if (infoV > 1) {
768  if (nhits[hstrip] > 0) {
769  LogTrace("CSCCathodeLCTProcessor")
770  << " bx = " << std::setw(2) << bx_time << " --->"
771  << " halfstrip = " << std::setw(3) << hstrip << " best pid = " << std::setw(2) << best_pid[hstrip]
772  << " nhits = " << nhits[hstrip];
773  }
774  }
775  // a pretrigger was found
776  if (nhits[hstrip] >= nplanes_hit_pretrig && best_pid[hstrip] >= pid_thresh_pretrig) {
777  pre_trig = true;
778  ispretrig_[hstrip] = true;
779 
780  // write each pre-trigger to output
781  nPreTriggers++;
782  thePreTriggerDigis.push_back(constructPreCLCT(bx_time, hstrip, nPreTriggers));
783  }
784  }
785 
786  // upon the first pretrigger, we save first BX and exit
787  if (pre_trig) {
788  first_bx = bx_time; // bx at time of pretrigger
789  return true;
790  }
791  }
792  } // end loop over bx times
793 
794  if (infoV > 1)
795  LogTrace("CSCCathodeLCTProcessor") << "no pretrigger, returning \n";
796  first_bx = fifo_tbins;
797  return false;
798 } // preTrigger -- TMB-07 version.
799 
800 // TMB-07 version.
802  const unsigned int bx_time, std::map<int, std::map<int, CSCCLCTDigi::ComparatorContainer>>& hits_in_patterns) {
803  if (bx_time >= fifo_tbins)
804  return false;
805 
806  unsigned layers_hit = pulse_.numberOfLayersAtBX(bx_time);
807  if (layers_hit < nplanes_hit_pretrig)
808  return false;
809 
810  for (int key_hstrip = 0; key_hstrip < numHalfStrips_; key_hstrip++) {
811  best_pid[key_hstrip] = 0;
812  nhits[key_hstrip] = 0;
813  }
814 
815  bool hit_layer[CSCConstants::NUM_LAYERS];
816 
817  // Loop over candidate key strips.
818  for (int key_hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; key_hstrip < numHalfStrips_; key_hstrip++) {
819  // Loop over patterns and look for hits matching each pattern.
820  for (unsigned int pid = clct_pattern_.size() - 1; pid >= pid_thresh_pretrig and pid < clct_pattern_.size(); pid--) {
821  layers_hit = 0;
822  // clear all layers
823  for (int ilayer = 0; ilayer < CSCConstants::NUM_LAYERS; ilayer++) {
824  hit_layer[ilayer] = false;
825  }
826 
827  // clear a single pattern!
828  CSCCLCTDigi::ComparatorContainer hits_single_pattern;
829  hits_single_pattern.resize(6);
830  for (auto& p : hits_single_pattern) {
832  }
833 
834  // clear all medians
835  double num_pattern_hits = 0., times_sum = 0.;
836  std::multiset<int> mset_for_median;
837  mset_for_median.clear();
838 
839  // Loop over halfstrips in trigger pattern mask and calculate the
840  // "absolute" halfstrip number for each.
841  for (int this_layer = 0; this_layer < CSCConstants::NUM_LAYERS; this_layer++) {
842  for (int strip_num = 0; strip_num < CSCConstants::CLCT_PATTERN_WIDTH; strip_num++) {
843  // ignore "0" half-strips in the pattern
844  if (clct_pattern_[pid][this_layer][strip_num] == 0)
845  continue;
846 
847  // the current strip is the key half-strip plus the offset (can be negative or positive)
848  int this_strip = CSCPatternBank::clct_pattern_offset_[strip_num] + key_hstrip;
849 
850  // current strip should be valid of course
851  if (this_strip >= 0 && this_strip < numHalfStrips_) {
852  if (infoV > 3) {
853  LogTrace("CSCCathodeLCTProcessor") << " In patternFinding: key_strip = " << key_hstrip << " pid = " << pid
854  << " layer = " << this_layer << " strip = " << this_strip << std::endl;
855  }
856  // Determine if "one shot" is high at this bx_time
857  if (pulse_.isOneShotHighAtBX(this_layer, this_strip, bx_time)) {
858  if (hit_layer[this_layer] == false) {
859  hit_layer[this_layer] = true;
860  layers_hit++; // determines number of layers hit
861  // add this strip in this layer to the pattern we are currently considering
862  hits_single_pattern[this_layer][strip_num] = this_strip - stagger[this_layer];
863  }
864 
865  // find at what bx did pulse on this halsfstrip & layer have started
866  // use hit_persist constraint on how far back we can go
867  int first_bx_layer = bx_time;
868  for (unsigned int dbx = 0; dbx < hit_persist; dbx++) {
869  if (pulse_.isOneShotHighAtBX(this_layer, this_strip, first_bx_layer - 1))
870  first_bx_layer--;
871  else
872  break;
873  }
874  times_sum += (double)first_bx_layer;
875  num_pattern_hits += 1.;
876  mset_for_median.insert(first_bx_layer);
877  if (infoV > 2)
878  LogTrace("CSCCathodeLCTProcessor") << " 1st bx in layer: " << first_bx_layer << " sum bx: " << times_sum
879  << " #pat. hits: " << num_pattern_hits;
880  }
881  }
882  } // end loop over strips in pretrigger pattern
883  } // end loop over layers
884 
885  // save the pattern information when a trigger was formed!
886  if (layers_hit >= nplanes_hit_pattern) {
887  hits_in_patterns[key_hstrip][pid] = hits_single_pattern;
888  }
889 
890  // determine the current best pattern!
891  if (layers_hit > nhits[key_hstrip]) {
892  best_pid[key_hstrip] = pid;
893  nhits[key_hstrip] = layers_hit;
894  // Do not loop over the other (worse) patterns if max. numbers of
895  // hits is found.
896  if (nhits[key_hstrip] == CSCConstants::NUM_LAYERS)
897  break;
898  }
899  } // end loop over pid
900  } // end loop over candidate key strips
901 
902  // At this point there exists at least one halfstrip for which at least one pattern
903  // has at least 3 layers --> definition of a pre-trigger
904  return true;
905 } // patternFinding -- TMB-07 version.
906 
907 // TMB-07 version.
908 void CSCCathodeLCTProcessor::markBusyKeys(const int best_hstrip,
909  const int best_patid,
911  int nspan = min_separation;
912  int pspan = min_separation;
913 
914  for (int hstrip = best_hstrip - nspan; hstrip <= best_hstrip + pspan; hstrip++) {
915  if (hstrip >= 0 && hstrip < CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER) {
916  quality[hstrip] = 0;
917  }
918  }
919 } // markBusyKeys -- TMB-07 version.
920 
922  const unsigned halfstrip_withstagger,
924  // Assign the CLCT properties
925  const unsigned quality = nhits[halfstrip_withstagger];
926  const unsigned pattern = best_pid[halfstrip_withstagger];
927  const unsigned bend = CSCPatternBank::getPatternBend(clct_pattern_[pattern]);
928  const unsigned keyhalfstrip = halfstrip_withstagger - stagger[CSCConstants::KEY_CLCT_LAYER - 1];
929  const unsigned cfeb = keyhalfstrip / CSCConstants::NUM_HALF_STRIPS_PER_CFEB;
930  const unsigned halfstrip = keyhalfstrip % CSCConstants::NUM_HALF_STRIPS_PER_CFEB;
931 
932  // set the Run-2 properties
933  CSCCLCTDigi clct(1,
934  quality,
935  pattern,
936  // CLCTs are always of type halfstrip (not strip or distrip)
937  1,
938  bend,
939  halfstrip,
940  cfeb,
941  bx,
942  0,
943  0,
944  -1,
946 
947  // set the hit collection
948  clct.setHits(hits);
949 
950  // do the CCLUT procedures for Run-3
951  if (runCCLUT_) {
952  cclut_->run(clct, numCFEBs_);
953  }
954 
955  // purge the comparator digi collection from the obsolete "65535" entries...
957 
958  if (infoV > 1) {
959  LogTrace("CSCCathodeLCTProcessor") << "Produce CLCT " << clct << std::endl;
960  }
961 
962  return clct;
963 }
964 
966  const unsigned hstrip,
967  const unsigned nPreTriggers) const {
969  const int halfstrip = hstrip % CSCConstants::NUM_HALF_STRIPS_PER_CFEB;
970  const int cfeb = hstrip / CSCConstants::NUM_HALF_STRIPS_PER_CFEB;
971  return CSCCLCTPreTriggerDigi(1, nhits[hstrip], best_pid[hstrip], 1, bend, halfstrip, cfeb, bx_time, nPreTriggers, 0);
972 }
973 
975  for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < numHalfStrips_; hstrip++) {
976  ispretrig_[hstrip] = false;
977  }
978 }
979 
981  CSCCLCTDigi::ComparatorContainer newHits = clct.getHits();
982  for (auto& p : newHits) {
983  p.erase(
984  std::remove_if(p.begin(), p.end(), [](unsigned i) -> bool { return i == CSCConstants::INVALID_HALF_STRIP; }),
985  p.end());
986  }
987  clct.setHits(newHits);
988 }
989 
990 // --------------------------------------------------------------------------
991 // Auxiliary code.
992 // --------------------------------------------------------------------------
993 // Dump of configuration parameters.
995  std::ostringstream strm;
996  strm << "\n";
997  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
998  strm << "+ CLCT configuration parameters: +\n";
999  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1000  strm << " fifo_tbins [total number of time bins in DAQ readout] = " << fifo_tbins << "\n";
1001  strm << " fifo_pretrig [start time of cathode raw hits in DAQ readout] = " << fifo_pretrig << "\n";
1002  strm << " hit_persist [duration of signal pulse, in 25 ns bins] = " << hit_persist << "\n";
1003  strm << " drift_delay [time after pre-trigger before TMB latches LCTs] = " << drift_delay << "\n";
1004  strm << " nplanes_hit_pretrig [min. number of layers hit for pre-trigger] = " << nplanes_hit_pretrig << "\n";
1005  strm << " nplanes_hit_pattern [min. number of layers hit for trigger] = " << nplanes_hit_pattern << "\n";
1006  strm << " pid_thresh_pretrig [lower threshold on pattern id] = " << pid_thresh_pretrig << "\n";
1007  strm << " min_separation [region of busy key strips] = " << min_separation << "\n";
1008  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1009  LogDebug("CSCCathodeLCTProcessor") << strm.str();
1010 }
1011 
1012 // Reasonably nice dump of digis on half-strips.
1015  LogDebug("CSCCathodeLCTProcessor") << theCSCName_ << " strip type: half-strip, numHalfStrips " << numHalfStrips_;
1016 
1017  std::ostringstream strstrm;
1018  for (int i_strip = 0; i_strip < numHalfStrips_; i_strip++) {
1019  if (i_strip % 10 == 0) {
1020  if (i_strip < 100)
1021  strstrm << i_strip / 10;
1022  else
1023  strstrm << (i_strip - 100) / 10;
1024  } else
1025  strstrm << " ";
1026  if ((i_strip + 1) % CSCConstants::NUM_HALF_STRIPS_PER_CFEB == 0)
1027  strstrm << " ";
1028  }
1029  strstrm << "\n";
1030  for (int i_strip = 0; i_strip < numHalfStrips_; i_strip++) {
1031  strstrm << i_strip % 10;
1032  if ((i_strip + 1) % CSCConstants::NUM_HALF_STRIPS_PER_CFEB == 0)
1033  strstrm << " ";
1034  }
1035  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
1036  strstrm << "\n";
1037  for (int i_strip = 0; i_strip < numHalfStrips_; i_strip++) {
1038  if (!strip[i_layer][i_strip].empty()) {
1039  std::vector<int> bx_times = strip[i_layer][i_strip];
1040  // Dump only the first in time.
1041  strstrm << std::hex << bx_times[0] << std::dec;
1042  } else {
1043  strstrm << "-";
1044  }
1045  if ((i_strip + 1) % CSCConstants::NUM_HALF_STRIPS_PER_CFEB == 0)
1046  strstrm << " ";
1047  }
1048  }
1049  LogTrace("CSCCathodeLCTProcessor") << strstrm.str();
1050 }
1051 
1052 // Returns vector of read-out CLCTs, if any. Starts with the vector
1053 // of all found CLCTs and selects the ones in the read-out time window.
1054 std::vector<CSCCLCTDigi> CSCCathodeLCTProcessor::readoutCLCTs() const {
1055  // temporary container for further selection
1056  std::vector<CSCCLCTDigi> tmpV;
1057 
1058  /*
1059  CLCTs in the BX window [early_tbin,...,late_tbin] are considered good for physics
1060  The central CLCT BX is time bin 7.
1061  For tmb_l1a_window_size set to 7 (Run-1, Run-2), the window is [4, 5, 6, 7, 8, 9, 10]
1062  For tmb_l1a_window_size set to 5 (Run-3), the window is [5, 6, 7, 8, 9]
1063  For tmb_l1a_window_size set to 3 (Run-4?), the window is [6, 7, 8]
1064  */
1065  const unsigned delta_tbin = tmb_l1a_window_size / 2;
1066  int early_tbin = CSCConstants::CLCT_CENTRAL_BX - delta_tbin;
1067  int late_tbin = CSCConstants::CLCT_CENTRAL_BX + delta_tbin;
1068  /*
1069  Special case for an even-numbered time-window,
1070  For instance tmb_l1a_window_size set to 6: [4, 5, 6, 7, 8, 9]
1071  */
1072  if (tmb_l1a_window_size % 2 == 0)
1073  late_tbin = CSCConstants::CLCT_CENTRAL_BX + delta_tbin - 1;
1074  const int max_late_tbin = CSCConstants::MAX_CLCT_TBINS - 1;
1075 
1076  // debugging messages when early_tbin or late_tbin has a suspicious value
1077  bool debugTimeBins = true;
1078  if (debugTimeBins) {
1079  if (early_tbin < 0) {
1080  edm::LogWarning("CSCCathodeLCTProcessor|SuspiciousParameters")
1081  << "Early time bin (early_tbin) smaller than minimum allowed, which is 0. set early_tbin to 0.";
1082  early_tbin = 0;
1083  }
1084  if (late_tbin > max_late_tbin) {
1085  edm::LogWarning("CSCCathodeLCTProcessor|SuspiciousParameters")
1086  << "Late time bin (late_tbin) larger than maximum allowed, which is " << max_late_tbin
1087  << ". set early_tbin to max allowed";
1088  late_tbin = CSCConstants::MAX_CLCT_TBINS - 1;
1089  }
1090  debugTimeBins = false;
1091  }
1092 
1093  // get the valid LCTs. No BX selection is done here
1094  const auto& all_clcts = getCLCTs();
1095 
1096  // Start from the vector of all found CLCTs and select those within
1097  // the CLCT*L1A coincidence window.
1098  int bx_readout = -1;
1099  for (const auto& clct : all_clcts) {
1100  // only consider valid CLCTs
1101  if (!clct.isValid())
1102  continue;
1103 
1104  const int bx = clct.getBX();
1105  // Skip CLCTs found too early relative to L1Accept.
1106  if (bx < early_tbin) {
1107  if (infoV > 1)
1108  LogDebug("CSCCathodeLCTProcessor")
1109  << " Do not report correlated CLCT on key halfstrip " << clct.getStrip() << ": found at bx " << bx
1110  << ", whereas the earliest allowed bx is " << early_tbin;
1111  continue;
1112  }
1113 
1114  // Skip CLCTs found too late relative to L1Accept.
1115  if (bx > late_tbin) {
1116  if (infoV > 1)
1117  LogDebug("CSCCathodeLCTProcessor")
1118  << " Do not report correlated CLCT on key halfstrip " << clct.getStrip() << ": found at bx " << bx
1119  << ", whereas the latest allowed bx is " << late_tbin;
1120  continue;
1121  }
1122 
1123  // If (readout_earliest_2) take only CLCTs in the earliest bx in the read-out window:
1124  if (readout_earliest_2) {
1125  // the first CLCT passes
1126  // the second CLCT passes if the BX matches to the first
1127  if (bx_readout == -1 || bx == bx_readout) {
1128  tmpV.push_back(clct);
1129  if (bx_readout == -1)
1130  bx_readout = bx;
1131  }
1132  } else
1133  tmpV.push_back(clct);
1134  }
1135 
1136  // do a final check on the CLCTs in readout
1137  qualityControl_->checkMultiplicityBX(tmpV);
1138  for (const auto& clct : tmpV) {
1139  qualityControl_->checkValid(clct);
1140  }
1141 
1142  return tmpV;
1143 }
1144 
1145 // Returns vector of all found CLCTs, if any. Used for ALCT-CLCT matching.
1146 std::vector<CSCCLCTDigi> CSCCathodeLCTProcessor::getCLCTs() const {
1147  std::vector<CSCCLCTDigi> tmpV;
1148  for (int bx = 0; bx < CSCConstants::MAX_CLCT_TBINS; bx++) {
1149  if (bestCLCT[bx].isValid())
1150  tmpV.push_back(bestCLCT[bx]);
1151  if (secondCLCT[bx].isValid())
1152  tmpV.push_back(secondCLCT[bx]);
1153  }
1154  return tmpV;
1155 }
1156 
1157 // shift the BX from 7 to 8
1158 // the unpacked real data CLCTs have central BX at bin 7
1159 // however in simulation the central BX is bin 8
1160 // to make a proper comparison with ALCTs we need
1161 // CLCT and ALCT to have the central BX in the same bin
1163  CSCCLCTDigi lct = bestCLCT[bx];
1165  return lct;
1166 }
1167 
1169  CSCCLCTDigi lct = secondCLCT[bx];
1171  return lct;
1172 }
1173 
1175  const std::vector<int> halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER]) {
1176  inTimeHMT_ = 0;
1177  outTimeHMT_ = 0;
1178 
1179  // functions for in-time and out-of-time
1180  auto inTime = [=](unsigned time) { return time >= showerMinInTBin_ and time <= showerMaxInTBin_; };
1181  auto outTime = [=](unsigned time) { return time >= showerMinOutTBin_ and time <= showerMaxOutTBin_; };
1182 
1183  // count the half-strips in-time and out-time
1184  unsigned hitsInTime = 0;
1185  unsigned hitsOutTime = 0;
1186  for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) {
1187  for (int i_hstrip = 0; i_hstrip < CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER; i_hstrip++) {
1188  auto times = halfstrip[i_layer][i_hstrip];
1189  hitsInTime += std::count_if(times.begin(), times.end(), inTime);
1190  hitsOutTime += std::count_if(times.begin(), times.end(), outTime);
1191  }
1192  }
1193 
1194  // convert station and ring number to index
1195  // index runs from 2 to 10, subtract 2
1196  unsigned csc_idx = CSCDetId::iChamberType(theStation, theRing) - 2;
1197 
1198  // loose, nominal and tight
1199  std::vector<unsigned> station_thresholds = {
1200  thresholds_[csc_idx * 3], thresholds_[csc_idx * 3 + 1], thresholds_[csc_idx * 3 + 2]};
1201 
1202  // assign the bits
1203  for (unsigned i = 0; i < station_thresholds.size(); i++) {
1204  if (hitsInTime >= station_thresholds[i]) {
1205  inTimeHMT_ = i + 1;
1206  }
1207  if (hitsOutTime >= station_thresholds[i]) {
1208  outTimeHMT_ = i + 1;
1209  }
1210  }
1211 
1212  // no shower object is created here. that is done at a later stage
1213  // in the motherboar, where potentially the trigger decisions from
1214  // anode hit counters and cathode hit counters are combined
1215 }
CSCConstants::INVALID_HALF_STRIP
Definition: CSCConstants.h:99
PulseArray::bitsInPulse
unsigned bitsInPulse() const
Definition: PulseArray.cc:25
CSCDBL1TPParameters
Definition: CSCDBL1TPParameters.h:14
CSCCathodeLCTProcessor::qualityControl_
std::unique_ptr< LCTQualityControl > qualityControl_
Definition: CSCCathodeLCTProcessor.h:219
CSCCathodeLCTProcessor::markBusyKeys
void markBusyKeys(const int best_hstrip, const int best_patid, int quality[CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER])
Definition: CSCCathodeLCTProcessor.cc:908
CSCCLCTDigi::setTrknmb
void setTrknmb(const uint16_t number)
Set track number (1,2) after sorting CLCTs.
Definition: CSCCLCTDigi.h:162
CSCCathodeLCTProcessor::showerMaxInTBin_
unsigned showerMaxInTBin_
Definition: CSCCathodeLCTProcessor.h:190
CSCCathodeLCTProcessor::nhits
unsigned int nhits[CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER]
Definition: CSCCathodeLCTProcessor.h:163
CSCCathodeLCTProcessor::findLCTs
virtual std::vector< CSCCLCTDigi > findLCTs(const std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER])
Definition: CSCCathodeLCTProcessor.cc:528
mps_fire.i
i
Definition: mps_fire.py:428
CSCBaseboard::theEndcap
const unsigned theEndcap
Definition: CSCBaseboard.h:41
CSCConstants::NUM_HALF_STRIPS_PER_CFEB
Definition: CSCConstants.h:62
CSCBaseboard::clctParams_
edm::ParameterSet clctParams_
Definition: CSCBaseboard.h:78
CSCCathodeLCTProcessor::numStrips_
int numStrips_
Definition: CSCCathodeLCTProcessor.h:172
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:177
CSCCathodeLCTProcessor::getSecondCLCT
CSCCLCTDigi getSecondCLCT(int bx) const
Definition: CSCCathodeLCTProcessor.cc:1168
CSCCathodeLCTProcessor::getCLCTs
std::vector< CSCCLCTDigi > getCLCTs() const
Definition: CSCCathodeLCTProcessor.cc:1146
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
CSCBaseboard::cscChamber_
const CSCChamber * cscChamber_
Definition: CSCBaseboard.h:66
CSCBaseboard::theSector
const unsigned theSector
Definition: CSCBaseboard.h:43
CSCCathodeLCTProcessor::showerMinInTBin_
unsigned showerMinInTBin_
Definition: CSCCathodeLCTProcessor.h:189
CSCCathodeLCTProcessor::outTimeHMT_
unsigned outTimeHMT_
Definition: CSCCathodeLCTProcessor.h:187
PulseArray::extend
void extend(const unsigned layer, const unsigned channel, const unsigned bx, const unsigned hit_persist)
Definition: PulseArray.cc:27
CSCPatternBank::getPatternBend
static int getPatternBend(const LCTPattern &pattern)
Definition: CSCPatternBank.h:60
CSCCathodeLCTProcessor::dumpConfigParams
void dumpConfigParams() const
Definition: CSCCathodeLCTProcessor.cc:994
CSCBaseboard::tmbParams_
edm::ParameterSet tmbParams_
Definition: CSCBaseboard.h:72
relativeConstraints.station
station
Definition: relativeConstraints.py:67
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
CSCBaseboard::disableME1a_
bool disableME1a_
Definition: CSCBaseboard.h:91
CSCCathodeLCTProcessor::fifo_tbins
unsigned int fifo_tbins
Definition: CSCCathodeLCTProcessor.h:195
CSCBaseboard::theStation
const unsigned theStation
Definition: CSCBaseboard.h:42
CSCDBL1TPParameters::clctNplanesHitPattern
unsigned int clctNplanesHitPattern() const
Definition: CSCDBL1TPParameters.h:65
CSCCathodeLCTProcessor::showerMinOutTBin_
unsigned showerMinOutTBin_
Definition: CSCCathodeLCTProcessor.h:191
CSCDBL1TPParameters::clctPidThreshPretrig
unsigned int clctPidThreshPretrig() const
Definition: CSCDBL1TPParameters.h:68
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
CSCBaseboard::theCSCName_
std::string theCSCName_
Definition: CSCBaseboard.h:84
protons_cff.time
time
Definition: protons_cff.py:35
CSCCathodeLCTProcessor::getDigis
bool getDigis(const CSCComparatorDigiCollection *compdc)
Definition: CSCCathodeLCTProcessor.cc:387
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:94
CSCCathodeLCTProcessor::def_nplanes_hit_pattern
static const unsigned int def_nplanes_hit_pattern
Definition: CSCCathodeLCTProcessor.h:214
CSCConstants::ALCT_CLCT_OFFSET
Definition: CSCConstants.h:164
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCCLCTDigi::getKeyStrip
uint16_t getKeyStrip(const uint16_t n=2) const
Definition: CSCCLCTDigi.cc:99
CSCDetId::iChamberType
unsigned short iChamberType() const
Definition: CSCDetId.h:96
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
CSCCathodeLCTProcessor::def_drift_delay
static const unsigned int def_drift_delay
Definition: CSCCathodeLCTProcessor.h:212
CSCCLCTDigi
Definition: CSCCLCTDigi.h:17
CSCConstants::MAX_CLCTS_PER_PROCESSOR
Definition: CSCConstants.h:132
CSCCathodeLCTProcessor::early_tbins
int early_tbins
Definition: CSCCathodeLCTProcessor.h:205
MuonDigiCollection::const_iterator
std::vector< DigiType >::const_iterator const_iterator
Definition: MuonDigiCollection.h:94
CSCCathodeLCTProcessor::ispretrig_
bool ispretrig_[CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER]
Definition: CSCCathodeLCTProcessor.h:166
quality
const uint32_t *__restrict__ Quality * quality
Definition: CAHitNtupletGeneratorKernelsImpl.h:122
CSCCathodeLCTProcessor::setConfigParameters
void setConfigParameters(const CSCDBL1TPParameters *conf)
Definition: CSCCathodeLCTProcessor.cc:123
CSCConstants::NUM_STRIPS_PER_CFEB
Definition: CSCConstants.h:60
CSCCathodeLCTProcessor::def_fifo_tbins
static const unsigned int def_fifo_tbins
Definition: CSCCathodeLCTProcessor.h:211
CSCDBL1TPParameters::clctDriftDelay
unsigned int clctDriftDelay() const
Definition: CSCDBL1TPParameters.h:59
CSCCathodeLCTProcessor::best_pid
unsigned int best_pid[CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER]
Definition: CSCCathodeLCTProcessor.h:160
CSCCathodeLCTProcessor::thePreTriggerDigis
std::vector< CSCCLCTPreTriggerDigi > thePreTriggerDigis
Definition: CSCCathodeLCTProcessor.h:181
CSCCathodeLCTProcessor::readout_earliest_2
bool readout_earliest_2
Definition: CSCCathodeLCTProcessor.h:208
CSCCathodeLCTProcessor::CSCCathodeLCTProcessor
CSCCathodeLCTProcessor(unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
Definition: CSCCathodeLCTProcessor.cc:21
CSCCathodeLCTProcessor::getBestCLCT
CSCCLCTDigi getBestCLCT(int bx) const
Definition: CSCCathodeLCTProcessor.cc:1162
PulseArray::numberOfLayersAtBX
unsigned numberOfLayersAtBX(const unsigned bx) const
Definition: PulseArray.cc:41
CSCCathodeLCTProcessor::cclut_
std::unique_ptr< ComparatorCodeLUT > cclut_
Definition: CSCCathodeLCTProcessor.h:222
CSCConstants::MAX_NUM_STRIPS_RUN2
Definition: CSCConstants.h:65
CSCCathodeLCTProcessor::dumpDigis
void dumpDigis(const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER]) const
Definition: CSCCathodeLCTProcessor.cc:1013
CSCCathodeLCTProcessor::readoutCLCTs
std::vector< CSCCLCTDigi > readoutCLCTs() const
Definition: CSCCathodeLCTProcessor.cc:1054
CSCCathodeLCTProcessor::bestCLCT
CSCCLCTDigi bestCLCT[CSCConstants::MAX_CLCT_TBINS]
Definition: CSCCathodeLCTProcessor.h:93
CSCConstants::MAX_NUM_STRIPS_RUN1
Definition: CSCConstants.h:64
CSCBaseboard::showerParams_
edm::ParameterSet showerParams_
Definition: CSCBaseboard.h:81
CSCCathodeLCTProcessor::numHalfStrips_
int numHalfStrips_
Definition: CSCCathodeLCTProcessor.h:174
CSCConstants::NUM_LAYERS
Definition: CSCConstants.h:103
CSCDBL1TPParameters::clctMinSeparation
unsigned int clctMinSeparation() const
Definition: CSCDBL1TPParameters.h:71
CSCDBL1TPParameters::clctHitPersist
unsigned int clctHitPersist() const
Definition: CSCDBL1TPParameters.h:56
CSCCathodeLCTProcessor::showerMaxOutTBin_
unsigned showerMaxOutTBin_
Definition: CSCCathodeLCTProcessor.h:192
CSCCLCTPreTriggerDigi
Definition: CSCCLCTPreTriggerDigi.h:15
CSCCathodeLCTProcessor::thePreTriggerBXs
std::vector< int > thePreTriggerBXs
Definition: CSCCathodeLCTProcessor.h:180
CSCComparatorDigi
Definition: CSCComparatorDigi.h:16
CSCCathodeLCTProcessor::def_fifo_pretrig
static const unsigned int def_fifo_pretrig
Definition: CSCCathodeLCTProcessor.h:211
CSCCathodeLCTProcessor::def_hit_persist
static const unsigned int def_hit_persist
Definition: CSCCathodeLCTProcessor.h:212
CSCCathodeLCTProcessor::preTrigger
virtual bool preTrigger(const int start_bx, int &first_bx)
Definition: CSCCathodeLCTProcessor.cc:742
CSCBaseboard::theSubsector
const unsigned theSubsector
Definition: CSCBaseboard.h:44
CSCLayer::geometry
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:44
CSCCathodeLCTProcessor::inTimeHMT_
unsigned inTimeHMT_
Definition: CSCCathodeLCTProcessor.h:186
CSCBaseboard::gangedME1a_
bool gangedME1a_
Definition: CSCBaseboard.h:91
sistrip::SpyUtilities::isValid
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
Definition: SiStripSpyUtilities.cc:124
CSCCathodeLCTProcessor::def_min_separation
static const unsigned int def_min_separation
Definition: CSCCathodeLCTProcessor.h:215
CSCDetId::chamberName
static std::string chamberName(int endcap, int station, int ring, int chamber)
Definition: CSCDetId.cc:74
CSCCathodeLCTProcessor.h
CSCCathodeLCTProcessor::run
std::vector< CSCCLCTDigi > run(const CSCComparatorDigiCollection *compdc)
Definition: CSCCathodeLCTProcessor.cc:184
CSCCathodeLCTProcessor::readComparatorDigis
void readComparatorDigis(std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER])
Definition: CSCCathodeLCTProcessor.cc:436
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
CSCConstants::NUM_STRIPS_ME1A_UNGANGED
Definition: CSCConstants.h:77
CSCCLCTDigi::ComparatorContainer
std::vector< std::vector< uint16_t > > ComparatorContainer
Definition: CSCCLCTDigi.h:19
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CSCDBL1TPParameters::clctNplanesHitPretrig
unsigned int clctNplanesHitPretrig() const
Definition: CSCDBL1TPParameters.h:62
CSCCathodeLCTProcessor::constructCLCT
CSCCLCTDigi constructCLCT(const int bx, const unsigned halfstrip_withstagger, const CSCCLCTDigi::ComparatorContainer &hits)
Definition: CSCCathodeLCTProcessor.cc:921
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
CSCBaseboard
Definition: CSCBaseboard.h:14
CSCCathodeLCTProcessor::secondCLCT
CSCCLCTDigi secondCLCT[CSCConstants::MAX_CLCT_TBINS]
Definition: CSCCathodeLCTProcessor.h:96
CSCDetId
Definition: CSCDetId.h:26
CSCCathodeLCTProcessor::digiV
std::vector< CSCComparatorDigi > digiV[CSCConstants::NUM_LAYERS]
Definition: CSCCathodeLCTProcessor.h:179
CSCCathodeLCTProcessor::cleanComparatorContainer
void cleanComparatorContainer(CSCCLCTDigi &lct) const
Definition: CSCCathodeLCTProcessor.cc:980
CSCCathodeLCTProcessor::patternFinding
bool patternFinding(const unsigned int bx_time, std::map< int, std::map< int, CSCCLCTDigi::ComparatorContainer > > &hits_in_patterns)
Definition: CSCCathodeLCTProcessor.cc:801
CSCCLCTDigi::isValid
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:50
CSCCathodeLCTProcessor::def_pid_thresh_pretrig
static const unsigned int def_pid_thresh_pretrig
Definition: CSCCathodeLCTProcessor.h:215
PulseArray::isOneShotHighAtBX
bool isOneShotHighAtBX(const unsigned layer, const unsigned channel, const unsigned bx) const
Definition: PulseArray.cc:37
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
CSCCathodeLCTProcessor::tmb_l1a_window_size
unsigned int tmb_l1a_window_size
Definition: CSCCathodeLCTProcessor.h:199
CSCCathodeLCTProcessor::thresholds_
std::vector< unsigned > thresholds_
Definition: CSCCathodeLCTProcessor.h:188
CSCComparatorDigiCollection
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:213
CSCCathodeLCTProcessor::constructPreCLCT
CSCCLCTPreTriggerDigi constructPreCLCT(const int bx, const unsigned halfstrip, const unsigned index) const
Definition: CSCCathodeLCTProcessor.cc:965
CSCCathodeLCTProcessor::hit_persist
unsigned int hit_persist
Definition: CSCCathodeLCTProcessor.h:196
CSCCLCTDigi::setHits
void setHits(const ComparatorContainer &hits)
Definition: CSCCLCTDigi.h:178
CSCCathodeLCTProcessor::encodeHighMultiplicityBits
void encodeHighMultiplicityBits(const std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER])
Definition: CSCCathodeLCTProcessor.cc:1174
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
CSCBaseboard::theChamber
unsigned theChamber
Definition: CSCBaseboard.h:48
CSCCathodeLCTProcessor::pid_thresh_pretrig
unsigned int pid_thresh_pretrig
Definition: CSCCathodeLCTProcessor.h:198
CSCCathodeLCTProcessor::clear
void clear()
Definition: CSCCathodeLCTProcessor.cc:173
CSCCathodeLCTProcessor::setDefaultConfigParameters
void setDefaultConfigParameters()
Definition: CSCCathodeLCTProcessor.cc:109
CSCCLCTDigi::getBX
uint16_t getBX() const
return BX
Definition: CSCCLCTDigi.h:123
CSCCathodeLCTProcessor::def_tmb_l1a_window_size
static const unsigned int def_tmb_l1a_window_size
Definition: CSCCathodeLCTProcessor.h:216
CSCCathodeLCTProcessor::fifo_pretrig
unsigned int fifo_pretrig
Definition: CSCCathodeLCTProcessor.h:195
CSCCathodeLCTProcessor::start_bx_shift
int start_bx_shift
Definition: CSCCathodeLCTProcessor.h:202
CSCPatternBank::clct_pattern_run3_
static const LCTPatterns clct_pattern_run3_
Definition: CSCPatternBank.h:54
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
CSCCLCTDigi::clear
void clear()
clear this CLCT
Definition: CSCCLCTDigi.cc:61
CSCDetId::chamberName
std::string chamberName() const
Definition: CSCDetId.cc:86
CSCCathodeLCTProcessor::nplanes_hit_pretrig
unsigned int nplanes_hit_pretrig
Definition: CSCCathodeLCTProcessor.h:197
CSCConstants::KEY_CLCT_LAYER
Definition: CSCConstants.h:103
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
CSCDBL1TPParameters::clctFifoPretrig
unsigned int clctFifoPretrig() const
Definition: CSCDBL1TPParameters.h:53
CSCConstants::MAX_CLCT_TBINS
Definition: CSCConstants.h:126
CSCConstants::NUM_STRIPS_ME1A_GANGED
Definition: CSCConstants.h:76
CSCCathodeLCTProcessor::numCFEBs_
int numCFEBs_
Definition: CSCCathodeLCTProcessor.h:173
CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER
Definition: CSCConstants.h:74
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
CSCConstants::CLCT_CENTRAL_BX
Definition: CSCConstants.h:162
MuonDigiCollection::Range
std::pair< const_iterator, const_iterator > Range
Definition: MuonDigiCollection.h:95
CSCCLCTDigi::Version::Legacy
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
CSCBaseboard::theTrigChamber
const unsigned theTrigChamber
Definition: CSCBaseboard.h:45
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CSCCLCTDigi::setBX
void setBX(const uint16_t bx)
set bx
Definition: CSCCLCTDigi.h:129
CSCConstants::NUM_STRIPS_ME1B
Definition: CSCConstants.h:78
CSCCathodeLCTProcessor::min_separation
unsigned int min_separation
Definition: CSCCathodeLCTProcessor.h:198
genParticles_cff.map
map
Definition: genParticles_cff.py:11
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
PulseArray::clear
void clear()
Definition: PulseArray.cc:14
CSCPatternBank::clct_pattern_legacy_
static const LCTPatterns clct_pattern_legacy_
Definition: CSCPatternBank.h:38
CSCConstants::CLCT_PATTERN_WIDTH
Definition: CSCConstants.h:116
CSCLayerGeometry::numberOfStrips
int numberOfStrips() const
Definition: CSCLayerGeometry.h:66
CSCCathodeLCTProcessor::clearPreTriggers
void clearPreTriggers()
Definition: CSCCathodeLCTProcessor.cc:974
CSCCathodeLCTProcessor::checkConfigParameters
void checkConfigParameters()
Definition: CSCCathodeLCTProcessor.cc:143
CSCCathodeLCTProcessor::drift_delay
unsigned int drift_delay
Definition: CSCCathodeLCTProcessor.h:196
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
CSCCathodeLCTProcessor::nplanes_hit_pattern
unsigned int nplanes_hit_pattern
Definition: CSCCathodeLCTProcessor.h:197
CSCBaseboard::isME11_
bool isME11_
Definition: CSCBaseboard.h:51
PulseArray::initialize
void initialize(unsigned numberOfChannels)
Definition: PulseArray.cc:5
CSCCLCTDigi::getHits
const ComparatorContainer & getHits() const
Definition: CSCCLCTDigi.h:176
CSCCathodeLCTProcessor::pulseExtension
void pulseExtension(const std::vector< int > time[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER])
Definition: CSCCathodeLCTProcessor.cc:701
CSCPatternBank::clct_pattern_offset_
static const int clct_pattern_offset_[CSCConstants::CLCT_PATTERN_WIDTH]
Definition: CSCPatternBank.h:57
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128
CSCConstants::CLCT_EMUL_TIME_OFFSET
Definition: CSCConstants.h:36
CSCBaseboard::runCCLUT_
bool runCCLUT_
Definition: CSCBaseboard.h:105
CSCCathodeLCTProcessor::clct_pattern_
CSCPatternBank::LCTPatterns clct_pattern_
Definition: CSCCathodeLCTProcessor.h:169
CSCBaseboard::infoV
int infoV
Definition: CSCBaseboard.h:63
CSCBaseboard::theRing
unsigned theRing
Definition: CSCBaseboard.h:47
CSCCathodeLCTProcessor::pulse_
PulseArray pulse_
Definition: CSCCathodeLCTProcessor.h:157