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>
class KDTreeLinkerAlgo;
19 template<
typename,
unsigned int>
class KDTreeNodeInfoT;
99 typedef std::unordered_map<const pandora::CaloHit*, const pandora::Cluster*>
HitToClusterMap;
101 pandora::StatusCode
ReadSettings(
const pandora::TiXmlHandle xmlHandle);
104 bool IsExtremalCluster(
const bool isForward,
const pandora::Cluster *
const pCurrentCluster,
const pandora::Cluster *
const pTestCluster)
const;
160 const ClusterAssociationMap &inputAssociationMap, TransverseClusterList &transverseClusterList)
const;
181 void GetAssociatedClusters(
const ClusterToClustersMap &nearbyClusters,
const pandora::Cluster *
const pCluster,
194 bool IsAssociated(
const bool isForward,
const pandora::Cluster *
const pCluster1,
const pandora::Cluster *
const pCluster2,
195 const ClusterToClustersMap &nearbyClusters)
const;
206 bool IsTransverseAssociated(
const pandora::Cluster *
const pCluster1,
const pandora::Cluster *
const pCluster2,
207 const ClusterToClustersMap &nearbyClusters)
const;
219 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;
298 void GetExtremalCoordinatesX(
const pandora::Cluster *
const pCluster, pandora::CartesianVector &innerCoordinate,
299 pandora::CartesianVector &outerCoordinate)
const;
393 #endif // #ifndef LAR_TRANSVERSE_ASSOCIATION_ALGORITHM_H KDTreeNodeInfoT< const pandora::CaloHit *, 2 > HitKDNode2D
void PopulateClusterAssociationMap(const pandora::ClusterVector &clusterVector, ClusterAssociationMap &clusterAssociationMap) const
Populate the cluster association map.
const pandora::Cluster * GetSeedCluster() const
Constructor.
KDTreeLinkerAlgo< const pandora::CaloHit *, 2 > HitKDTree2D
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.
Class that implements the KDTree partition of 2D space and a closest point search algorithm...
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.
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.
std::vector< LArTransverseCluster * > TransverseClusterList
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.
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.
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.
float m_maxLongitudinalOverlap
std::unordered_map< const pandora::Cluster *, pandora::ClusterSet > ClusterToClustersMap
float m_transverseClusterMinCosTheta
std::vector< art::Ptr< recob::Cluster > > ClusterVector
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...
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.
std::unordered_map< const pandora::CaloHit *, const pandora::Cluster * > HitToClusterMap
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
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.
std::unordered_map< const pandora::Cluster *, ClusterAssociation > ClusterAssociationMap
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.