CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/L1Trigger/GlobalMuonTrigger/src/L1MuGMTMIAUEtaConvLUT.cc

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00003 //   Class: L1MuGMTMIAUEtaConvLUT
00004 //
00005 // 
00006 //   $Date: 2007/04/02 15:45:39 $
00007 //   $Revision: 1.6 $
00008 //
00009 //   Author :
00010 //   H. Sakulin            HEPHY Vienna
00011 //
00012 //   Migrated to CMSSW:
00013 //   I. Mikulec
00014 //
00015 //--------------------------------------------------
00016 
00017 //-----------------------
00018 // This Class's Header --
00019 //-----------------------
00020 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTMIAUEtaConvLUT.h"
00021 
00022 //---------------
00023 // C++ Headers --
00024 //---------------
00025 
00026 //-------------------------------
00027 // Collaborating Class Headers --
00028 //-------------------------------
00029 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTConfig.h"
00030 #include "CondFormats/L1TObjects/interface/L1MuGMTScales.h"
00031 #include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h"
00032 #include "CondFormats/L1TObjects/interface/L1MuPacking.h"
00033 
00034 //-------------------
00035 // InitParameters  --
00036 //-------------------
00037 
00038 void L1MuGMTMIAUEtaConvLUT::InitParameters() {
00039 }
00040 
00041 //--------------------------------------------------------------------------------
00042 // Eta conversion LUT: converts 6-bit input eta to 4 bits
00043 // ===================
00044 // 
00045 // Because the phi projection LUT 1 can only accept 4 bits of eta information,
00046 // the eta-conversion LUT converts from the (non-linear) input scales to 
00047 // different 4-bit scales (for DT, CSC, BRPC, FRPC).
00048 //
00049 // The 4-bit eta is coded as a symmteric scale with pseudo-sign.
00050 // For the scale see GMTScales::ReducedEtaScale()
00051 //
00052 // In the HW this LUT is implemented as asynchronous distributed RAM.
00053 //
00054 //--------------------------------------------------------------------------------
00055 
00056 unsigned L1MuGMTMIAUEtaConvLUT::TheLookupFunction (int idx, unsigned eta_in) const {
00057   // idx is MIP_DT, MIP_BRPC, ISO_DT, ISO_BRPC, MIP_CSC, MIP_FRPC, ISO_CSC, ISO_FRPC
00058   // INPUTS:  eta_in(6)
00059   // OUTPUTS: eta_out(4) 
00060 
00061   const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales();
00062   const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
00063 
00064   int isRPC = idx % 2;
00065   int isFWD = idx / 4;
00066 
00067   int idx_drcr = isFWD * 2 + isRPC;
00068   
00069   float etaValue = theTriggerScales->getRegionalEtaScale(idx_drcr)->getCenter( eta_in );
00070 
00071   unsigned eta4bit = 0;
00072   if ( (isRPC && isFWD && fabs(etaValue) < theGMTScales->getReducedEtaScale(3)->getScaleMin() ) ||
00073        (isRPC && !isFWD && fabs(etaValue) > theGMTScales->getReducedEtaScale(1)->getScaleMax() )) {
00074     if(!m_saveFlag) edm::LogWarning("LUTRangeViolation") 
00075        << "L1MuGMTMIAUEtaConvLUT::TheLookupFunction: RPC " << (isFWD?"fwd":"brl") << " eta value out of range: " << etaValue;
00076   }
00077   else 
00078     eta4bit = theGMTScales->getReducedEtaScale(idx_drcr)->getPacked( etaValue );
00079 
00080   return eta4bit;
00081 }
00082 
00083 
00084 
00085 
00086 
00087 
00088 
00089 
00090 
00091 
00092 
00093 
00094 
00095