CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1MuGMTMIAUPhiPro2LUT.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuGMTMIAUPhiPro2LUT
4 //
5 //
6 // $Date: 2007/04/02 15:45:39 $
7 // $Revision: 1.3 $
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 //-------------------------------
27 // Collaborating Class Headers --
28 //-------------------------------
30 
31 //-------------------
32 // InitParameters --
33 //-------------------
34 
37 }
38 
39 //--------------------------------------------------------------------------------
40 // Phi Projection LUT 2: Set phi-select-bits based on start calo region(5bit), offset(3bit),
41 // ===================== fine-grain offset(1bit) and charge(1 bit)
42 //
43 // The 18 phi-select bits select which calo regions have to be checked for MIP
44 // and Quiet information. For MIP by default only one region is checked while for
45 // the Quiet bits multiple regions can be ckecked based on IsolationCellSizePhi.
46 // If IsolationCellSizePhi is even, then the fine-grain offset decides in which
47 // direction from the central region to check additional regions.
48 //
49 //--------------------------------------------------------------------------------
50 
51 unsigned L1MuGMTMIAUPhiPro2LUT::TheLookupFunction (int idx, unsigned cphi_start, unsigned cphi_fine, unsigned cphi_ofs, unsigned charge) const {
52  // idx is MIP_DT, MIP_BRPC, ISO_DT, ISO_BRPC, MIP_CSC, MIP_FRPC, ISO_CSC, ISO_FRPC
53  // INPUTS: cphi_start(5) cphi_fine(1) cphi_ofs(3) charge(1)
54  // OUTPUTS: phi_sel(18)
55 
56  // this LUT generates the 18 phi-select bits for the 18 Calo regions
57  if (cphi_start > 17) return 0;
58 
59  int isISO = (idx / 2) % 2;
60 
61  int offset = ( int(cphi_ofs) - 1 ) * ( (charge==0) ? 1 : -1 );
62 
63  int center_region = ( 18 + int(cphi_start) + offset ) % 18;
64 
65  // for MIP bit assignment, only one region is selected
66  unsigned phi_select_word = 1 << center_region;
67 
68  // for ISOlation bit assignment, multiple regions can be selected according to the IsolationCellSize
69  if (isISO) {
70  int imin = center_region - ( m_IsolationCellSizePhi-1 ) / 2;
71  int imax = center_region + ( m_IsolationCellSizePhi-1 ) / 2;
72 
73  // for even number of isolation cells check the fine grain info
74  if (m_IsolationCellSizePhi%2 == 0) {
75  if ( cphi_fine==1 ) imax++;
76  else imin--;
77  }
78 
79  for (int i=imin; i<=imax; i++ )
80  phi_select_word |= 1 << ( (i+18) % 18 );
81  }
82 
83  return phi_select_word;
84 }
85 
86 
87 
88 
89 
90 
91 
92 
93 
94 
95 
96 
97 
98 
99 
100 
101 
102 
int i
Definition: DBlmapReader.cc:9
int m_IsolationCellSizePhi
Private data members (LUT parameters);.
double charge(const std::vector< uint8_t > &Ampls)
unsigned int offset(bool)
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
unsigned TheLookupFunction(int idx, unsigned cphi_start, unsigned cphi_fine, unsigned cphi_ofs, unsigned charge) const
The lookup function - here the functionality of the LUT is implemented.
static int getIsolationCellSizePhi()