|
|
Go to the documentation of this file.
27 const std::vector<bool>&,
28 const std::vector<bool>&,
51 const std::vector<bool>& rechitMask,
52 const std::vector<bool>& seedable,
60 std::unordered_map<uint32_t, size_t> detIdToIndex(
hits.size());
61 for (uint32_t
i = 0;
i <
hits.size(); ++
i) {
62 detIdToIndex[
hits[
i].detId()] =
i;
65 for (
const auto& tst : tracksters) {
67 if (tst.vertices().empty()) {
72 float probTotal = 0.0f;
74 probTotal += tst.id_probabilities(
cat);
82 double energy = 0.0, highest_energy = 0.0;
86 std::vector<std::pair<DetId, float> > hitsAndFractions;
88 std::for_each(std::begin(tst.vertices()),
std::end(tst.vertices()), [&](
unsigned int lcId) {
89 const auto fraction = 1.f / tst.vertex_multiplicity(iLC++);
90 for (
const auto& cell :
clusters[lcId].hitsAndFractions()) {
91 hitsAndFractions.emplace_back(cell.first, cell.second *
fraction);
95 for (
const auto& hAndF : hitsAndFractions) {
96 auto itr = detIdToIndex.find(hAndF.first);
97 if (itr == detIdToIndex.end()) {
101 assert(ref->detId() == hAndF.first.rawId());
102 const double hit_energy = hAndF.second * ref->energy();
109 if (hit_energy > highest_energy || highest_energy == 0.0) {
110 highest_energy = hit_energy;
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
void setSeed(const DetId &id)
edm::Handle< std::vector< ticl::Trackster > > trackstersH_
PFClusterFromHGCalTrackster(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
static const std::string input
~PFClusterFromHGCalTrackster() override
Fraction of a PFRecHit (rechits can be shared between several PFCluster's)
PFClusterFromHGCalTrackster & operator=(const PFClusterFromHGCalTrackster &)=delete
void setCorrectedEnergy(double cenergy)
edm::EDGetTokenT< std::vector< ticl::Trackster > > tracksterToken_
std::vector< int > filter_on_categories_
edm::EDGetTokenT< reco::CaloClusterCollection > clusterToken_
reco::PFRecHitRef makeRefhit(const edm::Handle< reco::PFRecHitCollection > &h, const unsigned i) const
std::vector< CaloCluster > CaloClusterCollection
collection of CaloCluster objects
#define DEFINE_EDM_PLUGIN(factory, type, name)
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
bool filterByTracksterPID_
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.
T getParameter(std::string const &) const
void updateEvent(const edm::Event &) final
edm::Handle< reco::CaloClusterCollection > clusterH_
void buildClusters(const edm::Handle< reco::PFRecHitCollection > &, const std::vector< bool > &, const std::vector< bool > &, reco::PFClusterCollection &) override