28 throw cms::Exception(
"HGCalIsoCalculator::produceHGCalIso: rechittools not set");
35 auto makeEtaPhiPair = [
this](
const auto&
hit) {
39 return std::make_pair(eta, phi);
50 throw cms::Exception(
"HGCalIsoCalculator::produceHGCalIso: rechittools not set");
57 const float seedEta=seed->eta();
58 const float seedPhi=seed->phi();
59 const std::vector<std::pair<DetId, float>> & seedHitsAndFractions = seed->hitsAndFractions();
61 auto checkAndFill = [
this, &seedEta, &seedPhi, &seedHitsAndFractions](
const HGCRecHit&
hit, std::pair<float,float> etaphiVal) {
62 float deltar2=
reco::deltaR2(etaphiVal.first,etaphiVal.second,seedEta,seedPhi);
69 if( std::none_of(seedHitsAndFractions.begin(), seedHitsAndFractions.end(), [&hit](
const auto& seedhit){
return hit.id()==seedhit.first;}) ){
71 isoringdeposits_.at(ring)+=hit.energy();
78 checkAndFill(hit, *itEtaPhiCache);
82 checkAndFill(hit, *itEtaPhiCache);
86 checkAndFill(hit, *itEtaPhiCache);
93 throw std::logic_error(
"PhotonHGCalIsoCalculator::setNRings: max number of rings reached");
102 if(
i && !(
i%separator) && (
int)counter<(
int)nrings-1){
111 throw cms::Exception(
"HGCalIsoCalculator::getIso: ring index out of range");
edm::Handle< HGCRecHitCollection > recHitsEE_
edm::Handle< HGCRecHitCollection > recHitsBH_
void setNRings(const size_t nrings)
void setRecHits(edm::Handle< HGCRecHitCollection > hitsEE, edm::Handle< HGCRecHitCollection > hitsFH, edm::Handle< HGCRecHitCollection > hitsBH)
fill - once per event
std::vector< unsigned int > ringasso_
const hgcal::RecHitTools * rechittools_
std::vector< std::pair< float, float > > hitEtaPhiCache_
void produceHGCalIso(const reco::CaloClusterPtr &seedCluster)
edm::Handle< HGCRecHitCollection > recHitsFH_
std::vector< float > isoringdeposits_
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
static int position[264][3]
const float getIso(const unsigned int ring) const