LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
LArClusterHelper.h
Go to the documentation of this file.
1 
8 #ifndef LAR_CLUSTER_HELPER_H
9 #define LAR_CLUSTER_HELPER_H 1
10 
11 #include "Objects/Cluster.h"
12 
13 namespace lar_content
14 {
15 
20 {
21 public:
29  static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster);
30 
39  static void GetClustersUVW(const pandora::ClusterList &inputClusters, pandora::ClusterList &clusterListU,
40  pandora::ClusterList &clusterListV, pandora::ClusterList &clusterListW);
41 
49  static void GetClustersByHitType(const pandora::ClusterList &inputClusters, const pandora::HitType hitType,
50  pandora::ClusterList &clusterList);
51 
59  static float GetLengthSquared(const pandora::Cluster *const pCluster);
60 
68  static float GetLength(const pandora::Cluster *const pCluster);
69 
77  static float GetEnergyFromLength(const pandora::Cluster *const pCluster);
78 
86  static unsigned int GetLayerSpan(const pandora::Cluster *const pCluster);
87 
95  static float GetLayerOccupancy(const pandora::Cluster *const pCluster);
96 
105  static float GetLayerOccupancy(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2);
106 
115  static float GetClosestDistance(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2);
116 
125  static float GetClosestDistance(const pandora::Cluster *const pCluster, const pandora::ClusterList &clusterList);
126 
135  static float GetClosestDistance(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2);
136 
145  static float GetClosestDistance(const pandora::CartesianVector &position, const pandora::ClusterList &clusterList);
146 
155  static float GetClosestDistance(const pandora::CartesianVector &position, const pandora::Cluster *const pCluster);
156 
165  static pandora::CartesianVector GetClosestPosition(const pandora::CartesianVector &position, const pandora::ClusterList &clusterList);
166 
175  static pandora::CartesianVector GetClosestPosition(const pandora::CartesianVector &position, const pandora::Cluster *const pCluster);
176 
185  static void GetClosestPositions(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2,
186  pandora::CartesianVector &position1, pandora::CartesianVector &position2);
187 
195  static void GetExtremalCoordinates(const pandora::ClusterList &clusterList, pandora::CartesianVector &innerCoordinate,
196  pandora::CartesianVector &outerCoordinate);
197 
205  static void GetExtremalCoordinates(const pandora::Cluster *const pCluster, pandora::CartesianVector &innerCoordinate,
206  pandora::CartesianVector &outerCoordinate);
207 
215  static void GetExtremalCoordinates(const pandora::OrderedCaloHitList &orderedCaloHitList, pandora::CartesianVector &innerCoordinate,
216  pandora::CartesianVector &outerCoordinate);
217 
225  static void GetExtremalCoordinates(const pandora::CartesianPointVector &coordinateVector, pandora::CartesianVector &innerCoordinate,
226  pandora::CartesianVector &outerCoordinate);
227 
235  static void GetClusterBoundingBox(const pandora::Cluster *const pCluster, pandora::CartesianVector &minimumCoordinate,
236  pandora::CartesianVector &maximumCoordinate);
237 
245  static void GetClusterSpanX(const pandora::Cluster *const pCluster, float &xmin, float &xmax);
246 
256  static void GetClusterSpanZ(const pandora::Cluster *const pCluster, const float xmin, const float xmax, float &zmin, float &zmax);
257 
264  static void GetCoordinateVector(const pandora::Cluster *const pCluster, pandora::CartesianPointVector &coordinateVector);
265 
276  static pandora::StatusCode GetAverageZ(const pandora::Cluster *const pCluster, const float xmin, const float xmax, float &averageZ);
277 
284  static bool SortByNOccupiedLayers(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs);
285 
292  static bool SortByNHits(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs);
293 
300  static bool SortByLayerSpan(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs);
301 
308  static bool SortByInnerLayer(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs);
309 
316  static bool SortByPosition(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs);
317 
324  static bool SortByPulseHeight(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs);
325 
332  static bool SortHitsByPosition(const pandora::CaloHit *const pLhs, const pandora::CaloHit *const pRhs);
333 
340  static bool SortHitsByPulseHeight(const pandora::CaloHit *const pLhs, const pandora::CaloHit *const pRhs);
341 
348  static bool SortCoordinatesByPosition(const pandora::CartesianVector &lhs, const pandora::CartesianVector &rhs);
349 };
350 
351 } // namespace lar_content
352 
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.
LArClusterHelper class.
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.