24 const std::vector<bool>&,
25 const std::vector<bool>&,
36 #define LOGVERB(x) edm::LogVerbatim(x) 37 #define LOGWARN(x) edm::LogWarning(x) 38 #define LOGERR(x) edm::LogError(x) 39 #define LOGDRESSED(x) edm::LogInfo(x) 41 #define LOGVERB(x) LogTrace(x) 42 #define LOGWARN(x) edm::LogWarning(x) 43 #define LOGERR(x) edm::LogError(x) 44 #define LOGDRESSED(x) LogDebug(x) 50 const std::vector<bool>& rechitMask,
51 const std::vector<bool>& seedable,
57 std::unordered_map<uint32_t, size_t> detIdToIndex(
hits.size());
58 for (uint32_t
i = 0;
i <
hits.size(); ++
i) {
59 detIdToIndex[
hits[
i].detId()] =
i;
63 for (
const auto& sc : simClusters) {
67 double energy = 0.0, highest_energy = 0.0;
68 auto hitsAndFractions = sc.hits_and_fractions();
69 for (
const auto& hAndF : hitsAndFractions) {
70 auto itr = detIdToIndex.find(hAndF.first);
71 if (itr == detIdToIndex.end())
74 const double hit_energy = hAndF.second * ref->energy();
77 if (hit_energy > highest_energy || highest_energy == 0.0) {
78 highest_energy = hit_energy;
T getParameter(std::string const &) const
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
reco::PFRecHitRef makeRefhit(const edm::Handle< reco::PFRecHitCollection > &h, const unsigned i) const
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
uint32_t cc[maxCellsPerHit]
GenericSimClusterMapper B2DGT
B2DGT & operator=(const B2DGT &)=delete
Fraction of a PFRecHit (rechits can be shared between several PFCluster's)
void setEnergy(double energy)
GenericSimClusterMapper(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
void updateEvent(const edm::Event &) final
static std::string const input
void setSeed(const DetId &id)
edm::Handle< SimClusterCollection > _simClusterH
void buildClusters(const edm::Handle< reco::PFRecHitCollection > &, const std::vector< bool > &, const std::vector< bool > &, reco::PFClusterCollection &) override
void setCorrectedEnergy(double cenergy)
edm::EDGetTokenT< SimClusterCollection > _simClusterToken
void addRecHitFraction(const reco::PFRecHitFraction &frac)
add a given fraction of the rechit
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< SimCluster > SimClusterCollection
~GenericSimClusterMapper() override=default