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