CMS 3D CMS Logo

L1MuGMTLFPhiProLUT.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuGMTLFPhiProLUT
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 //-------------------------------
33 
35 
36 //-------------------
37 // InitParameters --
38 //-------------------
39 
41 }
42 
43 //------------------------
44 // The Lookup Function --
45 //------------------------
46 
47 //
48 // Phi projection LUT to project the phi coordinates to the vertex
49 //
50 // The output is 9 bits signed and should be in the range of -32 <= dphi < 32
51 // (+/- 80 deg)
52 //
53 // The input eta is converted from six to four bits as in the MIP/ISO AU chips
54 //
55 // The same parameterization as in the MIP/ISO AU chips can be used (proj. to vertex for ISO).
56 
57 unsigned L1MuGMTLFPhiProLUT::TheLookupFunction (int idx, unsigned eta, unsigned pt, unsigned charge) const {
58  // idx is DT, BRPC, CSC, FRPC
59  // INPUTS: eta(4) pt(5) charge(1)
60  // OUTPUTS: dphi(9)
61 
62 // const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
63  const L1MuTriggerPtScale* theTriggerPtScale = L1MuGMTConfig::getTriggerPtScale();
64 
65  // static bool doProjection = SimpleConfigurable<bool> (false, "L1GlobalMuonTrigger:PropagatePhi" );
66  static bool doProjection = L1MuGMTConfig::getPropagatePhi();
67 
68  if (!doProjection) return 0;
69 
70  int isRPC = idx % 2;
71  int isFWD = idx / 2;
72 
73  int isys = isFWD + 2 * isRPC; // DT, CSC, BRPC, FRPC
74  int ch_idx = (charge == 0) ? 1 : 0; // positive charge is 0 (but idx 1)
75 
76  // currently only support 3-bit eta (3 lower bits); ignore 4th bit
77  if (eta>7) eta -= 8;
78 
79  float dphi = L1MuGMTPhiLUT::dphi (isys, 1, ch_idx, (int) eta,
80  theTriggerPtScale->getPtScale()->getLowEdge(pt) ); // use old LUT, here
81  // theTriggerScales->getPtScale()->getLowEdge(pt) ); // use old LUT, here
82 
83  int dphi_int = (int) ( (-dphi + 1.25 / 180. * M_PI + 2* M_PI ) / ( 2.5 / 180. * M_PI ) ) - 144;
84 
85  L1MuSignedPacking<9> PhiPacking;
86  return PhiPacking.packedFromIdx(dphi_int);
87 }
88 
89 
90 
91 
92 
93 
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104 
105 
106 
const L1MuScale * getPtScale() const
get the Pt scale
unsigned packedFromIdx(int idx) const override
get the packed notation of a value, check range
Definition: L1MuPacking.h:102
unsigned TheLookupFunction(int idx, unsigned eta, unsigned pt, unsigned charge) const
The lookup function - here the functionality of the LUT is implemented.
static bool getPropagatePhi()
#define M_PI
static const L1MuTriggerPtScale * getTriggerPtScale()
bool isRPC(GeomDetEnumerators::SubDetector m)
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
static float dphi(int isys, int isISO, int icharge, int ieta, float pt)
look up delta-phi with integer eta
virtual float getLowEdge(unsigned packed) const =0
get the low edge of bin represented by packed