CMS 3D CMS Logo

L1MuGMTEtaProjectionUnit.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuGMTEtaProjectionUnit
4 //
5 // Description: GMT Eta Projection Unit
6 //
7 //
8 //
9 // Author :
10 // H. Sakulin CERN EP
11 //
12 // Migrated to CMSSW:
13 // I. Mikulec
14 //
15 //--------------------------------------------------
16 
17 //-----------------------
18 // This Class's Header --
19 //-----------------------
20 
22 //---------------
23 // C++ Headers --
24 //---------------
25 
26 #include <iostream>
27 #include <vector>
28 #include <cmath>
29 
30 //-------------------------------
31 // Collaborating Class Headers --
32 //-------------------------------
33 
39 
41 
42 // --------------------------------
43 // class L1MuGMTEtaProjectionUnit
44 //---------------------------------
45 
46 //----------------
47 // Constructors --
48 //----------------
50  : m_MIAU(miau), m_id(id), m_mu(nullptr) {}
51 
52 //--------------
53 // Destructor --
54 //--------------
56 
57 //--------------
58 // Operations --
59 //--------------
60 
61 //
62 // run eta projection unit
63 //
65  load();
66  if (m_mu && (!m_mu->empty())) {
67  int isFwd = m_id / 16;
68  int lut_id = m_id / 4;
69 
70  // obtain inputs as coded in HW
71  unsigned pt = m_mu->pt_packed();
72  unsigned charge = m_mu->charge_packed();
73  unsigned eta = m_mu->eta_packed();
74 
75  // lookup
77  unsigned eta_sel_bits = ep_lut->SpecificLookup_eta_sel(lut_id, eta, pt, charge);
78 
79  // convert to bit array
80  //
81  // see comments in L1MuGMTMIAUEtaProLUT.cc
82  //
83  m_eta_select = (unsigned)0;
84 
85  if (isFwd) { // forward
86  for (int i = 0; i < 5; i++)
87  if ((eta_sel_bits & (1 << i)) == (unsigned)(1 << i))
88  m_eta_select[i] = true;
89 
90  for (int i = 5; i < 10; i++)
91  if ((eta_sel_bits & (1 << i)) == (unsigned)(1 << i))
92  m_eta_select[i + 4] = true;
93  } else { // barrel
94  for (int i = 0; i < 10; i++)
95  if ((eta_sel_bits & (1 << i)) == (unsigned)(1 << i))
96  m_eta_select[i + 2] = true;
97  }
98 
99  // m_MIAU.GMT().DebugBlockForFill()->SetEtaSelBits( m_id, m_eta_select.read(0,14)) ;
101  }
102 }
103 
104 //
105 // reset eta projection unit
106 //
108  m_mu = nullptr;
109  m_ieta = 0;
110  m_feta = 0.;
111  m_eta_select = (unsigned int)0;
112 }
113 
114 //
115 // print results of eta projection
116 //
118  edm::LogVerbatim("GMT_EtaProjection_info") << "Eta select bits: ";
119  for (int i = 0; i < 14; i++) {
120  edm::LogVerbatim("GMT_EtaProjection_info") << m_eta_select[i] << " ";
121  }
122  edm::LogVerbatim("GMT_EtaProjection_info");
123 }
124 
125 //
126 // load 1 muon into eta projection unit
127 //
129  // retrieve muon from MIP & ISO bit assignment unit
130  m_mu = m_MIAU.muon(m_id % 8);
131 }
Log< level::Info, true > LogVerbatim
unsigned pt_packed() const
return pt packed as in hardware
const L1MuGMTMipIsoAU & m_MIAU
const L1MuRegionalCand * muon(int idx) const
return input muon (idx: 0..3: DT/CSC, 4..7: RPC)
unsigned SpecificLookup_eta_sel(int idx, unsigned eta, unsigned pt, unsigned charge) const
specific lookup function for eta_sel
const L1MuGlobalMuonTrigger & GMT() const
unsigned charge_packed() const
return charge packed as in hardware (0=pos, 1=neg)
L1MuGMTEtaProjectionUnit(const L1MuGMTMipIsoAU &miau, int id)
constructor
L1MuGMTDebugBlock * DebugBlockForFill() const
for debug: return the debug block (in order to fill it)
const L1MuRegionalCand * m_mu
virtual ~L1MuGMTEtaProjectionUnit()
destructor
void run()
run eta projection unit
void reset()
clear eta projection unit
void SetEtaSelBits(int idx, unsigned etasel)
Set eta select bits for current bx.
unsigned eta_packed() const
return eta packed as in hardware
virtual bool empty() const
return empty flag
void print() const
print results after eta projection
static L1MuGMTMIAUEtaProLUT * getMIAUEtaProLUT()