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 // The Lookup Function --
44 //------------------------
45 
46 //
47 // Phi projection LUT to project the phi coordinates to the vertex
48 //
49 // The output is 9 bits signed and should be in the range of -32 <= dphi < 32
50 // (+/- 80 deg)
51 //
52 // The input eta is converted from six to four bits as in the MIP/ISO AU chips
53 //
54 // The same parameterization as in the MIP/ISO AU chips can be used (proj. to vertex for ISO).
55 
56 unsigned L1MuGMTLFPhiProLUT::TheLookupFunction(int idx, unsigned eta, unsigned pt, unsigned charge) const {
57  // idx is DT, BRPC, CSC, FRPC
58  // INPUTS: eta(4) pt(5) charge(1)
59  // OUTPUTS: dphi(9)
60 
61  // const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
62  const L1MuTriggerPtScale* theTriggerPtScale = L1MuGMTConfig::getTriggerPtScale();
63 
64  // static bool doProjection = SimpleConfigurable<bool> (false, "L1GlobalMuonTrigger:PropagatePhi" );
65  static bool doProjection = L1MuGMTConfig::getPropagatePhi();
66 
67  if (!doProjection)
68  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)
78  eta -= 8;
79 
80  float dphi = L1MuGMTPhiLUT::dphi(isys,
81  1,
82  ch_idx,
83  (int)eta,
84  theTriggerPtScale->getPtScale()->getLowEdge(pt)); // use old LUT, here
85  // theTriggerScales->getPtScale()->getLowEdge(pt) ); // use old LUT, here
86 
87  int dphi_int = (int)((-dphi + 1.25 / 180. * M_PI + 2 * M_PI) / (2.5 / 180. * M_PI)) - 144;
88 
89  L1MuSignedPacking<9> PhiPacking;
90  return PhiPacking.packedFromIdx(dphi_int);
91 }
virtual float getLowEdge(unsigned packed) const =0
get the low edge of bin represented by packed
const L1MuScale * getPtScale() const
get the Pt scale
static bool getPropagatePhi()
#define M_PI
static const L1MuTriggerPtScale * getTriggerPtScale()
unsigned TheLookupFunction(int idx, unsigned eta, unsigned pt, unsigned charge) const
The lookup function - here the functionality of the LUT is implemented.
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
unsigned packedFromIdx(int idx) const override
get the packed notation of a value, check range
Definition: L1MuPacking.h:109