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 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTLFCOUDeltaEtaLUT.h"
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTConfig.h"
0030 #include "CondFormats/L1TObjects/interface/L1MuGMTScales.h"
0031 #include "CondFormats/L1TObjects/interface/L1MuPacking.h"
0032
0033
0034
0035
0036
0037 void L1MuGMTLFCOUDeltaEtaLUT::InitParameters() {}
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 unsigned L1MuGMTLFCOUDeltaEtaLUT::TheLookupFunction(int idx, unsigned eta1, unsigned eta2) const {
0052
0053
0054
0055
0056 const L1MuGMTScales* theGMTScales = L1MuGMTConfig::getGMTScales();
0057
0058
0059 L1MuSignedPacking<4> pack;
0060 unsigned delta_eta_OOR = pack.packedFromIdx(-8);
0061
0062 if (eta1 == 7 || eta2 == 7)
0063 return delta_eta_OOR;
0064
0065 int type1 = 0, type2 = 0;
0066 switch (idx) {
0067 case 0:
0068 type1 = 0;
0069 type2 = 2;
0070 break;
0071 case 1:
0072 type1 = 2;
0073 type2 = 0;
0074 break;
0075 case 2:
0076 type1 = 1;
0077 type2 = 2;
0078 break;
0079 case 3:
0080 type1 = 3;
0081 type2 = 0;
0082 break;
0083 }
0084
0085 float etaValue1 = theGMTScales->getOvlEtaScale(type1)->getCenter(eta1);
0086 float etaValue2 = theGMTScales->getOvlEtaScale(type2)->getCenter(eta2);
0087
0088 float delta_eta = etaValue1 - etaValue2;
0089
0090 unsigned delta_eta_4bit = 0;
0091
0092
0093 if (delta_eta < theGMTScales->getDeltaEtaScale(idx + 2)->getScaleMin() ||
0094 delta_eta > theGMTScales->getDeltaEtaScale(idx + 2)->getScaleMax()) {
0095 delta_eta_4bit = delta_eta_OOR;
0096 } else {
0097 delta_eta_4bit = theGMTScales->getDeltaEtaScale(idx + 2)->getPacked(delta_eta);
0098 }
0099
0100 return delta_eta_4bit;
0101 }