Go to the documentation of this file.
11 const std::vector<bool>& rechitMask,
12 const std::vector<bool>& seedable,
14 const auto& hgcalMultiClusters = *
clusterH_;
18 std::unordered_map<uint32_t, size_t> detIdToIndex(
hits.size());
19 for (uint32_t
i = 0;
i <
hits.size(); ++
i) {
20 detIdToIndex[
hits[
i].detId()] =
i;
23 for (
const auto& mcl : hgcalMultiClusters) {
25 double energy = 0.0, highest_energy = 0.0;
28 for (
const auto&
cl : mcl) {
29 const auto& hitsAndFractions =
cl->hitsAndFractions();
30 for (
const auto& hAndF : hitsAndFractions) {
31 auto itr = detIdToIndex.find(hAndF.first);
32 if (
itr == detIdToIndex.end()) {
36 assert(ref->detId() == hAndF.first.rawId());
37 const double hit_energy = hAndF.second * ref->energy();
44 if (hit_energy > highest_energy || highest_energy == 0.0) {
45 highest_energy = hit_energy;
void updateEvent(const edm::Event &) final
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
void setSeed(const DetId &id)
static const std::string input
Fraction of a PFRecHit (rechits can be shared between several PFCluster's)
void setCorrectedEnergy(double cenergy)
reco::PFRecHitRef makeRefhit(const edm::Handle< reco::PFRecHitCollection > &h, const unsigned i) const
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
void buildClusters(const edm::Handle< reco::PFRecHitCollection > &, const std::vector< bool > &, const std::vector< bool > &, reco::PFClusterCollection &) override
edm::EDGetTokenT< std::vector< reco::HGCalMultiCluster > > clusterToken_
std::vector< std::pair< float, float > >::iterator itr
void addRecHitFraction(const reco::PFRecHitFraction &frac)
add a given fraction of the rechit
void setEnergy(double energy)
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
edm::Handle< std::vector< reco::HGCalMultiCluster > > clusterH_