![]() |
LArSoft
v10_06_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "LArGraph.h"
Classes | |
| class | Edge |
Public Types | |
| typedef std::vector< const Edge * > | EdgeVector |
Public Member Functions | |
| LArGraph (const bool fullyConnect=true, const int nSourceEdges=2, const float maxSecondaryCosine=0.996f, const float maxSecondaryDistance=3.f) | |
| Constructor. More... | |
| ~LArGraph () | |
| Destructor. More... | |
| const EdgeVector & | GetEdges () const |
| Retrieve the edges for this graph. More... | |
| void | MakeGraph (const pandora::CaloHitList &caloHitList) |
| Construct a graph from a list of calo hits. More... | |
| void | Walk (const pandora::CaloHit *const pCaloHit, const HitEdgeMap &hitToEdgesMap, pandora::CaloHitList &graph, HitUseMap &connectedHits) const |
| Walk along node edges to define a connected graph. More... | |
Private Types | |
| typedef std::map< const pandora::CaloHit *, EdgeVector > | HitEdgeMap |
| typedef std::map< const pandora::CaloHit *, pandora::CaloHitList > | HitConnectionsMap |
| typedef std::map< const pandora::CaloHit *, bool > | HitUseMap |
Private Member Functions | |
| void | IdentifyDisconnectedRegions (const HitEdgeMap &hitToEdgesMap, HitConnectionsMap &graphs) const |
| Identify the different disconnected sub graphs in a set of eges. More... | |
| void | ConnectRegions (const HitConnectionsMap &graphs, HitEdgeMap &hitToEdgesMap) |
| Identify the different disconnected sub graphs in a set of eges. More... | |
| void | Vectorize (const pandora::CaloHitList &caloHitList, Eigen::MatrixXf &hitMatrix) const |
| Convert a list of calo hits into an Eigen matrix. More... | |
Private Attributes | |
| EdgeVector | m_edges |
| The edges defining the graph. More... | |
| bool | m_fullyConnect |
| Whether or not to connect any disconnected regions. More... | |
| int | m_nSourceEdges |
| The number of edges to consider emerging from a source. More... | |
| float | m_maxSecondaryCosine |
| The number of edges to consider emerging from a source. More... | |
| float | m_maxSecondaryDistance |
| The number of edges to consider emerging from a source. More... | |
LArGraph class.
Definition at line 21 of file LArGraph.h.
| typedef std::vector<const Edge *> lar_content::LArGraph::EdgeVector |
Definition at line 57 of file LArGraph.h.
|
private |
Definition at line 61 of file LArGraph.h.
|
private |
Definition at line 60 of file LArGraph.h.
|
private |
Definition at line 62 of file LArGraph.h.
| lar_content::LArGraph::LArGraph | ( | const bool | fullyConnect = true, |
| const int | nSourceEdges = 2, |
||
| const float | maxSecondaryCosine = 0.996f, |
||
| const float | maxSecondaryDistance = 3.f |
||
| ) |
Constructor.
| fullyConnect | Whether or not to connect disconnected regions |
| nSourceEdges | The number of edges emerging from a source node |
| maxSecondaryCosine | The maximum cosine of the opening angle between non-primary edges with the same source hit |
| maxSecondaryDistance | The maximum distance for a non-primary edge between hits |
Definition at line 20 of file LArGraph.cc.
References m_maxSecondaryCosine, m_maxSecondaryDistance, and m_nSourceEdges.
| lar_content::LArGraph::~LArGraph | ( | ) |
Destructor.
Definition at line 30 of file LArGraph.cc.
References m_edges.
|
private |
Identify the different disconnected sub graphs in a set of eges.
| graphs | the map between a root calo hit and all connected hits |
| hitToEdgesMap | the (updatable) map from calo hits to edges |
Definition at line 174 of file LArGraph.cc.
References lar::dump::array(), util::begin(), util::end(), m_edges, and Vectorize().
Referenced by MakeGraph().
| const LArGraph::EdgeVector & lar_content::LArGraph::GetEdges | ( | ) | const |
Retrieve the edges for this graph.
Definition at line 38 of file LArGraph.cc.
References m_edges.
|
private |
Identify the different disconnected sub graphs in a set of eges.
| hitToEdgesMap | the input maps from calo hits to edges |
| graphs | the output map between a root calo hit and all connected hits |
Definition at line 153 of file LArGraph.cc.
References Walk().
Referenced by MakeGraph().
| void lar_content::LArGraph::MakeGraph | ( | const pandora::CaloHitList & | caloHitList | ) |
Construct a graph from a list of calo hits.
| caloHitList | the calo hit list containing the hits from which to construct a graph |
Definition at line 45 of file LArGraph.cc.
References lar::dump::array(), ConnectRegions(), IdentifyDisconnectedRegions(), m_edges, m_fullyConnect, m_maxSecondaryCosine, m_maxSecondaryDistance, m_nSourceEdges, fhicl::other, r, and Vectorize().
|
private |
Convert a list of calo hits into an Eigen matrix.
| caloHitList | the calo hit list containing the hits from which to construct a graph |
| hitMatrix | the output Eigen matrix |
Definition at line 227 of file LArGraph.cc.
Referenced by ConnectRegions(), and MakeGraph().
| void lar_content::LArGraph::Walk | ( | const pandora::CaloHit *const | pCaloHit, |
| const HitEdgeMap & | hitToEdgesMap, | ||
| pandora::CaloHitList & | graph, | ||
| HitUseMap & | connectedHits | ||
| ) | const |
Walk along node edges to define a connected graph.
| pCaloHit | the root calo hit of the current subgraph |
| hitToEdgesMap | the map of hits to the edges for which they are a vertex |
| graph | the current graph to be augmented |
| connectedHits | the map of hits in use |
Definition at line 135 of file LArGraph.cc.
Referenced by IdentifyDisconnectedRegions().
|
private |
The edges defining the graph.
Definition at line 129 of file LArGraph.h.
Referenced by ConnectRegions(), GetEdges(), MakeGraph(), and ~LArGraph().
|
private |
Whether or not to connect any disconnected regions.
Definition at line 130 of file LArGraph.h.
Referenced by MakeGraph().
|
private |
The number of edges to consider emerging from a source.
Definition at line 132 of file LArGraph.h.
Referenced by LArGraph(), and MakeGraph().
|
private |
The number of edges to consider emerging from a source.
Definition at line 133 of file LArGraph.h.
Referenced by LArGraph(), and MakeGraph().
|
private |
The number of edges to consider emerging from a source.
Definition at line 131 of file LArGraph.h.
Referenced by LArGraph(), and MakeGraph().