CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
reco::GraphMap Class Reference

#include <GraphMap.h>

Public Types

enum  CollectionStrategy { Cascade, CollectAndMerge, SeedsFirst, CascadeHighest }
 
typedef std::vector< std::pair< uint, std::vector< uint > > > GraphOutput
 
typedef std::map< uint, std::vector< uint > > GraphOutputMap
 
enum  NodeCategory { kNode, kSeed, kNcategories }
 

Public Member Functions

void addEdge (const uint i, const uint j)
 
void addNode (const uint index, const NodeCategory category)
 
void addNodes (const std::vector< uint > &indices, const std::vector< NodeCategory > &categories)
 
void collectNodes (GraphMap::CollectionStrategy strategy, float threshold)
 
uint getAdjMatrix (const uint i, const uint j) const
 
std::vector< float > getAdjMatrixCol (const uint j) const
 
std::vector< float > getAdjMatrixRow (const uint i) const
 
const GraphOutputgetGraphOutput ()
 
const std::vector< uint > & getInEdges (const uint i) const
 
const std::vector< uint > & getOutEdges (const uint i) const
 
 GraphMap (uint nNodes)
 
void printGraphMap ()
 
void setAdjMatrix (const uint i, const uint j, const float score)
 
void setAdjMatrixSym (const uint i, const uint j, const float score)
 

Private Member Functions

void assignHighestScoreEdge ()
 
void collectCascading (float threshold)
 
std::pair< GraphOutput, GraphOutputMapcollectSeparately (float threshold)
 
void mergeSubGraphs (float threshold, GraphOutput seedsGraph, GraphOutputMap nodesGraphMap)
 
void resolveSuperNodesEdges (float threshold)
 

Private Attributes

std::map< std::pair< uint, uint >, float > adjMatrix_
 
std::vector< std::vector< uint > > edgesIn_
 
std::vector< std::vector< uint > > edgesOut_
 
GraphOutput graphOutput_
 
uint nNodes_
 
std::map< NodeCategory, std::vector< uint > > nodesCategories_
 
std::map< uint, uint > nodesCount_
 

Detailed Description

Definition at line 18 of file GraphMap.h.

Member Typedef Documentation

◆ GraphOutput

typedef std::vector<std::pair<uint, std::vector<uint> > > reco::GraphMap::GraphOutput

Definition at line 56 of file GraphMap.h.

◆ GraphOutputMap

typedef std::map<uint, std::vector<uint> > reco::GraphMap::GraphOutputMap

Definition at line 57 of file GraphMap.h.

Member Enumeration Documentation

◆ CollectionStrategy

Enumerator
Cascade 
CollectAndMerge 
SeedsFirst 
CascadeHighest 

Definition at line 38 of file GraphMap.h.

38  {
39  Cascade, // Starting from the highest energy seed, collect all the nodes.
40  // Other seeds collected by higher energy seeds are ignored
41  CollectAndMerge, // First, for each simple node keep only the edge with the highest score.
42  // Then collect all the simple nodes around the other seeds.
43  // Edges between the seeds nodes are ignored.
44  // Finally, starting from the first seed, look for linked secondary seeds
45  // and if they pass the threshold, merge their noded.
46  SeedsFirst, // Like strategy D, but after solving the edges between the seeds,
47  // the simple nodes edges are cleaned to keep only the highest score link.
48  // Then proceed as strategy B.
49  CascadeHighest // First, for each simple node keep only the edge with the highest score.
50  // Then proceed as strategy A, from the first seed node cascading to the others.
51  // Secondary seeds linked are absorbed and ignored in the next iteration:
52  // this implies that nodes connected to these seed are lost.
53  };

◆ NodeCategory

Enumerator
kNode 
kSeed 
kNcategories 

Definition at line 22 of file GraphMap.h.

Constructor & Destructor Documentation

◆ GraphMap()

GraphMap::GraphMap ( uint  nNodes)

Definition at line 9 of file GraphMap.cc.

