8 #ifndef LAR_CLUSTER_HELPER_H 9 #define LAR_CLUSTER_HELPER_H 1 11 #include "Objects/Cluster.h" 29 static pandora::HitType
GetClusterHitType(
const pandora::Cluster *
const pCluster);
39 static void GetClustersUVW(
const pandora::ClusterList &inputClusters, pandora::ClusterList &clusterListU,
40 pandora::ClusterList &clusterListV, pandora::ClusterList &clusterListW);
49 static void GetClustersByHitType(
const pandora::ClusterList &inputClusters,
const pandora::HitType hitType,
50 pandora::ClusterList &clusterList);
68 static float GetLength(
const pandora::Cluster *
const pCluster);
86 static unsigned int GetLayerSpan(
const pandora::Cluster *
const pCluster);
105 static float GetLayerOccupancy(
const pandora::Cluster *
const pCluster1,
const pandora::Cluster *
const pCluster2);
115 static float GetClosestDistance(
const pandora::ClusterList &clusterList1,
const pandora::ClusterList &clusterList2);
125 static float GetClosestDistance(
const pandora::Cluster *
const pCluster,
const pandora::ClusterList &clusterList);
135 static float GetClosestDistance(
const pandora::Cluster *
const pCluster1,
const pandora::Cluster *
const pCluster2);
145 static float GetClosestDistance(
const pandora::CartesianVector &position,
const pandora::ClusterList &clusterList);
155 static float GetClosestDistance(
const pandora::CartesianVector &position,
const pandora::Cluster *
const pCluster);
165 static pandora::CartesianVector
GetClosestPosition(
const pandora::CartesianVector &position,
const pandora::ClusterList &clusterList);
175 static pandora::CartesianVector
GetClosestPosition(
const pandora::CartesianVector &position,
const pandora::Cluster *
const pCluster);
185 static void GetClosestPositions(
const pandora::Cluster *
const pCluster1,
const pandora::Cluster *
const pCluster2,
186 pandora::CartesianVector &position1, pandora::CartesianVector &position2);
195 static void GetExtremalCoordinates(
const pandora::ClusterList &clusterList, pandora::CartesianVector &innerCoordinate,
196 pandora::CartesianVector &outerCoordinate);
205 static void GetExtremalCoordinates(
const pandora::Cluster *
const pCluster, pandora::CartesianVector &innerCoordinate,
206 pandora::CartesianVector &outerCoordinate);
215 static void GetExtremalCoordinates(
const pandora::OrderedCaloHitList &orderedCaloHitList, pandora::CartesianVector &innerCoordinate,
216 pandora::CartesianVector &outerCoordinate);
225 static void GetExtremalCoordinates(
const pandora::CartesianPointVector &coordinateVector, pandora::CartesianVector &innerCoordinate,
226 pandora::CartesianVector &outerCoordinate);
235 static void GetClusterBoundingBox(
const pandora::Cluster *
const pCluster, pandora::CartesianVector &minimumCoordinate,
236 pandora::CartesianVector &maximumCoordinate);
245 static void GetClusterSpanX(
const pandora::Cluster *
const pCluster,
float &xmin,
float &xmax);
256 static void GetClusterSpanZ(
const pandora::Cluster *
const pCluster,
const float xmin,
const float xmax,
float &zmin,
float &zmax);
264 static void GetCoordinateVector(
const pandora::Cluster *
const pCluster, pandora::CartesianPointVector &coordinateVector);
276 static pandora::StatusCode
GetAverageZ(
const pandora::Cluster *
const pCluster,
const float xmin,
const float xmax,
float &averageZ);
284 static bool SortByNOccupiedLayers(
const pandora::Cluster *
const pLhs,
const pandora::Cluster *
const pRhs);
292 static bool SortByNHits(
const pandora::Cluster *
const pLhs,
const pandora::Cluster *
const pRhs);
300 static bool SortByLayerSpan(
const pandora::Cluster *
const pLhs,
const pandora::Cluster *
const pRhs);
308 static bool SortByInnerLayer(
const pandora::Cluster *
const pLhs,
const pandora::Cluster *
const pRhs);
316 static bool SortByPosition(
const pandora::Cluster *
const pLhs,
const pandora::Cluster *
const pRhs);
324 static bool SortByPulseHeight(
const pandora::Cluster *
const pLhs,
const pandora::Cluster *
const pRhs);
332 static bool SortHitsByPosition(
const pandora::CaloHit *
const pLhs,
const pandora::CaloHit *
const pRhs);
340 static bool SortHitsByPulseHeight(
const pandora::CaloHit *
const pLhs,
const pandora::CaloHit *
const pRhs);
353 #endif // #ifndef LAR_CLUSTER_HELPER_H static bool SortByNHits(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by number of hits, then layer span, then inner layer, then position, then pulse-height.
static unsigned int GetLayerSpan(const pandora::Cluster *const pCluster)
Get number of layers spanned by cluster (1+Last-First)
static bool SortHitsByPulseHeight(const pandora::CaloHit *const pLhs, const pandora::CaloHit *const pRhs)
Sort calo hits by their pulse height.
static void GetClusterSpanZ(const pandora::Cluster *const pCluster, const float xmin, const float xmax, float &zmin, float &zmax)
Get upper and lower Z positions of the calo hits in a cluster in range xmin to xmax.
static void GetClustersByHitType(const pandora::ClusterList &inputClusters, const pandora::HitType hitType, pandora::ClusterList &clusterList)
Get the subset of clusters, from a provided list, that match the specified hit type.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
static void GetClosestPositions(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, pandora::CartesianVector &position1, pandora::CartesianVector &position2)
Get pair of closest positions for a pair of clusters.
static pandora::StatusCode GetAverageZ(const pandora::Cluster *const pCluster, const float xmin, const float xmax, float &averageZ)
Get average Z positions of the calo hits in a cluster in range xmin to xmax.
static bool SortByPulseHeight(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by pulse-height.
static void GetClustersUVW(const pandora::ClusterList &inputClusters, pandora::ClusterList &clusterListU, pandora::ClusterList &clusterListV, pandora::ClusterList &clusterListW)
Divide an input cluster list into separate u, v and w lists (exception raised if alternative hit type...
static bool SortCoordinatesByPosition(const pandora::CartesianVector &lhs, const pandora::CartesianVector &rhs)
Sort cartesian vectors by their position (use Z, followed by X, followed by Y)
static bool SortByPosition(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by position, then pulse-height.
static void GetClusterBoundingBox(const pandora::Cluster *const pCluster, pandora::CartesianVector &minimumCoordinate, pandora::CartesianVector &maximumCoordinate)
Get minimum and maximum X, Y and Z positions of the calo hits in a cluster.
static float GetEnergyFromLength(const pandora::Cluster *const pCluster)
Get energy of cluster, based on length.
static bool SortHitsByPosition(const pandora::CaloHit *const pLhs, const pandora::CaloHit *const pRhs)
Sort calo hits by their position (use Z, followed by X, followed by Y)
static float GetLength(const pandora::Cluster *const pCluster)
Get length of cluster.
static bool SortByLayerSpan(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by layer span, then inner layer, then position, then pulse-height.
static float GetLayerOccupancy(const pandora::Cluster *const pCluster)
Fraction of occupied layers in cluster.
static void GetExtremalCoordinates(const pandora::ClusterList &clusterList, pandora::CartesianVector &innerCoordinate, pandora::CartesianVector &outerCoordinate)
Get positions of the two most distant calo hits in a list of cluster (ordered by Z) ...
static void GetClusterSpanX(const pandora::Cluster *const pCluster, float &xmin, float &xmax)
Get minimum and maximum X positions of the calo hits in a cluster.
static float GetLengthSquared(const pandora::Cluster *const pCluster)
Get length squared of cluster.
static void GetCoordinateVector(const pandora::Cluster *const pCluster, pandora::CartesianPointVector &coordinateVector)
Get vector of hit coordinates from an input cluster.
static pandora::CartesianVector GetClosestPosition(const pandora::CartesianVector &position, const pandora::ClusterList &clusterList)
Get closest position in a list of clusters to a specified input position vector.
static float GetClosestDistance(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2)
Get closest distance between clusters in a pair of cluster lists.
static bool SortByNOccupiedLayers(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by number of occupied layers, and by inner layer, then energy in event of a tie...
static bool SortByInnerLayer(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by inner layer, then position, then pulse-height.