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