References edgesIn_, and edgesOut_.

9  : nNodes_(nNodes) {
10  // One entry for node in the edges_ list
11  edgesIn_.resize(nNodes);
12  edgesOut_.resize(nNodes);
13 }
std::vector< std::vector< uint > > edgesOut_
Definition: GraphMap.h:71
uint nNodes_
Definition: GraphMap.h:60
std::vector< std::vector< uint > > edgesIn_
Definition: GraphMap.h:69

Member Function Documentation

◆ addEdge()

void GraphMap::addEdge ( const uint  i,
const uint  j 
)

Definition at line 26 of file GraphMap.cc.

References adjMatrix_, edgesIn_, edgesOut_, mps_fire::i, and dqmiolumiharvest::j.

Referenced by reco::EcalClustersGraph::initWindows().

26  {
27  // The first index is the starting node of the outcoming edge.
28  edgesOut_.at(i).push_back(j);
29  edgesIn_.at(j).push_back(i);
30  // Adding a connection in the adjacency matrix only in one direction
31  adjMatrix_[{i, j}] = 1.;
32 }
std::vector< std::vector< uint > > edgesOut_
Definition: GraphMap.h:71
std::map< std::pair< uint, uint >, float > adjMatrix_
Definition: GraphMap.h:75
std::vector< std::vector< uint > > edgesIn_
Definition: GraphMap.h:69

◆ addNode()

void GraphMap::addNode ( const uint  index,
const NodeCategory  category 
)

Definition at line 15 of file GraphMap.cc.

References validateAlignments::category, nodesCategories_, and nodesCount_.

Referenced by addNodes(), and reco::EcalClustersGraph::EcalClustersGraph().

15  {
16  nodesCategories_[category].push_back(index);
17  nodesCount_[category] += 1;
18 }
std::map< uint, uint > nodesCount_
Definition: GraphMap.h:67
std::map< NodeCategory, std::vector< uint > > nodesCategories_
Definition: GraphMap.h:65

◆ addNodes()

void GraphMap::addNodes ( const std::vector< uint > &  indices,
const std::vector< NodeCategory > &  categories 
)

Definition at line 20 of file GraphMap.cc.

References addNode(), myMessageLogger_cff::categories, mps_fire::i, and dqmdumpme::indices.

20  {
21  for (size_t i = 0; i < indices.size(); i++) {
23  }
24 }
void addNode(const uint index, const NodeCategory category)
Definition: GraphMap.cc:15

◆ assignHighestScoreEdge()

void GraphMap::assignHighestScoreEdge ( )
private

Definition at line 172 of file GraphMap.cc.

References adjMatrix_, haddnano::cl, edgesIn_, newFWLiteAna::found, LogTrace, nodesCategories_, offlineSlimmedPrimaryVertices_cfi::score, and fileCollector::seed.

Referenced by collectNodes().

172  {
173  // First for each simple node (no seed) keep only the highest score link
174  // Then perform strategy A.
175  LogTrace("GraphMap") << "Keep only highest score edge";
176  for (const auto &cl : nodesCategories_[NodeCategory::kNode]) {
177  std::pair<uint, float> maxPair{0, 0};
178  bool found = false;
179  for (const auto &seed : edgesIn_[cl]) {
180  float score = adjMatrix_[{seed, cl}];
181  if (score > maxPair.second) {
182  maxPair = {seed, score};
183  found = true;
184  }
185  }
186  if (!found)
187  continue;
188  LogTrace("GraphMap") << "cluster: " << cl << " edge from " << maxPair.first;
189  // Second loop to remove all the edges apart from the max
190  for (const auto &seed : edgesIn_[cl]) {
191  if (seed != maxPair.first) {
192  adjMatrix_[{seed, cl}] = 0.;
193  }
194  }
195  }
196 }
#define LogTrace(id)
std::map< NodeCategory, std::vector< uint > > nodesCategories_
Definition: GraphMap.h:65
std::map< std::pair< uint, uint >, float > adjMatrix_
Definition: GraphMap.h:75
std::vector< std::vector< uint > > edgesIn_
Definition: GraphMap.h:69

