14 const std::vector<bool>& rechitMask,
const std::vector<bool>& seedable,
17 const auto& hgcalMultiClusters = *
clusterH_;
21 std::unordered_map<uint32_t, size_t> detIdToIndex(
hits.size());
22 for (uint32_t
i = 0;
i <
hits.size(); ++
i) {
23 detIdToIndex[
hits[
i].detId()] =
i;
26 for (
const auto& mcl : hgcalMultiClusters) {
28 double energy = 0.0, highest_energy = 0.0;
29 output.emplace_back();
31 for (
const auto&
cl : mcl) {
32 const auto& hitsAndFractions =
cl->hitsAndFractions();
33 for (
const auto& hAndF : hitsAndFractions) {
34 auto itr = detIdToIndex.find(hAndF.first);
35 if (itr == detIdToIndex.end()) {
39 assert(ref->detId() == hAndF.first.rawId());
40 const double hit_energy = hAndF.second * ref->energy();
47 if (hit_energy > highest_energy || highest_energy == 0.0) {
48 highest_energy = hit_energy;
void buildClusters(const edm::Handle< reco::PFRecHitCollection > &, const std::vector< bool > &, const std::vector< bool > &, reco::PFClusterCollection &) override
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Fraction of a PFRecHit (rechits can be shared between several PFCluster's)
void setEnergy(double energy)
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
static std::string const input
void setSeed(const DetId &id)
reco::PFRecHitRef makeRefhit(const edm::Handle< reco::PFRecHitCollection > &h, const unsigned i) const
void setCorrectedEnergy(double cenergy)
edm::Handle< std::vector< reco::HGCalMultiCluster > > clusterH_
void addRecHitFraction(const reco::PFRecHitFraction &frac)
add a given fraction of the rechit
edm::EDGetTokenT< std::vector< reco::HGCalMultiCluster > > clusterToken_
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
void updateEvent(const edm::Event &) final