CMS 3D CMS Logo

CSCGEMMotherboardME11.cc
Go to the documentation of this file.
5 
7  unsigned sector, unsigned subsector,
8  unsigned chamber,
9  const edm::ParameterSet& conf)
10  : CSCGEMMotherboard(endcap, station, sector, subsector, chamber, conf)
11  , allLCTs1b(match_trig_window_size)
12  , allLCTs1a(match_trig_window_size)
13  // special configuration parameters for ME11 treatment
14  , smartME1aME1b(commonParams_.getParameter<bool>("smartME1aME1b"))
15  , disableME1a(commonParams_.getParameter<bool>("disableME1a"))
16  , gangedME1a(commonParams_.getParameter<bool>("gangedME1a"))
17  , dropLowQualityCLCTsNoGEMs_ME1a_(tmbParams_.getParameter<bool>("dropLowQualityCLCTsNoGEMs_ME1a"))
18  , dropLowQualityCLCTsNoGEMs_ME1b_(tmbParams_.getParameter<bool>("dropLowQualityCLCTsNoGEMs_ME1b"))
19  , dropLowQualityALCTsNoGEMs_ME1a_(tmbParams_.getParameter<bool>("dropLowQualityALCTsNoGEMs_ME1a"))
20  , dropLowQualityALCTsNoGEMs_ME1b_(tmbParams_.getParameter<bool>("dropLowQualityALCTsNoGEMs_ME1b"))
21  , buildLCTfromALCTandGEM_ME1a_(tmbParams_.getParameter<bool>("buildLCTfromALCTandGEM_ME1a"))
22  , buildLCTfromALCTandGEM_ME1b_(tmbParams_.getParameter<bool>("buildLCTfromALCTandGEM_ME1b"))
23  , buildLCTfromCLCTandGEM_ME1a_(tmbParams_.getParameter<bool>("buildLCTfromCLCTandGEM_ME1a"))
24  , buildLCTfromCLCTandGEM_ME1b_(tmbParams_.getParameter<bool>("buildLCTfromCLCTandGEM_ME1b"))
25  , promoteCLCTGEMquality_ME1a_(tmbParams_.getParameter<bool>("promoteCLCTGEMquality_ME1a"))
26  , promoteCLCTGEMquality_ME1b_(tmbParams_.getParameter<bool>("promoteCLCTGEMquality_ME1b"))
27 {
28  if (!smartME1aME1b) edm::LogError("L1CSCTPEmulatorConfigError")
29  << "+++ Upgrade CSCGEMMotherboardME11 constructed while smartME1aME1b is not set! +++\n";
30 
31  const edm::ParameterSet clctParams(conf.getParameter<edm::ParameterSet>("clctSLHC"));
32  clct1a.reset( new CSCCathodeLCTProcessor(endcap, station, sector, subsector, chamber, clctParams, commonParams_, tmbParams_) );
33  clct1a->setRing(4);
34 
35  // set LUTs
36  tmbLUT_.reset(new CSCGEMMotherboardLUTME11());
37 }
38 
39 
44 {
45  // Constructor used only for testing.
46 
47  clct1a.reset( new CSCCathodeLCTProcessor() );
48  clct1a->setRing(4);
49 }
50 
51 
53 {
54 }
55 
56 
58 {
61 
62  if (clct1a) clct1a->clear();
63  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
64  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++) {
65  for (int i=0;i<CSCConstants::MAX_LCTS_PER_CSC;i++) {
66  allLCTs1b(bx,mbx,i).clear();
67  allLCTs1a(bx,mbx,i).clear();
68  }
69  }
70  }
71 }
72 
73 
75  const CSCComparatorDigiCollection* compdc,
76  const GEMPadDigiCollection* gemPads)
77 {
78  clear();
79  setupGeometry();
80  debugLUTs();
81 
82  if (gem_g != nullptr) {
83  if (infoV >= 0) edm::LogInfo("L1CSCTPEmulatorSetupInfo")
84  << "+++ run() called for GEM-CSC integrated trigger! +++ \n";
85  gemGeometryAvailable = true;
86  }
87 
88  // check for GEM geometry
89  if (not gemGeometryAvailable){
90  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorSetupError")
91  << "+++ run() called for GEM-CSC integrated trigger without valid GEM geometry! +++ \n";
92  return;
93  }
94  gemCoPadV = coPadProcessor->run(gemPads); // run copad processor in GE1/1
95 
96  if (!( alct and clct and clct1a and smartME1aME1b))
97  {
98  if (infoV >= 0) edm::LogError("L1CSCTPEmulatorSetupError")
99  << "+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
100  return;
101  }
102 
103  alct->setCSCGeometry(csc_g);
104  clct->setCSCGeometry(csc_g);
105  clct1a->setCSCGeometry(csc_g);
106 
107  alctV = alct->run(wiredc); // run anodeLCT
108  clctV1b = clct->run(compdc); // run cathodeLCT in ME1/b
109  clctV1a = clct1a->run(compdc); // run cathodeLCT in ME1/a
110 
111  // if there are no ALCTs and no CLCTs, it does not make sense to run this TMB
112  if (alctV.empty() and clctV1b.empty() and clctV1a.empty()) return;
113 
114  int used_clct_mask[20], used_clct_mask_1a[20];
115  for (int b=0;b<20;b++)
116  used_clct_mask[b] = used_clct_mask_1a[b] = 0;
117 
118  // retrieve CSCChamber geometry
119  const CSCDetId me1aId(theEndcap, 1, 4, theChamber);
120  const CSCChamber* cscChamberME1a(csc_g->chamber(me1aId));
121 
122  retrieveGEMPads(gemPads, gemId);
124 
125  const bool hasPads(!pads_.empty());
126  const bool hasCoPads(hasPads and !coPads_.empty());
127 
128  // ALCT-centric matching
129  for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++)
130  {
131  if (alct->bestALCT[bx_alct].isValid())
132  {
133  const int bx_clct_start(bx_alct - match_trig_window_size/2);
134  const int bx_clct_stop(bx_alct + match_trig_window_size/2);
135  const int bx_copad_start(bx_alct - maxDeltaBXCoPad_);
136  const int bx_copad_stop(bx_alct + maxDeltaBXCoPad_);
137 
138  if (debug_matching){
139  LogTrace("CSCGEMCMotherboardME11") << "========================================================================" << std::endl
140  << "ALCT-CLCT matching in ME1/1 chamber: " << cscChamber->id() << std::endl
141  << "------------------------------------------------------------------------" << std::endl
142  << "+++ Best ALCT Details: " << alct->bestALCT[bx_alct] << std::endl
143  << "+++ Second ALCT Details: " << alct->secondALCT[bx_alct] << std::endl;
144 
145  printGEMTriggerPads(bx_clct_start, bx_clct_stop, CSCPart::ME11);
146  printGEMTriggerCoPads(bx_clct_start, bx_clct_stop, CSCPart::ME11);
147 
148  LogTrace("CSCGEMCMotherboardME11") << "------------------------------------------------------------------------" << std::endl
149  << "Attempt ALCT-CLCT matching in ME1/b in bx range: [" << bx_clct_start << "," << bx_clct_stop << "]" << std::endl;
150  }
151 
152  // ALCT-to-CLCT matching in ME1b
153  int nSuccesFulMatches = 0;
154  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++)
155  {
156  if (bx_clct < 0 or bx_clct >= CSCConstants::MAX_CLCT_TBINS) continue;
157  if (drop_used_clcts and used_clct_mask[bx_clct]) continue;
158  if (clct->bestCLCT[bx_clct].isValid())
159  {
160  const int quality(clct->bestCLCT[bx_clct].getQuality());
161  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "++Valid ME1b CLCT: " << clct->bestCLCT[bx_clct] << std::endl;
162 
163  // pick the pad that corresponds
164  matches<GEMPadDigi> mPads;
165  matchingPads<GEMPadDigi>(clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct],
166  alct->bestALCT[bx_alct], alct->secondALCT[bx_alct], ME1B, mPads);
167  matches<GEMCoPadDigi> mCoPads;
168  matchingPads<GEMCoPadDigi>(clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct],
169  alct->bestALCT[bx_alct], alct->secondALCT[bx_alct], ME1B, mCoPads);
170 
171  // Low quality LCTs have at most 3 layers. Check if there is a matching GEM pad to keep the CLCT
172  if (dropLowQualityCLCTsNoGEMs_ME1b_ and quality < 4 and hasPads){
173  int nFound(mPads.size());
174  // these halfstrips (1,2,3,4) and (125,126,127,128) do not have matching GEM pads because GEM chambers are slightly wider than CSCs
175  const bool clctInEdge(clct->bestCLCT[bx_clct].getKeyStrip() < 5 or clct->bestCLCT[bx_clct].getKeyStrip() > 124);
176  if (clctInEdge){
177  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\tInfo: low quality CLCT in CSC chamber edge, don't care about GEM pads" << std::endl;
178  }
179  else {
180  if (nFound != 0){
181  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\tInfo: low quality CLCT with " << nFound << " matching GEM trigger pads" << std::endl;
182  }
183  else {
184  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\tWarning: low quality CLCT without matching GEM trigger pad" << std::endl;
185  continue;
186  }
187  }
188  }
189 
190  ++nSuccesFulMatches;
191 
192  // if (infoV > 1) LogTrace("CSCMotherboard")
193  int mbx = bx_clct-bx_clct_start;
194  correlateLCTsGEM(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct],
195  clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct],
196  mPads, mCoPads,
197  allLCTs1b(bx_alct,mbx,0), allLCTs1b(bx_alct,mbx,1), ME1B);
198  if (debug_matching) {
199  LogTrace("CSCGEMCMotherboardME11") << "Successful ALCT-CLCT match in ME1b: bx_alct = " << bx_alct
200  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop
201  << "]; bx_clct = " << bx_clct << std::endl
202  << "+++ Best CLCT Details: " << clct->bestCLCT[bx_clct] << std::endl
203  << "+++ Second CLCT Details: " << clct->secondCLCT[bx_clct] << std::endl;
204  }
205 
206  if (allLCTs1b(bx_alct,mbx,0).isValid()) {
207  used_clct_mask[bx_clct] += 1;
208  if (match_earliest_clct_only) break;
209  }
210  }
211  }
212 
213  // ALCT-to-GEM matching in ME1b
214  int nSuccesFulGEMMatches = 0;
215  if (nSuccesFulMatches==0 and buildLCTfromALCTandGEM_ME1b_){
216  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "++No valid ALCT-CLCT matches in ME1b" << std::endl;
217  for (int bx_gem = bx_copad_start; bx_gem <= bx_copad_stop; bx_gem++) {
218  if (not hasCoPads) {
219  continue;
220  }
221 
222  // find the best matching copad
223  matches<GEMCoPadDigi> copads;
224  matchingPads<CSCALCTDigi, GEMCoPadDigi>(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct], ME1B, copads);
225 
226  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\t++Number of matching GEM CoPads in BX " << bx_alct << " : "<< copads.size() << std::endl;
227  if (copads.empty()) {
228  continue;
229  }
230 
231  CSCGEMMotherboard::correlateLCTsGEM(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct],
232  copads, allLCTs1b(bx_alct,0,0), allLCTs1b(bx_alct,0,1), ME1B);
233  if (allLCTs1b(bx_alct,0,0).isValid()) {
234  ++nSuccesFulGEMMatches;
235  if (match_earliest_clct_only) break;
236  }
237  if (debug_matching) {
238  LogTrace("CSCGEMCMotherboardME11") << "Successful ALCT-GEM CoPad match in ME1b: bx_alct = " << bx_alct << std::endl << std::endl
239  << "------------------------------------------------------------------------" << std::endl << std::endl;
240  }
241  }
242  }
243 
244  if (debug_matching) {
245  LogTrace("CSCGEMCMotherboardME11") << "========================================================================" << std::endl
246  << "Summary: " << std::endl;
247  if (nSuccesFulMatches>1)
248  LogTrace("CSCGEMCMotherboardME11") << "Too many successful ALCT-CLCT matches in ME1b: " << nSuccesFulMatches
249  << ", CSCDetId " << cscChamber->id()
250  << ", bx_alct = " << bx_alct
251  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
252  else if (nSuccesFulMatches==1)
253  LogTrace("CSCGEMCMotherboardME11") << "1 successful ALCT-CLCT match in ME1b: "
254  << " CSCDetId " << cscChamber->id()
255  << ", bx_alct = " << bx_alct
256  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
257  else if (nSuccesFulGEMMatches==1)
258  LogTrace("CSCGEMCMotherboardME11") << "1 successful ALCT-GEM match in ME1b: "
259  << " CSCDetId " << cscChamber->id()
260  << ", bx_alct = " << bx_alct
261  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
262  else
263  LogTrace("CSCGEMCMotherboardME11") << "Unsuccessful ALCT-CLCT match in ME1b: "
264  << "CSCDetId " << cscChamber->id()
265  << ", bx_alct = " << bx_alct
266  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
267 
268  LogTrace("CSCGEMCMotherboardME11") << "------------------------------------------------------------------------" << std::endl
269  << "Attempt ALCT-CLCT matching in ME1/a in bx range: [" << bx_clct_start << "," << bx_clct_stop << "]" << std::endl;
270  }
271 
272  // ALCT-to-CLCT matching in ME1a
273  nSuccesFulMatches = 0;
274  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++)
275  {
276  if (bx_clct < 0 or bx_clct >= CSCConstants::MAX_CLCT_TBINS) continue;
277  if (drop_used_clcts and used_clct_mask_1a[bx_clct]) continue;
278  if (clct1a->bestCLCT[bx_clct].isValid())
279  {
280  const int quality(clct1a->bestCLCT[bx_clct].getQuality());
281  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "++Valid ME1a CLCT: " << clct1a->bestCLCT[bx_clct] << std::endl;
282 
283  // pick the pad that corresponds
284  matches<GEMPadDigi> mPads;
285  matchingPads<GEMPadDigi>(clct1a->bestCLCT[bx_clct], clct1a->secondCLCT[bx_clct],
286  alct->bestALCT[bx_alct], alct->secondALCT[bx_alct], ME1A, mPads);
287  matches<GEMCoPadDigi> mCoPads;
288  matchingPads<GEMCoPadDigi>(clct1a->bestCLCT[bx_clct], clct1a->secondCLCT[bx_clct],
289  alct->bestALCT[bx_alct], alct->secondALCT[bx_alct], ME1A, mCoPads);
290 
291  if (dropLowQualityCLCTsNoGEMs_ME1a_ and quality < 4 and hasPads){
292  int nFound(mPads.size());
293  const bool clctInEdge(clct1a->bestCLCT[bx_clct].getKeyStrip() < 4 or clct1a->bestCLCT[bx_clct].getKeyStrip() > 93);
294  if (clctInEdge){
295  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\tInfo: low quality CLCT in CSC chamber edge, don't care about GEM pads" << std::endl;
296  }
297  else {
298  if (nFound != 0){
299  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\tInfo: low quality CLCT with " << nFound << " matching GEM trigger pads" << std::endl;
300  }
301  else {
302  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\tWarning: low quality CLCT without matching GEM trigger pad" << std::endl;
303  continue;
304  }
305  }
306  }
307  ++nSuccesFulMatches;
308  int mbx = bx_clct-bx_clct_start;
309  correlateLCTsGEM(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct],
310  clct1a->bestCLCT[bx_clct], clct1a->secondCLCT[bx_clct],
311  mPads, mCoPads,
312  allLCTs1a(bx_alct,mbx,0), allLCTs1a(bx_alct,mbx,1), ME1A);
313  if (debug_matching) {
314  LogTrace("CSCGEMCMotherboardME11") << "Successful ALCT-CLCT match in ME1a: bx_alct = " << bx_alct
315  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop
316  << "]; bx_clct = " << bx_clct << std::endl
317  << "+++ Best CLCT Details: " << clct1a->bestCLCT[bx_clct] << std::endl
318  << "+++ Second CLCT Details: " << clct1a->secondCLCT[bx_clct] << std::endl;
319  }
320  if (allLCTs1a(bx_alct,mbx,0).isValid()){
321  used_clct_mask_1a[bx_clct] += 1;
322  if (match_earliest_clct_only) break;
323  }
324  }
325  }
326 
327  // ALCT-to-GEM matching in ME1a
328  nSuccesFulGEMMatches = 0;
329  if (nSuccesFulMatches==0 and buildLCTfromALCTandGEM_ME1a_){
330  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "++No valid ALCT-CLCT matches in ME1a" << std::endl;
331  for (int bx_gem = bx_copad_start; bx_gem <= bx_copad_stop; bx_gem++) {
332  if (not hasCoPads) {
333  continue;
334  }
335 
336  // find the best matching copad
337  matches<GEMCoPadDigi> copads;
338  matchingPads<CSCALCTDigi, GEMCoPadDigi>(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct], ME1A, copads);
339 
340  if (debug_matching) LogTrace("CSCGEMCMotherboardME11") << "\t++Number of matching GEM CoPads in BX " << bx_alct << " : "<< copads.size() << std::endl;
341  if (copads.empty()) {
342  continue;
343  }
344 
345  CSCGEMMotherboard::correlateLCTsGEM(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct],
346  copads, allLCTs1a(bx_alct,0,0), allLCTs1a(bx_alct,0,1), ME1A);
347  if (allLCTs1a(bx_alct,0,0).isValid()) {
348  ++nSuccesFulGEMMatches;
349  if (match_earliest_clct_only) break;
350  }
351  if (debug_matching) {
352  LogTrace("CSCGEMCMotherboardME11") << "Successful ALCT-GEM CoPad match in ME1a: bx_alct = " << bx_alct << std::endl << std::endl
353  << "------------------------------------------------------------------------" << std::endl << std::endl;
354  }
355  }
356  }
357 
358  if (debug_matching) {
359  LogTrace("CSCGEMCMotherboardME11") << "========================================================================" << std::endl
360  << "Summary: " << std::endl;
361  if (nSuccesFulMatches>1)
362  LogTrace("CSCGEMCMotherboardME11") << "Too many successful ALCT-CLCT matches in ME1a: " << nSuccesFulMatches
363  << ", CSCDetId " << cscChamberME1a->id()
364  << ", bx_alct = " << bx_alct
365  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
366  else if (nSuccesFulMatches==1)
367  LogTrace("CSCGEMCMotherboardME11") << "1 successful ALCT-CLCT match in ME1a: "
368  << " CSCDetId " << cscChamberME1a->id()
369  << ", bx_alct = " << bx_alct
370  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
371  else if (nSuccesFulGEMMatches==1)
372  LogTrace("CSCGEMCMotherboardME11") << "1 successful ALCT-GEM match in ME1a: "
373  << " CSCDetId " << cscChamberME1a->id()
374  << ", bx_alct = " << bx_alct
375  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
376  else
377  LogTrace("CSCGEMCMotherboardME11") << "Unsuccessful ALCT-CLCT match in ME1a: "
378  << "CSCDetId " << cscChamberME1a->id()
379  << ", bx_alct = " << bx_alct
380  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop << "]" << std::endl;
381  }
382 
383  } // end of ALCT valid block
384  else {
385  auto coPads(coPads_[bx_alct]);
386  if (!coPads.empty()) {
387  // keep it simple for the time being, only consider the first copad
388  const int bx_clct_start(bx_alct - match_trig_window_size/2);
389  const int bx_clct_stop(bx_alct + match_trig_window_size/2);
390 
391  // matching in ME1b
393  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
394  if (bx_clct < 0 or bx_clct >= CSCConstants::MAX_CLCT_TBINS) continue;
395  if (drop_used_clcts and used_clct_mask[bx_clct]) continue;
396  if (clct->bestCLCT[bx_clct].isValid()) {
397  const int quality(clct->bestCLCT[bx_clct].getQuality());
398  // only use high-Q stubs for the time being
399  if (quality < 4) continue;
400  int mbx = bx_clct-bx_clct_start;
401  CSCGEMMotherboard::correlateLCTsGEM(clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct], coPads,
402  allLCTs1b(bx_alct,mbx,0), allLCTs1b(bx_alct,mbx,1), ME1B);
403  if (debug_matching) {
404  // if (infoV > 1) LogTrace("CSCMotherboard")
405  LogTrace("CSCGEMCMotherboardME11") << "Successful GEM-CLCT match in ME1b: bx_alct = " << bx_alct
406  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop
407  << "]; bx_clct = " << bx_clct << std::endl
408  << "+++ Best CLCT Details: " << clct->bestCLCT[bx_clct] << std::endl
409  << "+++ Second CLCT Details: " << clct->secondCLCT[bx_clct] << std::endl;
410  }
411  if (allLCTs1b(bx_alct,mbx,0).isValid()) {
412  used_clct_mask[bx_clct] += 1;
413  if (match_earliest_clct_only) break;
414  }
415  }
416  }
417  }
418 
419  // matching in ME1a
421  for (int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++) {
422  if (bx_clct < 0 || bx_clct >= CSCConstants::MAX_CLCT_TBINS) continue;
423  if (drop_used_clcts && used_clct_mask_1a[bx_clct]) continue;
424  if (clct1a->bestCLCT[bx_clct].isValid()){
425  const int quality(clct1a->bestCLCT[bx_clct].getQuality());
426  // only use high-Q stubs for the time being
427  if (quality < 4) continue;
428  int mbx = bx_clct-bx_clct_start;
429  CSCGEMMotherboard::correlateLCTsGEM(clct1a->bestCLCT[bx_clct], clct1a->secondCLCT[bx_clct], coPads,
430  allLCTs1a(bx_alct,mbx,0), allLCTs1a(bx_alct,mbx,1), ME1A);
431  if (debug_matching) {
432  // if (infoV > 1) LogTrace("CSCMotherboard")
433  LogTrace("CSCGEMCMotherboardME11") << "Successful GEM-CLCT match in ME1a: bx_alct = " << bx_alct
434  << "; match window: [" << bx_clct_start << "; " << bx_clct_stop
435  << "]; bx_clct = " << bx_clct << std::endl
436  << "+++ Best CLCT Details: " << clct1a->bestCLCT[bx_clct] << std::endl
437  << "+++ Second CLCT Details: " << clct1a->secondCLCT[bx_clct] << std::endl;
438  }
439  if (allLCTs1a(bx_alct,mbx,0).isValid()){
440  used_clct_mask_1a[bx_clct] += 1;
441  if (match_earliest_clct_only) break;
442  }
443  }
444  }
445  }
446  }
447  }
448  } // end of ALCT-centric matching
449 
450  if (debug_matching){
451  LogTrace("CSCGEMCMotherboardME11") << "========================================================================" << std::endl
452  << "Counting the LCTs" << std::endl
453  << "========================================================================" << std::endl;
454  }
455 
456  // reduction of nLCTs per each BX
457  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++)
458  {
459  // counting
460  unsigned int n1a=0, n1b=0;
461  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
462  for (int i=0;i<CSCConstants::MAX_LCTS_PER_CSC;i++)
463  {
464  int cbx = bx + mbx - match_trig_window_size/2;
465  if (allLCTs1b(bx,mbx,i).isValid())
466  {
467  n1b++;
468  if (infoV > 0) LogDebug("CSCGEMMotherboardME11")
469  << "1b LCT"<<i+1<<" "<<bx<<"/"<<cbx<<": "<<allLCTs1b(bx,mbx,i)<<std::endl;
470  }
471  if (allLCTs1a(bx,mbx,i).isValid())
472  {
473  n1a++;
474  if (infoV > 0) LogDebug("CSCGEMMotherboardME11")
475  << "1a LCT"<<i+1<<" "<<bx<<"/"<<cbx<<": "<<allLCTs1a(bx,mbx,i)<<std::endl;
476  }
477  }
478  if (infoV > 0 and n1a+n1b>0) LogDebug("CSCGEMMotherboardME11")
479  <<"bx "<<bx<<" nLCT:"<<n1a<<" "<<n1b<<" "<<n1a+n1b<<std::endl;
480 
481  // some simple cross-bx sorting algorithms
482  if (tmb_cross_bx_algo == 1 and (n1a>2 or n1b>2) )
483  {
484  n1a=0, n1b=0;
485  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
486  for (int i=0;i<CSCConstants::MAX_LCTS_PER_CSC;i++)
487  {
488  if (allLCTs1b(bx,pref[mbx],i).isValid())
489  {
490  n1b++;
491  if (n1b>2) allLCTs1b(bx,pref[mbx],i).clear();
492  }
493  if (allLCTs1a(bx,pref[mbx],i).isValid())
494  {
495  n1a++;
496  if (n1a>2) allLCTs1a(bx,pref[mbx],i).clear();
497  }
498  }
499 
500  n1a=0, n1b=0;
501  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
502  for (int i=0;i<CSCConstants::MAX_LCTS_PER_CSC;i++)
503  {
504  int cbx = bx + mbx - match_trig_window_size/2;
505  if (allLCTs1b(bx,mbx,i).isValid())
506  {
507  n1b++;
508  if (infoV > 0) LogDebug("CSCGEMMotherboardME11")
509  << "1b LCT"<<i+1<<" "<<bx<<"/"<<cbx<<": "<<allLCTs1b(bx,mbx,i)<< std::endl;
510  }
511  if (allLCTs1a(bx,mbx,i).isValid())
512  {
513  n1a++;
514  if (infoV > 0) LogDebug("CSCGEMMotherboardME11")
515  << "1a LCT"<<i+1<<" "<<bx<<"/"<<cbx<<": "<<allLCTs1a(bx,mbx,i)<< std::endl;
516  }
517  }
518  if (infoV > 0 and n1a+n1b>0) LogDebug("CSCGEMMotherboardME11")
519  <<"bx "<<bx<<" nnLCT:"<<n1a<<" "<<n1b<<" "<<n1a+n1b<<std::endl;
520  } // x-bx sorting
521 
522  // Maximum 2 per whole ME11 per BX case:
523  // (supposedly, now we should have max 2 per bx in each 1a and 1b)
524  if (n1a+n1b > max_lcts and tmb_cross_bx_algo == 1)
525  {
526  // do it simple so far: take all low eta 1/b stubs
527  unsigned int nLCT=n1b;
528  n1a=0;
529  // right now nLCT<=2; cut 1a if necessary
530  for (unsigned int mbx=0; mbx<match_trig_window_size; mbx++)
531  for (int i=0;i<CSCConstants::MAX_LCTS_PER_CSC;i++)
532  if (allLCTs1a(bx,mbx,i).isValid()) {
533  nLCT++;
534  if (nLCT>max_lcts) allLCTs1a(bx,mbx,i).clear();
535  else n1a++;
536  }
537  if (infoV > 0 and nLCT>0) LogDebug("CSCGEMMotherboardME11")
538  <<"bx "<<bx<<" nnnLCT: "<<n1a<<" "<<n1b<<" "<<n1a+n1b<< std::endl;
539  }
540  }// reduction per bx
541 
542  unsigned int n1b=0, n1a=0;
543  LogTrace("CSCGEMCMotherboardME11") << "========================================================================" << std::endl
544  << "Counting the final LCTs" << std::endl
545  << "========================================================================" << std::endl
546  << "tmb_cross_bx_algo: " << tmb_cross_bx_algo << std::endl;
547 
548  for (const auto& p : readoutLCTs1b()) {
549  n1b++;
550  if (debug_matching)
551  LogTrace("CSCGEMCMotherboardME11") << "1b LCT "<<n1b<<" " << p <<std::endl;
552  }
553 
554  for (const auto& p : readoutLCTs1a()){
555  n1a++;
556  if (debug_matching)
557  LogTrace("CSCGEMCMotherboardME11") << "1a LCT "<<n1a<<" " << p <<std::endl;
558  }
559 }
560 
561 std::vector<CSCCorrelatedLCTDigi> CSCGEMMotherboardME11::readoutLCTs1a() const
562 {
563  return readoutLCTs(ME1A);
564 }
565 
566 
567 std::vector<CSCCorrelatedLCTDigi> CSCGEMMotherboardME11::readoutLCTs1b() const
568 {
569  return readoutLCTs(ME1B);
570 }
571 
572 
573 // Returns vector of read-out correlated LCTs, if any. Starts with
574 // the vector of all found LCTs and selects the ones in the read-out
575 // time window.
576 std::vector<CSCCorrelatedLCTDigi> CSCGEMMotherboardME11::readoutLCTs(enum CSCPart me1ab) const
577 {
578  std::vector<CSCCorrelatedLCTDigi> tmpV;
579 
580  // The start time of the L1A*LCT coincidence window should be related
581  // to the fifo_pretrig parameter, but I am not completely sure how.
582  // Just choose it such that the window is centered at bx=7. This may
583  // need further tweaking if the value of tmb_l1a_window_size changes.
584  //static int early_tbins = 4;
585  // The number of LCT bins in the read-out is given by the
586  // tmb_l1a_window_size parameter, forced to be odd
587  const int lct_bins =
589  const int late_tbins = early_tbins + lct_bins;
590 
591  // Start from the vector of all found correlated LCTs and select
592  // those within the LCT*L1A coincidence window.
593  int bx_readout = -1;
594  std::vector<CSCCorrelatedLCTDigi> all_lcts;
595  if (me1ab == ME1A and not (mpc_block_me1a or disableME1a)) {
596  allLCTs1a.getMatched(all_lcts);
597  }
598  if (me1ab == ME1B) {
599  allLCTs1b.getMatched(all_lcts);
600  }
601  // sort LCTs by quality or bending angle
602  switch(tmb_cross_bx_algo){
603  case 2: sortLCTs(all_lcts, me1ab, CSCUpgradeMotherboard::sortLCTsByQuality);
604  break;
605  case 3: sortLCTs(all_lcts, me1ab, CSCUpgradeMotherboard::sortLCTsByGEMDphi);
606  break;
607  default: LogTrace("CSCGEMCMotherboardME11")<<"tmb_cross_bx_algo error" <<std::endl;
608  break;
609  }
610  for (const auto& lct: all_lcts)
611  {
612  if (!lct.isValid()) continue;
613 
614  int bx = lct.getBX();
615  // Skip LCTs found too early relative to L1Accept.
616  if (bx <= early_tbins) continue;
617 
618  // Skip LCTs found too late relative to L1Accept.
619  if (bx > late_tbins) continue;
620 
621  // If (readout_earliest_2) take only LCTs in the earliest bx in the read-out window:
622  // in digi->raw step, LCTs have to be packed into the TMB header, and
623  // currently there is room just for two.
624  if (readout_earliest_2 and (bx_readout == -1 or bx == bx_readout) )
625  {
626  tmpV.push_back(lct);
627  if (bx_readout == -1) bx_readout = bx;
628  }
629  else tmpV.push_back(lct);
630  }
631  return tmpV;
632 }
633 
634 //sort LCTs in each BX
635 void CSCGEMMotherboardME11::sortLCTs(std::vector<CSCCorrelatedLCTDigi>& LCTs, int bx, enum CSCPart me,
636  bool (*sorter)(const CSCCorrelatedLCTDigi&, const CSCCorrelatedLCTDigi&)) const
637 {
638  const auto& allLCTs(me==ME1A ? allLCTs1a : allLCTs1b);
639 
640  allLCTs.getTimeMatched(bx, LCTs);
641 
643 }
644 
645 //sort LCTs in whole LCTs BX window
646 void CSCGEMMotherboardME11::sortLCTs(std::vector<CSCCorrelatedLCTDigi>& LCTs_final, enum CSCPart me,
647  bool (*sorter)(const CSCCorrelatedLCTDigi&, const CSCCorrelatedLCTDigi&)) const
648 {
649  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++)
650  {
651  // get sorted LCTs per subchamber
652  std::vector<CSCCorrelatedLCTDigi> LCTs1a;
653  std::vector<CSCCorrelatedLCTDigi> LCTs1b;
654 
657 
658  // temporary collection with all LCTs in the whole chamber
659  std::vector<CSCCorrelatedLCTDigi> LCTs_tmp;
660  LCTs_tmp.insert(LCTs_tmp.begin(), LCTs1b.begin(), LCTs1b.end());
661  LCTs_tmp.insert(LCTs_tmp.end(), LCTs1a.begin(), LCTs1a.end());
662 
663  // sort the selected LCTs
665 
666  //LCTs reduction per BX
667  if (max_lcts==2)
668  {
669  // loop on all the selected LCTs
670  for (const auto& p: LCTs_tmp){
671  // case when you only want to readout ME1A
672  if (me==ME1A and std::find(LCTs1a.begin(), LCTs1a.end(), p) != LCTs1a.end()){
673  LCTs_final.push_back(p);
674  }
675  // case when you only want to readout ME1B
676  else if(me==ME1B and std::find(LCTs1b.begin(), LCTs1b.end(), p) != LCTs1b.end()){
677  LCTs_final.push_back(p);
678  }
679  }
680  }
681  else {
682  if (!LCTs1a.empty() and !LCTs1b.empty() and me==ME1A)
683  LCTs_final.push_back(*LCTs1a.begin());
684  else if (!LCTs1a.empty() and !LCTs1b.empty() and me==ME1B)
685  LCTs_final.push_back(*LCTs1b.begin());
686  else if (!LCTs1a.empty() and LCTs1b.empty() and me==ME1A)
687  LCTs_final.insert(LCTs_final.end(), LCTs1a.begin(), LCTs1a.end());
688  else if (!LCTs1b.empty() and LCTs1a.empty() and me==ME1B)
689  LCTs_final.insert(LCTs_final.end(), LCTs1b.begin(), LCTs1b.end());
690  }
691  }
692 }
693 
694 
696 {
697  if ( !c.isValid() or !a.isValid() ) return false;
698  int key_hs = c.getKeyStrip();
699  int key_wg = a.getKeyWG();
700  if ( me == ME1A )
701  {
702  if ( !gangedME1a )
703  {
704  // wrap around ME11 HS number for -z endcap
705  if (theEndcap==2) key_hs = CSCConstants::MAX_HALF_STRIP_ME1A_UNGANGED - key_hs;
706  if ( key_hs >= (tmbLUT_->get_lut_wg_vs_hs(CSCPart::ME1A))[key_wg][0] and
707  key_hs <= (tmbLUT_->get_lut_wg_vs_hs(CSCPart::ME1A))[key_wg][1] ) return true;
708  return false;
709  }
710  else
711  {
712  if (theEndcap==2) key_hs = CSCConstants::MAX_HALF_STRIP_ME1A_GANGED - key_hs;
713  if ( key_hs >= (tmbLUT_->get_lut_wg_vs_hs(CSCPart::ME1Ag))[key_wg][0] and
714  key_hs <= (tmbLUT_->get_lut_wg_vs_hs(CSCPart::ME1Ag))[key_wg][1] ) return true;
715  return false;
716  }
717  }
718  if ( me == ME1B)
719  {
720  if (theEndcap==2) key_hs = CSCConstants::MAX_HALF_STRIP_ME1B - key_hs;
721  if ( key_hs >= (tmbLUT_->get_lut_wg_vs_hs(CSCPart::ME1B))[key_wg][0] and
722  key_hs <= (tmbLUT_->get_lut_wg_vs_hs(CSCPart::ME1B))[key_wg][1] ) return true;
723  }
724  return false;
725 }
726 
727 
729  CSCALCTDigi& secondALCT,
730  CSCCLCTDigi& bestCLCT,
731  CSCCLCTDigi& secondCLCT,
732  const GEMPadDigiIds& pads,
733  const GEMCoPadDigiIds& copads,
734  CSCCorrelatedLCTDigi& lct1,
735  CSCCorrelatedLCTDigi& lct2,
736  enum CSCPart p) const
737 {
738  // assume that always anodeBestValid and cathodeBestValid
739 
740  if (secondALCT == bestALCT) secondALCT.clear();
741  if (secondCLCT == bestCLCT) secondCLCT.clear();
742 
743  const int ok11 = doesALCTCrossCLCT( bestALCT, bestCLCT, p);
744  const int ok12 = doesALCTCrossCLCT( bestALCT, secondCLCT, p);
745  const int ok21 = doesALCTCrossCLCT( secondALCT, bestCLCT, p);
746  const int ok22 = doesALCTCrossCLCT( secondALCT, secondCLCT, p);
747  const int code = (ok11<<3) | (ok12<<2) | (ok21<<1) | (ok22);
748 
749  int dbg=0;
750  int ring = p;
752  CSCDetId did(theEndcap, theStation, ring, chamb, 0);
753  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"debug correlateLCTs in "<<did<<std::endl
754  <<"ALCT1: "<<bestALCT<<std::endl
755  <<"ALCT2: "<<secondALCT<<std::endl
756  <<"CLCT1: "<<bestCLCT<<std::endl
757  <<"CLCT2: "<<secondCLCT<<std::endl
758  <<"ok 11 12 21 22 code = "<<ok11<<" "<<ok12<<" "<<ok21<<" "<<ok22<<" "<<code<<std::endl;
759 
760  if ( code==0 ) return;
761 
762  // LUT defines correspondence between possible ok## combinations
763  // and resulting lct1 and lct2
764  int lut[16][2] = {
765  //ok: 11 12 21 22
766  {0 ,0 }, // 0 0 0 0
767  {22,0 }, // 0 0 0 1
768  {21,0 }, // 0 0 1 0
769  {21,22}, // 0 0 1 1
770  {12,0 }, // 0 1 0 0
771  {12,22}, // 0 1 0 1
772  {12,21}, // 0 1 1 0
773  {12,21}, // 0 1 1 1
774  {11,0 }, // 1 0 0 0
775  {11,22}, // 1 0 0 1
776  {11,21}, // 1 0 1 0
777  {11,22}, // 1 0 1 1
778  {11,12}, // 1 1 0 0
779  {11,22}, // 1 1 0 1
780  {11,12}, // 1 1 1 0
781  {11,22}, // 1 1 1 1
782  };
783 
784  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"lut 0 1 = "<<lut[code][0]<<" "<<lut[code][1]<<std::endl;
785 
786  // check matching copads
787  const GEMCoPadDigi& bb_copad = bestMatchingPad<GEMCoPadDigi>(bestALCT, bestCLCT, copads, p);
788  const GEMCoPadDigi& bs_copad = bestMatchingPad<GEMCoPadDigi>(bestALCT, secondCLCT, copads, p);
789  const GEMCoPadDigi& sb_copad = bestMatchingPad<GEMCoPadDigi>(secondALCT, bestCLCT, copads, p);
790  const GEMCoPadDigi& ss_copad = bestMatchingPad<GEMCoPadDigi>(secondALCT, secondCLCT, copads, p);
791 
792  // check matching pads
793  const GEMPadDigi& bb_pad = bestMatchingPad<GEMPadDigi>(bestALCT, bestCLCT, pads, p);
794  const GEMPadDigi& bs_pad = bestMatchingPad<GEMPadDigi>(bestALCT, secondCLCT, pads, p);
795  const GEMPadDigi& sb_pad = bestMatchingPad<GEMPadDigi>(secondALCT, bestCLCT, pads, p);
796  const GEMPadDigi& ss_pad = bestMatchingPad<GEMPadDigi>(secondALCT, secondCLCT, pads, p);
797 
798  // evaluate possible combinations
799  const bool ok_bb_copad = ok11==1 and bestALCT.isValid() and bestCLCT.isValid() and bb_copad.isValid();
800  const bool ok_bs_copad = ok12==1 and bestALCT.isValid() and secondCLCT.isValid() and bs_copad.isValid();
801  const bool ok_sb_copad = ok21==1 and secondALCT.isValid() and bestCLCT.isValid() and sb_copad.isValid();
802  const bool ok_ss_copad = ok22==1 and secondALCT.isValid() and secondCLCT.isValid() and ss_copad.isValid();
803 
804  const bool ok_bb_pad = (not ok_bb_copad) and ok11==1 and bestALCT.isValid() and bestCLCT.isValid() and bb_pad.isValid();
805  const bool ok_bs_pad = (not ok_bs_copad) and ok12==1 and bestALCT.isValid() and secondCLCT.isValid() and bs_pad.isValid();
806  const bool ok_sb_pad = (not ok_sb_copad) and ok21==1 and secondALCT.isValid() and bestCLCT.isValid() and sb_pad.isValid();
807  const bool ok_ss_pad = (not ok_ss_copad) and ok22==1 and secondALCT.isValid() and secondCLCT.isValid() and ss_pad.isValid();
808 
809  switch (lut[code][0]) {
810  case 11:
811  if (ok_bb_copad) lct1 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, bestCLCT, bb_copad, p, 1);
812  if (ok_bb_pad) lct1 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, bestCLCT, bb_pad, p, 1);
813  break;
814  case 12:
815  if (ok_bs_copad) lct1 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, secondCLCT, bs_copad, p, 1);
816  if (ok_bs_pad) lct1 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, secondCLCT, bs_pad, p, 1);
817  break;
818  case 21:
819  if (ok_sb_copad) lct1 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, bestCLCT, sb_copad, p, 1);
820  if (ok_sb_pad) lct1 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, bestCLCT, sb_pad, p, 1);
821  break;
822  case 22:
823  if (ok_ss_copad) lct1 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, secondCLCT, ss_copad, p, 1);
824  if (ok_ss_pad) lct1 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, secondCLCT, ss_pad, p, 1);
825  break;
826  default:
827  return;
828  }
829 
830  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"lct1: "<<lct1<<std::endl;
831 
832  switch (lut[code][1]){
833  case 12:
834  if (ok_bs_copad) lct2 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, secondCLCT, bs_copad, p, 2);
835  if (ok_bs_pad) lct2 = CSCGEMMotherboard::constructLCTsGEM(bestALCT, secondCLCT, bs_pad, p, 2);
836  break;
837  case 21:
838  if (ok_sb_copad) lct2 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, bestCLCT, sb_copad, p, 2);
839  if (ok_sb_pad) lct2 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, bestCLCT, sb_pad, p, 2);
840  break;
841  case 22:
842  if (ok_bb_copad) lct2 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, secondCLCT, bb_copad, p, 2);
843  if (ok_bb_pad) lct2 = CSCGEMMotherboard::constructLCTsGEM(secondALCT, secondCLCT, bb_pad, p, 2);
844  break;
845  default:
846  return;
847  }
848 
849  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"lct2: "<<lct2<<std::endl;
850 
851  if (dbg) LogTrace("CSCGEMMotherboardME11")<<"out of correlateLCTs"<<std::endl;
852  return;
853 }
#define LogDebug(id)
bool isValid() const
Definition: GEMPadDigi.cc:48
void retrieveGEMPads(const GEMPadDigiCollection *pads, unsigned id)
const unsigned theSector
T getParameter(std::string const &) const
std::vector< CSCCLCTDigi > clctV1b
std::vector< CSCCorrelatedLCTDigi > readoutLCTs()
unsigned int match_trig_window_size
CSCDetId id() const
Get the (concrete) DetId.
Definition: CSCChamber.h:37
const unsigned theTrigChamber
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:30
GEMCoPadDigiIdsBX coPads_
CSCCorrelatedLCTDigi constructLCTsGEM(const CSCALCTDigi &alct, const GEMCoPadDigi &gem, enum CSCPart, int i) const
bool doesALCTCrossCLCT(const CSCALCTDigi &a, const CSCCLCTDigi &c, int me) const
const unsigned theEndcap
void clear()
clear this ALCT
Definition: CSCALCTDigi.cc:35
static bool sortLCTsByQuality(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
int pref[CSCConstants::MAX_LCT_TBINS]
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
const CSCChamber * cscChamber
matches< GEMCoPadDigi > GEMCoPadDigiIds
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1b() const
std::vector< GEMCoPadDigi > gemCoPadV
std::vector< CSCALCTDigi > alctV
unsigned int mpc_block_me1a
bool isValid() const
Definition: GEMCoPadDigi.cc:32
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &lcts, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1a() const
const unsigned theStation
std::unique_ptr< GEMCoPadProcessor > coPadProcessor
const CSCGeometry * csc_g
edm::ParameterSet commonParams_
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
const unsigned theSubsector
void correlateLCTsGEM(T &best, T &second, const GEMCoPadDigiIds &coPads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, enum CSCPart) const
static bool sortLCTsByGEMDphi(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
void printGEMTriggerCoPads(int bx_start, int bx_stop, enum CSCPart)
unsigned int tmb_l1a_window_size
std::unique_ptr< CSCCathodeLCTProcessor > clct1a
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:30
#define LogTrace(id)
edm::ParameterSet tmbParams_
void getMatched(std::vector< CSCCorrelatedLCTDigi > &) const
std::unique_ptr< CSCGEMMotherboardLUTME11 > tmbLUT_
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:118
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &, int bx, enum CSCPart, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
double b
Definition: hdecay.h:120
std::vector< CSCCLCTDigi > clctV1a
GEMPadDigiIdsBX pads_
std::unique_ptr< CSCAnodeLCTProcessor > alct
double a
Definition: hdecay.h:121
std::unique_ptr< CSCCathodeLCTProcessor > clct
void clear()
clear this CLCT
Definition: CSCCLCTDigi.cc:58
matches< GEMPadDigi > GEMPadDigiIds
int getKeyStrip() const
Definition: CSCCLCTDigi.h:65
const GEMGeometry * gem_g
void correlateLCTsGEM(CSCALCTDigi &bestALCT, CSCALCTDigi &secondALCT, CSCCLCTDigi &bestCLCT, CSCCLCTDigi &secondCLCT, const GEMPadDigiIds &pads, const GEMCoPadDigiIds &copads, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, enum CSCPart p) const
int getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:45
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)
void printGEMTriggerPads(int bx_start, int bx_stop, enum CSCPart)
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiCollection *gemPads) override