◆ collectCascading()

void GraphMap::collectCascading ( float  threshold)
private

Definition at line 134 of file GraphMap.cc.

References adjMatrix_, edgesIn_, edgesOut_, graphOutput_, LogDebug, LogTrace, nodesCategories_, MillePedeFileConverter_cfg::out, alignCSCRings::s, HLT_2024v14_cff::seeds, and DiMuonV_cfg::threshold.

Referenced by collectNodes().

134  {
135  // Starting from the highest energy seed, collect all the nodes.
136  // Other seeds collected by higher energy seeds are ignored
137  const auto &seeds = nodesCategories_[NodeCategory::kSeed];
138  // seeds are already included in order
139  LogDebug("GraphMap") << "Cascading...";
140  for (const auto &s : seeds) {
141  LogTrace("GraphMap") << "seed: " << s;
142  std::vector<uint> collectedNodes;
143  // Check if the seed if still available
144  if (adjMatrix_[{s, s}] < threshold)
145  continue;
146  // Loop on the out-coming edges
147  for (const auto &out : edgesOut_[s]) {
148  // Check the threshold for association
149  if (adjMatrix_[{s, out}] >= threshold) {
150  LogTrace("GraphMap") << "\tOut edge: " << s << " --> " << out;
151  // Save the node
152  collectedNodes.push_back(out);
153  // Remove all incoming edges to the selected node
154  // So that it cannot be taken from other SuperNodes
155  for (const auto &out_in : edgesIn_[out]) {
156  // There can be 4 cases:
157  // 1) out == s, out_in can be an incoming edge from other seed: to be removed
158  // 2) out == s, out_in==s (self-loop): zeroing will remove the current node from the available ones
159  // 3) out == r, out_in==s (current link): keep this
160  // 4) out == r, out_in==r (self-loop on other seeds): remove this making the other seed not accessible
161  if (out != s && out_in == s)
162  continue; // No need to remove the edge we are using
163  adjMatrix_[{out_in, out}] = 0.;
164  LogTrace("GraphMap") << "\t\t Deleted edge: " << out << " <-- " << out_in;
165  }
166  }
167  }
168  graphOutput_.push_back({s, collectedNodes});
169  }
170 }
#define LogTrace(id)
std::map< NodeCategory, std::vector< uint > > nodesCategories_
Definition: GraphMap.h:65
std::vector< std::vector< uint > > edgesOut_
Definition: GraphMap.h:71
std::map< std::pair< uint, uint >, float > adjMatrix_
Definition: GraphMap.h:75
std::vector< std::vector< uint > > edgesIn_
Definition: GraphMap.h:69
GraphOutput graphOutput_
Definition: GraphMap.h:78
#define LogDebug(id)

◆ collectNodes()

void GraphMap::collectNodes ( GraphMap::CollectionStrategy  strategy,
float  threshold 
)

Definition at line 97 of file GraphMap.cc.

References assignHighestScoreEdge(), collectCascading(), collectSeparately(), graphOutput_, mergeSubGraphs(), resolveSuperNodesEdges(), and DiMuonV_cfg::threshold.

Referenced by reco::EcalClustersGraph::selectClusters().

