test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // --------------------------------
44 // class L1MuGMTEtaProjectionUnit
45 //---------------------------------
46 
47 //----------------
48 // Constructors --
49 //----------------
51  m_MIAU(miau), m_id(id), m_mu(0) {
52 
53 }
54 
55 //--------------
56 // Destructor --
57 //--------------
59 
60  reset();
61 
62 }
63 
64 //--------------
65 // Operations --
66 //--------------
67 
68 //
69 // run eta projection unit
70 //
72 
73  load();
74  if ( m_mu && ( !m_mu->empty() ) ) {
75 
76  int isFwd = m_id / 16;
77  int lut_id = m_id / 4;
78 
79  // obtain inputs as coded in HW
80  unsigned pt = m_mu->pt_packed();
81  unsigned charge = m_mu->charge_packed();
82  unsigned eta = m_mu->eta_packed();
83 
84  // lookup
86  unsigned eta_sel_bits = ep_lut->SpecificLookup_eta_sel (lut_id, eta, pt, charge);
87 
88  // convert to bit array
89  //
90  // see comments in L1MuGMTMIAUEtaProLUT.cc
91  //
92  m_eta_select = (unsigned) 0;
93 
94  if (isFwd) { // forward
95  for (int i=0; i<5; i++)
96  if ( (eta_sel_bits & (1 << i)) == (unsigned) (1<<i))
97  m_eta_select[i] = 1;
98 
99  for (int i=5; i<10; i++)
100  if ( (eta_sel_bits & (1 << i)) == (unsigned) (1<<i))
101  m_eta_select[i+4] = 1;
102  } else { // barrel
103  for (int i=0; i<10; i++)
104  if ( (eta_sel_bits & (1 << i)) == (unsigned) (1<<i))
105  m_eta_select[i+2] = 1;
106  }
107 
108  // m_MIAU.GMT().DebugBlockForFill()->SetEtaSelBits( m_id, m_eta_select.read(0,14)) ;
110  }
111 }
112 
113 
114 //
115 // reset eta projection unit
116 //
118 
119  m_mu = 0;
120  m_ieta = 0;
121  m_feta = 0.;
122  m_eta_select = (unsigned int) 0;
123 }
124 
125 
126 //
127 // print results of eta projection
128 //
130 
131  edm::LogVerbatim("GMT_EtaProjection_info") << "Eta select bits: ";
132  for ( int i=0; i<14; i++ ) {
133  edm::LogVerbatim("GMT_EtaProjection_info") << m_eta_select[i] << " ";
134  }
135  edm::LogVerbatim("GMT_EtaProjection_info");
136 }
137 
138 
139 //
140 // load 1 muon into eta projection unit
141 //
143 
144  // retrieve muon from MIP & ISO bit assignment unit
145  m_mu = m_MIAU.muon( m_id % 8 );
146 }
147 
148 
149 
150 
151 
152 
153 
154 
155 
156 
157 
158 
159 
160 
int i
Definition: DBlmapReader.cc:9
const L1MuGMTMipIsoAU & m_MIAU
virtual bool empty() const
return empty flag
unsigned charge_packed() const
return charge packed as in hardware (0=pos, 1=neg)
unsigned SpecificLookup_eta_sel(int idx, unsigned eta, unsigned pt, unsigned charge) const
specific lookup function for eta_sel
L1MuGMTEtaProjectionUnit(const L1MuGMTMipIsoAU &miau, int id)
constructor
const L1MuGlobalMuonTrigger & GMT() const
const L1MuRegionalCand * m_mu
virtual ~L1MuGMTEtaProjectionUnit()
destructor
void run()
run eta projection unit
void reset()
clear eta projection unit
unsigned eta_packed() const
return eta packed as in hardware
void SetEtaSelBits(int idx, unsigned etasel)
Set eta select bits for current bx.
m_id("(unknown)")
void print() const
print results after eta projection
unsigned pt_packed() const
return pt packed as in hardware
static L1MuGMTMIAUEtaProLUT * getMIAUEtaProLUT()
L1MuGMTDebugBlock * DebugBlockForFill() const
for debug: return the debug block (in order to fill it)
const L1MuRegionalCand * muon(int idx) const
return input muon (idx: 0..3: DT/CSC, 4..7: RPC)