Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:57

0001 //-------------------------------------------------
0002 //
0003 //   Class: L1MuGMTMIAUEtaConvLUT
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/L1MuGMTMIAUEtaConvLUT.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/L1MuGMTScales.h"
0029 #include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h"
0030 #include "CondFormats/L1TObjects/interface/L1MuPacking.h"
0031 
0032 //-------------------
0033 // InitParameters  --
0034 //-------------------
0035 
0036 void L1MuGMTMIAUEtaConvLUT::InitParameters() {}
0037 
0038 //--------------------------------------------------------------------------------
0039 // Eta conversion LUT: converts 6-bit input eta to 4 bits
0040 // ===================
0041 //
0042 // Because the phi projection LUT 1 can only accept 4 bits of eta information,
0043 // the eta-conversion LUT converts from the (non-linear) input scales to
0044 // different 4-bit scales (for DT, CSC, BRPC, FRPC).
0045 //
0046 // The 4-bit eta is coded as a symmteric scale with pseudo-sign.
0047 // For the scale see GMTScales::ReducedEtaScale()
0048 //
0049 // In the HW this LUT is implemented as asynchronous distributed RAM.
0050 //
0051 //--------------------------------------------------------------------------------
0052 
0053 unsigned L1MuGMTMIAUEtaConvLUT::TheLookupFunction(int idx, unsigned eta_in) const {
0054   // idx is MIP_DT, MIP_BRPC, ISO_DT, ISO_BRPC, MIP_CSC, MIP_FRPC, ISO_CSC, ISO_FRPC
0055   // INPUTS:  eta_in(6)
0056   // OUTPUTS: eta_out(4)
0057 
0058   const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales();
0059   const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
0060 
0061   int isRPC = idx % 2;
0062   int isFWD = idx / 4;
0063 
0064   int idx_drcr = isFWD * 2 + isRPC;
0065 
0066   float etaValue = theTriggerScales->getRegionalEtaScale(idx_drcr)->getCenter(eta_in);
0067 
0068   unsigned eta4bit = 0;
0069   if ((isRPC && isFWD && fabs(etaValue) < theGMTScales->getReducedEtaScale(3)->getScaleMin()) ||
0070       (isRPC && !isFWD && fabs(etaValue) > theGMTScales->getReducedEtaScale(1)->getScaleMax())) {
0071     if (!m_saveFlag)
0072       edm::LogWarning("LUTRangeViolation") << "L1MuGMTMIAUEtaConvLUT::TheLookupFunction: RPC "
0073                                            << (isFWD ? "fwd" : "brl") << " eta value out of range: " << etaValue;
0074   } else
0075     eta4bit = theGMTScales->getReducedEtaScale(idx_drcr)->getPacked(etaValue);
0076 
0077   return eta4bit;
0078 }