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 GEMPadDigiCollection* gemPads) {
34  setupGeometry();
35  debugLUTs();
36 
37  // generator_->generateLUTs(theEndcap, theStation, theSector, theSubsector, theTrigChamber);
38 
39  if (gem_g != nullptr) {
40  if (infoV >= 0)
41  edm::LogInfo("CSCGEMMotherboardME21|SetupInfo") << "+++ run() called for GEM-CSC integrated trigger! +++ \n";
42  gemGeometryAvailable = true;
43  }
44 
45  // check for GEM geometry
46  if (not gemGeometryAvailable) {
47  if (infoV >= 0)
48  edm::LogError("CSCGEMMotherboardME21|SetupError")
49  << "+++ run() called for GEM-CSC integrated trigger without valid GEM geometry! +++ \n";
50  return;
51  }
52  gemCoPadV = coPadProcessor->run(gemPads); // run copad processor in GE1/1
53 
54  if (!(alctProc and clctProc)) {
55  if (infoV >= 0)
56  edm::LogError("CSCGEMMotherboardME21|SetupError")
57  << "+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
58  return;
59  }
60 
61  alctProc->setCSCGeometry(cscGeometry_);
62  clctProc->setCSCGeometry(cscGeometry_);
63 
64  alctV = alctProc->run(wiredc); // run anodeLCT
65  clctV = clctProc->run(compdc); // run cathodeLCT
66 
67  // if there are no ALCTs and no CLCTs, it does not make sense to run this TMB
68  if (alctV.empty() and clctV.empty())
69  return;
70 
71  LogTrace("CSCGEMCMotherboardME21") << "ALL ALCTs from ME21 " << std::endl;
72  for (const auto& alct : alctV)
73  if (alct.isValid())
74  LogTrace("CSCGEMCMotherboardME21") << alct << std::endl;
75 
76  LogTrace("CSCGEMCMotherboardME21") << "ALL CLCTs from ME21 " << std::endl;
77  for (const auto& clct : clctV)
78  if (clct.isValid())
79  LogTrace("CSCGEMCMotherboardME21") << clct << std::endl;
80 
81  int used_clct_mask[20];
82  for (int c = 0; c < 20; ++c)
83  used_clct_mask[c] = 0;
84 
85  // retrieve pads and copads in a certain BX window for this CSC
86 
87  retrieveGEMPads(gemPads, gemId);
89 
90  const bool hasCoPads(!coPads_.empty());
91 
92  // ALCT centric matching
93  for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++) {
94  if (alctProc->getBestALCT(bx_alct).isValid()) {
95  const int bx_clct_start(bx_alct - match_trig_window_size / 2 - alctClctOffset_);
96  const int bx_clct_stop(bx_alct + match_trig_window_size / 2 - alctClctOffset_);
97  const int bx_copad_start(bx_alct - maxDeltaBXCoPad_);
98  const int bx_copad_stop(bx_alct + maxDeltaBXCoPad_);
99 
100  if (debug_matching) {
101  LogTrace("CSCGEMMotherboardME21")
102  << "========================================================================" << std::endl
103  << "ALCT-CLCT matching in ME2/1 chamber: " << cscId_ << " in bx range: [" << bx_clct_start << ","
104  << bx_clct_stop << "] for bx " << bx_alct << std::endl
105  << "------------------------------------------------------------------------" << std::endl
106  << "+++ Best ALCT Details: " << alctProc->getBestALCT(bx_alct) << std::endl
107  << "+++ Second ALCT Details: " << alctProc->getSecondALCT(bx_alct) << std::endl;
108 
109  printGEMTriggerPads(bx_clct_start, bx_clct_stop, CSCPart::ME21);
110  printGEMTriggerCoPads(bx_clct_start, bx_clct_stop, CSCPart::ME21);
111  }
112 
113  // ALCT-to-CLCT
114  int nGoodMatches = 0;
115  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
116  if (bx_clct < 0 or bx_clct >= CSCConstants::MAX_CLCT_TBINS)
117  continue;
118  if (drop_used_clcts and used_clct_mask[bx_clct])
119  continue;
120  if (clctProc->getBestCLCT(bx_clct).isValid()) {
121  if (debug_matching) {
122  LogTrace("CSCGEMMotherboardME21")
123  << "+++ Best CLCT Details: " << clctProc->getBestCLCT(bx_clct) << std::endl
124  << "+++ Second CLCT Details: " << clctProc->getSecondCLCT(bx_clct) << std::endl;
125  }
126 
127  // clct quality
128  const bool lowQualityCLCT(clctProc->getBestCLCT(bx_clct).getQuality() <= 3);
129  // low quality ALCT
130  const bool lowQualityALCT(alctProc->getBestALCT(bx_alct).getQuality() == 0);
131 
132  // pick the pad that corresponds
133  matches<GEMPadDigi> mPads;
134  matchingPads<GEMPadDigi>(clctProc->getBestCLCT(bx_clct),
135  clctProc->getSecondCLCT(bx_clct),
136  alctProc->getBestALCT(bx_alct),
137  alctProc->getSecondALCT(bx_alct),
138  mPads);
139  matches<GEMCoPadDigi> mCoPads;
140  matchingPads<GEMCoPadDigi>(clctProc->getBestCLCT(bx_clct),
141  clctProc->getSecondCLCT(bx_clct),
142  alctProc->getBestALCT(bx_alct),
143  alctProc->getSecondALCT(bx_alct),
144  mCoPads);
145 
146  bool hasMatchingPads(!mPads.empty() or !mCoPads.empty());
147 
148  if (dropLowQualityCLCTsNoGEMs_ and lowQualityCLCT and !hasMatchingPads) {
149  continue;
150  }
151  if (dropLowQualityALCTsNoGEMs_ and lowQualityALCT and !hasMatchingPads) {
152  continue;
153  }
154 
155  int mbx = bx_clct - bx_clct_start;
156  correlateLCTsGEM(alctProc->getBestALCT(bx_alct),
157  alctProc->getSecondALCT(bx_alct),
158  clctProc->getBestCLCT(bx_clct),
159  clctProc->getSecondCLCT(bx_clct),
160  mPads,
161  mCoPads,
162  allLCTs(bx_alct, mbx, 0),
163  allLCTs(bx_alct, mbx, 1));
164 
165  if (allLCTs(bx_alct, mbx, 0).isValid()) {
166  used_clct_mask[bx_clct] += 1;
167  ++nGoodMatches;
168 
169  if (debug_matching) {
170  LogTrace("CSCGEMMotherboardME21")
171  << "Good ALCT-CLCT match in ME21: bx_alct = " << bx_alct << "; match window: [" << bx_clct_start
172  << "; " << bx_clct_stop << "]; bx_clct = " << bx_clct << "\n"
173  << std::endl;
174 
175  if (allLCTs(bx_alct, mbx, 0).isValid()) {
176  LogTrace("CSCGEMMotherboardME21") << "LCT #1 " << allLCTs(bx_alct, mbx, 0) << std::endl
177  << allLCTs(bx_alct, mbx, 0).getALCT() << std::endl
178  << allLCTs(bx_alct, mbx, 0).getCLCT() << std::endl;
179  if (allLCTs(bx_alct, mbx, 0).getType() == 2)
180  LogTrace("CSCGEMMotherboardME21") << allLCTs(bx_alct, mbx, 0).getGEM1() << std::endl;
181  if (allLCTs(bx_alct, mbx, 0).getType() == 3)
182  LogTrace("CSCGEMMotherboardME21")
183  << allLCTs(bx_alct, mbx, 0).getGEM1() << " " << allLCTs(bx_alct, mbx, 0).getGEM2() << std::endl;
184  }
185 
186  if (allLCTs(bx_alct, mbx, 1).isValid()) {
187  LogTrace("CSCGEMMotherboardME21") << "LCT #2 " << allLCTs(bx_alct, mbx, 1) << std::endl
188  << allLCTs(bx_alct, mbx, 1).getALCT() << std::endl
189  << allLCTs(bx_alct, mbx, 1).getCLCT() << std::endl;
190  if (allLCTs(bx_alct, mbx, 1).getType() == 2)
191  LogTrace("CSCGEMMotherboardME21") << allLCTs(bx_alct, mbx, 1).getGEM1() << std::endl;
192  if (allLCTs(bx_alct, mbx, 1).getType() == 3)
193  LogTrace("CSCGEMMotherboardME21")
194  << allLCTs(bx_alct, mbx, 1).getGEM1() << " " << allLCTs(bx_alct, mbx, 1).getGEM2() << std::endl;
195  }
196  }
197 
199  break;
200  }
201  }
202  }
203  }
204 
205  // ALCT-to-GEM matching
206  int nGoodGEMMatches = 0;
207  if (nGoodMatches == 0 and buildLCTfromALCTandGEM_) {
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 - alctClctOffset_);
295  const int bx_clct_stop(bx_alct + match_trig_window_size / 2 - alctClctOffset_);
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;
424  allLCTs.getMatched(result);
425  if (tmb_cross_bx_algo == 2)
427  if (tmb_cross_bx_algo == 3)
429  return result;
430 }
431 
433  const CSCALCTDigi& sALCT,
434  const CSCCLCTDigi& bCLCT,
435  const CSCCLCTDigi& sCLCT,
436  const GEMPadDigiIds& pads,
437  const GEMCoPadDigiIds& copads,
438  CSCCorrelatedLCTDigi& lct1,
439  CSCCorrelatedLCTDigi& lct2) const {
440  CSCALCTDigi bestALCT = bALCT;
441  CSCALCTDigi secondALCT = sALCT;
442  CSCCLCTDigi bestCLCT = bCLCT;
443  CSCCLCTDigi secondCLCT = sCLCT;
444 
445  // assume that always anodeBestValid and cathodeBestValid
446  if (secondALCT == bestALCT)
447  secondALCT.clear();
448  if (secondCLCT == bestCLCT)
449  secondCLCT.clear();
450 
451  const bool ok_bb = bestALCT.isValid() and bestCLCT.isValid();
452  const bool ok_bs = bestALCT.isValid() and secondCLCT.isValid();
453  const bool ok_sb = secondALCT.isValid() and bestCLCT.isValid();
454  const bool ok_ss = secondALCT.isValid() and secondCLCT.isValid();
455 
456  if (!copads.empty() or !pads.empty()) {
457  // check matching copads
458  const GEMCoPadDigi& bb_copad = bestMatchingPad<GEMCoPadDigi>(bestALCT, bestCLCT, copads);
459  const GEMCoPadDigi& bs_copad = bestMatchingPad<GEMCoPadDigi>(bestALCT, secondCLCT, copads);
460  const GEMCoPadDigi& sb_copad = bestMatchingPad<GEMCoPadDigi>(secondALCT, bestCLCT, copads);
461  const GEMCoPadDigi& ss_copad = bestMatchingPad<GEMCoPadDigi>(secondALCT, secondCLCT, copads);
462 
463  // check matching pads
464  const GEMPadDigi& bb_pad = bestMatchingPad<GEMPadDigi>(bestALCT, bestCLCT, pads);
465  const GEMPadDigi& bs_pad = bestMatchingPad<GEMPadDigi>(bestALCT, secondCLCT, pads);
466  const GEMPadDigi& sb_pad = bestMatchingPad<GEMPadDigi>(secondALCT, bestCLCT, pads);
467  const GEMPadDigi& ss_pad = bestMatchingPad<GEMPadDigi>(secondALCT, secondCLCT, pads);
468 
469  // evaluate possible combinations
470  const bool ok_bb_copad = ok_bb and bb_copad.isValid();
471  const bool ok_bs_copad = ok_bs and bs_copad.isValid();
472  const bool ok_sb_copad = ok_sb and sb_copad.isValid();
473  const bool ok_ss_copad = ok_ss and ss_copad.isValid();
474 
475  const bool ok_bb_pad = (not ok_bb_copad) and ok_bb and bb_pad.isValid();
476  const bool ok_bs_pad = (not ok_bs_copad) and ok_bs and bs_pad.isValid();
477  const bool ok_sb_pad = (not ok_sb_copad) and ok_sb and sb_pad.isValid();
478  const bool ok_ss_pad = (not ok_ss_copad) and ok_ss and ss_pad.isValid();
479 
480  // possible cases with copad
481  if (ok_bb_copad or ok_ss_copad) {
482  if (ok_bb_copad)
483  lct1 = constructLCTsGEM(bestALCT, bestCLCT, bb_copad, 1);
484  if (ok_ss_copad)
485  lct2 = constructLCTsGEM(secondALCT, secondCLCT, ss_copad, 2);
486  } else if (ok_bs_copad or ok_sb_copad) {
487  if (ok_bs_copad)
488  lct1 = constructLCTsGEM(bestALCT, secondCLCT, bs_copad, 1);
489  if (ok_sb_copad)
490  lct2 = constructLCTsGEM(secondALCT, bestCLCT, sb_copad, 2);
491  }
492 
493  // done processing?
494  if (lct1.isValid() and lct2.isValid())
495  return;
496 
497  // possible cases with pad
498  if ((ok_bb_pad or ok_ss_pad) and not(ok_bs_copad or ok_sb_copad)) {
499  if (ok_bb_pad)
500  lct1 = constructLCTsGEM(bestALCT, bestCLCT, bb_pad, 1);
501  if (ok_ss_pad)
502  lct2 = constructLCTsGEM(secondALCT, secondCLCT, ss_pad, 2);
503  } else if ((ok_bs_pad or ok_sb_pad) and not(ok_bb_copad or ok_ss_copad)) {
504  if (ok_bs_pad)
505  lct1 = constructLCTsGEM(bestALCT, secondCLCT, bs_pad, 1);
506  if (ok_sb_pad)
507  lct2 = constructLCTsGEM(secondALCT, bestCLCT, sb_pad, 2);
508  }
509  } else {
510  // run without gems - happens in less than 0.04% of the time
511  if (ok_bb)
512  lct1 = constructLCTs(bestALCT, bestCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 1);
513  if (ok_ss)
514  lct2 = constructLCTs(secondALCT, secondCLCT, CSCCorrelatedLCTDigi::ALCTCLCT, 2);
515  }
516 }
#define LogDebug(id)
void retrieveGEMPads(const GEMPadDigiCollection *pads, unsigned id)
void correlateLCTsGEM(const T &best, const T &second, const GEMCoPadDigiIds &coPads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
std::vector< CSCCLCTDigi > clctV
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiCollection *gemPads) override
unsigned int match_trig_window_size
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:32
GEMCoPadDigiIdsBX coPads_
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
void clear()
clear this ALCT
Definition: CSCALCTDigi.cc:39
bool runME21ILT_
Definition: CSCBaseboard.h:96
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
static bool sortLCTsByQuality(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
int pref[CSCConstants::MAX_LCT_TBINS]
matches< GEMCoPadDigi > GEMCoPadDigiIds
CSCDetId cscId_
Definition: CSCBaseboard.h:50
std::vector< GEMCoPadDigi > gemCoPadV
void getMatched(std::vector< CSCCorrelatedLCTDigi > &) const
Definition: LCTContainer.cc:23
bool isValid() const
Definition: GEMCoPadDigi.cc:18
std::unique_ptr< GEMCoPadProcessor > coPadProcessor
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
std::vector< CSCALCTDigi > alctV
static bool sortLCTsByGEMDphi(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
void printGEMTriggerCoPads(int bx_start, int bx_stop, enum CSCPart)
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:35
CSCCorrelatedLCTDigi constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb) const
std::unique_ptr< CSCGEMMotherboardLUTME21 > tmbLUT_
#define LogTrace(id)
const CSCGeometry * cscGeometry_
Definition: CSCBaseboard.h:58
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, int i) const
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const override
bool isValid() const
return valid pattern bit
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
void clear()
clear this CLCT
Definition: CSCCLCTDigi.cc:54
matches< GEMPadDigi > GEMPadDigiIds
const GEMGeometry * gem_g
unsigned int alctClctOffset_
Definition: CSCBaseboard.h:90
void printGEMTriggerPads(int bx_start, int bx_stop, enum CSCPart)
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &lcts, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const