test
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 //
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 //-------------------------------
25 // Collaborating Class Headers --
26 //-------------------------------
28 
29 //-------------------
30 // InitParameters --
31 //-------------------
32 
35 }
36 
37 //--------------------------------------------------------------------------------
38 // Phi Projection LUT 2: Set phi-select-bits based on start calo region(5bit), offset(3bit),
39 // ===================== fine-grain offset(1bit) and charge(1 bit)
40 //
41 // The 18 phi-select bits select which calo regions have to be checked for MIP
42 // and Quiet information. For MIP by default only one region is checked while for
43 // the Quiet bits multiple regions can be ckecked based on IsolationCellSizePhi.
44 // If IsolationCellSizePhi is even, then the fine-grain offset decides in which
45 // direction from the central region to check additional regions.
46 //
47 //--------------------------------------------------------------------------------
48 
49 unsigned L1MuGMTMIAUPhiPro2LUT::TheLookupFunction (int idx, unsigned cphi_start, unsigned cphi_fine, unsigned cphi_ofs, unsigned charge) const {
50  // idx is MIP_DT, MIP_BRPC, ISO_DT, ISO_BRPC, MIP_CSC, MIP_FRPC, ISO_CSC, ISO_FRPC
51  // INPUTS: cphi_start(5) cphi_fine(1) cphi_ofs(3) charge(1)
52  // OUTPUTS: phi_sel(18)
53 
54  // this LUT generates the 18 phi-select bits for the 18 Calo regions
55  if (cphi_start > 17) return 0;
56 
57  int isISO = (idx / 2) % 2;
58 
59  int offset = ( int(cphi_ofs) - 1 ) * ( (charge==0) ? 1 : -1 );
60 
61  int center_region = ( 18 + int(cphi_start) + offset ) % 18;
62 
63  // for MIP bit assignment, only one region is selected
64  unsigned phi_select_word = 1 << center_region;
65 
66  // for ISOlation bit assignment, multiple regions can be selected according to the IsolationCellSize
67  if (isISO) {
68  int imin = center_region - ( m_IsolationCellSizePhi-1 ) / 2;
69  int imax = center_region + ( m_IsolationCellSizePhi-1 ) / 2;
70 
71  // for even number of isolation cells check the fine grain info
72  if (m_IsolationCellSizePhi%2 == 0) {
73  if ( cphi_fine==1 ) imax++;
74  else imin--;
75  }
76 
77  for (int i=imin; i<=imax; i++ )
78  phi_select_word |= 1 << ( (i+18) % 18 );
79  }
80 
81  return phi_select_word;
82 }
83 
84 
85 
86 
87 
88 
89 
90 
91 
92 
93 
94 
95 
96 
97 
98 
99 
100 
int i
Definition: DBlmapReader.cc:9
int m_IsolationCellSizePhi
Private data members (LUT parameters);.
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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()