Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:11:25

0001 //-------------------------------------------------
0002 //
0003 //   Class: L1MuGMTLFDeltaEtaLUT
0004 //
0005 //   this class was automatically generated by L1MuGMTLUT::MakeSubClass()
0006 //
0007 //
0008 //   Author :
0009 //   H. Sakulin            HEPHY Vienna
0010 //
0011 //   Migrated to CMSSW:
0012 //   I. Mikulec
0013 //
0014 //--------------------------------------------------
0015 
0016 //-----------------------
0017 // This Class's Header --
0018 //-----------------------
0019 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTLFDeltaEtaLUT.h"
0020 
0021 //------------------------------------
0022 // Collaborating Class Declarations --
0023 //------------------------------------
0024 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTConfig.h"
0025 #include "CondFormats/L1TObjects/interface/L1MuGMTScales.h"
0026 #include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h"
0027 #include "CondFormats/L1TObjects/interface/L1MuPacking.h"
0028 
0029 void L1MuGMTLFDeltaEtaLUT::InitParameters() {}
0030 
0031 unsigned L1MuGMTLFDeltaEtaLUT::TheLookupFunction(int idx, unsigned eta_dtcsc, unsigned eta_rpc) const {
0032   const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales();
0033   const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
0034 
0035   // idx is DTRPC CSCRPC
0036 
0037   float etaValue_dtcsc = theTriggerScales->getRegionalEtaScale(idx * 2)->getCenter(eta_dtcsc);
0038   float etaValue_rpc = theTriggerScales->getRegionalEtaScale(idx * 2 + 1)->getCenter(eta_rpc);
0039 
0040   float delta_eta = etaValue_dtcsc - etaValue_rpc;
0041 
0042   unsigned delta_eta_4bit = 0;
0043 
0044   // check out of range
0045   if (delta_eta < theGMTScales->getDeltaEtaScale(idx)->getScaleMin() ||
0046       delta_eta > theGMTScales->getDeltaEtaScale(idx)->getScaleMax()) {
0047     L1MuSignedPacking<4> pack;
0048     delta_eta_4bit = pack.packedFromIdx(-8);
0049   } else {
0050     delta_eta_4bit = theGMTScales->getDeltaEtaScale(idx)->getPacked(delta_eta);
0051   }
0052 
0053   //      cout << "delta-eta LUT : idx= " << idx
0054   //     << ", etaValue_dtcsc = " << etaValue_dtcsc
0055   //     << ", etaValue_rpc = " << etaValue_rpc
0056   //     << ", delta_eta = " << delta_eta
0057   //     << ", packed = " << delta_eta_4bit
0058   //     << endl;
0059 
0060   return delta_eta_4bit;
0061 }