CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1MuGMTMIAUEtaProLUT.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuGMTMIAUEtaProLUT
4 //
5 //
6 // $Date: 2008/04/17 23:18:30 $
7 // $Revision: 1.7 $
8 //
9 // Author :
10 // H. Sakulin HEPHY Vienna
11 //
12 // Migrated to CMSSW:
13 // I. Mikulec
14 //
15 //--------------------------------------------------
16 
17 //-----------------------
18 // This Class's Header --
19 //-----------------------
21 
22 //---------------
23 // C++ Headers --
24 //---------------
25 
26 //#include <iostream>
27 
28 //-------------------------------
29 // Collaborating Class Headers --
30 //-------------------------------
38 
40 
41 //-------------------
42 // InitParameters --
43 //-------------------
44 
47 }
48 
49 //--------------------------------------------------------------------------------
50 // Eta Projection LUT: Based on eta(6), pt(5) and charge(1), project in eta and directly
51 // =================== output the eta select-bits for the regions in eta.
52 //
53 // In the barrel there are 8 slect bits while in the forward chip there are 10.
54 //
55 // output: eta select bits
56 // eta= -3. 3.
57 // total: 14 rings in eta 0 1 2 3 4 5 6 7 8 9 10 11 12 13
58 //
59 // barrel:8 0 1 2 3 4 5 6 7
60 // fwd:10 0 1 2 3 4 5 6 7 8 9
61 //
62 // As for the phi projection, in case of MIP bits by defualt only one region is checked
63 // while for the ISO bit assignment multiple regions can be checked as given by
64 // IsolationCellSizeEta. Adjacent regions to be ckecked are determined in analogy to
65 // the phi projection.
66 //
67 //--------------------------------------------------------------------------------
68 
69 unsigned L1MuGMTMIAUEtaProLUT::TheLookupFunction (int idx, unsigned eta, unsigned pt, unsigned charge) const {
70  // idx is MIP_DT, MIP_BRPC, ISO_DT, ISO_BRPC, MIP_CSC, MIP_FRPC, ISO_CSC, ISO_FRPC
71  // INPUTS: eta(6) pt(5) charge(1)
72  // OUTPUTS: eta_sel(10)
73 
74  // const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales();
75  const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
76  const L1MuTriggerPtScale* theTriggerPtScale = L1MuGMTConfig::getTriggerPtScale();
77  const L1CaloGeometry* theCaloGeom = L1MuGMTConfig::getCaloGeom() ;
78 
79  int isRPC = idx % 2;
80  int isFWD = idx / 4;
81 
82  int isISO = (idx / 2) % 2;
83 
84  int idx_drcr = isFWD * 2 + isRPC;
85 
86  if (pt==0) return 0; // empty candidate
87 
88  int ch_idx = (charge == 0) ? 1 : 0; // positive charge is 0 (but idx 1)
89 
90  float oldeta = theTriggerScales->getRegionalEtaScale(idx_drcr)->getCenter(eta);
91 
92  if (idx_drcr==2) oldeta = theTriggerScales->getRegionalEtaScale(idx_drcr)->getLowEdge(eta); //FIXME use center when changed in ORCA
93 
94  if ( (isRPC && isFWD && fabs(oldeta) < 1.04 ) ||
95  (isRPC && !isFWD && fabs(oldeta) > 1.04 ) ) {
96  if(!m_saveFlag) edm::LogWarning("LUTRangeViolation")
97  << "L1MuGMTMIAUEtaProLUT::TheLookupFunction: RPC " << (isFWD?"fwd":"brl")
98  << " eta value out of range: " << oldeta;
99  }
100 
101  // eta conversion depends only on isys by default
102  int isys = isFWD + 2 * isRPC; // DT, CSC, BRPC, FRPC
103  float neweta = L1MuGMTEtaLUT::eta (isys, isISO, ch_idx, oldeta,
104  theTriggerPtScale->getPtScale()->getLowEdge(pt) ); // use old LUT, here
105  // theTriggerScales->getPtScale()->getLowEdge(pt) ); // use old LUT, here
106 
107 
108  // unsigned icenter = theGMTScales->getCaloEtaScale()->getPacked( neweta );
109  // globalEtaIndex is 0-21 for forward+central; need to shift to 0-13 for central only
110  unsigned icenter = theCaloGeom->globalEtaIndex( neweta ) - theCaloGeom->numberGctForwardEtaBinsPerHalf() ;
111 
112  unsigned eta_select_word_14 = 1 << icenter; // for the whole detector
113 
114  // for ISOlation bit assignment, multiple regions can be selected according to the IsolationCellSize
115  if (isISO) {
116  int imin = icenter - ( m_IsolationCellSizeEta-1 ) / 2;
117  int imax = icenter + ( m_IsolationCellSizeEta-1 ) / 2;
118 
119  // for even number of isolation cells check the fine grain info
120  if (m_IsolationCellSizeEta%2 == 0) {
121  // float bincenter = theGMTScales->getCaloEtaScale()->getCenter( icenter );
122  // globalEtaIndex is 0-21 for forward+central; need to shift to 0-13 for central only
123  float bincenter = theCaloGeom->globalEtaBinCenter( icenter + theCaloGeom->numberGctForwardEtaBinsPerHalf() );
124  if ( neweta > bincenter ) imax++;
125  else imin--;
126  }
127  if (imin<0) imin=0;
128  if (imax>13) imax=13;
129 
130  for (int i=imin; i<=imax; i++ )
131  eta_select_word_14 |= 1 << i ;
132  }
133 
134  // generate select words for barrel (10 central bits)
135  // and for forward (5+5 fwd bits) case
136  unsigned eta_select_word;
137  if (isFWD) {
138  unsigned mask5 = (1<<5)-1;
139  eta_select_word = eta_select_word_14 & mask5;
140  eta_select_word |= ( eta_select_word_14 & (mask5 << 9) ) >> 4;
141  }
142  else {
143  unsigned mask10 = (1<<10)-1;
144  eta_select_word = ( eta_select_word_14 & (mask10 << 2) ) >> 2;
145  }
146 
147  return eta_select_word;
148 }
149 
150 
151 
152 
153 
154 
155 
156 
157 
158 
159 
160 
161 
162 
163 
164 
165 
166 
unsigned int numberGctForwardEtaBinsPerHalf() const
int i
Definition: DBlmapReader.cc:9
const L1MuScale * getPtScale() const
get the Pt scale
static const L1CaloGeometry * getCaloGeom()
int m_IsolationCellSizeEta
Private data members (LUT parameters);.
virtual float getLowEdge(unsigned packed) const =0
get the low edge of bin represented by packed
T eta() const
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed
double charge(const std::vector< uint8_t > &Ampls)
static int getIsolationCellSizeEta()
unsigned TheLookupFunction(int idx, unsigned eta, unsigned pt, unsigned charge) const
The lookup function - here the functionality of the LUT is implemented.
static const L1MuTriggerPtScale * getTriggerPtScale()
double globalEtaBinCenter(unsigned int globalEtaIndex) const
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
static const L1MuTriggerScales * getTriggerScales()
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
const L1MuScale * getRegionalEtaScale(int isys) const
get the regioanl muon trigger eta scale, isys = 0(DT), 1(bRPC), 2(CSC), 3(fwdRPC) ...
bool m_saveFlag
Definition: L1MuGMTLUT.h:210
static float eta(int isys, int isISO, int icharge, float eta, float pt)
look up delta-eta
unsigned int globalEtaIndex(const double &etaValue) const