CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1MuGMTMerger.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuGMTMerger
4 //
5 // Description: GMT Merger
6 //
7 //
8 // $Date $
9 // $Revision $
10 //
11 // Author :
12 // H. Sakulin HEPHY Vienna
13 //
14 // Migrated to CMSSW:
15 // I. Mikulec
16 //
17 //--------------------------------------------------
18 
19 //-----------------------
20 // This Class's Header --
21 //-----------------------
22 
24 
25 //---------------
26 // C++ Headers --
27 //---------------
28 
29 #include <iostream>
30 #include <vector>
31 #include <cmath>
32 
33 //-------------------------------
34 // Collaborating Class Headers --
35 //-------------------------------
36 
45 
46 
51 
53 
56 
58 
61 
63 
65 
66 //---------------------------------
67 // class L1MuGMTMerger
68 //---------------------------------
69 
70 //----------------
71 // Constructors --
72 //----------------
74  m_gmt(gmt), m_id(id), dtcsc_mu(4), rpc_mu(4) {
75 
76  dtcsc_mu.reserve(4);
77  rpc_mu.reserve(4);
78 
79 }
80 
81 //--------------
82 // Destructor --
83 //--------------
85  reset();
86 }
87 
88 //--------------
89 // Operations --
90 //--------------
91 
92 //
93 // run Merger
94 //
96  load();
97  merge();
98 }
99 
100 
101 //
102 // reset Merger
103 //
105 
106  for ( int i = 0; i < 4; i++ ) {
107  dtcsc_mu[i] = 0;
108  rpc_mu[i] = 0;
109  }
110 
111  std::vector<L1MuGMTExtendedCand*>::iterator iter;
112  for ( iter = m_MuonCands.begin(); iter != m_MuonCands.end(); iter++ ) {
113  if ( *iter ) delete (*iter);
114  *iter = 0;
115  }
116 
117  m_MuonCands.clear();
118 
119 }
120 
121 
122 //
123 // print selection results
124 //
125 void L1MuGMTMerger::print() const {
126 
127  edm::LogVerbatim("GMT_Merger_info") << " ";
128 
129  std::vector<L1MuGMTExtendedCand*>::const_iterator iter;
130  for ( iter = m_MuonCands.begin(); iter != m_MuonCands.end(); iter++ ) {
131  if ( *iter && !(*iter)->empty() ) (*iter)->print();
132  }
133 
134  edm::LogVerbatim("GMT_Merger_info") << " ";
135 
136 }
137 
138 
139 //
140 // load Merger (get data from PSB)
141 //
143 
144  // barrel Merger gets DTBX and barrel RPC muons
145  if ( m_id == 0 ) {
146  for ( unsigned idt = 0; idt < L1MuGMTConfig::MAXDTBX; idt++ ) {
147  dtcsc_mu[idt] = m_gmt.Data()->DTBXMuon(idt);
148  }
149  for ( unsigned irpc = 0; irpc < L1MuGMTConfig::MAXRPCbarrel; irpc++ ) {
150  rpc_mu[irpc] = m_gmt.Data()->RPCMuon(irpc);
151  }
152  }
153 
154  // endcap Merger gets CSC and endcap RPC muons
155  if ( m_id == 1 ) {
156  for ( unsigned icsc = 0; icsc < L1MuGMTConfig::MAXCSC; icsc++ ) {
157  dtcsc_mu[icsc] = m_gmt.Data()->CSCMuon(icsc);
158  }
159  for ( unsigned irpc = 0; irpc < L1MuGMTConfig::MAXRPCendcap; irpc++ ) {
160  rpc_mu[irpc] = m_gmt.Data()->RPCMuon(irpc+4);
161  }
162  }
163 
164 }
165 
166 
168 
169  const L1MuGMTMatrix<bool>& pairM = m_gmt.Matcher(m_id)->pairM();
170 
171  // Handling of cancel-out and empty muons is different in software and hardware
172  //
173  // - in hardware, a candidate may be empty (pt_code == 0) and an empty bit
174  // is passed to the sorter in order to suppress the candidate. In the
175  // software no candidate is created in this case.
176  //
177  // - in hardware, RPC candidates are passed to the sorter even if they are
178  // also used in a matched pair. They are then suppressed in the sorter. In
179  // software no RPC candidate is created if the muon is used in a pair.
180  //
181  // - in hardware, cancel-out signals from the cancel-out units in the own and
182  // other Logic FPGA are passed to the sorter in order to cancel out muons.
183  // In software the cancel-out signals are alrady checked here in the merger
184  // and no candidates are created for cancelled muons.
185  //
186  // There may therefore be less muons passed to the sorter in software than
187  // in Hardware. At the output of the first sorter stage the results should
188  // be comparable, again.
189 
190  unsigned HaloOverwritesMatched = 1;
191 
192  // loop over DT/CSC muons
193  for (int i=0; i<4; i++) {
194  if (dtcsc_mu[i] != 0) {
195 
196  int match_idx = pairM.rowAny(i);
197 
198  int csc_is_halo = (m_id==1) && (dtcsc_mu[i]->finehalo_packed() == 1);
199 
200  if ( (match_idx != -1) && // is it matched?
201  (! (csc_is_halo && HaloOverwritesMatched) ) )
202  createMergedCand(i, match_idx);
203  else {
204  // check my first and the other chip's second cancel-out units
205  if ((! m_gmt.CancelOutUnit(m_id)->cancelMyChipMuon(i) ) &&
208  createDTCSCCand(i);
209  }
210  }
211  }
212 
213  // additionally loop over RPC muons
214  for (int j=0; j<4; j++) {
215  if (rpc_mu[j] != 0) {
216 
217  int match_idx = pairM.colAny(j);
218 
219  if (match_idx == -1) { // is it unmatched?
220  if ((! m_gmt.CancelOutUnit(m_id+2)->cancelMyChipMuon(j) ) &&
222  createRPCCand(j);
223  }
224  }
225  }
226 
227  // set physical values in the GMT candidates for use in the analysis
228  const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
229  const L1MuTriggerPtScale* theTriggerPtScale = L1MuGMTConfig::getTriggerPtScale();
230 
231  std::vector<L1MuGMTExtendedCand*>::const_iterator icand;
232  for(icand=m_MuonCands.begin();icand!=m_MuonCands.end();icand++) {
233  L1MuGMTExtendedCand* cand = (*icand);
234  cand->setPhiValue( theTriggerScales->getPhiScale()->getLowEdge( cand->phiIndex() ));
235  cand->setEtaValue( theTriggerScales->getGMTEtaScale()->getCenter( cand->etaIndex() ));
236  cand->setPtValue( theTriggerPtScale->getPtScale()->getLowEdge( cand->ptIndex() ));
237  // cand->setPtValue( theTriggerScales->getPtScale()->getLowEdge( cand->ptIndex() ));
238  }
239 
240 }
241 
242 void L1MuGMTMerger::createDTCSCCand(int idx_dtcsc) {
243  L1MuGMTExtendedCand* tmpmuon = new L1MuGMTExtendedCand();
244 
245  tmpmuon->setBx(dtcsc_mu[idx_dtcsc]->bx());
246  tmpmuon->setPhiPacked( projectedPhi(dtcsc_mu[idx_dtcsc]) );
247  tmpmuon->setEtaPacked( convertedEta(dtcsc_mu[idx_dtcsc]) );
248  tmpmuon->setPtPacked( dtcsc_mu[idx_dtcsc]->pt_packed() );
249  tmpmuon->setChargePacked( sysign(dtcsc_mu[idx_dtcsc]) );
250  tmpmuon->setMIP( m_gmt.MipIsoAU(m_id)->MIP(idx_dtcsc) );
251  tmpmuon->setIsolation ( m_gmt.MipIsoAU(m_id)->ISO(idx_dtcsc) );
252  tmpmuon->setRank( L1MuGMTSortRankUnit::sort_rank(dtcsc_mu[idx_dtcsc]) );
253 
254  unsigned quality = 0;
256  case 0: quality = 6; break; //DT/CSC
257  case 1: quality = 2; break; //VERY LOW QUALITY LEVEL 1
258  case 2: quality = 3; break; //VERY LOW QUALITY LEVEL 2
259  case 3: quality = 4; break; //VERY LOW QUALITY LEVEL 3
260  }
261 
262  if ( (m_id==1) && (dtcsc_mu[idx_dtcsc]->finehalo_packed() == 1) )
263  quality = 1; // HALO quality
264 
265  tmpmuon->setQuality( quality ); // RPC
266  tmpmuon->setDTCSCIndex(idx_dtcsc);
267  tmpmuon->setRPCIndex(0);
268  tmpmuon->setFwdBit( m_id );
269  tmpmuon->setRPCBit( 0 );
270 
271  m_MuonCands.push_back(tmpmuon);
272 }
273 
274 
275 void L1MuGMTMerger::createRPCCand(int idx_rpc) {
276  L1MuGMTExtendedCand* tmpmuon = new L1MuGMTExtendedCand();
277 
278  tmpmuon->setBx(rpc_mu[idx_rpc]->bx());
279  tmpmuon->setPhiPacked( projectedPhi(rpc_mu[idx_rpc]) );
280  tmpmuon->setEtaPacked( convertedEta(rpc_mu[idx_rpc]) );
281  tmpmuon->setPtPacked( rpc_mu[idx_rpc]->pt_packed() );
282  tmpmuon->setChargePacked( sysign( rpc_mu[idx_rpc] ) );
283  tmpmuon->setMIP( m_gmt.MipIsoAU(m_id)->MIP(idx_rpc+4) );
284  tmpmuon->setIsolation ( m_gmt.MipIsoAU(m_id)->ISO(idx_rpc+4) );
285  tmpmuon->setRank( L1MuGMTSortRankUnit::sort_rank(rpc_mu[idx_rpc]) );
286 
287  unsigned quality = 0;
289  case 0: quality = 5; break; //RPC
290  case 1: quality = 2; break; //VERY LOW QUALITY LEVEL1
291  case 2: quality = 3; break; //VERY LOW QUALITY LEVEL2
292  case 3: quality = 4; break; //VERY LOW QUALITY LEVEL3
293  }
294 
295  tmpmuon->setQuality( quality ); // RPC
296  tmpmuon->setDTCSCIndex(0);
297  tmpmuon->setRPCIndex(idx_rpc);
298  tmpmuon->setFwdBit( m_id );
299  tmpmuon->setRPCBit( 1 );
300 
301  m_MuonCands.push_back(tmpmuon);
302 }
303 
304 int L1MuGMTMerger::selectDTCSC(unsigned MMconfig, int by_rank, int by_pt, int by_combi) const {
305  return
306  ( (MMconfig & 32) == 32 ) ||
307  ( ( (MMconfig & 8) == 8 ) && by_rank ) ||
308  ( ( (MMconfig & 4) == 4 ) && by_pt ) ||
309  ( ( (MMconfig & 2) == 2 ) && by_combi);
310 
311 }
312 
313 int L1MuGMTMerger::doSpecialMerge(unsigned MMconfig) const {
314  return (MMconfig & 1) == 1;
315 }
316 
317 int L1MuGMTMerger::doANDMerge(unsigned MMconfig) const {
318  return (MMconfig & 64) == 64;
319 }
320 
323  return etaconv_lut->SpecificLookup_eta_gmt (mu->type_idx(), mu->eta_packed() );
324 }
325 
327 
328  // convert eta
330  unsigned eta4 = phiproetaconv_lut->SpecificLookup_eta_out (mu->type_idx(), mu->eta_packed() );
331 
332  // look up delta-phi 9 bit signed
334  unsigned dphi9 = phipro_lut->SpecificLookup_dphi (mu->type_idx(), eta4, mu->pt_packed(), mu->charge_packed());
335 
336  // sign extend
337  L1MuSignedPacking<9> DPhiPacking;
338  int dphi = DPhiPacking.idxFromPacked( dphi9 );
339 
340  // add modulo 144
341  int newphi = mu->phi_packed() + dphi;
342  if (newphi < 0) newphi += 144;
343  if (newphi >= 144) newphi -= 144;
344 
345  return (unsigned) newphi;
346 }
347 
348 
349 unsigned L1MuGMTMerger::sysign(const L1MuRegionalCand* mu) const {
350 
351  unsigned sysign = mu->charge_packed();
352 
353  if ( mu->charge_valid_packed() == 0 )
354  sysign = 2; // undefined charge
355 
356  return sysign;
357 }
358 
359 void L1MuGMTMerger::createMergedCand(int idx_dtcsc, int idx_rpc) {
360 
361  // In the hardware matrices of select_bits are calculated for all
362  // possible pairings.
363  // In ORCA we only calculate selec-bits for the actual
364  // pairs to save time.
365 
366  // look up merge ranks
367  int merge_rank_dtcsc = merge_rank(dtcsc_mu[idx_dtcsc]);
368  int merge_rank_rpc = merge_rank(rpc_mu[idx_rpc]);
369 
370  // calculate select-bits (1: take DT/CSC, 0: take RPC)
371  // fix: if equal prefer DT/CSC as in HW!
372 // int selected_by_rank = abs(merge_rank_dtcsc) > abs(merge_rank_rpc);
373  int selected_by_rank = abs(merge_rank_dtcsc) >= abs(merge_rank_rpc);
374  int selected_by_pt = dtcsc_mu[idx_dtcsc]->pt_packed() <= rpc_mu[idx_rpc]->pt_packed();
375 
376  // Selection by combination of min pt and higher rank
377  // select by rank if both flags are set, otherwise by min pt
378  // in other words: select by minpt if one flag is not set
379  int selected_by_combi = (merge_rank_dtcsc<0 && merge_rank_rpc<0) ? selected_by_rank : selected_by_pt;
380 
381 
382  L1MuGMTExtendedCand* tmpmuon = new L1MuGMTExtendedCand();
383 
384  tmpmuon->setBx(dtcsc_mu[idx_dtcsc]->bx());
385 
386 
387  // merge phi
388  // unsigned MMConfig_phi = 32; // take DT
389  unsigned MMConfig_phi = L1MuGMTConfig::getRegMMConfigPhi()->getValue(m_id);
390 
391  unsigned phi = 0;
392 
393  if (selectDTCSC(MMConfig_phi, selected_by_rank, selected_by_pt, selected_by_combi) )
394  phi = projectedPhi( dtcsc_mu[idx_dtcsc] );
395  else
396  phi = projectedPhi( rpc_mu[idx_rpc] );
397 
398  tmpmuon->setPhiPacked( phi );
399 
400  // merge eta
401  unsigned MMConfig_eta = L1MuGMTConfig::getRegMMConfigEta()->getValue(m_id);
402 
403  unsigned eta = 0;
404 
405  if (doSpecialMerge( MMConfig_eta ) ) {
406  if ( (m_id == 1) || dtcsc_mu[idx_dtcsc]->finehalo_packed() )
407  eta = convertedEta( dtcsc_mu[idx_dtcsc] );
408  else
409  eta = convertedEta( rpc_mu[idx_rpc] );
410  }
411  else {
412  if ( selectDTCSC(MMConfig_eta, selected_by_rank, selected_by_pt, selected_by_combi) )
413  eta = convertedEta( dtcsc_mu[idx_dtcsc] );
414  else
415  eta = convertedEta( rpc_mu[idx_rpc] );
416  }
417  tmpmuon->setEtaPacked( eta );
418 
419  // merge pt
420  unsigned MMConfig_pt = L1MuGMTConfig::getRegMMConfigPt()->getValue(m_id);
421 
422  unsigned pt = 0;
423 
424  if (doSpecialMerge( MMConfig_pt ) ) { // mix pt
426  pt = ptmix_lut->SpecificLookup_pt_mixed (m_id, dtcsc_mu[idx_dtcsc]->pt_packed(),
427  rpc_mu[idx_rpc]->pt_packed());
428  }
429  else {
430  if ( selectDTCSC(MMConfig_pt, selected_by_rank, selected_by_pt, selected_by_combi) )
431  pt = dtcsc_mu[idx_dtcsc]->pt_packed();
432  else
433  pt = rpc_mu[idx_rpc]->pt_packed();
434  }
435  tmpmuon->setPtPacked( pt );
436 
437  // merge charge
438  unsigned MMConfig_charge = L1MuGMTConfig::getRegMMConfigCharge()->getValue(m_id);
439 
440  unsigned sy_sign = 0;
441 
442  if (doSpecialMerge( MMConfig_charge ) ) {
443  // based on charge valid bits
444  if ( rpc_mu[idx_rpc]->charge_valid_packed()==1 && dtcsc_mu[idx_dtcsc]->charge_valid_packed()==0 )
445  sy_sign = sysign(rpc_mu[idx_rpc]);
446  else
447  sy_sign = sysign(dtcsc_mu[idx_dtcsc]);
448  }
449  else {
450  if ( selectDTCSC(MMConfig_charge, selected_by_rank, selected_by_pt, selected_by_combi) )
451  sy_sign = sysign(dtcsc_mu[idx_dtcsc]);
452  else
453  sy_sign = sysign(rpc_mu[idx_rpc]);
454  }
455  tmpmuon->setChargePacked( sy_sign );
456 
457  // merge quality
458 
459 
460  // merge MIP
461  unsigned MMConfig_MIP = L1MuGMTConfig::getRegMMConfigMIP()->getValue(m_id);
462 
463  bool mip_bit = false;
464 
465  bool mip_bit_dtcsc = m_gmt.MipIsoAU(m_id)->MIP(idx_dtcsc);
466  bool mip_bit_rpc = m_gmt.MipIsoAU(m_id)->MIP(idx_rpc+4);
467 
468  if ( doSpecialMerge(MMConfig_MIP) ) {
469  if ( doANDMerge(MMConfig_MIP) )
470  mip_bit = mip_bit_dtcsc && mip_bit_rpc;
471  else
472  mip_bit = mip_bit_dtcsc || mip_bit_rpc;
473  }
474  else {
475  if ( selectDTCSC(MMConfig_MIP, selected_by_rank, selected_by_pt, selected_by_combi) )
476  mip_bit = mip_bit_dtcsc;
477  else
478  mip_bit = mip_bit_rpc;
479  }
480 
481  tmpmuon->setMIP(mip_bit);
482 
483  // merge ISO
484  unsigned MMConfig_ISO = L1MuGMTConfig::getRegMMConfigISO()->getValue(m_id);
485 
486  bool iso_bit = false;
487 
488  bool iso_bit_dtcsc = m_gmt.MipIsoAU(m_id)->ISO(idx_dtcsc);
489  bool iso_bit_rpc = m_gmt.MipIsoAU(m_id)->ISO(idx_rpc+4);
490 
491  if ( doSpecialMerge(MMConfig_ISO) ) {
492  if ( doANDMerge(MMConfig_ISO) )
493  iso_bit = iso_bit_dtcsc && iso_bit_rpc;
494  else
495  iso_bit = iso_bit_dtcsc || iso_bit_rpc;
496  }
497  else {
498  if ( selectDTCSC(MMConfig_ISO, selected_by_rank, selected_by_pt, selected_by_combi) )
499  iso_bit = iso_bit_dtcsc;
500  else
501  iso_bit = iso_bit_rpc;
502  }
503 
504  tmpmuon->setIsolation(iso_bit);
505 
506  // merge sort rank
507  unsigned MMConfig_SRK = L1MuGMTConfig::getRegMMConfigSRK()->getValue(m_id);
508 
509  unsigned rank_offset = L1MuGMTConfig::getRegSortRankOffset()->getValue(m_id);
510 
511  unsigned rank = 0;
512  if ( selectDTCSC(MMConfig_SRK, selected_by_rank, selected_by_pt, selected_by_combi) )
513  rank = L1MuGMTSortRankUnit::sort_rank(dtcsc_mu[idx_dtcsc]) + rank_offset;
514  else
515  rank = L1MuGMTSortRankUnit::sort_rank(rpc_mu[idx_rpc]) + rank_offset;
516 
517  tmpmuon->setRank(rank);
518 
519  // quality of merged candidate
520  tmpmuon->setQuality( 7 ); // code for matched muons
521 
522  tmpmuon->setDTCSCIndex(idx_dtcsc);
523  tmpmuon->setRPCIndex(idx_rpc);
524  tmpmuon->setFwdBit( m_id );
525  tmpmuon->setRPCBit( 0 );
526 
527  m_MuonCands.push_back(tmpmuon);
528 }
529 
530 // calculate merge rank as in HW
531 
533 
534  if ( muon == 0 || muon->empty() ) return 0;
535 
536  unsigned lut_idx= muon->type_idx();
537 
538  // obtain inputs as coded in HW
539  unsigned eta = muon->eta_packed();
540  unsigned q = muon->quality_packed();
541  unsigned pt = muon->pt_packed();
542  unsigned phi = muon->phi_packed();
543 
544  // lookup eta-q
546  unsigned rank_etaq = etaq_lut->SpecificLookup_rank_etaq (lut_idx, eta, q);
547  unsigned flag = etaq_lut->SpecificLookup_flag (lut_idx, eta, q);
548 
549  // lookup pt-q
551  unsigned rank_ptq = ptq_lut->SpecificLookup_rank_ptq (lut_idx, q, pt);
552 
553  // lookup etaphi
555  unsigned rank_etaphi = etaphi_lut->SpecificLookup_rank_etaphi (lut_idx, eta, phi);
556 
557  // combine
559  unsigned rank = combine_lut->SpecificLookup_merge_rank (lut_idx, rank_etaq, rank_ptq, rank_etaphi);
560 
561  int rank_signed = rank;
562 
563  if (flag == 1) rank_signed *= -1;
564 
565  return rank_signed;
566 }
567 
568 
569 
570 
unsigned charge_valid_packed() const
return charge valid packed as in hardware (1=valid, 0=not valid)
static L1MuGMTRegMMConfigISO * getRegMMConfigISO()
void setPtPacked(unsigned pt)
set packed pt-code of muon candidate
Definition: L1MuGMTCand.h:156
unsigned SpecificLookup_rank_ptq(int idx, unsigned q, unsigned pt) const
specific lookup function for rank_ptq
int i
Definition: DBlmapReader.cc:9
static L1MuGMTRegMMConfigCharge * getRegMMConfigCharge()
unsigned SpecificLookup_rank_etaphi(int idx, unsigned eta, unsigned phi) const
specific lookup function for rank_etaphi
long int flag
Definition: mlp_lapack.h:47
const L1MuGMTMatcher * Matcher(int id) const
return pointer to Matcher
void setMIP(bool mip)
set min ionizing bit for muon candidate
Definition: L1MuGMTCand.h:168
std::vector< L1MuGMTExtendedCand * > m_MuonCands
static L1MuGMTLFMergeRankPtQLUT * getLFMergeRankPtQLUT()
const L1MuScale * getPtScale() const
get the Pt scale
static L1MuGMTRegMMConfigEta * getRegMMConfigEta()
unsigned SpecificLookup_eta_gmt(int idx, unsigned eta_regional) const
specific lookup function for eta_gmt
unsigned int phiIndex() const
get phi-code
Definition: L1MuGMTCand.h:75
static bool isDisabled(const L1MuRegionalCand *)
Diable bit.
virtual bool empty() const
return empty flag
virtual float getLowEdge(unsigned packed) const =0
get the low edge of bin represented by packed
unsigned charge_packed() const
return charge packed as in hardware (0=pos, 1=neg)
void createMergedCand(int idx_dtcsc, int idx_rpc)
unsigned getValue(int idx)
get Value
Definition: L1MuGMTReg.h:57
void setDTCSCIndex(unsigned int idxdtcsc)
set index of contributing DT/CSC muon
#define abs(x)
Definition: mlp_lapack.h:159
unsigned int etaIndex() const
get eta-code
Definition: L1MuGMTCand.h:110
int rowAny(int r) const
is any element in row r &gt; 0 ? return index or -1
bool MIP(int idx) const
return select matrix (idx 0..3: DT/CSC, idx 4..7: RPC)
virtual int idxFromPacked(unsigned packed) const
get the value from the packed notation (+/-)
Definition: L1MuPacking.h:92
T eta() const
int selectDTCSC(unsigned MMconfig, int by_rank, int by_pt, int by_combi) const
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed
unsigned projectedPhi(const L1MuRegionalCand *mu) const
unsigned SpecificLookup_dphi(int idx, unsigned eta, unsigned pt, unsigned charge) const
specific lookup function for dphi
const L1MuRegionalCand * CSCMuon(int index) const
get CSC muon
Definition: L1MuGMTPSB.cc:252
static unsigned getVeryLowQualityLevel(const L1MuRegionalCand *)
Very low quality bits.
void createDTCSCCand(int idx_dtcsc)
virtual ~L1MuGMTMerger()
destructor
unsigned SpecificLookup_merge_rank(int idx, unsigned rank_etaq, unsigned rank_ptq, unsigned rank_etaphi) const
specific lookup function for merge_rank
std::vector< const L1MuRegionalCand * > dtcsc_mu
static L1MuGMTRegMMConfigSRK * getRegMMConfigSRK()
const L1MuGlobalMuonTrigger & m_gmt
unsigned SpecificLookup_eta_out(int idx, unsigned eta_in) const
specific lookup function for eta_out
void setPhiValue(float phiVal)
Setters for physical values.
Definition: L1MuGMTCand.h:179
void setFwdBit(unsigned int fwdbit)
set forward bit (1=forward, 0=barrel)
const L1MuGMTPSB * Data() const
return pointer to PSB
static L1MuGMTRegMMConfigPhi * getRegMMConfigPhi()
const bool cancelMyChipMuon(int idx) const
return cancel bit for DT (m_id==0 || m_id==3) or CSC (m_id==1 || m_id==2) muon
static L1MuGMTLFPhiProLUT * getLFPhiProLUT()
const L1MuScale * getPhiScale() const
get the phi scale
static L1MuGMTRegMMConfigPt * getRegMMConfigPt()
const L1MuRegionalCand * RPCMuon(int index) const
get RPC muon
Definition: L1MuGMTPSB.cc:232
int j
Definition: DBlmapReader.cc:9
const L1MuGMTCancelOutUnit * CancelOutUnit(int id) const
return pointer to Cancel Out Unit
unsigned eta_packed() const
return eta packed as in hardware
int irpc
static const unsigned int MAXCSC
Definition: L1MuGMTConfig.h:91
static unsigned sort_rank(const L1MuRegionalCand *)
Sort Rank Table.
static const unsigned int MAXDTBX
Definition: L1MuGMTConfig.h:91
static const unsigned int MAXRPCendcap
Definition: L1MuGMTConfig.h:90
unsigned SpecificLookup_rank_etaq(int idx, unsigned eta, unsigned q) const
specific lookup function for rank_etaq
const int mu
Definition: Constants.h:23
void setBx(int bx)
set bunch crossing identifier
Definition: L1MuGMTCand.h:174
static L1MuGMTLFPtMixLUT * getLFPtMixLUT()
unsigned sysign(const L1MuRegionalCand *mu) const
void print() const
print results after selection
int doANDMerge(unsigned MMconfig) const
void setChargePacked(unsigned ch)
set packed charge/synchronization word of muon candidate (0=POS, 1=NEG, 2=UNDEF, 3=SYNC) ...
Definition: L1MuGMTCand.h:171
static L1MuGMTLFMergeRankEtaPhiLUT * getLFMergeRankEtaPhiLUT()
void reset()
clear Merger
unsigned SpecificLookup_pt_mixed(int idx, unsigned pt_dtcsc, unsigned pt_rpc) const
specific lookup function for pt_mixed
unsigned convertedEta(const L1MuRegionalCand *mu) const
static const L1MuTriggerPtScale * getTriggerPtScale()
int merge_rank(const L1MuRegionalCand *) const
Merge Rank Table.
std::vector< const L1MuRegionalCand * > rpc_mu
const L1MuGMTMipIsoAU * MipIsoAU(int id) const
return pointer to MIP &amp; ISO bit assignment unit
void setQuality(unsigned quality)
set quality of muon candidate
Definition: L1MuGMTCand.h:159
unsigned SpecificLookup_flag(int idx, unsigned eta, unsigned q) const
specific lookup function for flag
static L1MuGMTLFMergeRankCombineLUT * getLFMergeRankCombineLUT()
static const L1MuTriggerScales * getTriggerScales()
void setEtaPacked(unsigned eta)
set packed eta-code of muon candidate
Definition: L1MuGMTCand.h:162
void setEtaValue(float etaVal)
Set Eta Value (need to set type, first)
Definition: L1MuGMTCand.h:185
void run()
run GMT Merger
void setRPCBit(unsigned int rpcbit)
set RPC bit (1=RPC, 0=DT/CSC or matched)
const bool cancelOtherChipMuon(int idx) const
return cancel bit for barrel RPC (m_id==2) or forward RPC (m_id==3) muon
static L1MuGMTLFEtaConvLUT * getLFEtaConvLUT()
const L1MuRegionalCand * DTBXMuon(int index) const
get DTBX muon
Definition: L1MuGMTPSB.cc:242
void setRank(unsigned int rank)
set rank
bool ISO(int idx) const
return select matrix (idx 0..3: DT/CSC, idx 4..7: RPC)
unsigned int quality_packed() const
return quality packed as in hardware
const L1MuGMTMatrix< bool > & pairM() const
return pair matrix
static L1MuGMTRegSortRankOffset * getRegSortRankOffset()
static L1MuGMTRegMMConfigMIP * getRegMMConfigMIP()
L1MuGMTMerger(const L1MuGlobalMuonTrigger &gmt, int id)
constructor
const L1MuScale * getGMTEtaScale() const
get the GMT eta scale
static const unsigned int MAXRPCbarrel
Definition: L1MuGMTConfig.h:90
void setPtValue(float ptVal)
Set Pt Value.
Definition: L1MuGMTCand.h:182
unsigned pt_packed() const
return pt packed as in hardware
unsigned int ptIndex() const
get pt-code
Definition: L1MuGMTCand.h:78
int colAny(int c) const
is any element in column c &gt; 0 ? return index or -1
static L1MuGMTLFPhiProEtaConvLUT * getLFPhiProEtaConvLUT()
void setRPCIndex(unsigned int idxrpc)
set index of contributing RPC muon
void setPhiPacked(unsigned phi)
set packed phi-code of muon candidate
Definition: L1MuGMTCand.h:153
unsigned type_idx() const
return type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC
static L1MuGMTLFMergeRankEtaQLUT * getLFMergeRankEtaQLUT()
void setIsolation(bool isol)
set isolation of muon candidate
Definition: L1MuGMTCand.h:165
int doSpecialMerge(unsigned MMconfig) const
void createRPCCand(int idx_rpc)
unsigned phi_packed() const
return phi packed as in hardware
Definition: DDAxes.h:10