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 // $Date: 2007/04/10 09:59:19 $
9 // $Revision: 1.4 $
10 //
11 // Author :
12 // H. Sakulin CERN EP
13 //
14 // Migrated to CMSSW:
15 // I. Mikulec
16 //
17 //--------------------------------------------------
18 
19 //-----------------------
20 // This Class's Header --
21 //-----------------------
22 
24 //---------------
25 // C++ Headers --
26 //---------------
27 
28 #include <iostream>
29 #include <vector>
30 #include <cmath>
31 
32 //-------------------------------
33 // Collaborating Class Headers --
34 //-------------------------------
35 
41 
43 
44 
45 // --------------------------------
46 // class L1MuGMTEtaProjectionUnit
47 //---------------------------------
48 
49 //----------------
50 // Constructors --
51 //----------------
53  m_MIAU(miau), m_id(id), m_mu(0) {
54 
55 }
56 
57 //--------------
58 // Destructor --
59 //--------------
61 
62  reset();
63 
64 }
65 
66 //--------------
67 // Operations --
68 //--------------
69 
70 //
71 // run eta projection unit
72 //
74 
75  load();
76  if ( m_mu && ( !m_mu->empty() ) ) {
77 
78  int isFwd = m_id / 16;
79  int lut_id = m_id / 4;
80 
81  // obtain inputs as coded in HW
82  unsigned pt = m_mu->pt_packed();
83  unsigned charge = m_mu->charge_packed();
84  unsigned eta = m_mu->eta_packed();
85 
86  // lookup
88  unsigned eta_sel_bits = ep_lut->SpecificLookup_eta_sel (lut_id, eta, pt, charge);
89 
90  // convert to bit array
91  //
92  // see comments in L1MuGMTMIAUEtaProLUT.cc
93  //
94  m_eta_select = (unsigned) 0;
95 
96  if (isFwd) { // forward
97  for (int i=0; i<5; i++)
98  if ( (eta_sel_bits & (1 << i)) == (unsigned) (1<<i))
99  m_eta_select[i] = 1;
100 
101  for (int i=5; i<10; i++)
102  if ( (eta_sel_bits & (1 << i)) == (unsigned) (1<<i))
103  m_eta_select[i+4] = 1;
104  } else { // barrel
105  for (int i=0; i<10; i++)
106  if ( (eta_sel_bits & (1 << i)) == (unsigned) (1<<i))
107  m_eta_select[i+2] = 1;
108  }
109 
110  // m_MIAU.GMT().DebugBlockForFill()->SetEtaSelBits( m_id, m_eta_select.read(0,14)) ;
112  }
113 }
114 
115 
116 //
117 // reset eta projection unit
118 //
120 
121  m_mu = 0;
122  m_ieta = 0;
123  m_feta = 0.;
124  m_eta_select = (unsigned int) 0;
125 }
126 
127 
128 //
129 // print results of eta projection
130 //
132 
133  edm::LogVerbatim("GMT_EtaProjection_info") << "Eta select bits: ";
134  for ( int i=0; i<14; i++ ) {
135  edm::LogVerbatim("GMT_EtaProjection_info") << m_eta_select[i] << " ";
136  }
137  edm::LogVerbatim("GMT_EtaProjection_info");
138 }
139 
140 
141 //
142 // load 1 muon into eta projection unit
143 //
145 
146  // retrieve muon from MIP & ISO bit assignment unit
147  m_mu = m_MIAU.muon( m_id % 8 );
148 }
149 
150 
151 
152 
153 
154 
155 
156 
157 
158 
159 
160 
161 
162 
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
T eta() const
double charge(const std::vector< uint8_t > &Ampls)
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.
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)