Skip to content

Commit

Permalink
Slightly different window creation mechanism and bugfix for CollectAn…
Browse files Browse the repository at this point in the history
…dMerge strategy

Including only lower energy seeds in the window around each seed as done originally and as done in the training of the model.
  • Loading branch information
valsdav committed Jun 8, 2022
1 parent d72062a commit 7e71237
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 7 additions & 1 deletion RecoEcal/EgammaCoreTools/src/EcalClustersGraph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
6 changes: 5 additions & 1 deletion RecoEcal/EgammaCoreTools/src/GraphMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@ std::pair<GraphMap::GraphOutput, GraphMap::GraphOutputMap> 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
Expand Down Expand Up @@ -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});
}
}
Expand Down

0 comments on commit 7e71237

Please sign in to comment.