97  {
98  // Clear any stored graph output
99  graphOutput_.clear();
100 
101  if (strategy == GraphMap::CollectionStrategy::Cascade) {
102  // Starting from the highest energy seed, collect all the nodes.
103  // Other seeds collected by higher energy seeds are ignored
105  } else if (strategy == GraphMap::CollectionStrategy::CollectAndMerge) {
106  // First, for each simple node (no seed) keep only the edge with the highest score.
107  // Then collect all the simple nodes around the seeds.
108  // Edges between the seed are ignored.
109  // Finally, starting from the first seed (highest pt), look for linked secondary seed
110  // and if they pass the threshold, merge their noded.
112  const auto &[seedsGraph, simpleNodesMap] = collectSeparately(threshold);
113  mergeSubGraphs(threshold, seedsGraph, simpleNodesMap);
114  } else if (strategy == GraphMap::CollectionStrategy::SeedsFirst) {
115  // Like strategy D, but after solving the edges between the seeds,
116  // the simple nodes edges are cleaned to keep only the highest score link.
117  // Then proceed as strategy B.
121  } else if (strategy == GraphMap::CollectionStrategy::CascadeHighest) {
122  // First, for each simple node keep only the edge with the highest score.
123  // Then proceed as strategy A, from the first seed cascading to the others.
124  // Secondary seeds that are linked, are absorbed and ignored in the next iteration:
125  // this implies that nodes connected to these seeds are lost.
128  }
129 }
void mergeSubGraphs(float threshold, GraphOutput seedsGraph, GraphOutputMap nodesGraphMap)
Definition: GraphMap.cc:242
void resolveSuperNodesEdges(float threshold)
Definition: GraphMap.cc:281
void assignHighestScoreEdge()
Definition: GraphMap.cc:172
void collectCascading(float threshold)
Definition: GraphMap.cc:134
std::pair< GraphOutput, GraphOutputMap > collectSeparately(float threshold)
Definition: GraphMap.cc:198
strategy
Definition: nnet_common.h:18
GraphOutput graphOutput_
Definition: GraphMap.h:78

◆ collectSeparately()

std::pair< GraphMap::GraphOutput, GraphMap::GraphOutputMap > GraphMap::collectSeparately ( float  threshold)
private

Definition at line 198 of file GraphMap.cc.

References adjMatrix_, edgesOut_, LogDebug, LogTrace, nodesCategories_, MillePedeFileConverter_cfg::out, alignCSCRings::s, and DiMuonV_cfg::threshold.

Referenced by collectNodes().

198  {
199  // Save a subgraph of only seeds, without self-loops
200  GraphOutput seedsGraph;
201  // Collect all the nodes around seeds, but not other seeds
202  GraphOutputMap simpleNodesGraphMap;
203  LogDebug("GraphMap") << "Collecting separately each seed...";
204  // seeds are already included in order
205  for (const auto &s : nodesCategories_[NodeCategory::kSeed]) {
206  LogTrace("GraphMap") << "seed: " << s;
207  std::vector<uint> collectedNodes;
208  std::vector<uint> collectedSeeds;
209  // Check if the seed if still available
210  if (adjMatrix_[{s, s}] < threshold)
211  continue;
212  // Loop on the out-coming edges
213  for (const auto &out : edgesOut_[s]) {
214  // Check if it is another seed
215  // if out is a seed adjMatrix[self-loop] > 0
216  if (out != s && adjMatrix_[{out, out}] > 0) {
217  // DO NOT CHECK the score of the edge, it will be checked during the merging
218  collectedSeeds.push_back(out);
219  // No self-loops are saved in the seed graph output
220  // Then continue and do not work on this edgeOut
221  continue;
222  }
223  // Check the threshold for association
224  if (adjMatrix_[{s, out}] >= threshold) {
225  LogTrace("GraphMap") << "\tOut edge: " << s << " --> " << out << " (" << adjMatrix_[{s, out}] << " )";
226  // Save the node
227  collectedNodes.push_back(out);
228  // The links of the node to other seeds are not touched
229  // IF the function is called after assignHighestScoreEdge
230  // the other links have been already removed.
231  // IF not: the same node can be assigned to more subgraphs.
232  // The self-loop is included in this case in order to save the seed node
233  // in its own sub-graph.
234  }
235  }
236  simpleNodesGraphMap[s] = collectedNodes;
237  seedsGraph.push_back({s, collectedSeeds});
238  }
239  return std::make_pair(seedsGraph, simpleNodesGraphMap);
240 }
#define LogTrace(id)
std::vector< std::pair< uint, std::vector< uint > > > GraphOutput
Definition: GraphMap.h:56
std::map< NodeCategory, std::vector< uint > > nodesCategories_
Definition: GraphMap.h:65
std::vector< std::vector< uint > > edgesOut_
Definition: GraphMap.h:71
std::map< std::pair< uint, uint >, float > adjMatrix_
Definition: GraphMap.h:75
std::map< uint, std::vector< uint > > GraphOutputMap
Definition: GraphMap.h:57
#define LogDebug(id)

