13 m_fwVersion = microGMTParamsHelper->
fwVersion();
35 m_etaExtrapolationLUTs[
tftype::bmtf] = m_BEtaExtrapolation;
36 m_phiExtrapolationLUTs[
tftype::bmtf] = m_BPhiExtrapolation;
52 int phi = (
mu.hwGlobalPhi() +
mu.hwDPhi()) % 576;
57 int phiIndex = m_IdxSelMemPhi->lookup(phi);
58 int eta =
mu.hwEta() +
mu.hwDEta();
60 int etaIndex = m_IdxSelMemEta->lookup(
eta);
61 mu.setHwCaloEta(etaIndex);
62 mu.setHwCaloPhi(phiIndex);
64 return phiIndex + etaIndex * 36;
68 int outputShiftPhi = 3;
69 int outputShiftEta = 3;
70 if (m_fwVersion >= 0x4010000) {
75 for (
auto&
mu : inputmuons) {
77 std::shared_ptr<MicroGMTExtrapolationLUT> phiExtrapolationLUT = m_phiExtrapolationLUTs.at(
mu->trackFinderType());
78 int ptRedInWidth = phiExtrapolationLUT->getPtRedInWidth();
79 int ptMask = (1 << ptRedInWidth) - 1;
80 int etaRedInWidth = phiExtrapolationLUT->getEtaRedInWidth();
81 int redEtaShift = 8 - etaRedInWidth;
84 int ptRed =
mu->hwPt() & ptMask;
86 int etaAbsRed = (
std::abs(
mu->hwEta()) >> redEtaShift) & ((1 << etaRedInWidth) - 1);
91 if (
mu->hwPt() < (1 << ptRedInWidth)) {
93 if (
mu->hwSign() == 1) {
96 deltaPhi = (phiExtrapolationLUT->lookup(etaAbsRed, ptRed) << outputShiftPhi) *
sign;
97 deltaEta = (m_etaExtrapolationLUTs.at(
mu->trackFinderType())->lookup(etaAbsRed, ptRed) << outputShiftEta);
98 if (
mu->hwEta() > 0) {
108 m_5by1TowerSums.clear();
113 int iphiIndexOffset =
iphi * 28;
118 for (
int dIEta = 0 -
ieta; dIEta <= 2; ++dIEta) {
119 if (m_caloInputsToDisable.test(
ieta + dIEta) || m_maskedCaloInputs.test(
ieta + dIEta))
121 sum +=
inputs.at(
bx, iphiIndexOffset + dIEta).etBits();
123 m_5by1TowerSums.push_back(sum);
128 for (
int dIEta = -2; dIEta <= 2; ++dIEta) {
129 if (m_caloInputsToDisable.test(
ieta + dIEta) || m_maskedCaloInputs.test(
ieta + dIEta))
131 sum +=
inputs.at(
bx, iphiIndexOffset + dIEta).etBits();
133 m_5by1TowerSums.push_back(sum);
139 for (
int dIEta = -2; dIEta <= 27 -
ieta; ++dIEta) {
140 if (m_caloInputsToDisable.test(
ieta + dIEta) || m_maskedCaloInputs.test(
ieta + dIEta))
142 sum +=
inputs.at(
bx, iphiIndexOffset + dIEta).etBits();
144 m_5by1TowerSums.push_back(sum);
148 m_initialSums =
true;
152 if (
index > m_5by1TowerSums.size()) {
158 for (
int dIPhi = -2; dIPhi <= 2; ++dIPhi) {
159 int currIndex = (
index + dIPhi * 28) % 1008;
161 currIndex = 1008 + currIndex;
162 if ((
unsigned)currIndex < m_5by1TowerSums.size()) {
163 returnSum += m_5by1TowerSums[currIndex];
173 int caloIndex = getCaloIndex(*
mu);
174 int energySum = calculate5by5Sum(caloIndex);
186 m_towerEnergies.clear();
192 if (m_caloInputsToDisable.test(
input->hwEta()) || m_maskedCaloInputs.test(
input->hwEta())) {
195 if (
input->etBits() != 0) {
196 m_towerEnergies[
input->hwEta() * 36 +
input->hwPhi()] =
input->etBits();
200 m_initialSums =
true;
205 int caloIndex = getCaloIndex(*
mu);
207 if (m_towerEnergies.count(caloIndex) == 1) {
208 energySum = m_towerEnergies.at(caloIndex);
static unsigned getTwosComp(const int signedInt, const int width)
l1t::LUT * fPhiExtrapolationLUT()
l1t::LUT * oEtaExtrapolationLUT()
void extrapolateMuons(MicroGMTConfiguration::InterMuonList &) const
void isolate(MicroGMTConfiguration::InterMuonList &) const
void setTowerSums(const MicroGMTConfiguration::CaloInputCollection &inputs, int bx)
static ReturnType create(const std::string &filename, const int fwVersion)
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
static const double deltaEta
static std::string const input
void isolatePreSummed(MicroGMTConfiguration::InterMuonList &muons) const
static ReturnType create(const std::string &filename, const int fwVersion)
l1t::LUT * fEtaExtrapolationLUT()
l1t::LUT * absIsoCheckMemLUT()
l1t::LUT * relIsoCheckMemLUT()
Abs< T >::type abs(const T &t)
GMTInternalMuonList InterMuonList
l1t::LUT * idxSelMemPhiLUT()
std::bitset< 28 > maskedCaloInputs() const
void calculate5by1Sums(const MicroGMTConfiguration::CaloInputCollection &, int bx)
l1t::LUT * idxSelMemEtaLUT()
virtual ~MicroGMTIsolationUnit()
l1t::LUT * oPhiExtrapolationLUT()
l1t::LUT * bPhiExtrapolationLUT()
l1t::LUT * bEtaExtrapolationLUT()
int calculate5by5Sum(unsigned index) const
double energySum(const DataFrame &df, int fs, int ls)
Log< level::Warning, false > LogWarning
void initialise(L1TMuonGlobalParamsHelper *)
Initialisation from ES record.
unsigned fwVersion() const
static ReturnType create(const std::string &filename, const int type, const int fwVersion)
int getCaloIndex(MicroGMTConfiguration::InterMuon &) const
std::bitset< 28 > caloInputsToDisable() const