CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/L1Trigger/GlobalMuonTrigger/src/L1MuGMTLFEtaConvLUT.cc

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00003 //   Class: L1MuGMTLFEtaConvLUT
00004 //
00005 // 
00006 //   $Date: 2007/04/02 15:45:38 $
00007 //   $Revision: 1.3 $
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/L1MuGMTLFEtaConvLUT.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/L1MuTriggerScales.h"
00031 #include "CondFormats/L1TObjects/interface/L1MuPacking.h"
00032 
00033 
00034 //-------------------
00035 // InitParameters  --
00036 //-------------------
00037 
00038 void L1MuGMTLFEtaConvLUT::InitParameters() {
00039 }
00040 
00041 //----------------------------------------------------------------
00042 // Main eta conversion LUT
00043 //
00044 // Converts 6 bit regional trigger eta to GMT output eta scale
00045 //
00046 //----------------------------------------------------------------
00047 
00048 unsigned L1MuGMTLFEtaConvLUT::TheLookupFunction (int idx, unsigned eta_regional) const {
00049   // idx is DT, bRPC, CSC, fRPC
00050   // INPUTS:  eta_regional(6)
00051   // OUTPUTS: eta_gmt(6) 
00052  
00053   const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
00054 
00055   int isRPC = idx % 2;
00056   //  int isFWD = idx / 2;
00057   
00058   float etaValue = theTriggerScales->getRegionalEtaScale(idx)->getCenter( eta_regional );
00059 
00060   if ( fabs(etaValue) > 2.4 ) etaValue = 2.39 * ((etaValue)>0?1.:-1.);
00061 
00062   // this is the only trick needed ...
00063   if (isRPC) {
00064     // etaValue() is center. make eta=0 and |eta|=1.3 non-ambiguous, when converting to GMT bins
00065     etaValue += (etaValue>0.01? -1. : 1.) * 0.001;
00066   }
00067   
00068   unsigned eta_gmt = theTriggerScales->getGMTEtaScale()->getPacked( etaValue );
00069 
00070   return eta_gmt;
00071 }
00072 
00073 
00074 
00075 
00076 
00077 
00078 
00079 
00080 
00081 
00082 
00083 
00084 
00085 
00086 
00087 
00088 
00089 
00090