◆ getAdjMatrix()

uint GraphMap::getAdjMatrix ( const uint  i,
const uint  j 
) const

Definition at line 45 of file GraphMap.cc.

References adjMatrix_, mps_fire::i, and dqmiolumiharvest::j.

45 { return adjMatrix_.at({i, j}); };
std::map< std::pair< uint, uint >, float > adjMatrix_
Definition: GraphMap.h:75

◆ getAdjMatrixCol()

std::vector< float > GraphMap::getAdjMatrixCol ( const uint  j) const

Definition at line 55 of file GraphMap.cc.

References adjMatrix_, getInEdges(), mps_fire::i, dqmiolumiharvest::j, and MillePedeFileConverter_cfg::out.

55  {
56  std::vector<float> out;
57  for (const auto &i : getInEdges(j)) {
58  out.push_back(adjMatrix_.at({i, j}));
59  }
60  return out;
61 };
const std::vector< uint > & getInEdges(const uint i) const
Definition: GraphMap.cc:43
std::map< std::pair< uint, uint >, float > adjMatrix_
Definition: GraphMap.h:75

◆ getAdjMatrixRow()

std::vector< float > GraphMap::getAdjMatrixRow ( const uint  i) const

Definition at line 47 of file GraphMap.cc.

References adjMatrix_, getOutEdges(), mps_fire::i, dqmiolumiharvest::j, and MillePedeFileConverter_cfg::out.

47  {
48  std::vector<float> out;
49  for (const auto &j : getOutEdges(i)) {
50  out.push_back(adjMatrix_.at({i, j}));
51  }
52  return out;
53 };
const std::vector< uint > & getOutEdges(const uint i) const
Definition: GraphMap.cc:41
std::map< std::pair< uint, uint >, float > adjMatrix_
Definition: GraphMap.h:75

◆ getGraphOutput()

const GraphOutput& reco::GraphMap::getGraphOutput ( )
inline

Definition at line 60 of file GraphMap.h.

Referenced by reco::EcalClustersGraph::getGraphOutput().

60 { return graphOutput_; };
GraphOutput graphOutput_
Definition: GraphMap.h:78

◆ getInEdges()

const std::vector< uint > & GraphMap::getInEdges ( const uint  i) const

Definition at line 43 of file GraphMap.cc.

References edgesIn_, and mps_fire::i.

Referenced by getAdjMatrixCol().

43 { return edgesIn_.at(i); };
std::vector< std::vector< uint > > edgesIn_
Definition: GraphMap.h:69

◆ getOutEdges()

const std::vector< uint > & GraphMap::getOutEdges ( const uint  i) const

Definition at line 41 of file GraphMap.cc.

References edgesOut_, and mps_fire::i.

Referenced by reco::EcalClustersGraph::evaluateScores(), reco::EcalClustersGraph::fillVariables(), and getAdjMatrixRow().

41 { return edgesOut_.at(i); };
std::vector< std::vector< uint > > edgesOut_
Definition: GraphMap.h:71

◆ mergeSubGraphs()

void GraphMap::mergeSubGraphs ( float  threshold,
GraphOutput  seedsGraph,
GraphOutputMap  nodesGraphMap 
)
private

Definition at line 242 of file GraphMap.cc.

References adjMatrix_, graphOutput_, LogTrace, alignCSCRings::s, and DiMuonV_cfg::threshold.

Referenced by collectNodes().

