CMS 3D CMS Logo

CSCMotherboard.cc
Go to the documentation of this file.
2 #include <iostream>
3 
4 // Default values of configuration parameters.
5 const unsigned int CSCMotherboard::def_mpc_block_me1a = 1;
6 const unsigned int CSCMotherboard::def_alct_trig_enable = 0;
7 const unsigned int CSCMotherboard::def_clct_trig_enable = 0;
8 const unsigned int CSCMotherboard::def_match_trig_enable = 1;
9 const unsigned int CSCMotherboard::def_match_trig_window_size = 7;
10 const unsigned int CSCMotherboard::def_tmb_l1a_window_size = 7;
11 
13  unsigned sector, unsigned subsector,
14  unsigned chamber,
15  const edm::ParameterSet& conf) :
16  CSCBaseboard(endcap, station, sector, subsector, chamber, conf)
17 {
18  // Normal constructor. -JM
19  // Pass ALCT, CLCT, and common parameters on to ALCT and CLCT processors.
20  static std::atomic<bool> config_dumped{false};
21 
22  mpc_block_me1a = tmbParams_.getParameter<unsigned int>("mpcBlockMe1a");
23  alct_trig_enable = tmbParams_.getParameter<unsigned int>("alctTrigEnable");
24  clct_trig_enable = tmbParams_.getParameter<unsigned int>("clctTrigEnable");
25  match_trig_enable = tmbParams_.getParameter<unsigned int>("matchTrigEnable");
27  tmbParams_.getParameter<unsigned int>("matchTrigWindowSize");
28  tmb_l1a_window_size = // Common to CLCT and TMB
29  tmbParams_.getParameter<unsigned int>("tmbL1aWindowSize");
30 
31  // configuration handle for number of early time bins
32  early_tbins = tmbParams_.getParameter<int>("tmbEarlyTbins");
33 
34  // whether to not reuse ALCTs that were used by previous matching CLCTs
35  drop_used_alcts = tmbParams_.getParameter<bool>("tmbDropUsedAlcts");
36  drop_used_clcts = tmbParams_.getParameter<bool>("tmbDropUsedClcts");
37 
38  clct_to_alct = tmbParams_.getParameter<bool>("clctToAlct");
39 
40  // whether to readout only the earliest two LCTs in readout window
41  readout_earliest_2 = tmbParams_.getParameter<bool>("tmbReadoutEarliest2");
42 
43  infoV = tmbParams_.getParameter<int>("verbosity");
44 
45  alctProc.reset( new CSCAnodeLCTProcessor(endcap, station, sector, subsector, chamber, conf) );
46  clctProc.reset( new 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 }
55 
57  CSCBaseboard()
58 {
59  // Constructor used only for testing. -JM
60  static std::atomic<bool> config_dumped{false};
61 
62  early_tbins = 4;
63 
64  alctProc.reset( new CSCAnodeLCTProcessor() );
65  clctProc.reset( new CSCCathodeLCTProcessor() );
72 
73  infoV = 2;
74 
75  // Check and print configuration parameters.
77  if (infoV > 0 && !config_dumped) {
79  config_dumped = true;
80  }
81 }
82 
84 {
85  // clear the processors
86  if (alctProc) alctProc->clear();
87  if (clctProc) clctProc->clear();
88 
89  // clear the ALCT and CLCT containers
90  alctV.clear();
91  clctV.clear();
92 
93  // clear the LCT containers
94  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
95  firstLCT[bx].clear();
96  secondLCT[bx].clear();
97  }
98 }
99 
100 // Set configuration parameters obtained via EventSetup mechanism.
102 {
103  static std::atomic<bool> config_dumped{false};
104 
105  // Config. parameters for the TMB itself.
112 
113  // Config. paramteres for ALCT and CLCT processors.
114  alctProc->setConfigParameters(conf);
115  clctProc->setConfigParameters(conf);
116 
117  // Check and print configuration parameters.
119  if (!config_dumped) {
121  config_dumped = true;
122  }
123 }
124 
125 void
127  const CSCComparatorDigiCollection* compdc)
128 {
129  // clear the ALCT/CLCT/LCT containers. Clear the processors
130  clear();
131 
132  // Check for existing processors
133  if (!( alctProc && clctProc))
134  {
135  if (infoV >= 0) edm::LogError("CSCMotherboard|SetupError")
136  << "+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
137  return;
138  }
139 
140  // set geometry
141  alctProc->setCSCGeometry(cscGeometry_);
142  clctProc->setCSCGeometry(cscGeometry_);
143 
144  alctV = alctProc->run(wiredc); // run anodeLCT
145  clctV = clctProc->run(compdc); // run cathodeLCT
146 
147  // if there are no ALCTs and no CLCTs, it does not make sense to run this TMB
148  if (alctV.empty() and clctV.empty()) return;
149 
150  // CLCT-centric matching
151  if (clct_to_alct){
152  int used_alct_mask[20];
153  for (int a=0;a<20;++a) used_alct_mask[a]=0;
154 
155  int bx_alct_matched = 0; // bx of last matched ALCT
156  for (int bx_clct = 0; bx_clct < CSCConstants::MAX_CLCT_TBINS;
157  bx_clct++) {
158  // There should be at least one valid ALCT or CLCT for a
159  // correlated LCT to be formed. Decision on whether to reject
160  // non-complete LCTs (and if yes of which type) is made further
161  // upstream.
162  if (clctProc->bestCLCT[bx_clct].isValid()) {
163  // Look for ALCTs within the match-time window. The window is
164  // centered at the CLCT bx; therefore, we make an assumption
165  // that anode and cathode hits are perfectly synchronized. This
166  // is always true for MC, but only an approximation when the
167  // data is analyzed (which works fairly good as long as wide
168  // windows are used). To get rid of this assumption, one would
169  // need to access "full BX" words, which are not readily
170  // available.
171  bool is_matched = false;
172  const int bx_alct_start = bx_clct - match_trig_window_size/2 + alctClctOffset_;
173  const int bx_alct_stop = bx_clct + match_trig_window_size/2 + alctClctOffset_;
174 
175  for (int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++) {
176  if (bx_alct < 0 || bx_alct >= CSCConstants::MAX_ALCT_TBINS)
177  continue;
178  // default: do not reuse ALCTs that were used with previous CLCTs
179  if (drop_used_alcts && used_alct_mask[bx_alct]) continue;
180  if (alctProc->bestALCT[bx_alct].isValid()) {
181  if (infoV > 1) LogTrace("CSCMotherboard")
182  << "Successful CLCT-ALCT match: bx_clct = " << bx_clct
183  << "; match window: [" << bx_alct_start << "; " << bx_alct_stop
184  << "]; bx_alct = " << bx_alct;
185  correlateLCTs(alctProc->bestALCT[bx_alct], alctProc->secondALCT[bx_alct],
186  clctProc->bestCLCT[bx_clct], clctProc->secondCLCT[bx_clct],
188  used_alct_mask[bx_alct] += 1;
189  is_matched = true;
190  bx_alct_matched = bx_alct;
191  break;
192  }
193  }
194  // No ALCT within the match time interval found: report CLCT-only LCT
195  // (use dummy ALCTs).
196  if (!is_matched and clct_trig_enable) {
197  if (infoV > 1) LogTrace("CSCMotherboard")
198  << "Unsuccessful CLCT-ALCT match (CLCT only): bx_clct = "
199  << bx_clct <<" first ALCT "<< clctProc->bestCLCT[bx_clct]
200  << "; match window: [" << bx_alct_start
201  << "; " << bx_alct_stop << "]";
202  correlateLCTs(alctProc->bestALCT[bx_clct], alctProc->secondALCT[bx_clct],
203  clctProc->bestCLCT[bx_clct], clctProc->secondCLCT[bx_clct],
205  }
206  }
207  // No valid CLCTs; attempt to make ALCT-only LCT. Use only ALCTs
208  // which have zeroth chance to be matched at later cathode times.
209  // (I am not entirely sure this perfectly matches the firmware logic.)
210  // Use dummy CLCTs.
211  else {
212  int bx_alct = bx_clct - match_trig_window_size/2;
213  if (bx_alct >= 0 && bx_alct > bx_alct_matched) {
214  if (alctProc->bestALCT[bx_alct].isValid() and alct_trig_enable) {
215  if (infoV > 1) LogTrace("CSCMotherboard")
216  << "Unsuccessful CLCT-ALCT match (ALCT only): bx_alct = "
217  << bx_alct;
218  correlateLCTs(alctProc->bestALCT[bx_alct], alctProc->secondALCT[bx_alct],
219  clctProc->bestCLCT[bx_clct], clctProc->secondCLCT[bx_clct],
221  }
222  }
223  }
224  }
225  }
226  // ALCT-centric matching
227  else {
228  int used_clct_mask[20];
229  for (int a=0;a<20;++a) used_clct_mask[a]=0;
230 
231  int bx_clct_matched = 0; // bx of last matched CLCT
232  for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS;
233  bx_alct++) {
234  // There should be at least one valid CLCT or ALCT for a
235  // correlated LCT to be formed. Decision on whether to reject
236  // non-complete LCTs (and if yes of which type) is made further
237  // upstream.
238  if (alctProc->bestALCT[bx_alct].isValid()) {
239  // Look for CLCTs within the match-time window. The window is
240  // centered at the ALCT bx; therefore, we make an assumption
241  // that anode and cathode hits are perfectly synchronized. This
242  // is always true for MC, but only an approximation when the
243  // data is analyzed (which works fairly good as long as wide
244  // windows are used). To get rid of this assumption, one would
245  // need to access "full BX" words, which are not readily
246  // available.
247  bool is_matched = false;
248  const int bx_clct_start = bx_alct - match_trig_window_size/2 - alctClctOffset_;
249  const int bx_clct_stop = bx_alct + match_trig_window_size/2 - alctClctOffset_;
250 
251  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
252  if (bx_clct < 0 || bx_clct >= CSCConstants::MAX_CLCT_TBINS)
253  continue;
254  // default: do not reuse CLCTs that were used with previous ALCTs
255  if (drop_used_clcts && used_clct_mask[bx_clct]) continue;
256  if (clctProc->bestCLCT[bx_clct].isValid()) {
257  if (infoV > 1) LogTrace("CSCMotherboard")
258  << "Successful ALCT-CLCT match: bx_alct = " << bx_alct
259  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop
260  << "]; bx_clct = " << bx_clct;
261  correlateLCTs(alctProc->bestALCT[bx_alct], alctProc->secondALCT[bx_alct],
262  clctProc->bestCLCT[bx_clct], clctProc->secondCLCT[bx_clct],
264  used_clct_mask[bx_clct] += 1;
265  is_matched = true;
266  bx_clct_matched = bx_clct;
267  break;
268  }
269  }
270  // No CLCT within the match time interval found: report ALCT-only LCT
271  // (use dummy CLCTs).
272  if (!is_matched) {
273  if (infoV > 1) LogTrace("CSCMotherboard")
274  << "Unsuccessful ALCT-CLCT match (ALCT only): bx_alct = "
275  << bx_alct <<" first ALCT "<< alctProc->bestALCT[bx_alct]
276  << "; match window: [" << bx_clct_start
277  << "; " << bx_clct_stop << "]";
278  if (alct_trig_enable)
279  correlateLCTs(alctProc->bestALCT[bx_alct], alctProc->secondALCT[bx_alct],
280  clctProc->bestCLCT[bx_alct], clctProc->secondCLCT[bx_alct],
282  }
283  }
284  // No valid ALCTs; attempt to make CLCT-only LCT. Use only CLCTs
285  // which have zeroth chance to be matched at later cathode times.
286  // (I am not entirely sure this perfectly matches the firmware logic.)
287  // Use dummy ALCTs.
288  else {
289  int bx_clct = bx_alct - match_trig_window_size/2;
290  if (bx_clct >= 0 && bx_clct > bx_clct_matched) {
291  if (clctProc->bestCLCT[bx_clct].isValid() and clct_trig_enable) {
292  if (infoV > 1) LogTrace("CSCMotherboard")
293  << "Unsuccessful ALCT-CLCT match (CLCT only): bx_clct = "
294  << bx_clct;
295  correlateLCTs(alctProc->bestALCT[bx_alct], alctProc->secondALCT[bx_alct],
296  clctProc->bestCLCT[bx_clct], clctProc->secondCLCT[bx_clct],
298  }
299  }
300  }
301  }
302  }
303 
304  // Debug first and second LCTs
305  if (infoV > 0) {
306  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
307  if (firstLCT[bx].isValid())
308  LogDebug("CSCMotherboard") << firstLCT[bx];
309  if (secondLCT[bx].isValid())
310  LogDebug("CSCMotherboard") << secondLCT[bx];
311  }
312  }
313 }
314 
315 
316 // Returns vector of read-out correlated LCTs, if any. Starts with
317 // the vector of all found LCTs and selects the ones in the read-out
318 // time window.
319 std::vector<CSCCorrelatedLCTDigi> CSCMotherboard::readoutLCTs() const
320 {
321  std::vector<CSCCorrelatedLCTDigi> tmpV;
322 
323  // The start time of the L1A*LCT coincidence window should be related
324  // to the fifo_pretrig parameter, but I am not completely sure how.
325  // Just choose it such that the window is centered at bx=7. This may
326  // need further tweaking if the value of tmb_l1a_window_size changes.
327  //static int early_tbins = 4;
328 
329  // Empirical correction to match 2009 collision data (firmware change?)
330  int lct_bins = tmb_l1a_window_size;
331  int late_tbins = early_tbins + lct_bins;
332 
333  int ifois = 0;
334  if (ifois == 0) {
335  if (infoV >= 0 && early_tbins < 0) {
336  edm::LogWarning("CSCMotherboard|SuspiciousParameters")
337  << "+++ early_tbins = " << early_tbins
338  << "; in-time LCTs are not getting read-out!!! +++" << "\n";
339  }
340 
341  if (late_tbins > CSCConstants::MAX_LCT_TBINS-1) {
342  if (infoV >= 0) edm::LogWarning("CSCMotherboard|SuspiciousParameters")
343  << "+++ Allowed range of time bins, [0-" << late_tbins
344  << "] exceeds max allowed, " << CSCConstants::MAX_LCT_TBINS-1 << " +++\n"
345  << "+++ Set late_tbins to max allowed +++\n";
346  late_tbins = CSCConstants::MAX_LCT_TBINS-1;
347  }
348  ifois = 1;
349  }
350 
351  // Start from the vector of all found correlated LCTs and select
352  // those within the LCT*L1A coincidence window.
353  int bx_readout = -1;
354  const std::vector<CSCCorrelatedLCTDigi>& all_lcts = getLCTs();
355  for (auto plct = all_lcts.begin(); plct != all_lcts.end(); plct++) {
356  if (!plct->isValid()) continue;
357 
358  int bx = (*plct).getBX();
359  // Skip LCTs found too early relative to L1Accept.
360  if (bx <= early_tbins) {
361  if (infoV > 1) LogDebug("CSCMotherboard")
362  << " Do not report correlated LCT on key halfstrip "
363  << plct->getStrip() << " and key wire " << plct->getKeyWG()
364  << ": found at bx " << bx << ", whereas the earliest allowed bx is "
365  << early_tbins+1;
366  continue;
367  }
368 
369  // Skip LCTs found too late relative to L1Accept.
370  if (bx > late_tbins) {
371  if (infoV > 1) LogDebug("CSCMotherboard")
372  << " Do not report correlated LCT on key halfstrip "
373  << plct->getStrip() << " and key wire " << plct->getKeyWG()
374  << ": found at bx " << bx << ", whereas the latest allowed bx is "
375  << late_tbins;
376  continue;
377  }
378 
379  // If (readout_earliest_2) take only LCTs in the earliest bx in the read-out window:
380  // in digi->raw step, LCTs have to be packed into the TMB header, and
381  // currently there is room just for two.
382  if (readout_earliest_2) {
383  if (bx_readout == -1 || bx == bx_readout) {
384  tmpV.push_back(*plct);
385  if (bx_readout == -1) bx_readout = bx;
386  }
387  }
388  // if readout_earliest_2 == false, save all LCTs
389  else tmpV.push_back(*plct);
390  }
391  return tmpV;
392 }
393 
394 // Returns vector of all found correlated LCTs, if any.
395 std::vector<CSCCorrelatedLCTDigi> CSCMotherboard::getLCTs() const
396 {
397  std::vector<CSCCorrelatedLCTDigi> tmpV;
398 
399  // Do not report LCTs found in ME1/A if mpc_block_me1/a is set.
400  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
401  if (firstLCT[bx].isValid())
402  if (!mpc_block_me1a || (!isME11_ || firstLCT[bx].getStrip() <= 127))
403  tmpV.push_back(firstLCT[bx]);
404  if (secondLCT[bx].isValid())
405  if (!mpc_block_me1a || (!isME11_ || secondLCT[bx].getStrip() <= 127))
406  tmpV.push_back(secondLCT[bx]);
407  }
408  return tmpV;
409 }
410 
412  const CSCALCTDigi& sALCT,
413  const CSCCLCTDigi& bCLCT,
414  const CSCCLCTDigi& sCLCT,
415  int type)
416 {
417  CSCALCTDigi bestALCT = bALCT;
418  CSCALCTDigi secondALCT = sALCT;
419  CSCCLCTDigi bestCLCT = bCLCT;
420  CSCCLCTDigi secondCLCT = sCLCT;
421 
422  bool anodeBestValid = bestALCT.isValid();
423  bool anodeSecondValid = secondALCT.isValid();
424  bool cathodeBestValid = bestCLCT.isValid();
425  bool cathodeSecondValid = secondCLCT.isValid();
426 
427  if (anodeBestValid && !anodeSecondValid) secondALCT = bestALCT;
428  if (!anodeBestValid && anodeSecondValid) bestALCT = secondALCT;
429  if (cathodeBestValid && !cathodeSecondValid) secondCLCT = bestCLCT;
430  if (!cathodeBestValid && cathodeSecondValid) bestCLCT = secondCLCT;
431 
432  // ALCT-CLCT matching conditions are defined by "trig_enable" configuration
433  // parameters.
434  if ((alct_trig_enable && bestALCT.isValid()) ||
435  (clct_trig_enable && bestCLCT.isValid()) ||
436  (match_trig_enable && bestALCT.isValid() && bestCLCT.isValid())) {
437  const CSCCorrelatedLCTDigi& lct = constructLCTs(bestALCT, bestCLCT, type, 1);
438  int bx = lct.getBX();
439  if (bx >= 0 && bx < CSCConstants::MAX_LCT_TBINS) {
440  firstLCT[bx] = lct;
441  }
442  else {
443  if (infoV > 0) edm::LogWarning("CSCMotherboard|OutOfTimeLCT")
444  << "+++ Bx of first LCT candidate, " << bx
445  << ", is not within the allowed range, [0-" << CSCConstants::MAX_LCT_TBINS-1
446  << "); skipping it... +++\n";
447  }
448  }
449 
450  if (((secondALCT != bestALCT) || (secondCLCT != bestCLCT)) &&
451  ((alct_trig_enable && secondALCT.isValid()) ||
452  (clct_trig_enable && secondCLCT.isValid()) ||
453  (match_trig_enable && secondALCT.isValid() && secondCLCT.isValid()))) {
454  const CSCCorrelatedLCTDigi& lct = constructLCTs(secondALCT, secondCLCT, type, 2);
455  int bx = lct.getBX();
456  if (bx >= 0 && bx < CSCConstants::MAX_LCT_TBINS) {
457  secondLCT[bx] = lct;
458  }
459  else {
460  if (infoV > 0) edm::LogWarning("CSCMotherboard|OutOfTimeLCT")
461  << "+++ Bx of second LCT candidate, " << bx
462  << ", is not within the allowed range, [0-" << CSCConstants::MAX_LCT_TBINS-1
463  << "); skipping it... +++\n";
464  }
465  }
466 }
467 
468 // This method calculates all the TMB words and then passes them to the
469 // constructor of correlated LCTs.
471  const CSCCLCTDigi& cLCT,
472  int type,
473  int trknmb) const
474 {
475  // CLCT pattern number
476  unsigned int pattern = encodePattern(cLCT.getPattern());
477 
478  // LCT quality number
479  unsigned int quality = findQuality(aLCT, cLCT);
480 
481  // Bunch crossing: get it from cathode LCT if anode LCT is not there.
482  int bx = aLCT.isValid() ? aLCT.getBX() : cLCT.getBX();
483 
484  // construct correlated LCT
485  CSCCorrelatedLCTDigi thisLCT(trknmb, 1, quality, aLCT.getKeyWG(),
486  cLCT.getKeyStrip(), pattern, cLCT.getBend(),
487  bx, 0, 0, 0, theTrigChamber);
488  thisLCT.setType(type);
489  // make sure to shift the ALCT BX from 8 to 3!
490  thisLCT.setALCT(getBXShiftedALCT(aLCT));
491  thisLCT.setCLCT(cLCT);
492  return thisLCT;
493 }
494 
495 // CLCT pattern number: encodes the pattern number itself
496 unsigned int CSCMotherboard::encodePattern(const int ptn) const
497 {
498  const int kPatternBitWidth = 4;
499 
500  // In the TMB07 firmware, LCT pattern is just a 4-bit CLCT pattern.
501  unsigned int pattern = (abs(ptn) & ((1<<kPatternBitWidth)-1));
502 
503  return pattern;
504 }
505 
506 // 4-bit LCT quality number.
507 unsigned int CSCMotherboard::findQuality(const CSCALCTDigi& aLCT,
508  const CSCCLCTDigi& cLCT) const
509 {
510  unsigned int quality = 0;
511 
512  // 2008 definition.
513  if (!(aLCT.isValid()) || !(cLCT.isValid())) {
514  if (aLCT.isValid() && !(cLCT.isValid())) quality = 1; // no CLCT
515  else if (!(aLCT.isValid()) && cLCT.isValid()) quality = 2; // no ALCT
516  else quality = 0; // both absent; should never happen.
517  }
518  else {
519  int pattern = cLCT.getPattern();
520  if (pattern == 1) quality = 3; // layer-trigger in CLCT
521  else {
522  // CLCT quality is the number of layers hit minus 3.
523  // CLCT quality is the number of layers hit.
524  bool a4 = (aLCT.getQuality() >= 1);
525  bool c4 = (cLCT.getQuality() >= 4);
526  // quality = 4; "reserved for low-quality muons in future"
527  if (!a4 && !c4) quality = 5; // marginal anode and cathode
528  else if ( a4 && !c4) quality = 6; // HQ anode, but marginal cathode
529  else if (!a4 && c4) quality = 7; // HQ cathode, but marginal anode
530  else if ( a4 && c4) {
531  if (aLCT.getAccelerator()) quality = 8; // HQ muon, but accel ALCT
532  else {
533  // quality = 9; "reserved for HQ muons with future patterns
534  // quality = 10; "reserved for HQ muons with future patterns
535  if (pattern == 2 || pattern == 3) quality = 11;
536  else if (pattern == 4 || pattern == 5) quality = 12;
537  else if (pattern == 6 || pattern == 7) quality = 13;
538  else if (pattern == 8 || pattern == 9) quality = 14;
539  else if (pattern == 10) quality = 15;
540  else {
541  if (infoV >= 0) edm::LogWarning("CSCMotherboard|WrongValues")
542  << "+++ findQuality: Unexpected CLCT pattern id = "
543  << pattern << "+++\n";
544  }
545  }
546  }
547  }
548  }
549  return quality;
550 }
551 
553 {
554  // Make sure that the parameter values are within the allowed range.
555 
556  // Max expected values.
557  static const unsigned int max_mpc_block_me1a = 1 << 1;
558  static const unsigned int max_alct_trig_enable = 1 << 1;
559  static const unsigned int max_clct_trig_enable = 1 << 1;
560  static const unsigned int max_match_trig_enable = 1 << 1;
561  static const unsigned int max_match_trig_window_size = 1 << 4;
562  static const unsigned int max_tmb_l1a_window_size = 1 << 4;
563 
564  // Checks.
565  if (mpc_block_me1a >= max_mpc_block_me1a) {
566  if (infoV >= 0) edm::LogError("CSCMotherboard|ConfigError")
567  << "+++ Value of mpc_block_me1a, " << mpc_block_me1a
568  << ", exceeds max allowed, " << max_mpc_block_me1a-1 << " +++\n"
569  << "+++ Try to proceed with the default value, mpc_block_me1a="
570  << def_mpc_block_me1a << " +++\n";
572  }
573  if (alct_trig_enable >= max_alct_trig_enable) {
574  if (infoV >= 0) edm::LogError("CSCMotherboard|ConfigError")
575  << "+++ Value of alct_trig_enable, " << alct_trig_enable
576  << ", exceeds max allowed, " << max_alct_trig_enable-1 << " +++\n"
577  << "+++ Try to proceed with the default value, alct_trig_enable="
578  << def_alct_trig_enable << " +++\n";
580  }
581  if (clct_trig_enable >= max_clct_trig_enable) {
582  if (infoV >= 0) edm::LogError("CSCMotherboard|ConfigError")
583  << "+++ Value of clct_trig_enable, " << clct_trig_enable
584  << ", exceeds max allowed, " << max_clct_trig_enable-1 << " +++\n"
585  << "+++ Try to proceed with the default value, clct_trig_enable="
586  << def_clct_trig_enable << " +++\n";
588  }
589  if (match_trig_enable >= max_match_trig_enable) {
590  if (infoV >= 0) edm::LogError("CSCMotherboard|ConfigError")
591  << "+++ Value of match_trig_enable, " << match_trig_enable
592  << ", exceeds max allowed, " << max_match_trig_enable-1 << " +++\n"
593  << "+++ Try to proceed with the default value, match_trig_enable="
594  << def_match_trig_enable << " +++\n";
596  }
597  if (match_trig_window_size >= max_match_trig_window_size) {
598  if (infoV >= 0) edm::LogError("CSCMotherboard|ConfigError")
599  << "+++ Value of match_trig_window_size, " << match_trig_window_size
600  << ", exceeds max allowed, " << max_match_trig_window_size-1 << " +++\n"
601  << "+++ Try to proceed with the default value, match_trig_window_size="
602  << def_match_trig_window_size << " +++\n";
604  }
605  if (tmb_l1a_window_size >= max_tmb_l1a_window_size) {
606  if (infoV >= 0) edm::LogError("CSCMotherboard|ConfigError")
607  << "+++ Value of tmb_l1a_window_size, " << tmb_l1a_window_size
608  << ", exceeds max allowed, " << max_tmb_l1a_window_size-1 << " +++\n"
609  << "+++ Try to proceed with the default value, tmb_l1a_window_size="
610  << def_tmb_l1a_window_size << " +++\n";
612  }
613 }
614 
616  std::ostringstream strm;
617  strm << "\n";
618  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
619  strm << "+ TMB configuration parameters: +\n";
620  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
621  strm << " mpc_block_me1a [block/not block triggers which come from ME1/A] = "
622  << mpc_block_me1a << "\n";
623  strm << " alct_trig_enable [allow ALCT-only triggers] = "
624  << alct_trig_enable << "\n";
625  strm << " clct_trig_enable [allow CLCT-only triggers] = "
626  << clct_trig_enable << "\n";
627  strm << " match_trig_enable [allow matched ALCT-CLCT triggers] = "
628  << match_trig_enable << "\n";
629  strm << " match_trig_window_size [ALCT-CLCT match window width, in 25 ns] = "
630  << match_trig_window_size << "\n";
631  strm << " tmb_l1a_window_size [L1Accept window width, in 25 ns bins] = "
632  << tmb_l1a_window_size << "\n";
633  strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
634  LogDebug("CSCMotherboard") << strm.str();
635 }
636 
639 {
640  CSCALCTDigi aLCT_shifted = aLCT;
641  aLCT_shifted.setBX(aLCT_shifted.getBX() - (CSCConstants::LCT_CENTRAL_BX - tmb_l1a_window_size/2));
642  return aLCT_shifted;
643 }
#define LogDebug(id)
int getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTDigi.h:41
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
std::vector< CSCCLCTDigi > clctV
unsigned int clct_trig_enable
unsigned int match_trig_window_size
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
static const unsigned int def_alct_trig_enable
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:32
void correlateLCTs(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, int type)
static const unsigned int def_mpc_block_me1a
unsigned int tmbClctTrigEnable() const
CSCCorrelatedLCTDigi secondLCT[CSCConstants::MAX_LCT_TBINS]
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
static const unsigned int def_clct_trig_enable
int getBend() const
return bend
Definition: CSCCLCTDigi.h:59
unsigned int mpc_block_me1a
std::vector< CSCCorrelatedLCTDigi > getLCTs() const
const unsigned theTrigChamber
Definition: CSCBaseboard.h:37
unsigned int tmbTmbL1aWindowSize() const
unsigned int tmbMatchTrigWindowSize() const
static const unsigned int def_tmb_l1a_window_size
std::vector< CSCALCTDigi > alctV
int getBX() const
return BX
Definition: CSCCLCTDigi.h:77
unsigned int tmbAlctTrigEnable() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned int encodePattern(const int clctPattern) const
unsigned int tmb_l1a_window_size
void checkConfigParameters()
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:35
unsigned int match_trig_enable
CSCCorrelatedLCTDigi constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb) const
#define LogTrace(id)
int getBX() const
return BX
int getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:65
const CSCGeometry * cscGeometry_
Definition: CSCBaseboard.h:54
unsigned int tmbMpcBlockMe1a() const
edm::ParameterSet tmbParams_
Definition: CSCBaseboard.h:61
int getQuality() const
return quality of a pattern
Definition: CSCALCTDigi.h:38
virtual void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
int getAccelerator() const
Definition: CSCALCTDigi.h:45
unsigned int findQuality(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT) const
int getPattern() const
return pattern
Definition: CSCCLCTDigi.h:47
static const unsigned int def_match_trig_window_size
unsigned int alct_trig_enable
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
double a
Definition: hdecay.h:121
void dumpConfigParams() const
int getKeyStrip() const
Definition: CSCCLCTDigi.h:94
void setConfigParameters(const CSCDBL1TPParameters *conf)
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:59
unsigned int alctClctOffset_
Definition: CSCBaseboard.h:86
static const unsigned int def_match_trig_enable
virtual std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const
void setBX(const int BX)
set BX
Definition: CSCALCTDigi.h:68
unsigned int tmbMatchTrigEnable() const
CSCCorrelatedLCTDigi firstLCT[CSCConstants::MAX_LCT_TBINS]