diff --git a/L1Trigger/Phase2L1ParticleFlow/plugins/L1TPFCaloProducer.cc b/L1Trigger/Phase2L1ParticleFlow/plugins/L1TPFCaloProducer.cc index bcf7806c1b0b0..2387893723f67 100644 --- a/L1Trigger/Phase2L1ParticleFlow/plugins/L1TPFCaloProducer.cc +++ b/L1Trigger/Phase2L1ParticleFlow/plugins/L1TPFCaloProducer.cc @@ -268,12 +268,12 @@ void L1TPFCaloProducer::readPhase2BarrelCaloTowers_(edm::Event &event, const edm continue; if (debug_ && (t.hcalTowerEt() > 0 || t.ecalTowerEt() > 0)) { edm::LogWarning("L1TPFCaloProducer") - << "adding phase2 L1 CaloTower eta " << t.towerEta() << " phi " << t.towerIPhi() << " ieta " + << "adding phase2 L1 CaloTower eta " << t.towerEta() << " phi " << t.towerPhi() << " ieta " << t.towerIEta() << " iphi " << t.towerIPhi() << " ecal " << t.ecalTowerEt() << " hcal " << t.hcalTowerEt() << "\n"; } - hcalClusterer_.add(t.hcalTowerEt(), t.towerEta(), t.towerIPhi()); - ecalClusterer_.add(t.ecalTowerEt(), t.towerEta(), t.towerIPhi()); + hcalClusterer_.add(t.hcalTowerEt(), t.towerEta(), t.towerPhi()); + ecalClusterer_.add(t.ecalTowerEt(), t.towerEta(), t.towerPhi()); } } } diff --git a/L1Trigger/Phase2L1ParticleFlow/src/CaloClusterer.cc b/L1Trigger/Phase2L1ParticleFlow/src/CaloClusterer.cc index 7696909ce64c2..06e95297e8c3f 100644 --- a/L1Trigger/Phase2L1ParticleFlow/src/CaloClusterer.cc +++ b/L1Trigger/Phase2L1ParticleFlow/src/CaloClusterer.cc @@ -34,8 +34,10 @@ l1tpf_calo::Phase1GridBase::Phase1GridBase( continue; ieta_[icell] = ie; iphi_[icell] = iph; - eta_[icell] = (ie > 0 ? 0.5 : -0.5) * (towerEtas_[absie - 1] + towerEtas_[absie]); - etaWidth_[icell] = (towerEtas_[absie] - towerEtas_[absie - 1]); + float etaLo = (absie < nEta_ ? towerEtas_[absie - 1] : towerEtas_[absie - 2]); + float etaHi = (absie < nEta_ ? towerEtas_[absie] : towerEtas_[absie - 1]); + eta_[icell] = (ie > 0 ? 0.5 : -0.5) * (etaLo + etaHi); + etaWidth_[icell] = (etaHi - etaLo); phiWidth_[icell] = 2 * M_PI / nPhi_; if (absie >= ietaVeryCoarse_) phiWidth_[icell] *= 4;