CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/L1Trigger/GlobalMuonTrigger/src/L1MuGMTLFOvlEtaConvLUT.cc

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00003 //   Class: L1MuGMTLFOvlEtaConvLUT
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/L1MuGMTLFOvlEtaConvLUT.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 //-------------------
00037 // InitParameters  --
00038 //-------------------
00039 
00040 void L1MuGMTLFOvlEtaConvLUT::InitParameters() {
00041 }
00042 
00043 
00044 //--------------------------------------------------------------------------------
00045 // Overlap eta conversion LUT
00046 // 
00047 // convert global eta to a 4-bit pseudo-signed eta in the overlap region to be used in
00048 // the COU matching units
00049 //
00050 // instances:
00051 // ----------
00052 //   barrel chip: DT, bRPC
00053 //   barrel chip : ovlCSC 
00054 //
00055 //   forward chip: CSC bRPC
00056 //   forward chip: ovlDT
00057 //
00058 //--------------------------------------------------------------------------------
00059 
00060 unsigned L1MuGMTLFOvlEtaConvLUT::TheLookupFunction (int idx, unsigned eta6) const {
00061   // idx is DT, CSC, bRPC, fRPC, ovlCSC, ovlDT
00062   // INPUTS:  eta6(6)
00063   // OUTPUTS: eta_ovl(4) 
00064 
00065   const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales();
00066   const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
00067 
00068   int idx_drcr = 0;
00069 
00070   switch (idx) {
00071   case DT     : idx_drcr = 0; break;
00072   case CSC    : idx_drcr = 2; break;
00073   case bRPC   : idx_drcr = 1; break;
00074   case fRPC   : idx_drcr = 3; break;
00075   case ovlCSC : idx_drcr = 2; break;
00076   case ovlDT  : idx_drcr = 0; break;
00077   }
00078 
00079   float etaValue = theTriggerScales->getRegionalEtaScale(idx_drcr)->getCenter( eta6 );
00080 
00081   unsigned eta4bit = 0;
00082   if (fabs(etaValue) <  theGMTScales->getOvlEtaScale(idx_drcr)->getScaleMin() || 
00083       fabs(etaValue) >  theGMTScales->getOvlEtaScale(idx_drcr)->getScaleMax() ) {
00084     eta4bit = 7; // out of range code is max pos value
00085   }
00086 
00087   else {
00088     eta4bit  = theGMTScales->getOvlEtaScale(idx_drcr)->getPacked( etaValue );
00089     //    cout << "etaValue  = " << etaValue << "   eta OVERLAP= " << eta4bit << endl;
00090   }
00091 
00092   return eta4bit;
00093 }
00094 
00095 
00096 
00097 
00098 
00099 
00100 
00101 
00102 
00103 
00104 
00105