242  {
243  // We have the graph between the seed and a map of
244  // simple nodes connected to each seed separately.
245  // Now we link them and build superGraphs starting from the first seed
246  LogTrace("GraphMap") << "Starting merging";
247  for (const auto &[s, other_seeds] : seedsGraph) {
248  LogTrace("GraphMap") << "seed: " << s;
249  // Check if the seed is still available
250  if (adjMatrix_[{s, s}] < threshold)
251  continue;
252  // If it is, we collect the final list of nodes
253  std::vector<uint> collectedNodes;
254  // Take the previously connected simple nodes to the current seed one
255  const auto &simpleNodes = nodesGraphMap[s];
256  collectedNodes.insert(std::end(collectedNodes), std::begin(simpleNodes), std::end(simpleNodes));
257  // Check connected seeds
258  for (const auto &out_s : other_seeds) {
259  // Check the score of the edge for the merging
260  // and check if the other seed has not been taken already
261  if (adjMatrix_[{out_s, out_s}] > threshold && adjMatrix_[{s, out_s}] > threshold) {
262  LogTrace("GraphMap") << "\tMerging nodes from seed: " << out_s;
263  // Take the nodes already linked to this seed
264  const auto &otherNodes = nodesGraphMap[out_s];
265  // We don't check for duplicates because assignHighestScoreEdge() should
266  // have been called already
267  collectedNodes.insert(std::end(collectedNodes), std::begin(otherNodes), std::end(otherNodes));
268  // Now let's disable the secondary seed
269  adjMatrix_[{out_s, out_s}] = 0.;
270  // This makes the strategy NOT RECURSIVE
271  // Other seeds linked to the disable seed won't be collected, but analyzed independently.
272  }
273  }
274  // Now remove the current seed from the available ones,
275  // if not other seeds could take it and we would have a double use of objects.
276  adjMatrix_[{s, s}] = 0;
277  graphOutput_.push_back({s, collectedNodes});
278  }
279 }
#define LogTrace(id)
std::map< std::pair< uint, uint >, float > adjMatrix_
Definition: GraphMap.h:75
GraphOutput graphOutput_
Definition: GraphMap.h:78

◆ printGraphMap()

void GraphMap::printGraphMap ( )

Definition at line 65 of file GraphMap.cc.

References adjMatrix_, MillePedeFileConverter_cfg::e, edgesIn_, edgesOut_, dqmiodumpmetadata::n, nNodes_, nodesCategories_, alignCSCRings::s, fileCollector::seed, and parallelization::uint.

65  {
66  edm::LogVerbatim("GraphMap") << "OUT edges" << std::endl;
67  uint seed = 0;
68  for (const auto &s : edgesOut_) {
69  edm::LogVerbatim("GraphMap") << "cl: " << seed << " --> ";
70  for (const auto &e : s) {
71  edm::LogVerbatim("GraphMap") << e << " (" << adjMatrix_[{seed, e}] << ") ";
72  }
73  edm::LogVerbatim("GraphMap") << std::endl;
74  seed++;
75  }
76  edm::LogVerbatim("GraphMap") << std::endl << "IN edges" << std::endl;
77  seed = 0;
78  for (const auto &s : edgesIn_) {
79  edm::LogVerbatim("GraphMap") << "cl: " << seed << " <-- ";
80  for (const auto &e : s) {
81  edm::LogVerbatim("GraphMap") << e << " (" << adjMatrix_[{e, seed}] << ") ";
82  }
83  edm::LogVerbatim("GraphMap") << std::endl;
84  seed++;
85  }
86  edm::LogVerbatim("GraphMap") << std::endl << "AdjMatrix" << std::endl;
87  for (const auto &s : nodesCategories_[NodeCategory::kSeed]) {
88  for (size_t n = 0; n < nNodes_; n++) {
89  edm::LogVerbatim("GraphMap") << std::setprecision(2) << adjMatrix_[{s, n}] << " ";
90  }
91  edm::LogVerbatim("GraphMap") << std::endl;
92  }
93 }
Log< level::Info, true > LogVerbatim
std::map< NodeCategory, std::vector< uint > > nodesCategories_
Definition: GraphMap.h:65
std::vector< std::vector< uint > > edgesOut_
Definition: GraphMap.h:71
std::map< std::pair< uint, uint >, float > adjMatrix_
Definition: GraphMap.h:75
uint nNodes_
Definition: GraphMap.h:60
std::vector< std::vector< uint > > edgesIn_
Definition: GraphMap.h:69

