diff --git a/RecoEcal/EgammaCoreTools/src/EcalClustersGraph.cc b/RecoEcal/EgammaCoreTools/src/EcalClustersGraph.cc index a3cd8f95091e2..77a4f71baaded 100644 --- a/RecoEcal/EgammaCoreTools/src/EcalClustersGraph.cc +++ b/RecoEcal/EgammaCoreTools/src/EcalClustersGraph.cc @@ -142,7 +142,13 @@ void EcalClustersGraph::initWindows() { // Add a self loop on the seed node graphMap_.addEdge(is, is); - for (uint icl = 0; icl < nCls_; icl++) { + // The graph associated to each seed includes only other seeds if they have a smaller energy. + // This is imposed to be consistent with the current trained model, which has been training on "non-overalapping windows". + // The effect of connecting all the seeds, and not only the smaller energy ones has been already tested: the reconstruction + // differences are negligible (tested with Cascade collection algo). + // In the next version of the training this requirement will be relaxed to have a model that fully matches the reconstruction + // mechanism in terms of overlapping seeds. + for (uint icl = is + 1; icl < nCls_; icl++) { if (is == icl) continue; const auto& clusterLocal = clusterPosition((*clusters_[icl]).ptr().get()); diff --git a/RecoEcal/EgammaCoreTools/src/GraphMap.cc b/RecoEcal/EgammaCoreTools/src/GraphMap.cc index d3e9feed29ebe..f7a0dc463eb39 100644 --- a/RecoEcal/EgammaCoreTools/src/GraphMap.cc +++ b/RecoEcal/EgammaCoreTools/src/GraphMap.cc @@ -211,8 +211,9 @@ std::pair GraphMap::collectSepa continue; // Loop on the out-coming edges for (const auto &out : edgesOut_[s]) { + // Check if it is another seed + // if out is a seed adjMatrix[self-loop] > 0 if (out != s && adjMatrix_[{out, out}] > 0) { - // Check if it is another seed // DO NOT CHECK the score of the edge, it will be checked during the merging collectedSeeds.push_back(out); // No self-loops are saved in the seed graph output @@ -270,6 +271,9 @@ void GraphMap::mergeSubGraphs(float threshold, GraphOutput seedsGraph, GraphOutp // Other seeds linked to the disable seed won't be collected, but analyzed independently. } } + // Now remove the current seed from the available ones, + // if not other seeds could take it and we would have a double use of objects. + adjMatrix_[{s, s}] = 0; graphOutput_.push_back({s, collectedNodes}); } }