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