11 #include "Objects/Cluster.h" 13 #include <Eigen/Dense> 33 Edge(
const pandora::CaloHit *
const pVertex0,
const pandora::CaloHit *
const pVertex1);
54 const pandora::CaloHit *
const m_v0;
55 const pandora::CaloHit *
const m_v1;
60 typedef std::map<const pandora::CaloHit *, EdgeVector>
HitEdgeMap;
62 typedef std::map<const pandora::CaloHit *, bool>
HitUseMap;
73 LArGraph(
const bool fullyConnect =
true,
const int nSourceEdges = 2,
const float maxSecondaryCosine = 0.996
f,
const float maxSecondaryDistance = 3.
f);
92 void MakeGraph(
const pandora::CaloHitList &caloHitList);
102 void Walk(
const pandora::CaloHit *
const pCaloHit,
const HitEdgeMap &hitToEdgesMap, pandora::CaloHitList &graph, HitUseMap &connectedHits)
const;
119 void ConnectRegions(
const HitConnectionsMap &graphs, HitEdgeMap &hitToEdgesMap);
127 void Vectorize(
const pandora::CaloHitList &caloHitList, Eigen::MatrixXf &hitMatrix)
const;
138 #endif // #ifndef LAR_GRAPH_H int m_nSourceEdges
The number of edges to consider emerging from a source.
const EdgeVector & GetEdges() const
Retrieve the edges for this graph.
const pandora::CaloHit *const m_v1
An endpoint of the edge.
std::map< const pandora::CaloHit *, bool > HitUseMap
float m_maxSecondaryCosine
The number of edges to consider emerging from a source.
std::vector< const Edge * > EdgeVector
void MakeGraph(const pandora::CaloHitList &caloHitList)
Construct a graph from a list of calo hits.
bool operator==(const Edge &other) const
Check if another edge shares the same calo hit end points.
void ConnectRegions(const HitConnectionsMap &graphs, HitEdgeMap &hitToEdgesMap)
Identify the different disconnected sub graphs in a set of eges.
float m_maxSecondaryDistance
The number of edges to consider emerging from a source.
Edge(const pandora::CaloHit *const pVertex0, const pandora::CaloHit *const pVertex1)
Constructor.
EdgeVector m_edges
The edges defining the graph.
std::map< const pandora::CaloHit *, pandora::CaloHitList > HitConnectionsMap
const pandora::CaloHit *const m_v0
An endpoint of the edge.
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.
void IdentifyDisconnectedRegions(const HitEdgeMap &hitToEdgesMap, HitConnectionsMap &graphs) const
Identify the different disconnected sub graphs in a set of eges.
float LengthSquared() const
Compute the square of the length of this edge.
void Vectorize(const pandora::CaloHitList &caloHitList, Eigen::MatrixXf &hitMatrix) const
Convert a list of calo hits into an Eigen matrix.
std::map< const pandora::CaloHit *, EdgeVector > HitEdgeMap
bool m_fullyConnect
Whether or not to connect any disconnected regions.
LArGraph(const bool fullyConnect=true, const int nSourceEdges=2, const float maxSecondaryCosine=0.996f, const float maxSecondaryDistance=3.f)
Constructor.