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 }
L1MuGMTPhiLUT::dphi
static float dphi(int isys, int isISO, int icharge, int ieta, float pt)
look up delta-phi with integer eta
Definition: L1MuGMTPhiLUT.cc:68
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
L1MuPacking.h
GeomDetEnumerators::isRPC
bool isRPC(GeomDetEnumerators::SubDetector m)
Definition: GeomDetEnumerators.cc:90
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
L1MuGMTLFPhiProLUT::TheLookupFunction
unsigned TheLookupFunction(int idx, unsigned eta, unsigned pt, unsigned charge) const
The lookup function - here the functionality of the LUT is implemented.
Definition: L1MuGMTLFPhiProLUT.cc:56
L1MuTriggerPtScale
Definition: L1MuTriggerPtScale.h:33
PVValHelper::eta
Definition: PVValidationHelpers.h:70
L1MuGMTPhiLUT.h
L1MuScale::getLowEdge
virtual float getLowEdge(unsigned packed) const =0
get the low edge of bin represented by packed
L1MuGMTConfig.h
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
L1MuTriggerPtScale::getPtScale
const L1MuScale * getPtScale() const
get the Pt scale
Definition: L1MuTriggerPtScale.h:59
L1MuTriggerPtScale.h
createfilelist.int
int
Definition: createfilelist.py:10
L1MuTriggerScales.h
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
L1MuGMTConfig::getPropagatePhi
static bool getPropagatePhi()
Definition: L1MuGMTConfig.h:130
L1MuGMTLFPhiProLUT.h
L1MuSignedPacking
Definition: L1MuPacking.h:94
L1MuGMTLFPhiProLUT::InitParameters
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
Definition: L1MuGMTLFPhiProLUT.cc:40
L1MuGMTConfig::getTriggerPtScale
static const L1MuTriggerPtScale * getTriggerPtScale()
Definition: L1MuGMTConfig.h:181
L1MuSignedPacking::packedFromIdx
unsigned packedFromIdx(int idx) const override
get the packed notation of a value, check range
Definition: L1MuPacking.h:104