CMS 3D CMS Logo

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