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,
54 auto const& hits = *
input;
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) {
64 output.emplace_back();
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;
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
GenericSimClusterMapper B2DGT
B2DGT & operator=(const B2DGT &)=delete
Fraction of a PFRecHit (rechits can be shared between several PFCluster's)
void setEnergy(double energy)
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
GenericSimClusterMapper(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
void updateEvent(const edm::Event &) final
static std::string const input
void setSeed(const DetId &id)
reco::PFRecHitRef makeRefhit(const edm::Handle< reco::PFRecHitCollection > &h, const unsigned i) const
edm::Handle< SimClusterCollection > _simClusterH
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
void setCorrectedEnergy(double cenergy)
#define override(base_class)
edm::EDGetTokenT< SimClusterCollection > _simClusterToken
std::vector< l1t::PFCluster > PFClusterCollection
T getParameter(std::string const &) const
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