64 return phiIndex + etaIndex * 36;
68 int outputShiftPhi = 3;
69 int outputShiftEta = 3;
75 for (
auto&
mu : inputmuons) {
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;
98 if (
mu->hwEta() > 0) {
103 mu->setExtrapolation(deltaEta, deltaPhi);
109 if (inputs.
size(bx) == 0)
113 int iphiIndexOffset =
iphi * 28;
118 for (
int dIEta = 0 -
ieta; dIEta <= 2; ++dIEta) {
121 sum += inputs.
at(bx, iphiIndexOffset + dIEta).etBits();
128 for (
int dIEta = -2; dIEta <= 2; ++dIEta) {
131 sum += inputs.
at(bx, iphiIndexOffset + dIEta).etBits();
139 for (
int dIEta = -2; dIEta <= 27 -
ieta; ++dIEta) {
142 sum += inputs.
at(bx, iphiIndexOffset + dIEta).etBits();
158 for (
int dIPhi = -2; dIPhi <= 2; ++dIPhi) {
159 int currIndex = (index + dIPhi * 28) % 1008;
161 currIndex = 1008 + currIndex;
172 for (
auto&
mu : muons) {
175 mu->setHwIsoSum(energySum);
180 mu->setHwRelIso(relIso);
181 mu->setHwAbsIso(absIso);
189 if (inputs.
size(bx) == 0)
195 if (
input->etBits() != 0) {
204 for (
const auto&
mu : muons) {
211 mu->setHwIsoSum(energySum);
216 mu->setHwRelIso(relIso);
217 mu->setHwAbsIso(absIso);
static unsigned getTwosComp(const int signedInt, const int width)
const_iterator end(int bx) const
l1t::LUT * fPhiExtrapolationLUT()
std::shared_ptr< MicroGMTCaloIndexSelectionLUT > m_IdxSelMemEta
l1t::LUT * oEtaExtrapolationLUT()
void extrapolateMuons(MicroGMTConfiguration::InterMuonList &) const
unsigned size(int bx) const
std::shared_ptr< MicroGMTExtrapolationLUT > m_OPhiExtrapolation
void setTowerSums(const MicroGMTConfiguration::CaloInputCollection &inputs, int bx)
std::bitset< 28 > caloInputsToDisable() const
void setHwCaloPhi(int idx)
std::shared_ptr< MicroGMTAbsoluteIsolationCheckLUT > m_AbsIsoCheckMem
std::map< tftype, std::shared_ptr< MicroGMTExtrapolationLUT > > m_etaExtrapolationLUTs
std::map< int, int > m_towerEnergies
static ReturnType create(const std::string &filename, const int fwVersion)
std::shared_ptr< MicroGMTRelativeIsolationCheckLUT > m_RelIsoCheckMem
std::bitset< 28 > m_caloInputsToDisable
static const double deltaEta
static std::string const input
static ReturnType create(const std::string &filename, const int fwVersion)
l1t::LUT * fEtaExtrapolationLUT()
std::shared_ptr< MicroGMTExtrapolationLUT > m_FEtaExtrapolation
l1t::LUT * absIsoCheckMemLUT()
l1t::LUT * relIsoCheckMemLUT()
std::shared_ptr< MicroGMTExtrapolationLUT > m_BPhiExtrapolation
Abs< T >::type abs(const T &t)
std::shared_ptr< MicroGMTExtrapolationLUT > m_OEtaExtrapolation
GMTInternalMuonList InterMuonList
std::shared_ptr< MicroGMTExtrapolationLUT > m_FPhiExtrapolation
l1t::LUT * idxSelMemPhiLUT()
std::shared_ptr< MicroGMTCaloIndexSelectionLUT > m_IdxSelMemPhi
void calculate5by1Sums(const MicroGMTConfiguration::CaloInputCollection &, int bx)
l1t::LUT * idxSelMemEtaLUT()
virtual ~MicroGMTIsolationUnit()
void isolate(MicroGMTConfiguration::InterMuonList &) const
std::shared_ptr< MicroGMTExtrapolationLUT > m_BEtaExtrapolation
const int hwGlobalPhi() const
int getCaloIndex(MicroGMTConfiguration::InterMuon &) const
unsigned fwVersion() const
l1t::LUT * oPhiExtrapolationLUT()
l1t::LUT * bPhiExtrapolationLUT()
l1t::LUT * bEtaExtrapolationLUT()
std::bitset< 28 > m_maskedCaloInputs
double energySum(const DataFrame &df, int fs, int ls)
std::map< tftype, std::shared_ptr< MicroGMTExtrapolationLUT > > m_phiExtrapolationLUTs
void initialise(L1TMuonGlobalParamsHelper *)
Initialisation from ES record.
void isolatePreSummed(MicroGMTConfiguration::InterMuonList &muons) const
const_iterator begin(int bx) const
std::vector< int > m_5by1TowerSums
std::bitset< 28 > maskedCaloInputs() const
void setHwCaloEta(int idx)
static ReturnType create(const std::string &filename, const int type, const int fwVersion)
int calculate5by5Sum(unsigned index) const
const T & at(int bx, unsigned i) const