LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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:
22  typedef std::set<unsigned int> UIntSet;
23 
31  static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster);
32 
41  static void GetClustersUVW(const pandora::ClusterList &inputClusters, pandora::ClusterList &clusterListU,
42  pandora::ClusterList &clusterListV, pandora::ClusterList &clusterListW);
43 
51  static void GetClustersByHitType(const pandora::ClusterList &inputClusters, const pandora::HitType hitType, pandora::ClusterList &clusterList);
52 
60  static float GetLengthSquared(const pandora::Cluster *const pCluster);
61 
69  static float GetLength(const pandora::Cluster *const pCluster);
70 
78  static float GetEnergyFromLength(const pandora::Cluster *const pCluster);
79 
87  static unsigned int GetLayerSpan(const pandora::Cluster *const pCluster);
88 
96  static float GetLayerOccupancy(const pandora::Cluster *const pCluster);
97 
106  static float GetLayerOccupancy(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2);
107 
116  static float GetClosestDistance(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2);
117 
126  static float GetClosestDistance(const pandora::Cluster *const pCluster, const pandora::ClusterList &clusterList);
127 
136  static float GetClosestDistance(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2);
137 
146  static float GetClosestDistance(const pandora::CartesianVector &position, const pandora::ClusterList &clusterList);
147 
156  static float GetClosestDistance(const pandora::CartesianVector &position, const pandora::Cluster *const pCluster);
157 
166  static float GetClosestDistance(const pandora::CartesianVector &position, const pandora::CaloHitList &caloHitList);
167 
176  static pandora::CartesianVector GetClosestPosition(const pandora::CartesianVector &position, const pandora::ClusterList &clusterList);
177 
186  static pandora::CartesianVector GetClosestPosition(const pandora::CartesianVector &position, const pandora::Cluster *const pCluster);
187 
196  static pandora::CartesianVector GetClosestPosition(const pandora::CartesianVector &position, const pandora::CaloHitList &caloHitList);
197 
206  static pandora::CartesianVector GetClosestPosition(const pandora::CartesianVector &position, const pandora::OrderedCaloHitList &caloHitList);
207 
216  static void GetClosestPositions(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2,
217  pandora::CartesianVector &position1, pandora::CartesianVector &position2);
218 
226  static void GetExtremalCoordinates(
227  const pandora::ClusterList &clusterList, pandora::CartesianVector &innerCoordinate, pandora::CartesianVector &outerCoordinate);
228 
236  static void GetExtremalCoordinates(
237  const pandora::Cluster *const pCluster, pandora::CartesianVector &innerCoordinate, pandora::CartesianVector &outerCoordinate);
238 
246  static void GetExtremalCoordinates(const pandora::OrderedCaloHitList &orderedCaloHitList, pandora::CartesianVector &innerCoordinate,
247  pandora::CartesianVector &outerCoordinate);
248 
256  static void GetExtremalCoordinates(const pandora::CartesianPointVector &coordinateVector, pandora::CartesianVector &innerCoordinate,
257  pandora::CartesianVector &outerCoordinate);
258 
266  static void GetClusterBoundingBox(
267  const pandora::Cluster *const pCluster, pandora::CartesianVector &minimumCoordinate, pandora::CartesianVector &maximumCoordinate);
268 
275  static void GetCoordinateVector(const pandora::Cluster *const pCluster, pandora::CartesianPointVector &coordinateVector);
276 
285  static void GetCaloHitListInBoundingBox(const pandora::Cluster *const pCluster, const pandora::CartesianVector &lowerBound,
286  const pandora::CartesianVector &upperBound, pandora::CaloHitList &caloHitList);
287 
294  static void GetDaughterVolumeIDs(const pandora::Cluster *const pCluster, UIntSet &daughterVolumeIds);
295 
306  static pandora::StatusCode GetAverageZ(const pandora::Cluster *const pCluster, const float xmin, const float xmax, float &averageZ);
307 
314  static bool SortByNOccupiedLayers(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs);
315 
322  static bool SortByNHits(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs);
323 
330  static bool SortByLayerSpan(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs);
331 
338  static bool SortByInnerLayer(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs);
339 
346  static bool SortByPosition(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs);
347 
354  static bool SortByPulseHeight(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs);
355 
362  static bool SortHitsByPosition(const pandora::CaloHit *const pLhs, const pandora::CaloHit *const pRhs);
363 
370  static bool SortHitsByPositionInX(const pandora::CaloHit *const pLhs, const pandora::CaloHit *const pRhs);
371 
378  static bool SortHitsByPulseHeight(const pandora::CaloHit *const pLhs, const pandora::CaloHit *const pRhs);
379 
386  static bool SortCoordinatesByPosition(const pandora::CartesianVector &lhs, const pandora::CartesianVector &rhs);
387 };
388 
389 } // namespace lar_content
390 
391 #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...
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) ...
HitType
Definition: HitType.h:12
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.