8 #ifndef LAR_TRANSVERSE_ASSOCIATION_ALGORITHM_H
9 #define LAR_TRANSVERSE_ASSOCIATION_ALGORITHM_H 1
11 #include "Pandora/Algorithm.h"
18 template <
typename,
unsigned int>
19 class KDTreeLinkerAlgo;
20 template <
typename,
unsigned int>
21 class KDTreeNodeInfoT;
101 typedef std::unordered_map<const pandora::CaloHit *, const pandora::Cluster *>
HitToClusterMap;
103 pandora::StatusCode
ReadSettings(
const pandora::TiXmlHandle xmlHandle);
106 bool IsExtremalCluster(
const bool isForward,
const pandora::Cluster *
const pCurrentCluster,
const pandora::Cluster *
const pTestCluster)
const;
194 bool IsAssociated(
const bool isForward,
const pandora::Cluster *
const pCluster1,
const pandora::Cluster *
const pCluster2,
207 const pandora::Cluster *
const pCluster1,
const pandora::Cluster *
const pCluster2,
const ClusterToClustersMap &nearbyClusters)
const;
239 bool IsOverlapping(
const pandora::Cluster *
const pCluster1,
const pandora::Cluster *
const pCluster2)
const;
289 void GetExtremalCoordinatesXZ(
const pandora::Cluster *
const pCluster,
const bool useX,
float &minXZ,
float &maxXZ)
const;
299 const pandora::Cluster *
const pCluster, pandora::CartesianVector &innerCoordinate, pandora::CartesianVector &outerCoordinate)
const;
367 return m_associatedClusters;
374 return m_innerVertex;
381 return m_outerVertex;
393 #endif // #ifndef LAR_TRANSVERSE_ASSOCIATION_ALGORITHM_H
void PopulateClusterAssociationMap(const pandora::ClusterVector &clusterVector, ClusterAssociationMap &clusterAssociationMap) const
Populate the cluster association map.
const pandora::Cluster * GetSeedCluster() const
Constructor.
pandora::CartesianVector m_outerVertex
TransverseAssociationAlgorithm()
Default constructor.
const pandora::CartesianVector & GetInnerVertex() const
Get the inner vertex position.
float GetTransverseSpan(const pandora::Cluster *const pCluster) const
Calculate the overall span in X for a clusters.
void FillTransverseAssociationMap(const ClusterToClustersMap &nearbyClusters, const TransverseClusterList &transverseClusterList, const ClusterAssociationMap &transverseAssociationMap, ClusterAssociationMap &clusterAssociationMap) const
Form associations between transverse cluster objects.
const pandora::Cluster * m_pSeedCluster
float m_transverseClusterMinLength
void GetExtremalCoordinatesXZ(const pandora::Cluster *const pCluster, const bool useX, float &minXZ, float &maxXZ) const
Get minimum and maximum X or Z coordinates for a given cluster.
std::unordered_map< const pandora::Cluster *, ClusterAssociation > ClusterAssociationMap
pandora::CartesianVector m_innerVertex
bool IsExtremalCluster(const bool isForward, const pandora::Cluster *const pCurrentCluster, const pandora::Cluster *const pTestCluster) const
Determine which of two clusters is extremal.
void FillSymmetricAssociationMap(const ClusterAssociationMap &inputAssociationMap, ClusterAssociationMap &outputAssociationMap) const
Symmetrise an association map.
bool IsTransverseAssociated(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const ClusterToClustersMap &nearbyClusters) const
Determine whether two clusters are within the same cluster window.
void FillAssociationMap(const ClusterToClustersMap &nearbyClusters, const pandora::ClusterVector &firstVector, const pandora::ClusterVector &secondVector, ClusterAssociationMap &firstAssociationMap, ClusterAssociationMap &secondAssociationMap) const
Form associations between two input lists of cluster.
std::vector< LArTransverseCluster * > TransverseClusterList
Data stored in each KDTree node. The dim1/dim2 fields are usually the duplication of some PFRecHit va...
float m_transverseClusterMaxDisplacement
bool IsOverlapping(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2) const
Determine whether two clusters are overlapping.
float m_maxTransverseOverlap
void GetExtremalCoordinatesX(const pandora::Cluster *const pCluster, float &minX, float &maxX) const
Get minimum and maximum X coordinates for a given cluster.
pandora::CartesianVector m_direction
float m_searchRegionX
Search region, applied to x dimension, for look-up from kd-trees.
void SortInputClusters(const pandora::ClusterVector &inputClusters, pandora::ClusterVector &shortClusters, pandora::ClusterVector &transverseMediumClusters, pandora::ClusterVector &longitudinalMediumClusters, pandora::ClusterVector &longClusters) const
Separate input clusters by length.
KDTreeNodeInfoT< const pandora::CaloHit *, 2 > HitKDNode2D
Header file for the cluster association algorithm class.
void FillTransverseClusterList(const ClusterToClustersMap &nearbyClusters, const pandora::ClusterVector &inputClusters, const ClusterAssociationMap &inputAssociationMap, TransverseClusterList &transverseClusterList) const
Create transverse cluster objects, these are protoclusters with a direction and inner/outer vertices...
const pandora::CartesianVector & GetOuterVertex() const
Get the outer vertex position.
std::unordered_map< const pandora::Cluster *, pandora::ClusterSet > ClusterToClustersMap
float m_maxLongitudinalOverlap
float m_transverseClusterMinCosTheta
std::unordered_map< const pandora::CaloHit *, const pandora::Cluster * > HitToClusterMap
void FinalizeClusterAssociationMap(const ClusterAssociationMap &inputAssociationMap, ClusterAssociationMap &outputAssociationMap) const
Symmetrise and then remove double-counting from an association map.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
float m_maxProjectedOverlap
void GetListOfCleanClusters(const pandora::ClusterList *const pClusterList, pandora::ClusterVector &clusterVector) const
Populate cluster vector with subset of cluster list, containing clusters judged to be clean...
KDTreeLinkerAlgo< const pandora::CaloHit *, 2 > HitKDTree2D
TransverseAssociationAlgorithm class.
void GetNearbyClusterMap(const pandora::ClusterVector &allClusters, ClusterToClustersMap &nearbyClusters) const
Use a kd-tree to obtain details of all nearby cluster combinations.
const pandora::CartesianVector & GetDirection() const
Get the direction.
ClusterAssociationAlgorithm class.
bool IsAssociated(const bool isForward, const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const ClusterToClustersMap &nearbyClusters) const
Determine whether clusters are association.
std::vector< HitKDNode2D > HitKDNode2DList
std::vector< art::Ptr< recob::Cluster > > ClusterVector
void FillReducedAssociationMap(const ClusterToClustersMap &nearbyClusters, const pandora::ClusterVector &firstVector, const pandora::ClusterVector &secondVector, ClusterAssociationMap &clusterAssociationMap) const
Form a reduced set of associations between two input lists of clusters.
float GetLongitudinalSpan(const pandora::Cluster *const pCluster) const
Calculate the overall span in Z for a clusters.
LArTransverseCluster class.
void GetAssociatedClusters(const ClusterToClustersMap &nearbyClusters, const pandora::Cluster *const pCluster, const ClusterAssociationMap &inputAssociationMap, pandora::ClusterVector &associatedClusters) const
Find the clusters that are transversely associated with a target cluster.
pandora::ClusterVector m_associatedClusters
float m_searchRegionZ
Search region, applied to u/v/w dimension, for look-up from kd-trees.
const pandora::ClusterVector & GetAssociatedClusters() const
Get the associated cluster vector.
void GetExtremalCoordinatesZ(const pandora::Cluster *const pCluster, float &minZ, float &maxZ) const
Get minimum and maximum Z coordinates for a given cluster.
LArTransverseCluster(const pandora::Cluster *const pSeedCluster, const pandora::ClusterVector &associatedClusters)
Constructor.