File indexing completed on 2024-04-06 12:19:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTMIAUEtaProLUT.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/L1MuTriggerScales.h"
0032 #include "CondFormats/L1TObjects/interface/L1MuTriggerPtScale.h"
0033 #include "CondFormats/L1TObjects/interface/L1MuPacking.h"
0034 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTEtaLUT.h"
0035 #include "CondFormats/L1TObjects/interface/L1CaloGeometry.h"
0036
0037 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0038
0039
0040
0041
0042
0043 void L1MuGMTMIAUEtaProLUT::InitParameters() { m_IsolationCellSizeEta = L1MuGMTConfig::getIsolationCellSizeEta(); }
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065 unsigned L1MuGMTMIAUEtaProLUT::TheLookupFunction(int idx, unsigned eta, unsigned pt, unsigned charge) const {
0066
0067
0068
0069
0070
0071 const L1MuTriggerScales* theTriggerScales = L1MuGMTConfig::getTriggerScales();
0072 const L1MuTriggerPtScale* theTriggerPtScale = L1MuGMTConfig::getTriggerPtScale();
0073 const L1CaloGeometry* theCaloGeom = L1MuGMTConfig::getCaloGeom();
0074
0075 int isRPC = idx % 2;
0076 int isFWD = idx / 4;
0077
0078 int isISO = (idx / 2) % 2;
0079
0080 int idx_drcr = isFWD * 2 + isRPC;
0081
0082 if (pt == 0)
0083 return 0;
0084
0085 int ch_idx = (charge == 0) ? 1 : 0;
0086
0087 float oldeta = theTriggerScales->getRegionalEtaScale(idx_drcr)->getCenter(eta);
0088
0089 if (idx_drcr == 2)
0090 oldeta = theTriggerScales->getRegionalEtaScale(idx_drcr)->getLowEdge(eta);
0091
0092 if ((isRPC && isFWD && fabs(oldeta) < 1.04) || (isRPC && !isFWD && fabs(oldeta) > 1.04)) {
0093 if (!m_saveFlag)
0094 edm::LogWarning("LUTRangeViolation") << "L1MuGMTMIAUEtaProLUT::TheLookupFunction: RPC " << (isFWD ? "fwd" : "brl")
0095 << " eta value out of range: " << oldeta;
0096 }
0097
0098
0099 int isys = isFWD + 2 * isRPC;
0100 float neweta = L1MuGMTEtaLUT::eta(isys,
0101 isISO,
0102 ch_idx,
0103 oldeta,
0104 theTriggerPtScale->getPtScale()->getLowEdge(pt));
0105
0106
0107
0108
0109 unsigned icenter = theCaloGeom->globalEtaIndex(neweta) - theCaloGeom->numberGctForwardEtaBinsPerHalf();
0110
0111 unsigned eta_select_word_14 = 1 << icenter;
0112
0113
0114 if (isISO) {
0115 int imin = icenter - (m_IsolationCellSizeEta - 1) / 2;
0116 int imax = icenter + (m_IsolationCellSizeEta - 1) / 2;
0117
0118
0119 if (m_IsolationCellSizeEta % 2 == 0) {
0120
0121
0122 float bincenter = theCaloGeom->globalEtaBinCenter(icenter + theCaloGeom->numberGctForwardEtaBinsPerHalf());
0123 if (neweta > bincenter)
0124 imax++;
0125 else
0126 imin--;
0127 }
0128 if (imin < 0)
0129 imin = 0;
0130 if (imax > 13)
0131 imax = 13;
0132
0133 for (int i = imin; i <= imax; i++)
0134 eta_select_word_14 |= 1 << i;
0135 }
0136
0137
0138
0139 unsigned eta_select_word;
0140 if (isFWD) {
0141 unsigned mask5 = (1 << 5) - 1;
0142 eta_select_word = eta_select_word_14 & mask5;
0143 eta_select_word |= (eta_select_word_14 & (mask5 << 9)) >> 4;
0144 } else {
0145 unsigned mask10 = (1 << 10) - 1;
0146 eta_select_word = (eta_select_word_14 & (mask10 << 2)) >> 2;
0147 }
0148
0149 return eta_select_word;
0150 }