Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:11:25

0001 //-------------------------------------------------
0002 //
0003 //   Class: L1MuGMTLFEtaConvLUT
0004 //
0005 //
0006 //
0007 //   Author :
0008 //   H. Sakulin            HEPHY Vienna
0009 //
0010 //   Migrated to CMSSW:
0011 //   I. Mikulec
0012 //
0013 //--------------------------------------------------
0014 
0015 //-----------------------
0016 // This Class's Header --
0017 //-----------------------
0018 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTLFEtaConvLUT.h"
0019 
0020 //---------------
0021 // C++ Headers --
0022 //---------------
0023 
0024 //-------------------------------
0025 // Collaborating Class Headers --
0026 //-------------------------------
0027 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTConfig.h"
0028 #include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h"
0029 #include "CondFormats/L1TObjects/interface/L1MuPacking.h"
0030 
0031 //-------------------
0032 // InitParameters  --
0033 //-------------------
0034 
0035 void L1MuGMTLFEtaConvLUT::InitParameters() {}
0036 
0037 //----------------------------------------------------------------
0038 // Main eta conversion LUT
0039 //
0040 // Converts 6 bit regional trigger eta to GMT output eta scale
0041 //
0042 //----------------------------------------------------------------
0043 
0044 unsigned L1MuGMTLFEtaConvLUT::TheLookupFunction(int idx, unsigned eta_regional) const {
0045   // idx is DT, bRPC, CSC, fRPC
0046   // INPUTS:  eta_regional(6)
0047   // OUTPUTS: eta_gmt(6)
0048 
0049   const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
0050 
0051   int isRPC = idx % 2;
0052   //  int isFWD = idx / 2;
0053 
0054   float etaValue = theTriggerScales->getRegionalEtaScale(idx)->getCenter(eta_regional);
0055 
0056   if (fabs(etaValue) > 2.4)
0057     etaValue = 2.39 * ((etaValue) > 0 ? 1. : -1.);
0058 
0059   // this is the only trick needed ...
0060   if (isRPC) {
0061     // etaValue() is center. make eta=0 and |eta|=1.3 non-ambiguous, when converting to GMT bins
0062     etaValue += (etaValue > 0.01 ? -1. : 1.) * 0.001;
0063   }
0064 
0065   unsigned eta_gmt = theTriggerScales->getGMTEtaScale()->getPacked(etaValue);
0066 
0067   return eta_gmt;
0068 }