14 const std::vector<bool>& rechitMask,
15 const std::vector<bool>& seedable,
17 const auto& hgcalMultiClusters = *
clusterH_;
23 std::unordered_map<uint32_t, size_t> detIdToIndex(
hits.size());
24 for (uint32_t
i = 0;
i <
hits.size(); ++
i) {
25 detIdToIndex[
hits[
i].detId()] =
i;
30 for (
const auto& mcl : hgcalMultiClusters) {
34 if (mcl.hitsAndFractions().empty()) {
40 float probTotal = 0.0f;
43 probTotal += tracksters[iMultiClus].id_probabilities(
cat);
52 double energy = 0.0, highest_energy = 0.0;
55 const auto& hitsAndFractions_mcl = mcl.hitsAndFractions();
57 std::vector<std::pair<DetId, float> > hitsAndFractions;
58 hitsAndFractions.insert(hitsAndFractions.end(), hitsAndFractions_mcl.begin(), hitsAndFractions_mcl.end());
61 if (hitsAndFractions.empty()) {
62 for (
const auto&
cl : mcl) {
63 const auto& hAndF_temp =
cl->hitsAndFractions();
64 hitsAndFractions.insert(hitsAndFractions.end(), hAndF_temp.begin(), hAndF_temp.end());
68 for (
const auto& hAndF : hitsAndFractions) {
69 auto itr = detIdToIndex.find(hAndF.first);
70 if (
itr == detIdToIndex.end()) {
74 assert(ref->detId() == hAndF.first.rawId());
75 const double hit_energy = hAndF.second * ref->energy();
82 if (hit_energy > highest_energy || highest_energy == 0.0) {
83 highest_energy = hit_energy;