CMS 3D CMS Logo

L1MuGMTLFCOUDeltaEtaLUT.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuGMTLFCOUDeltaEtaLUT
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 //-------------------------------
32 
33 //-------------------
34 // InitParameters --
35 //-------------------
36 
38 
39 //---------------------------------------------------------------------------
40 // Cancel-Out-Unit Delta-Eta LUT
41 // =============================
42 //
43 // Calculate delta-eta between two eta values coded in a special 4-bit scale
44 // used in the overlap region
45 //
46 // This scale is used to save I/O pins and in order to be able to do the delta-eta
47 // calculateion in a distributed RAM LUT
48 //
49 //---------------------------------------------------------------------------
50 
51 unsigned L1MuGMTLFCOUDeltaEtaLUT::TheLookupFunction(int idx, unsigned eta1, unsigned eta2) const {
52  // idx is DTCSC, CSCDT, bRPCCSC, fRPCDT
53  // INPUTS: eta1(4) eta2(4)
54  // OUTPUTS: delta_eta(4)
55 
56  const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales();
57 
58  // check out of range in inputs
60  unsigned delta_eta_OOR = pack.packedFromIdx(-8);
61 
62  if (eta1 == 7 || eta2 == 7)
63  return delta_eta_OOR;
64 
65  int type1 = 0, type2 = 0;
66  switch (idx) {
67  case 0:
68  type1 = 0;
69  type2 = 2;
70  break; // DT, CSC
71  case 1:
72  type1 = 2;
73  type2 = 0;
74  break; // CSC, DT
75  case 2:
76  type1 = 1;
77  type2 = 2;
78  break; // bRPC, CSC
79  case 3:
80  type1 = 3;
81  type2 = 0;
82  break; // fRPC, DT
83  }
84 
85  float etaValue1 = theGMTScales->getOvlEtaScale(type1)->getCenter(eta1);
86  float etaValue2 = theGMTScales->getOvlEtaScale(type2)->getCenter(eta2);
87 
88  float delta_eta = etaValue1 - etaValue2;
89 
90  unsigned delta_eta_4bit = 0;
91 
92  // check out of range
93  if (delta_eta < theGMTScales->getDeltaEtaScale(idx + 2)->getScaleMin() ||
94  delta_eta > theGMTScales->getDeltaEtaScale(idx + 2)->getScaleMax()) {
95  delta_eta_4bit = delta_eta_OOR;
96  } else {
97  delta_eta_4bit = theGMTScales->getDeltaEtaScale(idx + 2)->getPacked(delta_eta);
98  }
99 
100  return delta_eta_4bit;
101 }
L1MuPacking.h
L1MuGMTLFCOUDeltaEtaLUT.h
L1MuGMTScales
Definition: L1MuGMTScales.h:34
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
L1MuGMTLFCOUDeltaEtaLUT::TheLookupFunction
unsigned TheLookupFunction(int idx, unsigned eta1, unsigned eta2) const
The lookup function - here the functionality of the LUT is implemented.
Definition: L1MuGMTLFCOUDeltaEtaLUT.cc:51
L1MuGMTConfig::getGMTScales
static const L1MuGMTScales * getGMTScales()
Definition: L1MuGMTConfig.h:172
HLT_FULL_cff.eta2
eta2
Definition: HLT_FULL_cff.py:9542
L1MuGMTScales::getOvlEtaScale
const L1MuScale * getOvlEtaScale(int isys) const
get the overlap eta scale (4 bits); isys = 0(DT), 1(bRPC), 2(CSC), 3(fwdRPC)
Definition: L1MuGMTScales.h:204
L1MuGMTConfig.h
HLT_FULL_cff.eta1
eta1
Definition: HLT_FULL_cff.py:9541
L1MuGMTScales::getDeltaEtaScale
const L1MuScale * getDeltaEtaScale(int idx) const
get the delta eta scale; idx = 0(DT=RPC), 1(CSC-RPC), 2(DT-CSC), 3(CSC-DT), 4(bRPC-CSC),...
Definition: L1MuGMTScales.h:194
timeUnitHelper.pack
def pack(high, low)
Definition: timeUnitHelper.py:3
L1MuGMTScales.h
L1MuSignedPacking
Definition: L1MuPacking.h:94
L1MuScale::getPacked
virtual unsigned getPacked(float value) const =0
pack a value
HLT_FULL_cff.delta_eta
delta_eta
Definition: HLT_FULL_cff.py:11671
L1MuScale::getScaleMax
virtual float getScaleMax() const =0
get the upper edge of the last bin
L1MuGMTLFCOUDeltaEtaLUT::InitParameters
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
Definition: L1MuGMTLFCOUDeltaEtaLUT.cc:37
L1MuScale::getCenter
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed