CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1MuGMTLFPhiProLUT.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuGMTLFPhiProLUT
4 //
5 //
6 // $Date: 2008/04/21 17:22:41 $
7 // $Revision: 1.5 $
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 //#include <iostream>
27 
28 //-------------------------------
29 // Collaborating Class Headers --
30 //-------------------------------
35 
37 
38 //-------------------
39 // InitParameters --
40 //-------------------
41 
43 }
44 
45 //------------------------
46 // The Lookup Function --
47 //------------------------
48 
49 //
50 // Phi projection LUT to project the phi coordinates to the vertex
51 //
52 // The output is 9 bits signed and should be in the range of -32 <= dphi < 32
53 // (+/- 80 deg)
54 //
55 // The input eta is converted from six to four bits as in the MIP/ISO AU chips
56 //
57 // The same parameterization as in the MIP/ISO AU chips can be used (proj. to vertex for ISO).
58 
59 unsigned L1MuGMTLFPhiProLUT::TheLookupFunction (int idx, unsigned eta, unsigned pt, unsigned charge) const {
60  // idx is DT, BRPC, CSC, FRPC
61  // INPUTS: eta(4) pt(5) charge(1)
62  // OUTPUTS: dphi(9)
63 
64 // const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
65  const L1MuTriggerPtScale* theTriggerPtScale = L1MuGMTConfig::getTriggerPtScale();
66 
67  // static bool doProjection = SimpleConfigurable<bool> (false, "L1GlobalMuonTrigger:PropagatePhi" );
68  static bool doProjection = L1MuGMTConfig::getPropagatePhi();
69 
70  if (!doProjection) return 0;
71 
72  int isRPC = idx % 2;
73  int isFWD = idx / 2;
74 
75  int isys = isFWD + 2 * isRPC; // DT, CSC, BRPC, FRPC
76  int ch_idx = (charge == 0) ? 1 : 0; // positive charge is 0 (but idx 1)
77 
78  // currently only support 3-bit eta (3 lower bits); ignore 4th bit
79  if (eta>7) eta -= 8;
80 
81  float dphi = L1MuGMTPhiLUT::dphi (isys, 1, ch_idx, (int) eta,
82  theTriggerPtScale->getPtScale()->getLowEdge(pt) ); // use old LUT, here
83  // theTriggerScales->getPtScale()->getLowEdge(pt) ); // use old LUT, here
84 
85  int dphi_int = (int) ( (-dphi + 1.25 / 180. * M_PI + 2* M_PI ) / ( 2.5 / 180. * M_PI ) ) - 144;
86 
87  L1MuSignedPacking<9> PhiPacking;
88  return PhiPacking.packedFromIdx(dphi_int);
89 }
90 
91 
92 
93 
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104 
105 
106 
107 
108 
virtual unsigned packedFromIdx(int idx) const
get the packed notation of a value, check range
Definition: L1MuPacking.h:94
const L1MuScale * getPtScale() const
get the Pt scale
virtual float getLowEdge(unsigned packed) const =0
get the low edge of bin represented by packed
T eta() const
double charge(const std::vector< uint8_t > &Ampls)
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()
static const L1MuTriggerPtScale * getTriggerPtScale()
#define M_PI
Definition: BFit3D.cc:3
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