Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 //-------------------------------------------------
0002 //
0003 //   Class: L1MuGMTLFOvlEtaConvLUT
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/L1MuGMTLFOvlEtaConvLUT.h"
0019 
0020 //---------------
0021 // C++ Headers --
0022 //---------------
0023 
0024 //#include <iostream>
0025 
0026 //-------------------------------
0027 // Collaborating Class Headers --
0028 //-------------------------------
0029 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTConfig.h"
0030 #include "CondFormats/L1TObjects/interface/L1MuGMTScales.h"
0031 #include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h"
0032 #include "CondFormats/L1TObjects/interface/L1MuPacking.h"
0033 
0034 //-------------------
0035 // InitParameters  --
0036 //-------------------
0037 
0038 void L1MuGMTLFOvlEtaConvLUT::InitParameters() {}
0039 
0040 //--------------------------------------------------------------------------------
0041 // Overlap eta conversion LUT
0042 //
0043 // convert global eta to a 4-bit pseudo-signed eta in the overlap region to be used in
0044 // the COU matching units
0045 //
0046 // instances:
0047 // ----------
0048 //   barrel chip: DT, bRPC
0049 //   barrel chip : ovlCSC
0050 //
0051 //   forward chip: CSC bRPC
0052 //   forward chip: ovlDT
0053 //
0054 //--------------------------------------------------------------------------------
0055 
0056 unsigned L1MuGMTLFOvlEtaConvLUT::TheLookupFunction(int idx, unsigned eta6) const {
0057   // idx is DT, CSC, bRPC, fRPC, ovlCSC, ovlDT
0058   // INPUTS:  eta6(6)
0059   // OUTPUTS: eta_ovl(4)
0060 
0061   const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales();
0062   const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
0063 
0064   int idx_drcr = 0;
0065 
0066   switch (idx) {
0067     case DT:
0068       idx_drcr = 0;
0069       break;
0070     case CSC:
0071       idx_drcr = 2;
0072       break;
0073     case bRPC:
0074       idx_drcr = 1;
0075       break;
0076     case fRPC:
0077       idx_drcr = 3;
0078       break;
0079     case ovlCSC:
0080       idx_drcr = 2;
0081       break;
0082     case ovlDT:
0083       idx_drcr = 0;
0084       break;
0085   }
0086 
0087   float etaValue = theTriggerScales->getRegionalEtaScale(idx_drcr)->getCenter(eta6);
0088 
0089   unsigned eta4bit = 0;
0090   if (fabs(etaValue) < theGMTScales->getOvlEtaScale(idx_drcr)->getScaleMin() ||
0091       fabs(etaValue) > theGMTScales->getOvlEtaScale(idx_drcr)->getScaleMax()) {
0092     eta4bit = 7;  // out of range code is max pos value
0093   }
0094 
0095   else {
0096     eta4bit = theGMTScales->getOvlEtaScale(idx_drcr)->getPacked(etaValue);
0097     //    cout << "etaValue  = " << etaValue << "   eta OVERLAP= " << eta4bit << endl;
0098   }
0099 
0100   return eta4bit;
0101 }