8 #ifndef LAR_CLUSTER_HELPER_H
9 #define LAR_CLUSTER_HELPER_H 1
11 #include "Objects/Cluster.h"
31 static pandora::HitType
GetClusterHitType(
const pandora::Cluster *
const pCluster);
41 static void GetClustersUVW(
const pandora::ClusterList &inputClusters, pandora::ClusterList &clusterListU,
42 pandora::ClusterList &clusterListV, pandora::ClusterList &clusterListW);
51 static void GetClustersByHitType(
const pandora::ClusterList &inputClusters,
const pandora::HitType hitType, pandora::ClusterList &clusterList);
69 static float GetLength(
const pandora::Cluster *
const pCluster);
87 static unsigned int GetLayerSpan(
const pandora::Cluster *
const pCluster);
106 static float GetLayerOccupancy(
const pandora::Cluster *
const pCluster1,
const pandora::Cluster *
const pCluster2);
116 static float GetClosestDistance(
const pandora::ClusterList &clusterList1,
const pandora::ClusterList &clusterList2);
126 static float GetClosestDistance(
const pandora::Cluster *
const pCluster,
const pandora::ClusterList &clusterList);
136 static float GetClosestDistance(
const pandora::Cluster *
const pCluster1,
const pandora::Cluster *
const pCluster2);
146 static float GetClosestDistance(
const pandora::CartesianVector &position,
const pandora::ClusterList &clusterList);
156 static float GetClosestDistance(
const pandora::CartesianVector &position,
const pandora::Cluster *
const pCluster);
166 static float GetClosestDistance(
const pandora::CartesianVector &position,
const pandora::CaloHitList &caloHitList);
176 static pandora::CartesianVector
GetClosestPosition(
const pandora::CartesianVector &position,
const pandora::ClusterList &clusterList);
186 static pandora::CartesianVector
GetClosestPosition(
const pandora::CartesianVector &position,
const pandora::Cluster *
const pCluster);
196 static pandora::CartesianVector
GetClosestPosition(
const pandora::CartesianVector &position,
const pandora::CaloHitList &caloHitList);
206 static void GetClosestPositions(
const pandora::Cluster *
const pCluster1,
const pandora::Cluster *
const pCluster2,
207 pandora::CartesianVector &position1, pandora::CartesianVector &position2);
217 const pandora::ClusterList &clusterList, pandora::CartesianVector &innerCoordinate, pandora::CartesianVector &outerCoordinate);
227 const pandora::Cluster *
const pCluster, pandora::CartesianVector &innerCoordinate, pandora::CartesianVector &outerCoordinate);
236 static void GetExtremalCoordinates(
const pandora::OrderedCaloHitList &orderedCaloHitList, pandora::CartesianVector &innerCoordinate,
237 pandora::CartesianVector &outerCoordinate);
246 static void GetExtremalCoordinates(
const pandora::CartesianPointVector &coordinateVector, pandora::CartesianVector &innerCoordinate,
247 pandora::CartesianVector &outerCoordinate);
257 const pandora::Cluster *
const pCluster, pandora::CartesianVector &minimumCoordinate, pandora::CartesianVector &maximumCoordinate);
265 static void GetCoordinateVector(
const pandora::Cluster *
const pCluster, pandora::CartesianPointVector &coordinateVector);
276 const pandora::CartesianVector &upperBound, pandora::CaloHitList &caloHitList);
296 static pandora::StatusCode
GetAverageZ(
const pandora::Cluster *
const pCluster,
const float xmin,
const float xmax,
float &averageZ);
304 static bool SortByNOccupiedLayers(
const pandora::Cluster *
const pLhs,
const pandora::Cluster *
const pRhs);
312 static bool SortByNHits(
const pandora::Cluster *
const pLhs,
const pandora::Cluster *
const pRhs);
320 static bool SortByLayerSpan(
const pandora::Cluster *
const pLhs,
const pandora::Cluster *
const pRhs);
328 static bool SortByInnerLayer(
const pandora::Cluster *
const pLhs,
const pandora::Cluster *
const pRhs);
336 static bool SortByPosition(
const pandora::Cluster *
const pLhs,
const pandora::Cluster *
const pRhs);
344 static bool SortByPulseHeight(
const pandora::Cluster *
const pLhs,
const pandora::Cluster *
const pRhs);
352 static bool SortHitsByPosition(
const pandora::CaloHit *
const pLhs,
const pandora::CaloHit *
const pRhs);
360 static bool SortHitsByPositionInX(
const pandora::CaloHit *
const pLhs,
const pandora::CaloHit *
const pRhs);
368 static bool SortHitsByPulseHeight(
const pandora::CaloHit *
const pLhs,
const pandora::CaloHit *
const pRhs);
381 #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 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 void GetDaughterVolumeIDs(const pandora::Cluster *const pCluster, UIntSet &daughterVolumeIds)
Get the set of the daughter volumes that contains the cluster.
static bool SortHitsByPositionInX(const pandora::CaloHit *const pLhs, const pandora::CaloHit *const pRhs)
Sort calo hits by their position (use X, followed by Z, followed by Y)
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...
process_name pandoraGausCryo1 vertexChargeCryo1 vertexStubCryo1 xmin
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 void GetCaloHitListInBoundingBox(const pandora::Cluster *const pCluster, const pandora::CartesianVector &lowerBound, const pandora::CartesianVector &upperBound, pandora::CaloHitList &caloHitList)
Get list of Calo hits from an input cluster that are contained in a bounding box. The hits are sorted...
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.
std::set< unsigned int > UIntSet
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 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.