CMS 3D CMS Logo

CSCMotherboard.cc
Go to the documentation of this file.
2 #include <iostream>
3 #include <memory>
4 
5 // Default values of configuration parameters.
6 const unsigned int CSCMotherboard::def_mpc_block_me1a = 1;
7 const unsigned int CSCMotherboard::def_alct_trig_enable = 0;
8 const unsigned int CSCMotherboard::def_clct_trig_enable = 0;
9 const unsigned int CSCMotherboard::def_match_trig_enable = 1;
10 const unsigned int CSCMotherboard::def_match_trig_window_size = 7;
11 const unsigned int CSCMotherboard::def_tmb_l1a_window_size = 7;
12 
14  unsigned station,
15  unsigned sector,
16  unsigned subsector,
17  unsigned chamber,
18  const edm::ParameterSet& conf)
19  : CSCBaseboard(endcap, station, sector, subsector, chamber, conf) {
20  // Normal constructor. -JM
21  // Pass ALCT, CLCT, and common parameters on to ALCT and CLCT processors.
22  static std::atomic<bool> config_dumped{false};
23 
24  mpc_block_me1a = tmbParams_.getParameter<unsigned int>("mpcBlockMe1a");
25  alct_trig_enable = tmbParams_.getParameter<unsigned int>("alctTrigEnable");
26  clct_trig_enable = tmbParams_.getParameter<unsigned int>("clctTrigEnable");
27  match_trig_enable = tmbParams_.getParameter<unsigned int>("matchTrigEnable");
28  match_trig_window_size = tmbParams_.getParameter<unsigned int>("matchTrigWindowSize");
29  tmb_l1a_window_size = // Common to CLCT and TMB
30  tmbParams_.getParameter<unsigned int>("tmbL1aWindowSize");
31 
32  // configuration handle for number of early time bins
33  early_tbins = tmbParams_.getParameter<int>("tmbEarlyTbins");
34 
35  // whether to not reuse CLCTs that were used by previous matching ALCTs
36  drop_used_clcts = tmbParams_.getParameter<bool>("tmbDropUsedClcts");
37 
38  // whether to readout only the earliest two LCTs in readout window
39  readout_earliest_2 = tmbParams_.getParameter<bool>("tmbReadoutEarliest2");
40 
41  match_earliest_clct_only_ = tmbParams_.getParameter<bool>("matchEarliestClctOnly");
42 
43  infoV = tmbParams_.getParameter<int>("verbosity");
44 
45  alctProc = std::make_unique<CSCAnodeLCTProcessor>(endcap, station, sector, subsector, chamber, conf);
46  clctProc = std::make_unique<CSCCathodeLCTProcessor>(endcap, station, sector, subsector, chamber, conf);
47 
48  // Check and print configuration parameters.
50  if (infoV > 0 && !config_dumped) {
52  config_dumped = true;
53  }
54 
56 
57  // get the preferred CLCT BX match array
58  preferred_bx_match_ = tmbParams_.getParameter<std::vector<int> >("preferredBxMatch");
59 
60  // quality assignment
61  qualityAssignment_ = std::make_unique<LCTQualityAssignment>(endcap, station, sector, subsector, chamber, conf);
62 
63  // quality control of stubs
64  qualityControl_ = std::make_unique<LCTQualityControl>(endcap, station, sector, subsector, chamber, conf);
65 
66  // shower-trigger source
67  showerSource_ = showerParams_.getParameter<unsigned>("source");
68 
69  // enable the upgrade processors for ring 1 stations
70  if (runPhase2_ and theRing == 1) {
71  clctProc = std::make_unique<CSCUpgradeCathodeLCTProcessor>(endcap, station, sector, subsector, chamber, conf);
72  if (enableAlctPhase2_) {
73  alctProc = std::make_unique<CSCUpgradeAnodeLCTProcessor>(endcap, station, sector, subsector, chamber, conf);
74  }
75  }
76 
77  // set up helper class to check if ALCT and CLCT cross
78  const bool ignoreAlctCrossClct = tmbParams_.getParameter<bool>("ignoreAlctCrossClct");
79  cscOverlap_ = std::make_unique<CSCALCTCrossCLCT>(endcap, station, theRing, ignoreAlctCrossClct, conf);
80 }
81 
83  // clear the processors
84  if (alctProc)
85  alctProc->clear();
86  if (clctProc)
87  clctProc->clear();
88 
89  // clear the ALCT and CLCT containers
90  alctV.clear();
91  clctV.clear();
92  lctV.clear();
93 
94  allLCTs_.clear();
95 
96  // reset the shower trigger
97  shower_.clear();
98 }
99 
100 // Set configuration parameters obtained via EventSetup mechanism.
102  static std::atomic<bool> config_dumped{false};
103 
104  // Config. parameters for the TMB itself.
111 
112  // Config. paramteres for ALCT and CLCT processors.
113  alctProc->setConfigParameters(conf);
114  clctProc->setConfigParameters(conf);
115 
116  // Check and print configuration parameters.
118  if (!config_dumped) {
120  config_dumped = true;
121  }
122 }
123 
125  // Step 1: Setup
126  clear();
127 
128  // Check for existing processors
129  if (!(alctProc && clctProc)) {
130  edm::LogError("CSCMotherboard|SetupError") << "+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
131  return;
132  }
133 
134  // set geometry
135  alctProc->setCSCGeometry(cscGeometry_);
136  clctProc->setCSCGeometry(cscGeometry_);
137 
138  // Step 2: Run the processors
139  alctV = alctProc->run(wiredc); // run anodeLCT
140  clctV = clctProc->run(compdc); // run cathodeLCT
141 
142  // Step 2b: encode high multiplicity bits (independent of LCT construction)
144 
145  // if there are no ALCTs and no CLCTs, it does not make sense to run this TMB
146  if (alctV.empty() and clctV.empty())
147  return;
148 
149  // array to mask CLCTs
150  bool used_clct_mask[CSCConstants::MAX_CLCT_TBINS] = {false};
151 
152  // Step 3: ALCT-centric ALCT-to-CLCT matching
153  int bx_clct_matched = 0; // bx of last matched CLCT
154  for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++) {
155  // There should be at least one valid CLCT or ALCT for a
156  // correlated LCT to be formed. Decision on whether to reject
157  // non-complete LCTs (and if yes of which type) is made further
158  // upstream.
159  if (alctProc->getBestALCT(bx_alct).isValid()) {
160  // Look for CLCTs within the match-time window. The window is
161  // centered at the ALCT bx; therefore, we make an assumption
162  // that anode and cathode hits are perfectly synchronized. This
163  // is always true for MC, but only an approximation when the
164  // data is analyzed (which works fairly good as long as wide
165  // windows are used). To get rid of this assumption, one would
166  // need to access "full BX" words, which are not readily
167  // available.
168  bool is_matched = false;
169  // loop on the preferred "delta BX" array
170  for (unsigned mbx = 0; mbx < match_trig_window_size; mbx++) {
171  // evaluate the preffered CLCT BX, taking into account that there is an offset in the simulation
172  unsigned bx_clct = bx_alct + preferred_bx_match_[mbx] - CSCConstants::ALCT_CLCT_OFFSET;
173  // check that the CLCT BX is valid
174  if (bx_clct >= CSCConstants::MAX_CLCT_TBINS)
175  continue;
176  // do not consider previously matched CLCTs
177  if (drop_used_clcts && used_clct_mask[bx_clct])
178  continue;
179  if (clctProc->getBestCLCT(bx_clct).isValid()) {
180  if (infoV > 1)
181  LogTrace("CSCMotherboard") << "Successful ALCT-CLCT match: bx_alct = " << bx_alct
182  << "; bx_clct = " << bx_clct << "; mbx = " << mbx;
183  // now correlate the ALCT and CLCT into LCT.
184  // smaller mbx means more preferred!
185  correlateLCTs(alctProc->getBestALCT(bx_alct),
186  alctProc->getSecondALCT(bx_alct),
187  clctProc->getBestCLCT(bx_clct),
188  clctProc->getSecondCLCT(bx_clct),
189  allLCTs_(bx_alct, mbx, 0),
190  allLCTs_(bx_alct, mbx, 1),
192  // when the first LCT is valid, you can mask the matched CLCT and/or
193  // move on to the next ALCT if match_earliest_clct_only_ is set to true
194  if (allLCTs_(bx_alct, mbx, 0).isValid()) {
195  is_matched = true;
196  used_clct_mask[bx_clct] = true;
198  break;
199  }
200  }
201  }
202  // No CLCT within the match time interval found: report ALCT-only LCT
203  // (use dummy CLCTs).
204  if (!is_matched) {
205  if (infoV > 1)
206  LogTrace("CSCMotherboard") << "Unsuccessful ALCT-CLCT match (ALCT only): bx_alct = " << bx_alct
207  << " first ALCT " << alctProc->getBestALCT(bx_alct);
208  if (alct_trig_enable)
209  correlateLCTs(alctProc->getBestALCT(bx_alct),
210  alctProc->getSecondALCT(bx_alct),
211  clctProc->getBestCLCT(bx_alct),
212  clctProc->getSecondCLCT(bx_alct),
213  allLCTs_(bx_alct, 0, 0),
214  allLCTs_(bx_alct, 0, 1),
216  }
217  }
218  // No valid ALCTs; attempt to make CLCT-only LCT. Use only CLCTs
219  // which have zeroth chance to be matched at later cathode times.
220  // (I am not entirely sure this perfectly matches the firmware logic.)
221  // Use dummy ALCTs.
222  else {
223  int bx_clct = bx_alct - match_trig_window_size / 2;
224  if (bx_clct >= 0 && bx_clct > bx_clct_matched) {
225  if (clctProc->getBestCLCT(bx_clct).isValid() and clct_trig_enable) {
226  if (infoV > 1)
227  LogTrace("CSCMotherboard") << "Unsuccessful ALCT-CLCT match (CLCT only): bx_clct = " << bx_clct;
228  correlateLCTs(alctProc->getBestALCT(bx_alct),
229  alctProc->getSecondALCT(bx_alct),
230  clctProc->getBestCLCT(bx_clct),
231  clctProc->getSecondCLCT(bx_clct),
232  allLCTs_(bx_clct, 0, 0),
233  allLCTs_(bx_clct, 0, 1),
235  }
236  }
237  }
238  }
239 
240  // Step 4: Select at most 2 LCTs per BX
241  selectLCTs();
242 }
243 
244 // Returns vector of read-out correlated LCTs, if any. Starts with
245 // the vector of all found LCTs and selects the ones in the read-out
246 // time window.
247 std::vector<CSCCorrelatedLCTDigi> CSCMotherboard::readoutLCTs() const {
248  // temporary container for further selection
249  std::vector<CSCCorrelatedLCTDigi> tmpV;
250 
251  /*
252  LCTs in the BX window [early_tbin,...,late_tbin] are considered good for physics
253  The central LCT BX is time bin 8.
254  For tmb_l1a_window_size set to 7 (Run-1, Run-2), the window is [5, 6, 7, 8, 9, 10, 11]
255  For tmb_l1a_window_size set to 5 (Run-3), the window is [6, 7, 8, 9, 10]
256  For tmb_l1a_window_size set to 3 (Run-4?), the window is [ 7, 8, 9]
257  */
258  const unsigned delta_tbin = tmb_l1a_window_size / 2;
259  int early_tbin = CSCConstants::LCT_CENTRAL_BX - delta_tbin;
260  int late_tbin = CSCConstants::LCT_CENTRAL_BX + delta_tbin;
261  /*
262  Special case for an even-numbered time-window,
263  For instance tmb_l1a_window_size set to 6: [5, 6, 7, 8, 9, 10]
264  */
265  if (tmb_l1a_window_size % 2 == 0)
266  late_tbin = CSCConstants::LCT_CENTRAL_BX + delta_tbin - 1;
267  const int max_late_tbin = CSCConstants::MAX_LCT_TBINS - 1;
268 
269  // debugging messages when early_tbin or late_tbin has a suspicious value
270  bool debugTimeBins = true;
271  if (debugTimeBins) {
272  if (early_tbin < 0) {
273  edm::LogWarning("CSCMotherboard|SuspiciousParameters")
274  << "Early time bin (early_tbin) smaller than minimum allowed, which is 0. set early_tbin to 0.";
275  early_tbin = 0;
276  }
277  if (late_tbin > max_late_tbin) {
278  edm::LogWarning("CSCMotherboard|SuspiciousParameters")
279  << "Late time bin (late_tbin) larger than maximum allowed, which is " << max_late_tbin
280  << ". set early_tbin to max allowed";
281  late_tbin = CSCConstants::MAX_LCT_TBINS - 1;
282  }
283  debugTimeBins = false;
284  }
285 
286  // Start from the vector of all found correlated LCTs and select
287  // those within the LCT*L1A coincidence window.
288  int bx_readout = -1;
289  for (const auto& lct : lctV) {
290  // extra check on invalid LCTs
291  if (!lct.isValid()) {
292  continue;
293  }
294 
295  const int bx = lct.getBX();
296  // Skip LCTs found too early relative to L1Accept.
297  if (bx < early_tbin) {
298  if (infoV > 1)
299  LogDebug("CSCMotherboard") << " Do not report correlated LCT on key halfstrip " << lct.getStrip()
300  << " and key wire " << lct.getKeyWG() << ": found at bx " << bx
301  << ", whereas the earliest allowed bx is " << early_tbin;
302  continue;
303  }
304 
305  // Skip LCTs found too late relative to L1Accept.
306  if (bx > late_tbin) {
307  if (infoV > 1)
308  LogDebug("CSCMotherboard") << " Do not report correlated LCT on key halfstrip " << lct.getStrip()
309  << " and key wire " << lct.getKeyWG() << ": found at bx " << bx
310  << ", whereas the latest allowed bx is " << late_tbin;
311  continue;
312  }
313 
314  // Do not report LCTs found in ME1/A if mpc_block_me1a is set.
315  if (mpc_block_me1a and isME11_ and lct.getStrip() > CSCConstants::MAX_HALF_STRIP_ME1B) {
316  continue;
317  }
318 
319  // If (readout_earliest_2) take only LCTs in the earliest bx in the read-out window:
320  // in digi->raw step, LCTs have to be packed into the TMB header, and
321  // currently there is room just for two.
322  if (readout_earliest_2) {
323  if (bx_readout == -1 || bx == bx_readout) {
324  tmpV.push_back(lct);
325  if (bx_readout == -1)
326  bx_readout = bx;
327  }
328  }
329  // if readout_earliest_2 == false, save all LCTs
330  else {
331  tmpV.push_back(lct);
332  }
333  }
334 
335  // do a final check on the LCTs in readout
336  qualityControl_->checkMultiplicityBX(tmpV);
337  for (const auto& lct : tmpV) {
338  qualityControl_->checkValid(lct);
339  }
340 
341  return tmpV;
342 }
343 
345 
347  const CSCALCTDigi& sALCT,
348  const CSCCLCTDigi& bCLCT,
349  const CSCCLCTDigi& sCLCT,
350  CSCCorrelatedLCTDigi& bLCT,
351  CSCCorrelatedLCTDigi& sLCT,
352  int type) const {
353  CSCALCTDigi bestALCT = bALCT;
354  CSCALCTDigi secondALCT = sALCT;
355  CSCCLCTDigi bestCLCT = bCLCT;
356  CSCCLCTDigi secondCLCT = sCLCT;
357 
358  // check which ALCTs and CLCTs are valid
359  copyValidToInValid(bestALCT, secondALCT, bestCLCT, secondCLCT);
360 
361  // ALCT-only LCTs
362  const bool bestCase1(alct_trig_enable and bestALCT.isValid());
363  // CLCT-only LCTs
364  const bool bestCase2(clct_trig_enable and bestCLCT.isValid());
365  /*
366  Normal case: ALCT-CLCT matched LCTs. We require ALCT and CLCT to be valid.
367  Optionally, we can check if the ALCT cross the CLCT. This check will always return true
368  for a valid ALCT-CLCT pair in non-ME1/1 chambers. For ME1/1 chambers, it returns true,
369  only when the ALCT-CLCT pair crosses and when the parameter "checkAlctCrossClct" is set to True.
370  It is recommended to keep "checkAlctCrossClct" set to False, so that the EMTF receives
371  all information, even if it's unphysical.
372  */
373  const bool bestCase3(match_trig_enable and bestALCT.isValid() and bestCLCT.isValid() and
374  cscOverlap_->doesALCTCrossCLCT(bestALCT, bestCLCT));
375 
376  // at least one of the cases must be valid
377  if (bestCase1 or bestCase2 or bestCase3) {
378  constructLCTs(bestALCT, bestCLCT, type, 1, bLCT);
379  }
380 
381  // ALCT-only LCTs
382  const bool secondCase1(alct_trig_enable and secondALCT.isValid());
383  // CLCT-only LCTs
384  const bool secondCase2(clct_trig_enable and secondCLCT.isValid());
385  /*
386  Normal case: ALCT-CLCT matched LCTs. We require ALCT and CLCT to be valid.
387  Optionally, we can check if the ALCT cross the CLCT. This check will always return true
388  for a valid ALCT-CLCT pair in non-ME1/1 chambers. For ME1/1 chambers, it returns true,
389  only when the ALCT-CLCT pair crosses and when the parameter "checkAlctCrossClct" is set to True.
390  It is recommended to keep "checkAlctCrossClct" set to False, so that the EMTF receives
391  all information, even if it's unphysical.
392  */
393  const bool secondCase3(match_trig_enable and secondALCT.isValid() and secondCLCT.isValid() and
394  cscOverlap_->doesALCTCrossCLCT(secondALCT, secondCLCT));
395 
396  // at least one component must be different in order to consider the secondLCT
397  if ((secondALCT != bestALCT) or (secondCLCT != bestCLCT)) {
398  // at least one of the cases must be valid
399  if (secondCase1 or secondCase2 or secondCase3) {
400  constructLCTs(secondALCT, secondCLCT, type, 2, sLCT);
401  }
402  }
403 }
404 
406  CSCALCTDigi& secondALCT,
407  CSCCLCTDigi& bestCLCT,
408  CSCCLCTDigi& secondCLCT) const {
409  // check which ALCTs and CLCTs are valid
410  const bool anodeBestValid = bestALCT.isValid();
411  const bool anodeSecondValid = secondALCT.isValid();
412  const bool cathodeBestValid = bestCLCT.isValid();
413  const bool cathodeSecondValid = secondCLCT.isValid();
414 
415  // copy the valid ALCT/CLCT information to the valid ALCT/CLCT
416  if (anodeBestValid && !anodeSecondValid)
417  secondALCT = bestALCT;
418  if (!anodeBestValid && anodeSecondValid)
419  bestALCT = secondALCT;
420  if (cathodeBestValid && !cathodeSecondValid)
421  secondCLCT = bestCLCT;
422  if (!cathodeBestValid && cathodeSecondValid)
423  bestCLCT = secondCLCT;
424 }
425 
426 // This method calculates all the TMB words and then passes them to the
427 // constructor of correlated LCTs.
429  const CSCALCTDigi& aLCT, const CSCCLCTDigi& cLCT, int type, int trknmb, CSCCorrelatedLCTDigi& thisLCT) const {
430  thisLCT.setValid(true);
431  thisLCT.setType(type);
432  // make sure to shift the ALCT BX from 8 to 3 and the CLCT BX from 8 to 7!
433  thisLCT.setALCT(getBXShiftedALCT(aLCT));
434  thisLCT.setCLCT(getBXShiftedCLCT(cLCT));
435  thisLCT.setPattern(encodePattern(cLCT.getPattern()));
436  thisLCT.setMPCLink(0);
437  thisLCT.setBX0(0);
438  thisLCT.setSyncErr(0);
439  thisLCT.setCSCID(theTrigChamber);
440  thisLCT.setTrknmb(trknmb);
441  thisLCT.setWireGroup(aLCT.getKeyWG());
442  thisLCT.setStrip(cLCT.getKeyStrip());
443  thisLCT.setBend(cLCT.getBend());
444  // Bunch crossing: get it from cathode LCT if anode LCT is not there.
445  int bx = aLCT.isValid() ? aLCT.getBX() : cLCT.getBX();
446  thisLCT.setBX(bx);
447  thisLCT.setQuality(qualityAssignment_->findQuality(aLCT, cLCT));
448  if (runCCLUT_) {
449  thisLCT.setRun3(true);
450  // 4-bit slope value derived with the CCLUT algorithm
451  thisLCT.setSlope(cLCT.getSlope());
452  thisLCT.setQuartStripBit(cLCT.getQuartStripBit());
453  thisLCT.setEighthStripBit(cLCT.getEighthStripBit());
454  thisLCT.setRun3Pattern(cLCT.getRun3Pattern());
455  }
456 }
457 
458 // CLCT pattern number: encodes the pattern number itself
459 unsigned int CSCMotherboard::encodePattern(const int ptn) const {
460  const int kPatternBitWidth = 4;
461 
462  // In the TMB07 firmware, LCT pattern is just a 4-bit CLCT pattern.
463  unsigned int pattern = (abs(ptn) & ((1 << kPatternBitWidth) - 1));
464 
465  return pattern;
466 }
467 
469  // in each of the LCT time bins
470  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
471  unsigned nLCTs = 0;
472 
473  std::vector<CSCCorrelatedLCTDigi> tempV;
474  // check each of the preferred combinations
475  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
476  // select at most 2
477  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
478  if (allLCTs_(bx, mbx, i).isValid() and nLCTs < 2) {
479  tempV.push_back(allLCTs_(bx, mbx, i));
480  ++nLCTs;
481  }
482  }
483  }
484  // store the best 2
485  for (const auto& lct : tempV) {
486  lctV.push_back(lct);
487  }
488  }
489 
490  // Show the pre-selected LCTs. They're not final yet. Some selection is done in the readoutLCTs function
491  if (infoV > 0) {
492  for (const auto& lct : lctV) {
493  LogDebug("CSCMotherboard") << "Selected LCT" << lct;
494  }
495  }
496 }
497 
499  // Make sure that the parameter values are within the allowed range.
500 
501  // Max expected values.
502  static const unsigned int max_mpc_block_me1a = 1 << 1;
503  static const unsigned int max_alct_trig_enable = 1 << 1;
504  static const unsigned int max_clct_trig_enable = 1 << 1;
505  static const unsigned int max_match_trig_enable = 1 << 1;
506  static const unsigned int max_match_trig_window_size = 1 << 4;
507  static const unsigned int max_tmb_l1a_window_size = 1 << 4;
508 
509  // Checks.
510  CSCBaseboard::checkConfigParameters(mpc_block_me1a, max_mpc_block_me1a, def_mpc_block_me1a, "mpc_block_me1a");
511  CSCBaseboard::checkConfigParameters(alct_trig_enable, max_alct_trig_enable, def_alct_trig_enable, "alct_trig_enable");
512  CSCBaseboard::checkConfigParameters(clct_trig_enable, max_clct_trig_enable, def_clct_trig_enable, "clct_trig_enable");
514  match_trig_enable, max_match_trig_enable, def_match_trig_enable, "match_trig_enable");
516  match_trig_window_size, max_match_trig_window_size, def_match_trig_window_size, "match_trig_window_size");
518  tmb_l1a_window_size, max_tmb_l1a_window_size, def_tmb_l1a_window_size, "tmb_l1a_window_size");
519 }
520 
522  std::ostringstream strm;
523  strm << "\n";
524  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
525  strm << "+ TMB configuration parameters: +\n";
526  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
527  strm << " mpc_block_me1a [block/not block triggers which come from ME1/A] = " << mpc_block_me1a << "\n";
528  strm << " alct_trig_enable [allow ALCT-only triggers] = " << alct_trig_enable << "\n";
529  strm << " clct_trig_enable [allow CLCT-only triggers] = " << clct_trig_enable << "\n";
530  strm << " match_trig_enable [allow matched ALCT-CLCT triggers] = " << match_trig_enable << "\n";
531  strm << " match_trig_window_size [ALCT-CLCT match window width, in 25 ns] = " << match_trig_window_size << "\n";
532  strm << " tmb_l1a_window_size [L1Accept window width, in 25 ns bins] = " << tmb_l1a_window_size << "\n";
533  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
534  LogDebug("CSCMotherboard") << strm.str();
535 }
536 
538  CSCALCTDigi aLCT_shifted = aLCT;
539  aLCT_shifted.setBX(aLCT_shifted.getBX() - (CSCConstants::LCT_CENTRAL_BX - CSCConstants::ALCT_CENTRAL_BX));
540  return aLCT_shifted;
541 }
542 
544  CSCCLCTDigi cLCT_shifted = cLCT;
545  cLCT_shifted.setBX(cLCT_shifted.getBX() - CSCConstants::ALCT_CLCT_OFFSET);
546  return cLCT_shifted;
547 }
548 
550  // get the high multiplicity
551  // for anode this reflects what is already in the anode CSCShowerDigi object
552  unsigned cathodeInTime = clctProc->getInTimeHMT();
553  unsigned cathodeOutTime = clctProc->getOutTimeHMT();
554  unsigned anodeInTime = alctProc->getInTimeHMT();
555  unsigned anodeOutTime = alctProc->getOutTimeHMT();
556 
557  // assign the bits
558  unsigned inTimeHMT_;
559  unsigned outTimeHMT_;
560 
561  // set the value according to source
562  switch (showerSource_) {
563  case 0:
564  inTimeHMT_ = cathodeInTime;
565  outTimeHMT_ = cathodeOutTime;
566  break;
567  case 1:
568  inTimeHMT_ = anodeInTime;
569  outTimeHMT_ = anodeOutTime;
570  break;
571  case 2:
572  inTimeHMT_ = anodeInTime | cathodeInTime;
573  outTimeHMT_ = anodeOutTime | cathodeOutTime;
574  break;
575  default:
576  inTimeHMT_ = cathodeInTime;
577  outTimeHMT_ = cathodeOutTime;
578  break;
579  };
580 
581  // create a new object
582  shower_ = CSCShowerDigi(inTimeHMT_, outTimeHMT_, theTrigChamber);
583 }
CSCMotherboard::run
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
Definition: CSCMotherboard.cc:124
CSCALCTDigi::getBX
uint16_t getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:73
CSCDBL1TPParameters
Definition: CSCDBL1TPParameters.h:14
CSCMotherboard::qualityControl_
std::unique_ptr< LCTQualityControl > qualityControl_
Definition: CSCMotherboard.h:158
CSCMotherboard::selectLCTs
void selectLCTs()
Definition: CSCMotherboard.cc:468
mps_fire.i
i
Definition: mps_fire.py:428
CSCMotherboard::readoutShower
CSCShowerDigi readoutShower() const
Definition: CSCMotherboard.cc:344
CSCMotherboard::match_trig_window_size
unsigned int match_trig_window_size
Definition: CSCMotherboard.h:124
CSCMotherboard::copyValidToInValid
void copyValidToInValid(CSCALCTDigi &, CSCALCTDigi &, CSCCLCTDigi &, CSCCLCTDigi &) const
Definition: CSCMotherboard.cc:405
CSCCorrelatedLCTDigi::setValid
void setValid(const uint16_t v)
set valid
Definition: CSCCorrelatedLCTDigi.h:174
CSCMotherboard::CSCMotherboard
CSCMotherboard(unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
Definition: CSCMotherboard.cc:13
CSCMotherboard::def_clct_trig_enable
static const unsigned int def_clct_trig_enable
Definition: CSCMotherboard.h:150
CSCMotherboard::mpc_block_me1a
unsigned int mpc_block_me1a
Definition: CSCMotherboard.h:122
CSCBaseboard::cscGeometry_
const CSCGeometry * cscGeometry_
Definition: CSCBaseboard.h:65
CSCConstants::MAX_ALCT_TBINS
Definition: CSCConstants.h:127
CSCMotherboard::lctV
std::vector< CSCCorrelatedLCTDigi > lctV
Definition: CSCMotherboard.h:113
CSCBaseboard::tmbParams_
edm::ParameterSet tmbParams_
Definition: CSCBaseboard.h:72
relativeConstraints.station
station
Definition: relativeConstraints.py:67
CSCMotherboard::alctProc
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
Definition: CSCMotherboard.h:98
CSCShowerDigi
Definition: CSCShowerDigi.h:9
CSCDBL1TPParameters::tmbClctTrigEnable
unsigned int tmbClctTrigEnable() const
Definition: CSCDBL1TPParameters.h:80
CSCCLCTDigi::getEighthStripBit
bool getEighthStripBit() const
get single eighth strip bit
Definition: CSCCLCTDigi.h:114
CSCCorrelatedLCTDigi::setQuality
void setQuality(const uint16_t q)
set quality code
Definition: CSCCorrelatedLCTDigi.h:171
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
CSCMotherboard::allLCTs_
LCTContainer allLCTs_
Definition: CSCMotherboard.h:110
CSCConstants::LCT_CENTRAL_BX
Definition: CSCConstants.h:148
CSCCorrelatedLCTDigi::setWireGroup
void setWireGroup(const uint16_t wiregroup)
set wiregroup number
Definition: CSCCorrelatedLCTDigi.h:168
CSCMotherboard::def_alct_trig_enable
static const unsigned int def_alct_trig_enable
Definition: CSCMotherboard.h:150
CSCMotherboard::clear
void clear()
Definition: CSCMotherboard.cc:82
CSCMotherboard::clct_trig_enable
unsigned int clct_trig_enable
Definition: CSCMotherboard.h:123
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
CSCConstants::ALCT_CLCT_OFFSET
Definition: CSCConstants.h:164
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCDBL1TPParameters::tmbMpcBlockMe1a
unsigned int tmbMpcBlockMe1a() const
Definition: CSCDBL1TPParameters.h:74
CSCCLCTDigi::getKeyStrip
uint16_t getKeyStrip(const uint16_t n=2) const
Definition: CSCCLCTDigi.cc:99
CSCCorrelatedLCTDigi::setBX0
void setBX0(const uint16_t b)
set bx0
Definition: CSCCorrelatedLCTDigi.h:195
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
CSCCLCTDigi
Definition: CSCCLCTDigi.h:17
CSCCorrelatedLCTDigi::ALCTCLCT
Definition: CSCCorrelatedLCTDigi.h:28
CSCMotherboard::checkConfigParameters
void checkConfigParameters()
Definition: CSCMotherboard.cc:498
CSCCorrelatedLCTDigi::setCLCT
void setCLCT(const CSCCLCTDigi &clct)
Definition: CSCCorrelatedLCTDigi.h:216
CSCMotherboard::clctV
std::vector< CSCCLCTDigi > clctV
Definition: CSCMotherboard.h:107
CSCMotherboard::match_earliest_clct_only_
bool match_earliest_clct_only_
Definition: CSCMotherboard.h:136
CSCMotherboard::clctProc
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
Definition: CSCMotherboard.h:101
CSCCorrelatedLCTDigi::setALCT
void setALCT(const CSCALCTDigi &alct)
Definition: CSCCorrelatedLCTDigi.h:215
CSCALCTDigi::getKeyWG
uint16_t getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:67
CSCMotherboard::correlateLCTs
void correlateLCTs(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, CSCCorrelatedLCTDigi &bLCT, CSCCorrelatedLCTDigi &sLCT, int type) const
Definition: CSCMotherboard.cc:346
CSCCorrelatedLCTDigi::setStrip
void setStrip(const uint16_t s)
set strip
Definition: CSCCorrelatedLCTDigi.h:177
CSCCLCTDigi::getQuartStripBit
bool getQuartStripBit() const
get single quart strip bit
Definition: CSCCLCTDigi.h:108
CSCCLCTDigi::getBend
uint16_t getBend() const
Definition: CSCCLCTDigi.h:93
CSCMotherboard::alctV
std::vector< CSCALCTDigi > alctV
Definition: CSCMotherboard.h:106
CSCConstants::MAX_LCTS_PER_CSC
Definition: CSCConstants.h:138
CSCDBL1TPParameters::tmbMatchTrigWindowSize
unsigned int tmbMatchTrigWindowSize() const
Definition: CSCDBL1TPParameters.h:86
CSCCorrelatedLCTDigi::CLCTONLY
Definition: CSCCorrelatedLCTDigi.h:33
CSCBaseboard::showerParams_
edm::ParameterSet showerParams_
Definition: CSCBaseboard.h:81
CSCConstants::MAX_HALF_STRIP_ME1B
Definition: CSCConstants.h:88
CSCCorrelatedLCTDigi::setMPCLink
void setMPCLink(const uint16_t &link)
Set mpc link number after MPC sorting.
Definition: CSCCorrelatedLCTDigi.h:158
CSCMotherboard::dumpConfigParams
void dumpConfigParams() const
Definition: CSCMotherboard.cc:521
CSCCorrelatedLCTDigi::setSlope
void setSlope(const uint16_t slope)
set the slope
Definition: CSCCorrelatedLCTDigi.h:186
CSCMotherboard::def_tmb_l1a_window_size
static const unsigned int def_tmb_l1a_window_size
Definition: CSCMotherboard.h:152
CSCConstants::MAX_LCT_TBINS
Definition: CSCConstants.h:128
CSCMotherboard.h
sistrip::SpyUtilities::isValid
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
Definition: SiStripSpyUtilities.cc:124
CSCALCTDigi::setBX
void setBX(const uint16_t BX)
set BX
Definition: CSCALCTDigi.h:76
CSCBaseboard::runPhase2_
bool runPhase2_
Definition: CSCBaseboard.h:87
CSCCorrelatedLCTDigi::setBend
void setBend(const uint16_t b)
set bend
Definition: CSCCorrelatedLCTDigi.h:189
CSCMotherboard::cscOverlap_
std::unique_ptr< CSCALCTCrossCLCT > cscOverlap_
Definition: CSCMotherboard.h:166
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
CSCCorrelatedLCTDigi::setBX
void setBX(const uint16_t b)
set bx
Definition: CSCCorrelatedLCTDigi.h:192
CSCCorrelatedLCTDigi::setTrknmb
void setTrknmb(const uint16_t number)
Set track number (1,2) after sorting LCTs.
Definition: CSCCorrelatedLCTDigi.h:155
edm::ParameterSet
Definition: ParameterSet.h:47
LCTContainer::clear
void clear()
Definition: LCTContainer.cc:31
CSCShowerDigi::clear
void clear()
clear this Shower
Definition: CSCShowerDigi.cc:15
CSCCorrelatedLCTDigi::setPattern
void setPattern(const uint16_t p)
set pattern
Definition: CSCCorrelatedLCTDigi.h:180
CSCBaseboard::enableAlctPhase2_
bool enableAlctPhase2_
Definition: CSCBaseboard.h:88
CSCDBL1TPParameters::tmbMatchTrigEnable
unsigned int tmbMatchTrigEnable() const
Definition: CSCDBL1TPParameters.h:83
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
CSCBaseboard
Definition: CSCBaseboard.h:14
CSCCorrelatedLCTDigi::setCSCID
void setCSCID(const uint16_t c)
set cscID
Definition: CSCCorrelatedLCTDigi.h:201
CSCMotherboard::preferred_bx_match_
std::vector< int > preferred_bx_match_
Definition: CSCMotherboard.h:146
CSCMotherboard::shower_
CSCShowerDigi shower_
Definition: CSCMotherboard.h:115
CSCMotherboard::early_tbins
int early_tbins
Definition: CSCMotherboard.h:130
CSCCorrelatedLCTDigi::setRun3Pattern
void setRun3Pattern(const uint16_t pattern)
set Run-3 pattern
Definition: CSCCorrelatedLCTDigi.h:183
CSCCLCTDigi::isValid
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:50
CSCDBL1TPParameters::tmbTmbL1aWindowSize
unsigned int tmbTmbL1aWindowSize() const
Definition: CSCDBL1TPParameters.h:89
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
CSCComparatorDigiCollection
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
CSCCLCTDigi::getSlope
uint16_t getSlope() const
return the slope
Definition: CSCCLCTDigi.h:74
CSCCorrelatedLCTDigi::setSyncErr
void setSyncErr(const uint16_t s)
set syncErr
Definition: CSCCorrelatedLCTDigi.h:198
CSCMotherboard::readout_earliest_2
bool readout_earliest_2
Definition: CSCMotherboard.h:133
CSCDBL1TPParameters::tmbAlctTrigEnable
unsigned int tmbAlctTrigEnable() const
Definition: CSCDBL1TPParameters.h:77
CSCMotherboard::drop_used_clcts
bool drop_used_clcts
Definition: CSCMotherboard.h:127
CSCCLCTDigi::getBX
uint16_t getBX() const
return BX
Definition: CSCCLCTDigi.h:123
CSCMotherboard::readoutLCTs
virtual std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const
Definition: CSCMotherboard.cc:247
CSCMotherboard::getBXShiftedCLCT
CSCCLCTDigi getBXShiftedCLCT(const CSCCLCTDigi &) const
Definition: CSCMotherboard.cc:543
CSCCorrelatedLCTDigi::setQuartStripBit
void setQuartStripBit(const bool quartStripBit)
set single quart strip bit
Definition: CSCCorrelatedLCTDigi.h:79
CSCConstants::ALCT_CENTRAL_BX
Definition: CSCConstants.h:155
CSCMotherboard::tmb_l1a_window_size
unsigned int tmb_l1a_window_size
Definition: CSCMotherboard.h:124
CSCWireDigiCollection
CSCMotherboard::setConfigParameters
void setConfigParameters(const CSCDBL1TPParameters *conf)
Definition: CSCMotherboard.cc:101
CSCALCTDigi
Definition: CSCALCTDigi.h:17
CSCMotherboard::alct_trig_enable
unsigned int alct_trig_enable
Definition: CSCMotherboard.h:123
CSCConstants::MAX_CLCT_TBINS
Definition: CSCConstants.h:126
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
CSCMotherboard::showerSource_
unsigned showerSource_
Definition: CSCMotherboard.h:139
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
CSCMotherboard::encodePattern
unsigned int encodePattern(const int clctPattern) const
Definition: CSCMotherboard.cc:459
CSCCorrelatedLCTDigi::ALCTONLY
Definition: CSCCorrelatedLCTDigi.h:34
CSCMotherboard::constructLCTs
void constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb, CSCCorrelatedLCTDigi &lct) const
Definition: CSCMotherboard.cc:428
CSCMotherboard::def_match_trig_window_size
static const unsigned int def_match_trig_window_size
Definition: CSCMotherboard.h:151
CSCALCTDigi::isValid
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:40
CSCCorrelatedLCTDigi::setEighthStripBit
void setEighthStripBit(const bool eighthStripBit)
set single eighth strip bit
Definition: CSCCorrelatedLCTDigi.h:85
CSCMotherboard::def_mpc_block_me1a
static const unsigned int def_mpc_block_me1a
Definition: CSCMotherboard.h:149
CSCMotherboard::def_match_trig_enable
static const unsigned int def_match_trig_enable
Definition: CSCMotherboard.h:151
CSCCorrelatedLCTDigi::setRun3
void setRun3(const bool isRun3)
Definition: CSCCorrelatedLCTDigi.cc:133
LCTContainer::setMatchTrigWindowSize
void setMatchTrigWindowSize(unsigned trig_window_size)
Definition: LCTContainer.h:41
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
CSCMotherboard::match_trig_enable
unsigned int match_trig_enable
Definition: CSCMotherboard.h:123
tmbParams.ignoreAlctCrossClct
ignoreAlctCrossClct
Definition: tmbParams.py:43
CSCMotherboard::getBXShiftedALCT
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
Definition: CSCMotherboard.cc:537
CSCCLCTDigi::getPattern
uint16_t getPattern() const
return pattern
Definition: CSCCLCTDigi.h:62
CSCCorrelatedLCTDigi::setType
void setType(int type)
Definition: CSCCorrelatedLCTDigi.h:213
CSCMotherboard::encodeHighMultiplicityBits
void encodeHighMultiplicityBits()
Definition: CSCMotherboard.cc:549
CSCMotherboard::qualityAssignment_
std::unique_ptr< LCTQualityAssignment > qualityAssignment_
Definition: CSCMotherboard.h:155
CSCBaseboard::isME11_
bool isME11_
Definition: CSCBaseboard.h:51
CSCCorrelatedLCTDigi
Definition: CSCCorrelatedLCTDigi.h:19
CSCBaseboard::runCCLUT_
bool runCCLUT_
Definition: CSCBaseboard.h:105
CSCBaseboard::infoV
int infoV
Definition: CSCBaseboard.h:63
CSCBaseboard::theRing
unsigned theRing
Definition: CSCBaseboard.h:47
CSCCLCTDigi::getRun3Pattern
uint16_t getRun3Pattern() const
return pattern
Definition: CSCCLCTDigi.h:68