File indexing completed on 2024-04-06 12:19:56
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTLFDeltaEtaLUT.h"
0020
0021
0022
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
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
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
0054
0055
0056
0057
0058
0059
0060 return delta_eta_4bit;
0061 }