62 return phiIndex + etaIndex*36;
67 int outputShiftPhi = 3;
68 int outputShiftEta = 3;
74 for (
auto &
mu : inputmuons) {
77 int ptRedInWidth = phiExtrapolationLUT->getPtRedInWidth();
78 int ptMask = (1 << ptRedInWidth) - 1;
79 int etaRedInWidth = phiExtrapolationLUT->getEtaRedInWidth();
80 int redEtaShift = 8 - etaRedInWidth;
83 int ptRed =
mu->hwPt() & ptMask;
85 int etaAbsRed = (
std::abs(
mu->hwEta()) >> redEtaShift) & ((1 << etaRedInWidth) - 1);
90 if (
mu->hwPt() < (1 << ptRedInWidth)) {
92 if (
mu->hwSign() == 1) {
95 deltaPhi = (phiExtrapolationLUT->lookup(etaAbsRed, ptRed) << outputShiftPhi) * sign;
97 if (
mu->hwEta() > 0) {
102 mu->setExtrapolation(deltaEta, deltaPhi);
110 if (inputs.
size(bx) == 0)
return;
112 for (
int iphi = 0; iphi < 36; ++iphi) {
113 int iphiIndexOffset = iphi*28;
116 for (
int ieta = 0; ieta < 2; ++ieta) {
118 for (
int dIEta = 0-ieta; dIEta <= 2; ++dIEta) {
120 sum += inputs.
at(bx, iphiIndexOffset+dIEta).etBits();
125 for (
int ieta = 2; ieta < 26; ++ieta) {
127 for (
int dIEta = -2; dIEta <= 2; ++dIEta) {
129 sum += inputs.
at(bx, iphiIndexOffset+dIEta).etBits();
135 for (
int ieta = 26; ieta < 28; ++ieta) {
137 for (
int dIEta = -2; dIEta <= 27-ieta; ++dIEta) {
139 sum += inputs.
at(bx, iphiIndexOffset+dIEta).etBits();
158 for (
int dIPhi = -2; dIPhi <= 2; ++dIPhi) {
159 int currIndex = (index + dIPhi*28)%1008;
160 if (currIndex < 0) currIndex = 1008+currIndex;
173 for (
auto&
mu : muons) {
176 mu->setHwIsoSum(energySum);
181 mu->setHwRelIso(relIso);
182 mu->setHwAbsIso(absIso);
189 if (inputs.
size(bx) == 0)
return;
194 if (
input->etBits() != 0 ) {
205 for (
const auto &
mu : muons) {
212 mu->setHwIsoSum(energySum);
217 mu->setHwRelIso(relIso);
218 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