00001 //------------------------------------------------- 00002 // 00003 // Class: L1MuGMTLFPhiProEtaConvLUT 00004 // 00005 // 00006 // $Date: 2007/04/02 15:45:38 $ 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/L1MuGMTLFPhiProEtaConvLUT.h" 00021 00022 //--------------- 00023 // C++ Headers -- 00024 //--------------- 00025 00026 //#include <iostream> 00027 00028 //------------------------------- 00029 // Collaborating Class Headers -- 00030 //------------------------------- 00031 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTConfig.h" 00032 #include "CondFormats/L1TObjects/interface/L1MuGMTScales.h" 00033 #include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h" 00034 #include "CondFormats/L1TObjects/interface/L1MuPacking.h" 00035 00036 #include "FWCore/MessageLogger/interface/MessageLogger.h" 00037 00038 //------------------- 00039 // InitParameters -- 00040 //------------------- 00041 00042 void L1MuGMTLFPhiProEtaConvLUT::InitParameters() { 00043 } 00044 00045 //------------------------ 00046 // The Lookup Function -- 00047 //------------------------ 00048 // 00049 // The LUT converts eta from 6 to 4 bits in order to use it as an Input to the Phi Projection 00050 // LUT in the Logic FPGA. It uses the same Scales as in the MIP/ISO AU Chip. 00051 // 00052 00053 unsigned L1MuGMTLFPhiProEtaConvLUT::TheLookupFunction (int idx, unsigned eta_in) const { 00054 // idx is DT, BRPC, CSC, FRPC 00055 // INPUTS: eta_in(6) 00056 // OUTPUTS: eta_out(4) 00057 00058 const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales(); 00059 const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales(); 00060 00061 int isRPC = idx % 2; 00062 int isFWD = idx / 2; 00063 00064 float etaValue = theTriggerScales->getRegionalEtaScale(idx)->getCenter( eta_in ); 00065 00066 unsigned eta4bit = 0; 00067 if ( (isRPC && isFWD && fabs(etaValue) < theGMTScales->getReducedEtaScale(3)->getScaleMin() ) || 00068 (isRPC && !isFWD && fabs(etaValue) > theGMTScales->getReducedEtaScale(1)->getScaleMax() )) { 00069 if(!m_saveFlag) edm::LogWarning("LUTRangeViolation") 00070 << "L1MuGMTMIAUEtaConvLUT::TheLookupFunction: RPC " << (isFWD?"fwd":"brl") << " eta value out of range: " << etaValue; 00071 } 00072 else 00073 eta4bit = theGMTScales->getReducedEtaScale(idx)->getPacked( etaValue ); 00074 00075 return eta4bit; 00076 } 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095