◆ resolveSuperNodesEdges()

void GraphMap::resolveSuperNodesEdges ( float  threshold)
private

Definition at line 281 of file GraphMap.cc.

References adjMatrix_, DummyCfis::c, edgesOut_, LogTrace, nodesCategories_, MillePedeFileConverter_cfg::out, alignCSCRings::s, and DiMuonV_cfg::threshold.

Referenced by collectNodes().

281  {
282  LogTrace("GraphMap") << "Resolving seeds";
283  for (const auto &s : nodesCategories_[NodeCategory::kSeed]) {
284  LogTrace("GraphMap") << "seed: " << s;
285  // Check if the seed if still available
286  if (adjMatrix_[{s, s}] < threshold)
287  continue;
288  // Loop on the out-coming edges
289  for (const auto &out : edgesOut_[s]) {
290  if (out != s && adjMatrix_[{out, out}] > 0 && adjMatrix_[{s, out}] > threshold) {
291  // This is a link to another still available seed
292  // If the edge score is good the other seed node is not disabled --> remove it
293  LogTrace("GraphMap") << "\tdisable seed: " << out;
294  adjMatrix_[{out, out}] = 0.;
295  // Remove the edges from that seed
296  // This is needed in order to be able to use the
297  // assignHighestScoreEdge after this function correctly
298  for (const auto &c : edgesOut_[out]) {
299  adjMatrix_[{out, c}] = 0.;
300  // We don't touch the edgesIn and edgesOut collections but we zero the adjmatrix --> more efficient
301  }
302  }
303  }
304  }
305 }
#define LogTrace(id)
std::map< NodeCategory, std::vector< uint > > nodesCategories_
Definition: GraphMap.h:65
std::vector< std::vector< uint > > edgesOut_
Definition: GraphMap.h:71
std::map< std::pair< uint, uint >, float > adjMatrix_
Definition: GraphMap.h:75

◆ setAdjMatrix()

void GraphMap::setAdjMatrix ( const uint  i,
const uint  j,
const float  score 
)

◆ setAdjMatrixSym()

void GraphMap::setAdjMatrixSym ( const uint  i,
const uint  j,
const float  score 
)

Definition at line 36 of file GraphMap.cc.

References adjMatrix_, mps_fire::i, dqmiolumiharvest::j, and offlineSlimmedPrimaryVertices_cfi::score.

36  {
37  adjMatrix_[{i, j}] = score;
38  adjMatrix_[{j, i}] = score;
39 };
std::map< std::pair< uint, uint >, float > adjMatrix_
Definition: GraphMap.h:75

Member Data Documentation

◆ adjMatrix_

std::map<std::pair<uint, uint>, float> reco::GraphMap::adjMatrix_
private

◆ edgesIn_

std::vector<std::vector<uint> > reco::GraphMap::edgesIn_
private

◆ edgesOut_

std::vector<std::vector<uint> > reco::GraphMap::edgesOut_
private

◆ graphOutput_

GraphOutput reco::GraphMap::graphOutput_
private

Definition at line 78 of file GraphMap.h.

Referenced by collectCascading(), collectNodes(), and mergeSubGraphs().

◆ nNodes_

uint reco::GraphMap::nNodes_
private

Definition at line 60 of file GraphMap.h.

Referenced by printGraphMap().

◆ nodesCategories_

std::map<NodeCategory, std::vector<uint> > reco::GraphMap::nodesCategories_
private

◆ nodesCount_

std::map<uint, uint> reco::GraphMap::nodesCount_
private

Definition at line 67 of file GraphMap.h.

Referenced by addNode().