CMS 3D CMS Logo

CSCGEMMotherboardME21.cc
Go to the documentation of this file.
2 
4  unsigned station,
5  unsigned sector,
6  unsigned subsector,
7  unsigned chamber,
8  const edm::ParameterSet& conf)
9  : CSCGEMMotherboard(endcap, station, sector, subsector, chamber, conf),
10  dropLowQualityCLCTsNoGEMs_(tmbParams_.getParameter<bool>("dropLowQualityCLCTsNoGEMs")),
11  dropLowQualityALCTsNoGEMs_(tmbParams_.getParameter<bool>("dropLowQualityALCTsNoGEMs")),
12  buildLCTfromALCTandGEM_(tmbParams_.getParameter<bool>("buildLCTfromALCTandGEM")),
13  buildLCTfromCLCTandGEM_(tmbParams_.getParameter<bool>("buildLCTfromCLCTandGEM")) {
14  if (!isSLHC_) {
15  edm::LogError("CSCGEMMotherboardME21|SetupError") << "+++ TMB constructed while isSLHC is not set! +++\n";
16  }
17 
18  if (!runME21ILT_) {
19  edm::LogError("CSCGEMMotherboardME21|SetupError") << "+++ TMB constructed while runME21ILT_ is not set! +++\n";
20  }
21 
22  // set LUTs
23  tmbLUT_.reset(new CSCGEMMotherboardLUTME21());
24 }
25 
27  if (!isSLHC_) {
28  edm::LogError("CSCGEMMotherboardME21|SetupError") << "+++ TMB constructed while isSLHC is not set! +++\n";
29  }
30 
31  if (!runME21ILT_) {
32  edm::LogError("CSCGEMMotherboardME21|SetupError") << "+++ TMB constructed while runME21ILT_ is not set! +++\n";
33  }
34 }
35 
37 
39  const CSCComparatorDigiCollection* compdc,
40  const GEMPadDigiClusterCollection* gemClusters) {
41  std::unique_ptr<GEMPadDigiCollection> gemPads(new GEMPadDigiCollection());
42  coPadProcessor->declusterize(gemClusters, *gemPads);
43  run(wiredc, compdc, gemPads.get());
44 }
45 
47  const CSCComparatorDigiCollection* compdc,
48  const GEMPadDigiCollection* gemPads) {
50  setupGeometry();
51  debugLUTs();
52 
53  // encode high multiplicity bits
54  unsigned alctBits = alctProc->getHighMultiplictyBits();
56 
57  if (gem_g != nullptr) {
58  if (infoV >= 0)
59  edm::LogInfo("CSCGEMMotherboardME21|SetupInfo") << "+++ run() called for GEM-CSC integrated trigger! +++ \n";
60  gemGeometryAvailable = true;
61  }
62 
63  // check for GEM geometry
64  if (not gemGeometryAvailable) {
65  edm::LogError("CSCGEMMotherboardME21|SetupError")
66  << "+++ run() called for GEM-CSC integrated trigger without valid GEM geometry! +++ \n";
67  return;
68  }
69  gemCoPadV = coPadProcessor->run(gemPads); // run copad processor in GE1/1
70 
71  if (!(alctProc and clctProc)) {
72  edm::LogError("CSCGEMMotherboardME21|SetupError")
73  << "+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
74  return;
75  }
76 
77  alctProc->setCSCGeometry(cscGeometry_);
78  clctProc->setCSCGeometry(cscGeometry_);
79 
80  alctV = alctProc->run(wiredc); // run anodeLCT
81  clctV = clctProc->run(compdc); // run cathodeLCT
82 
83  // if there are no ALCTs and no CLCTs, it does not make sense to run this TMB
84  if (alctV.empty() and clctV.empty())
85  return;
86 
87  LogTrace("CSCGEMCMotherboardME21") << "ALL ALCTs from ME21 " << std::endl;
88  for (const auto& alct : alctV)
89  if (alct.isValid())
90  LogTrace("CSCGEMCMotherboardME21") << alct << std::endl;
91 
92  LogTrace("CSCGEMCMotherboardME21") << "ALL CLCTs from ME21 " << std::endl;
93  for (const auto& clct : clctV)
94  if (clct.isValid())
95  LogTrace("CSCGEMCMotherboardME21") << clct << std::endl;
96 
97  int used_clct_mask[20];
98  for (int c = 0; c < 20; ++c)
99  used_clct_mask[c] = 0;
100 
101  // retrieve pads and copads in a certain BX window for this CSC
102 
103  retrieveGEMPads(gemPads, gemId);
105 
106  const bool hasCoPads(!coPads_.empty());
107 
108  // ALCT centric matching
109  for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++) {
110  if (alctProc->getBestALCT(bx_alct).isValid()) {
111  const int bx_clct_start(bx_alct - match_trig_window_size / 2 - alctClctOffset_);
112  const int bx_clct_stop(bx_alct + match_trig_window_size / 2 - alctClctOffset_);
113  const int bx_copad_start(bx_alct - maxDeltaBXCoPad_);
114  const int bx_copad_stop(bx_alct + maxDeltaBXCoPad_);
115 
116  const int quality(alctProc->getBestALCT(bx_alct).getQuality());
117 
118  if (debug_matching) {
119  LogTrace("CSCGEMMotherboardME21")
120  << "========================================================================" << std::endl
121  << "ALCT-CLCT matching in ME2/1 chamber: " << cscId_ << " in bx range: [" << bx_clct_start << ","
122  << bx_clct_stop << "] for bx " << bx_alct << std::endl
123  << "------------------------------------------------------------------------" << std::endl
124  << "+++ Best ALCT Details: " << alctProc->getBestALCT(bx_alct) << std::endl
125  << "+++ Second ALCT Details: " << alctProc->getSecondALCT(bx_alct) << std::endl;
126 
127  printGEMTriggerPads(bx_clct_start, bx_clct_stop, CSCPart::ME21);
128  printGEMTriggerCoPads(bx_clct_start, bx_clct_stop, CSCPart::ME21);
129  }
130 
131  // ALCT-to-CLCT
132  int nGoodMatches = 0;
133  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
134  if (bx_clct < 0 or bx_clct >= CSCConstants::MAX_CLCT_TBINS)
135  continue;
136  if (drop_used_clcts and used_clct_mask[bx_clct])
137  continue;
138  if (clctProc->getBestCLCT(bx_clct).isValid()) {
139  if (debug_matching) {
140  LogTrace("CSCGEMMotherboardME21")
141  << "+++ Best CLCT Details: " << clctProc->getBestCLCT(bx_clct) << std::endl
142  << "+++ Second CLCT Details: " << clctProc->getSecondCLCT(bx_clct) << std::endl;
143  }
144 
145  // clct quality
146  const bool lowQualityCLCT(clctProc->getBestCLCT(bx_clct).getQuality() <= 3);
147  // low quality ALCT
148  const bool lowQualityALCT(alctProc->getBestALCT(bx_alct).getQuality() == 0);
149 
150  // pick the pad that corresponds
151  matches<GEMPadDigi> mPads;
152  matchingPads<GEMPadDigi>(clctProc->getBestCLCT(bx_clct),
153  clctProc->getSecondCLCT(bx_clct),
154  alctProc->getBestALCT(bx_alct),
155  alctProc->getSecondALCT(bx_alct),
156  mPads);
157  matches<GEMCoPadDigi> mCoPads;
158  matchingPads<GEMCoPadDigi>(clctProc->getBestCLCT(bx_clct),
159  clctProc->getSecondCLCT(bx_clct),
160  alctProc->getBestALCT(bx_alct),
161  alctProc->getSecondALCT(bx_alct),
162  mCoPads);
163 
164  bool hasMatchingPads(!mPads.empty() or !mCoPads.empty());
165 
166  if (dropLowQualityCLCTsNoGEMs_ and lowQualityCLCT and !hasMatchingPads) {
167  continue;
168  }
169  if (dropLowQualityALCTsNoGEMs_ and lowQualityALCT and !hasMatchingPads) {
170  continue;
171  }
172 
173  int mbx = bx_clct - bx_clct_start;
174  correlateLCTsGEM(alctProc->getBestALCT(bx_alct),
175  alctProc->getSecondALCT(bx_alct),
176  clctProc->getBestCLCT(bx_clct),
177  clctProc->getSecondCLCT(bx_clct),
178  mPads,
179  mCoPads,
180  allLCTs(bx_alct, mbx, 0),
181  allLCTs(bx_alct, mbx, 1));
182 
183  if (allLCTs(bx_alct, mbx, 0).isValid()) {
184  used_clct_mask[bx_clct] += 1;
185  ++nGoodMatches;
186 
187  if (debug_matching) {
188  LogTrace("CSCGEMMotherboardME21")
189  << "Good ALCT-CLCT match in ME21: bx_alct = " << bx_alct << "; match window: [" << bx_clct_start
190  << "; " << bx_clct_stop << "]; bx_clct = " << bx_clct << "\n"
191  << std::endl;
192 
193  if (allLCTs(bx_alct, mbx, 0).isValid()) {
194  LogTrace("CSCGEMMotherboardME21") << "LCT #1 " << allLCTs(bx_alct, mbx, 0) << std::endl
195  << allLCTs(bx_alct, mbx, 0).getALCT() << std::endl
196  << allLCTs(bx_alct, mbx, 0).getCLCT() << std::endl;
197  if (allLCTs(bx_alct, mbx, 0).getType() == 2)
198  LogTrace("CSCGEMMotherboardME21") << allLCTs(bx_alct, mbx, 0).getGEM1() << std::endl;
199  if (allLCTs(bx_alct, mbx, 0).getType() == 3)
200  LogTrace("CSCGEMMotherboardME21")
201  << allLCTs(bx_alct, mbx, 0).getGEM1() << " " << allLCTs(bx_alct, mbx, 0).getGEM2() << std::endl;
202  }
203 
204  if (allLCTs(bx_alct, mbx, 1).isValid()) {
205  LogTrace("CSCGEMMotherboardME21") << "LCT #2 " << allLCTs(bx_alct, mbx, 1) << std::endl
206  << allLCTs(bx_alct, mbx, 1).getALCT() << std::endl
207  << allLCTs(bx_alct, mbx, 1).getCLCT() << std::endl;
208  if (allLCTs(bx_alct, mbx, 1).getType() == 2)
209  LogTrace("CSCGEMMotherboardME21") << allLCTs(bx_alct, mbx, 1).getGEM1() << std::endl;
210  if (allLCTs(bx_alct, mbx, 1).getType() == 3)
211  LogTrace("CSCGEMMotherboardME21")
212  << allLCTs(bx_alct, mbx, 1).getGEM1() << " " << allLCTs(bx_alct, mbx, 1).getGEM2() << std::endl;
213  }
214  }
215 
217  break;
218  }
219  }
220  }
221  }
222 
223  // ALCT-to-GEM matching
224  int nGoodGEMMatches = 0;
225  // only use high-quality stubs
226  if (nGoodMatches == 0 and buildLCTfromALCTandGEM_ and quality >=1) {
227  if (debug_matching)
228  LogTrace("CSCGEMMotherboardME21") << "++No valid ALCT-CLCT matches in ME21" << std::endl;
229  for (int bx_gem = bx_copad_start; bx_gem <= bx_copad_stop; bx_gem++) {
230  if (not hasCoPads) {
231  continue;
232  }
233 
234  // find the best matching copad
235  matches<GEMCoPadDigi> copads;
236  matchingPads<CSCALCTDigi, GEMCoPadDigi>(
237  alctProc->getBestALCT(bx_alct), alctProc->getSecondALCT(bx_alct), copads);
238 
239  if (debug_matching)
240  LogTrace("CSCGEMMotherboardME21")
241  << "\t++Number of matching GEM CoPads in BX " << bx_alct << " : " << copads.size() << std::endl;
242  if (copads.empty()) {
243  continue;
244  }
245 
246  CSCGEMMotherboard::correlateLCTsGEM(alctProc->getBestALCT(bx_alct),
247  alctProc->getSecondALCT(bx_alct),
248  copads,
249  allLCTs(bx_alct, 0, 0),
250  allLCTs(bx_alct, 0, 1));
251  if (allLCTs(bx_alct, 0, 0).isValid()) {
252  ++nGoodGEMMatches;
253 
254  if (debug_matching) {
255  LogTrace("CSCGEMMotherboardME21")
256  << "Good ALCT-GEM CoPad match in ME21: bx_alct = " << bx_alct << "\n\n"
257  << "------------------------------------------------------------------------" << std::endl
258  << std::endl;
259  if (allLCTs(bx_alct, 0, 0).isValid()) {
260  LogTrace("CSCGEMMotherboardME21") << "LCT #1 " << allLCTs(bx_alct, 0, 0) << std::endl
261  << allLCTs(bx_alct, 0, 0).getALCT() << std::endl;
262  if (allLCTs(bx_alct, 0, 0).getType() == 4)
263  LogTrace("CSCGEMMotherboardME21")
264  << allLCTs(bx_alct, 0, 0).getGEM1() << " " << allLCTs(bx_alct, 0, 0).getGEM2() << std::endl
265  << std::endl;
266  }
267  if (allLCTs(bx_alct, 0, 1).isValid()) {
268  LogTrace("CSCGEMMotherboardME21") << "LCT #2 " << allLCTs(bx_alct, 0, 1) << std::endl
269  << allLCTs(bx_alct, 0, 1).getALCT() << std::endl;
270  if (allLCTs(bx_alct, 0, 1).getType() == 4)
271  LogTrace("CSCGEMMotherboardME21")
272  << allLCTs(bx_alct, 0, 1).getGEM1() << " " << allLCTs(bx_alct, 0, 1).getGEM2() << std::endl
273  << std::endl;
274  }
275  }
277  break;
278  } else {
279  LogTrace("CSCGEMMotherboardME21") << "No valid LCT is built from ALCT-GEM matching in ME21" << std::endl;
280  }
281  }
282  }
283 
284  if (debug_matching) {
285  LogTrace("CSCGEMMotherboardME21")
286  << "========================================================================" << std::endl;
287  LogTrace("CSCGEMMotherboardME21") << "Summary: " << std::endl;
288  if (nGoodMatches > 1)
289  LogTrace("CSCGEMMotherboardME21")
290  << "Too many good ALCT-CLCT matches in ME21: " << nGoodMatches << ", CSCDetId " << cscId_
291  << ", bx_alct = " << bx_alct << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]"
292  << std::endl;
293  else if (nGoodMatches == 1)
294  LogTrace("CSCGEMMotherboardME21")
295  << "1 good ALCT-CLCT match in ME21: "
296  << " CSCDetId " << cscId_ << ", bx_alct = " << bx_alct << "; match window: [" << bx_clct_start << "; "
297  << bx_clct_stop << "]" << std::endl;
298  else if (nGoodGEMMatches == 1)
299  LogTrace("CSCGEMMotherboardME21")
300  << "1 good ALCT-GEM match in ME21: "
301  << " CSCDetId " << cscId_ << ", bx_alct = " << bx_alct << "; match window: [" << bx_clct_start << "; "
302  << bx_clct_stop << "]" << std::endl;
303  else
304  LogTrace("CSCGEMMotherboardME21") << "Bad ALCT-CLCT match in ME21: "
305  << "CSCDetId " << cscId_ << ", bx_alct = " << bx_alct << "; match window: ["
306  << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
307  }
308  }
309  // at this point we have invalid ALCTs --> try GEM pad matching
310  else {
311  auto coPads(coPads_[bx_alct]);
312  if (!coPads.empty() and buildLCTfromCLCTandGEM_) {
313  const int bx_clct_start(bx_alct - match_trig_window_size / 2 - alctClctOffset_);
314  const int bx_clct_stop(bx_alct + match_trig_window_size / 2 - alctClctOffset_);
315 
316  if (debug_matching) {
317  LogTrace("CSCGEMMotherboardME21")
318  << "========================================================================" << std::endl
319  << "GEM-CLCT matching in ME2/1 chamber: " << cscId_ << "in bx:" << bx_alct << std::endl
320  << "------------------------------------------------------------------------" << std::endl;
321  }
322  // GEM-to-CLCT
323  // matching in ME21
325  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
326  if (bx_clct < 0 or bx_clct >= CSCConstants::MAX_CLCT_TBINS)
327  continue;
328  if (drop_used_clcts and used_clct_mask[bx_clct])
329  continue;
330  if (clctProc->getBestCLCT(bx_clct).isValid()) {
331  const int quality(clctProc->getBestCLCT(bx_clct).getQuality());
332  // only use high-Q stubs for the time being
333  if (quality < 4)
334  continue;
335 
336  int mbx = bx_clct - bx_clct_start;
337  CSCGEMMotherboard::correlateLCTsGEM(clctProc->getBestCLCT(bx_clct),
338  clctProc->getSecondCLCT(bx_clct),
339  coPads,
340  allLCTs(bx_alct, mbx, 0),
341  allLCTs(bx_alct, mbx, 1));
342  if (allLCTs(bx_alct, mbx, 0).isValid()) {
343  used_clct_mask[bx_clct] += 1;
344 
345  if (debug_matching) {
346  LogTrace("CSCGEMMotherboardME21")
347  << "Good GEM-CLCT match in ME21: bx_alct = " << bx_alct << "; match window: [" << bx_clct_start
348  << "; " << bx_clct_stop << "]; bx_clct = " << bx_clct << "\n"
349  << "+++ Best CLCT Details: " << clctProc->getBestCLCT(bx_clct) << "\n"
350  << "+++ Second CLCT Details: " << clctProc->getSecondCLCT(bx_clct) << std::endl;
351 
352  LogTrace("CSCGEMMotherboardME21") << "LCT #1 " << allLCTs(bx_alct, mbx, 0) << std::endl
353  << allLCTs(bx_alct, mbx, 0).getALCT() << std::endl;
354  if (allLCTs(bx_alct, mbx, 0).getType() == 5)
355  LogTrace("CSCGEMMotherboardME21")
356  << allLCTs(bx_alct, mbx, 0).getGEM1() << " " << allLCTs(bx_alct, mbx, 0).getGEM2() << std::endl;
357 
358  LogTrace("CSCGEMMotherboardME21") << "LCT #2 " << allLCTs(bx_alct, mbx, 1) << std::endl
359  << allLCTs(bx_alct, mbx, 1).getALCT() << std::endl;
360  if (allLCTs(bx_alct, mbx, 1).getType() == 5)
361  LogTrace("CSCGEMMotherboardME21")
362  << allLCTs(bx_alct, mbx, 1).getGEM1() << " " << allLCTs(bx_alct, mbx, 1).getGEM2() << std::endl;
363  }
364 
366  break;
367  }
368  }
369  }
370  }
371  }
372  }
373  }
374  // reduction of nLCTs per each BX
375  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
376  // counting
377  unsigned int n = 0;
378  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
379  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
380  if (allLCTs(bx, mbx, i).isValid()) {
381  ++n;
382  if (infoV > 0) {
383  LogDebug("CSCGEMMotherboardME21")
384  << "LCT" << i + 1 << " " << bx << "/" << bx + mbx - match_trig_window_size / 2 << ": "
385  << allLCTs(bx, mbx, i) << std::endl;
386  }
387  }
388  }
389  }
390 
391  // some simple cross-bx sorting algorithms
392  if (tmb_cross_bx_algo == 1 and (n > 2)) {
393  n = 0;
394  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
395  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
396  if (allLCTs(bx, pref[mbx], i).isValid()) {
397  n++;
398  if (n > 2)
399  allLCTs(bx, pref[mbx], i).clear();
400  }
401  }
402  }
403 
404  n = 0;
405  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
406  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
407  if (allLCTs(bx, mbx, i).isValid()) {
408  n++;
409  if (infoV > 0) {
410  LogDebug("CSCGEMMotherboardME21")
411  << "LCT" << i + 1 << " " << bx << "/" << bx + mbx - match_trig_window_size / 2 << ": "
412  << allLCTs(bx, mbx, i) << std::endl;
413  }
414  }
415  }
416  if (infoV > 0 and n > 0)
417  LogDebug("CSCGEMMotherboardME21") << "bx " << bx << " nnLCT:" << n << " " << n << std::endl;
418  }
419  } // x-bx sorting
420  }
421 
422  bool first = true;
423  unsigned int n = 0;
424  for (const auto& p : readoutLCTs()) {
425  if (debug_matching and first) {
426  LogTrace("CSCGEMCMotherboardME21") << "========================================================================"
427  << std::endl;
428  LogTrace("CSCGEMCMotherboardME21") << "Counting the final LCTs in CSCGEM Motherboard ME21" << std::endl;
429  LogTrace("CSCGEMCMotherboardME21") << "========================================================================"
430  << std::endl;
431  first = false;
432  LogTrace("CSCGEMCMotherboardME21") << "tmb_cross_bx_algo: " << tmb_cross_bx_algo << std::endl;
433  }
434  n++;
435  if (debug_matching)
436  LogTrace("CSCGEMCMotherboardME21") << "LCT " << n << " " << p << std::endl;
437  }
438 }
439 
440 //readout LCTs
441 std::vector<CSCCorrelatedLCTDigi> CSCGEMMotherboardME21::readoutLCTs() const {
442  std::vector<CSCCorrelatedLCTDigi> result;
444  if (tmb_cross_bx_algo == 2)
446  if (tmb_cross_bx_algo == 3)
448 
449  // do a final check on the LCTs in readout
450  for (const auto& lct : result) {
451  checkValid(lct);
452  }
453 
454  return result;
455 }
456 
458  const CSCALCTDigi& sALCT,
459  const CSCCLCTDigi& bCLCT,
460  const CSCCLCTDigi& sCLCT,
461  const GEMPadDigiIds& pads,
462  const GEMCoPadDigiIds& copads,
463  CSCCorrelatedLCTDigi& lct1,
464  CSCCorrelatedLCTDigi& lct2) const {
465  CSCALCTDigi bestALCT = bALCT;
466  CSCALCTDigi secondALCT = sALCT;
467  const CSCCLCTDigi& bestCLCT = bCLCT;
468  CSCCLCTDigi secondCLCT = sCLCT;
469 
470  // assume that always anodeBestValid and cathodeBestValid
471  if (secondALCT == bestALCT)
472  secondALCT.clear();
473  if (secondCLCT == bestCLCT)
474  secondCLCT.clear();
475 
476  const bool ok_bb = bestALCT.isValid() and bestCLCT.isValid();
477  const bool ok_bs = bestALCT.isValid() and secondCLCT.isValid();
478  const bool ok_sb = secondALCT.isValid() and bestCLCT.isValid();
479  const bool ok_ss = secondALCT.isValid() and secondCLCT.isValid();
480 
481  if (!copads.empty() or !pads.empty()) {
482  // check matching copads
483  const GEMCoPadDigi& bb_copad = bestMatchingPad<GEMCoPadDigi>(bestALCT, bestCLCT, copads);
484  const GEMCoPadDigi& bs_copad = bestMatchingPad<GEMCoPadDigi>(bestALCT, secondCLCT, copads);
485  const GEMCoPadDigi& sb_copad = bestMatchingPad<GEMCoPadDigi>(secondALCT, bestCLCT, copads);
486  const GEMCoPadDigi& ss_copad = bestMatchingPad<GEMCoPadDigi>(secondALCT, secondCLCT, copads);
487 
488  // check matching pads
489  const GEMPadDigi& bb_pad = bestMatchingPad<GEMPadDigi>(bestALCT, bestCLCT, pads);
490  const GEMPadDigi& bs_pad = bestMatchingPad<GEMPadDigi>(bestALCT, secondCLCT, pads);
491  const GEMPadDigi& sb_pad = bestMatchingPad<GEMPadDigi>(secondALCT, bestCLCT, pads);
492  const GEMPadDigi& ss_pad = bestMatchingPad<GEMPadDigi>(secondALCT, secondCLCT, pads);
493 
494  // evaluate possible combinations
495  const bool ok_bb_copad = ok_bb and bb_copad.isValid();
496  const bool ok_bs_copad = ok_bs and bs_copad.isValid();
497  const bool ok_sb_copad = ok_sb and sb_copad.isValid();
498  const bool ok_ss_copad = ok_ss and ss_copad.isValid();
499 
500  const bool ok_bb_pad = (not ok_bb_copad) and ok_bb and bb_pad.isValid();
501  const bool ok_bs_pad = (not ok_bs_copad) and ok_bs and bs_pad.isValid();
502  const bool ok_sb_pad = (not ok_sb_copad) and ok_sb and sb_pad.isValid();
503  const bool ok_ss_pad = (not ok_ss_copad) and ok_ss and ss_pad.isValid();
504 
505  // possible cases with copad
506  if (ok_bb_copad or ok_ss_copad) {
507  if (ok_bb_copad)
508  lct1 = constructLCTsGEM(bestALCT, bestCLCT, bb_copad, 1);
509  if (ok_ss_copad)
510  lct2 = constructLCTsGEM(secondALCT, secondCLCT, ss_copad, 2);
511  } else if (ok_bs_copad or ok_sb_copad) {
512  if (ok_bs_copad)
513  lct1 = constructLCTsGEM(bestALCT, secondCLCT, bs_copad, 1);
514  if (ok_sb_copad)
515  lct2 = constructLCTsGEM(secondALCT, bestCLCT, sb_copad, 2);
516  }
517 
518  // done processing?
519  if (lct1.isValid() and lct2.isValid())
520  return;
521 
522  // possible cases with pad
523  if ((ok_bb_pad or ok_ss_pad) and not(ok_bs_copad or ok_sb_copad)) {
524  if (ok_bb_pad)
525  lct1 = constructLCTsGEM(bestALCT, bestCLCT, bb_pad, 1);
526  if (ok_ss_pad)
527  lct2 = constructLCTsGEM(secondALCT, secondCLCT, ss_pad, 2);
528  } else if ((ok_bs_pad or ok_sb_pad) and not(ok_bb_copad or ok_ss_copad)) {
529  if (ok_bs_pad)
530  lct1 = constructLCTsGEM(bestALCT, secondCLCT, bs_pad, 1);
531  if (ok_sb_pad)
532  lct2 = constructLCTsGEM(secondALCT, bestCLCT, sb_pad, 2);
533  }
534  } else {
535  // run without gems - happens in less than 0.04% of the time
536  if (ok_bb)
537  lct1 = constructLCTs(bestALCT, bestCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 1);
538  if (ok_ss)
539  lct2 = constructLCTs(secondALCT, secondCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 2);
540  }
541 }
electrons_cff.bool
bool
Definition: electrons_cff.py:372
mps_fire.i
i
Definition: mps_fire.py:355
CSCMotherboard::match_trig_window_size
unsigned int match_trig_window_size
Definition: CSCMotherboard.h:99
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
CSCMotherboard::checkValid
void checkValid(const CSCCorrelatedLCTDigi &lct) const
Definition: CSCMotherboard.cc:647
GEMPadDigi
Definition: GEMPadDigi.h:15
CSCBaseboard::cscGeometry_
const CSCGeometry * cscGeometry_
Definition: CSCBaseboard.h:64
CSCBaseboard::isSLHC_
bool isSLHC_
Definition: CSCBaseboard.h:83
CSCConstants::MAX_ALCT_TBINS
Definition: CSCConstants.h:62
CSCGEMMotherboardME21.h
relativeConstraints.station
station
Definition: relativeConstraints.py:67
CSCMotherboard::alctProc
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
Definition: CSCMotherboard.h:75
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CSCGEMMotherboardME21::run
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiClusterCollection *gemPads) override
Definition: CSCGEMMotherboardME21.cc:38
CSCALCTDigi::clear
void clear()
clear this ALCT
Definition: CSCALCTDigi.cc:43
edm::LogInfo
Definition: MessageLogger.h:254
CSCGEMMotherboard::gemGeometryAvailable
bool gemGeometryAvailable
Definition: CSCGEMMotherboard.h:207
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
CSCGEMMotherboardME21::readoutLCTs
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const override
Definition: CSCGEMMotherboardME21.cc:441
GEMPadDigiCollection
MuonDigiCollection< GEMDetId, GEMPadDigi > GEMPadDigiCollection
Definition: GEMPadDigiCollection.h:13
CSCGEMMotherboard::constructLCTsGEM
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, int i) const
Definition: CSCGEMMotherboard.cc:71
CSCGEMMotherboard::coPads_
GEMCoPadDigiIdsBX coPads_
Definition: CSCGEMMotherboard.h:213
CSCUpgradeMotherboard::tmb_cross_bx_algo
unsigned int tmb_cross_bx_algo
Definition: CSCUpgradeMotherboard.h:109
CSCUpgradeMotherboard::debugLUTs
void debugLUTs()
Definition: CSCUpgradeMotherboard.cc:299
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCGEMMotherboardME21::buildLCTfromALCTandGEM_
bool buildLCTfromALCTandGEM_
Definition: CSCGEMMotherboardME21.h:69
dqmdumpme.first
first
Definition: dqmdumpme.py:55
CSCGEMMotherboard::setupGeometry
void setupGeometry()
Definition: CSCGEMMotherboard.cc:281
CSCCLCTDigi
Definition: CSCCLCTDigi.h:17
CSCCorrelatedLCTDigi::ALCTCLCT
Definition: CSCCorrelatedLCTDigi.h:160
CSCMotherboard::clctV
std::vector< CSCCLCTDigi > clctV
Definition: CSCMotherboard.h:84
CSCMotherboard::clctProc
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
Definition: CSCMotherboard.h:78
LCTContainer::getMatched
void getMatched(std::vector< CSCCorrelatedLCTDigi > &) const
Definition: LCTContainer.cc:23
CSCMotherboard::alctV
std::vector< CSCALCTDigi > alctV
Definition: CSCMotherboard.h:83
CSCConstants::MAX_LCTS_PER_CSC
Definition: CSCConstants.h:73
CSCMotherboard::constructLCTs
CSCCorrelatedLCTDigi constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb) const
Definition: CSCMotherboard.cc:484
CSCGEMMotherboardME21::buildLCTfromCLCTandGEM_
bool buildLCTfromCLCTandGEM_
Definition: CSCGEMMotherboardME21.h:70
CSCGEMMotherboard::correlateLCTsGEM
void correlateLCTsGEM(const T &best, const T &second, const GEMCoPadDigiIds &coPads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
Definition: CSCGEMMotherboard.h:464
CSCUpgradeMotherboard::match_earliest_clct_only
bool match_earliest_clct_only
Definition: CSCUpgradeMotherboard.h:106
CSCBaseboard::alctClctOffset_
unsigned int alctClctOffset_
Definition: CSCBaseboard.h:96
CSCGEMMotherboardME21::~CSCGEMMotherboardME21
~CSCGEMMotherboardME21() override
Definition: CSCGEMMotherboardME21.cc:36
GEMPadDigiCollection
CSCUpgradeMotherboard::sortLCTsByGEMDphi
static bool sortLCTsByGEMDphi(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
Definition: CSCUpgradeMotherboard.cc:308
CSCGEMMotherboardME21::dropLowQualityCLCTsNoGEMs_
bool dropLowQualityCLCTsNoGEMs_
Definition: CSCGEMMotherboardME21.h:65
CSCConstants::MAX_LCT_TBINS
Definition: CSCConstants.h:63
CSCGEMMotherboard::printGEMTriggerCoPads
void printGEMTriggerCoPads(int bx_start, int bx_stop, enum CSCPart)
Definition: CSCGEMMotherboard.cc:311
CSCGEMMotherboard::gemId
unsigned gemId
Definition: CSCGEMMotherboard.h:202
GEMPadDigiClusterCollection
CSCGEMMotherboard::coPadProcessor
std::unique_ptr< GEMCoPadProcessor > coPadProcessor
Definition: CSCGEMMotherboard.h:63
CSCGEMMotherboard::gemCoPadV
std::vector< GEMCoPadDigi > gemCoPadV
Definition: CSCGEMMotherboard.h:209
CSCGEMMotherboardME21::dropLowQualityALCTsNoGEMs_
bool dropLowQualityALCTsNoGEMs_
Definition: CSCGEMMotherboardME21.h:66
GEMCoPadDigiIds
matches< GEMCoPadDigi > GEMCoPadDigiIds
Definition: CSCGEMMotherboard.h:26
GEMCoPadDigi
Definition: GEMCoPadDigi.h:16
CSCGEMMotherboardLUTME21
Definition: CSCUpgradeMotherboardLUT.h:103
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
LCTContainer::clear
void clear()
Definition: LCTContainer.cc:31
CSCUpgradeMotherboard::debug_matching
bool debug_matching
Definition: CSCUpgradeMotherboard.h:115
CSCCLCTDigi::isValid
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:45
CSCUpgradeMotherboard::sortLCTs
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &lcts, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
Definition: CSCUpgradeMotherboard.cc:312
CSCUpgradeMotherboard::pref
int pref[CSCConstants::MAX_LCT_TBINS]
Definition: CSCUpgradeMotherboard.h:103
CSCComparatorDigiCollection
CSCGEMMotherboard::retrieveGEMCoPads
void retrieveGEMCoPads()
Definition: CSCGEMMotherboard.cc:62
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
CSCMotherboard::drop_used_clcts
bool drop_used_clcts
Definition: CSCMotherboard.h:105
CSCMotherboard::encodeHighMultiplicityBits
void encodeHighMultiplicityBits(unsigned alctBits)
Definition: CSCMotherboard.cc:638
CSCGEMMotherboardME21::tmbLUT_
std::unique_ptr< CSCGEMMotherboardLUTME21 > tmbLUT_
Definition: CSCGEMMotherboardME21.h:48
CSCUpgradeMotherboard::sortLCTsByQuality
static bool sortLCTsByQuality(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
Definition: CSCUpgradeMotherboard.cc:304
CSCGEMMotherboard
Definition: CSCGEMMotherboard.h:29
CSCBaseboard::runME21ILT_
bool runME21ILT_
Definition: CSCBaseboard.h:102
CSCUpgradeMotherboard::allLCTs
LCTContainer allLCTs
Definition: CSCUpgradeMotherboard.h:98
CSCWireDigiCollection
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
CSCGEMMotherboardME21::CSCGEMMotherboardME21
CSCGEMMotherboardME21()
Definition: CSCGEMMotherboardME21.cc:26
CSCCLCTDigi::clear
void clear()
clear this CLCT
Definition: CSCCLCTDigi.cc:68
CSCALCTDigi
Definition: CSCALCTDigi.h:16
CSCGEMMotherboard::printGEMTriggerPads
void printGEMTriggerPads(int bx_start, int bx_stop, enum CSCPart)
Definition: CSCGEMMotherboard.cc:290
CSCConstants::MAX_CLCT_TBINS
Definition: CSCConstants.h:61
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
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
CSCGEMMotherboard::clear
void clear()
Definition: CSCGEMMotherboard.cc:34
CSCGEMMotherboard::maxDeltaBXCoPad_
int maxDeltaBXCoPad_
Definition: CSCGEMMotherboard.h:217
CSCBaseboard::cscId_
CSCDetId cscId_
Definition: CSCBaseboard.h:56
CSCALCTDigi::isValid
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:37
CSCGEMMotherboard::retrieveGEMPads
void retrieveGEMPads(const GEMPadDigiCollection *pads, unsigned id)
Definition: CSCGEMMotherboard.cc:40
CSCGEMMotherboardME21::correlateLCTsGEM
void correlateLCTsGEM(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, const GEMPadDigiIds &pads, const GEMCoPadDigiIds &copads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
Definition: CSCGEMMotherboardME21.cc:457
mps_fire.result
result
Definition: mps_fire.py:303
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
GEMPadDigi::isValid
bool isValid() const
Definition: GEMPadDigi.cc:22
CSCCorrelatedLCTDigi::isValid
bool isValid() const
return valid pattern bit
Definition: CSCCorrelatedLCTDigi.h:50
GEMPadDigiIds
matches< GEMPadDigi > GEMPadDigiIds
Definition: CSCGEMMotherboard.h:22
CSCGEMMotherboard::gem_g
const GEMGeometry * gem_g
Definition: CSCGEMMotherboard.h:206
CSCCorrelatedLCTDigi
Definition: CSCCorrelatedLCTDigi.h:19
ME21
Definition: CSCUpgradeMotherboardLUT.h:12
GEMCoPadDigi::isValid
bool isValid() const
Definition: GEMCoPadDigi.cc:18
CSCBaseboard::infoV
int infoV
Definition: CSCBaseboard.h:62