LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar_content::LArClusterHelper Class Reference

LArClusterHelper class. More...

#include "LArClusterHelper.h"

Public Types

typedef std::set< unsigned int > UIntSet
 

Static Public Member Functions

static pandora::HitType GetClusterHitType (const pandora::Cluster *const pCluster)
 Get the hit type associated with a two dimensional cluster. More...
 
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 encountered) More...
 
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. More...
 
static float GetLengthSquared (const pandora::Cluster *const pCluster)
 Get length squared of cluster. More...
 
static float GetLength (const pandora::Cluster *const pCluster)
 Get length of cluster. More...
 
static float GetEnergyFromLength (const pandora::Cluster *const pCluster)
 Get energy of cluster, based on length. More...
 
static unsigned int GetLayerSpan (const pandora::Cluster *const pCluster)
 Get number of layers spanned by cluster (1+Last-First) More...
 
static float GetLayerOccupancy (const pandora::Cluster *const pCluster)
 Fraction of occupied layers in cluster. More...
 
static float GetLayerOccupancy (const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2)
 Fraction of occupied layers in a pair of clusters. More...
 
static float GetClosestDistance (const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2)
 Get closest distance between clusters in a pair of cluster lists. More...
 
static float GetClosestDistance (const pandora::Cluster *const pCluster, const pandora::ClusterList &clusterList)
 Get closest distance between a specified cluster and list of clusters. More...
 
static float GetClosestDistance (const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2)
 Get closest distance between a pair of clusters. More...
 
static float GetClosestDistance (const pandora::CartesianVector &position, const pandora::ClusterList &clusterList)
 Get closest distance between a specified position and list of clusters. More...
 
static float GetClosestDistance (const pandora::CartesianVector &position, const pandora::Cluster *const pCluster)
 Get closest distance between a specified position vector and the hits in a specified cluster. More...
 
static float GetClosestDistance (const pandora::CartesianVector &position, const pandora::CaloHitList &caloHitList)
 Get closest distance between a specified position vector and the hits in a specified calo hit list. More...
 
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. More...
 
static pandora::CartesianVector GetClosestPosition (const pandora::CartesianVector &position, const pandora::Cluster *const pCluster)
 Get closest position on a cluster to a specified input position vector. More...
 
static pandora::CartesianVector GetClosestPosition (const pandora::CartesianVector &position, const pandora::CaloHitList &caloHitList)
 Get closest position of hits in a given calo hit list to a specified input position vector. More...
 
static pandora::CartesianVector GetClosestPosition (const pandora::CartesianVector &position, const pandora::OrderedCaloHitList &caloHitList)
 Get closest position of hits in a given calo hit list to a specified input position vector. More...
 
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. More...
 
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) More...
 
static void GetExtremalCoordinates (const pandora::Cluster *const pCluster, pandora::CartesianVector &innerCoordinate, pandora::CartesianVector &outerCoordinate)
 Get positions of the two most distant calo hits in a cluster (ordered by Z) More...
 
static void GetExtremalCoordinates (const pandora::OrderedCaloHitList &orderedCaloHitList, pandora::CartesianVector &innerCoordinate, pandora::CartesianVector &outerCoordinate)
 Get positions of the two most distant calo hits in an ordered calo hit list (ordered by Z) More...
 
static void GetExtremalCoordinates (const pandora::CartesianPointVector &coordinateVector, pandora::CartesianVector &innerCoordinate, pandora::CartesianVector &outerCoordinate)
 Get positions of the two most distant points in a provided list (ordered by Z) More...
 
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. More...
 
static void GetCoordinateVector (const pandora::Cluster *const pCluster, pandora::CartesianPointVector &coordinateVector)
 Get vector of hit coordinates from an input cluster. More...
 
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 by position. More...
 
static void GetDaughterVolumeIDs (const pandora::Cluster *const pCluster, UIntSet &daughterVolumeIds)
 Get the set of the daughter volumes that contains the cluster. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
static bool SortByInnerLayer (const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
 Sort clusters by inner layer, then position, then pulse-height. More...
 
static bool SortByPosition (const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
 Sort clusters by position, then pulse-height. More...
 
static bool SortByPulseHeight (const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
 Sort clusters by pulse-height. More...
 
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) More...
 
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) More...
 
static bool SortHitsByPulseHeight (const pandora::CaloHit *const pLhs, const pandora::CaloHit *const pRhs)
 Sort calo hits by their pulse height. More...
 
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) More...
 

Detailed Description

LArClusterHelper class.

Definition at line 19 of file LArClusterHelper.h.

Member Typedef Documentation

typedef std::set<unsigned int> lar_content::LArClusterHelper::UIntSet

Definition at line 22 of file LArClusterHelper.h.

Member Function Documentation

StatusCode lar_content::LArClusterHelper::GetAverageZ ( const pandora::Cluster *const  pCluster,
const float  xmin,
const float  xmax,
float &  averageZ 
)
static

Get average Z positions of the calo hits in a cluster in range xmin to xmax.

Parameters
pClusteraddress of the cluster
xminfor range in x
xmaxfor range in x
averageZto receive the average Z position
Returns
status code, faster than throwing in regular use-cases

Definition at line 388 of file LArClusterHelper.cc.

References f.

Referenced by lar_content::ThreeViewRemnantsAlgorithm::CalculateOverlapResult(), lar_content::ParticleRecoveryAlgorithm::CheckConsistency(), and lar_content::CosmicRayShowerMatchingAlgorithm::CheckMatchedClusters3D().

389 {
390  averageZ = std::numeric_limits<float>::max();
391 
392  if (xmin > xmax)
393  return STATUS_CODE_INVALID_PARAMETER;
394 
395  const OrderedCaloHitList &orderedCaloHitList(pCluster->GetOrderedCaloHitList());
396 
397  float zsum(0.f);
398  int count(0);
399 
400  for (OrderedCaloHitList::const_iterator ochIter = orderedCaloHitList.begin(), ochIterEnd = orderedCaloHitList.end(); ochIter != ochIterEnd; ++ochIter)
401  {
402  for (CaloHitList::const_iterator hIter = ochIter->second->begin(), hIterEnd = ochIter->second->end(); hIter != hIterEnd; ++hIter)
403  {
404  const CaloHit *const pCaloHit = *hIter;
405  const CartesianVector &hit(pCaloHit->GetPositionVector());
406 
407  if (hit.GetX() < xmin || hit.GetX() > xmax)
408  continue;
409 
410  zsum += hit.GetZ();
411  ++count;
412  }
413  }
414 
415  if (count == 0)
416  return STATUS_CODE_NOT_FOUND;
417 
418  averageZ = zsum / static_cast<float>(count);
419  return STATUS_CODE_SUCCESS;
420 }
intermediate_table::const_iterator const_iterator
TFile f
Definition: plotHisto.C:6
Detector simulation of raw signals on wires.
void lar_content::LArClusterHelper::GetCaloHitListInBoundingBox ( const pandora::Cluster *const  pCluster,
const pandora::CartesianVector &  lowerBound,
const pandora::CartesianVector &  upperBound,
pandora::CaloHitList &  caloHitList 
)
static

Get list of Calo hits from an input cluster that are contained in a bounding box. The hits are sorted by position.

Parameters
pClusteraddress of the cluster
lowerBoundone opposing corner of the bounding box
upperBoundthe other opposing corner of the bounding box
caloHitListthe CaloHitList to be filled

Definition at line 586 of file LArClusterHelper.cc.

References maxY, and minY.

Referenced by lar_content::TwoViewTransverseTracksAlgorithm::TwoViewTransverseTracksAlgorithm().

588 {
589  const bool useX(std::fabs(upperBound.GetX() - lowerBound.GetX()) > std::numeric_limits<float>::epsilon());
590  const bool useY(std::fabs(upperBound.GetY() - lowerBound.GetY()) > std::numeric_limits<float>::epsilon());
591  const bool useZ(std::fabs(upperBound.GetZ() - lowerBound.GetZ()) > std::numeric_limits<float>::epsilon());
592  if (!useX && !useY && !useZ)
593  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
594 
595  const float minX(std::min(lowerBound.GetX(), upperBound.GetX()));
596  const float maxX(std::max(lowerBound.GetX(), upperBound.GetX()));
597  const float minY(std::min(lowerBound.GetY(), upperBound.GetY()));
598  const float maxY(std::max(lowerBound.GetY(), upperBound.GetY()));
599  const float minZ(std::min(lowerBound.GetZ(), upperBound.GetZ()));
600  const float maxZ(std::max(lowerBound.GetZ(), upperBound.GetZ()));
601 
602  for (const OrderedCaloHitList::value_type &layerEntry : pCluster->GetOrderedCaloHitList())
603  {
604  for (const CaloHit *const pCaloHit : *layerEntry.second)
605  {
606  const CartesianVector &hitPosition = pCaloHit->GetPositionVector();
607  if (useX &&
608  (hitPosition.GetX() < minX - std::numeric_limits<float>::epsilon() || hitPosition.GetX() > maxX + std::numeric_limits<float>::epsilon()))
609  continue;
610  else if (useY &&
611  (hitPosition.GetY() < minY - std::numeric_limits<float>::epsilon() || hitPosition.GetY() > maxY + std::numeric_limits<float>::epsilon()))
612  continue;
613  else if (useZ &&
614  (hitPosition.GetZ() < minZ - std::numeric_limits<float>::epsilon() || hitPosition.GetZ() > maxZ + std::numeric_limits<float>::epsilon()))
615  continue;
616 
617  caloHitList.push_back(pCaloHit);
618  }
619  }
620  caloHitList.sort(LArClusterHelper::SortHitsByPosition);
621 }
double minY
Definition: plot_hist.C:9
double maxY
Definition: plot_hist.C:10
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 lar_content::LArClusterHelper::GetClosestDistance ( const pandora::ClusterList &  clusterList1,
const pandora::ClusterList &  clusterList2 
)
static

Get closest distance between clusters in a pair of cluster lists.

Parameters
clusterList1the first cluster list
clusterList2the second cluster list
Returns
the closest distance

Referenced by lar_content::LArMuonLeadingHelper::AddInPostBremsstrahlungHits(), lar_content::TrackRefinementBaseAlgorithm::AddToNearestCluster(), lar_content::ShowerGrowingAlgorithm::AreClustersAssociated(), lar_content::NeutrinoDaughterVerticesAlgorithm::BuildDaughterTrack(), lar_content::OvershootSplittingAlgorithm::BuildIntersectionMap(), lar_content::SplitShowersTool::CheckClusterProximities(), lar_content::CosmicRayTrackMatchingAlgorithm::CheckMatchedClusters3D(), lar_content::NearbyClusterMopUpAlgorithm::ClusterMopUp(), lar_content::CosmicRayRemovalTool::CollectHitsFromDeltaRay(), lar_content::TwoViewCosmicRayRemovalTool::CollectHitsFromDeltaRay(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::CollectStrayClusters(), lar_content::CosmicRaySplittingAlgorithm::ConfirmSplitPosition(), lar_content::CosmicRayRemovalTool::CreateSeed(), lar_content::TwoViewCosmicRayRemovalTool::CreateSeed(), lar_content::MuonLeadingEventValidationAlgorithm::FillContaminationHitsDistance(), lar_content::AmbiguousRegionFeatureTool::FindAmbiguousContinuousSpine(), lar_content::DeltaRaySplittingAlgorithm::FindBestSplitPosition(), lar_content::CrossedTrackSplittingAlgorithm::FindBestSplitPosition(), lar_content::ElectronInitialRegionRefinementAlgorithm::FindContinuousPath(), lar_content::DeltaRayMergeTool::FindVertices(), lar_content::TrackRefinementBaseAlgorithm::FragmentRemnantCluster(), lar_content::LocalAsymmetryFeatureTool::GetAsymmetryForView(), lar_content::GlobalAsymmetryFeatureTool::GetAsymmetryForView(), lar_content::DeltaRayIdentificationAlgorithm::GetClosestDistance(), lar_content::LArMuonLeadingHelper::GetClosestPosition(), lar_content::DeltaRayMatchingAlgorithm::GetDistanceSquaredToPfo(), lar_content::TransverseExtensionAlgorithm::GetListOfCleanClusters(), lar_content::DeltaRayGrowingAlgorithm::GetListOfSeedClusters(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::GetProjectedPositions(), lar_content::DeltaRayParentAlgorithm::GetTwoDSeparation(), lar_content::CutClusterCharacterisationAlgorithm::GetVertexDistance(), lar_content::SimpleClusterMergingAlgorithm::IsAssociated(), lar_content::DeltaRayMergeTool::IsBrokenCluster(), lar_content::UnambiguousDeltaRayTool::IsConnected(), lar_content::ConnectedRemnantsTool::IsConnected(), lar_content::DeltaRayMergeTool::IsConnected(), lar_content::DeltaRayMergeTool::IsHiddenByTrack(), lar_content::TwoViewCosmicRayRemovalTool::PassElementChecks(), lar_content::RemovalBaseTool::PassElementChecks(), lar_content::OneViewDeltaRayMatchingAlgorithm::PerformOneViewMatching(), lar_content::ClusterGrowingAlgorithm::PopulateClusterMergeMap(), lar_content::CosmicRayRemovalTool::ReclusterRemnant(), lar_content::TwoViewCosmicRayRemovalTool::ReclusterRemnant(), lar_content::VertexRefinementAlgorithm::RefineVertexTwoD(), lar_content::BranchAssociatedPfosTool::Run(), lar_content::CosmicRayTrackMatchingAlgorithm::SelectCleanClusters(), and lar_content::ShowerAsymmetryFeatureTool::ShouldUseShowerCluster().

static float lar_content::LArClusterHelper::GetClosestDistance ( const pandora::Cluster *const  pCluster,
const pandora::ClusterList &  clusterList 
)
static

Get closest distance between a specified cluster and list of clusters.

Parameters
pClusteraddress of the input cluster
clusterListlist of input clusters
Returns
the closest distance
static float lar_content::LArClusterHelper::GetClosestDistance ( const pandora::Cluster *const  pCluster1,
const pandora::Cluster *const  pCluster2 
)
static

Get closest distance between a pair of clusters.

Parameters
pCluster1address of the first cluster
pCluster2address of the second cluster
Returns
the closest distance
static float lar_content::LArClusterHelper::GetClosestDistance ( const pandora::CartesianVector &  position,
const pandora::ClusterList &  clusterList 
)
static

Get closest distance between a specified position and list of clusters.

Parameters
positionthe position vector
clusterListlist of input clusters
Returns
the closest distance
static float lar_content::LArClusterHelper::GetClosestDistance ( const pandora::CartesianVector &  position,
const pandora::Cluster *const  pCluster 
)
static

Get closest distance between a specified position vector and the hits in a specified cluster.

Parameters
positionthe position vector
pClusteraddress of the cluster
Returns
the closest distance
static float lar_content::LArClusterHelper::GetClosestDistance ( const pandora::CartesianVector &  position,
const pandora::CaloHitList &  caloHitList 
)
static

Get closest distance between a specified position vector and the hits in a specified calo hit list.

Parameters
positionthe position vector
caloHitListthe list of calo hits
Returns
the closest distance
static pandora::CartesianVector lar_content::LArClusterHelper::GetClosestPosition ( const pandora::CartesianVector &  position,
const pandora::Cluster *const  pCluster 
)
static

Get closest position on a cluster to a specified input position vector.

Parameters
positionthe position vector
pClusteraddress of the cluster
Returns
the closest position
static pandora::CartesianVector lar_content::LArClusterHelper::GetClosestPosition ( const pandora::CartesianVector &  position,
const pandora::CaloHitList &  caloHitList 
)
static

Get closest position of hits in a given calo hit list to a specified input position vector.

Parameters
positionthe position vector
caloHitListthe list of calo hits
Returns
the closest position
static pandora::CartesianVector lar_content::LArClusterHelper::GetClosestPosition ( const pandora::CartesianVector &  position,
const pandora::OrderedCaloHitList &  caloHitList 
)
static

Get closest position of hits in a given calo hit list to a specified input position vector.

Parameters
positionthe position vector
caloHitListthe list of calo hits
Returns
the closest position
void lar_content::LArClusterHelper::GetClosestPositions ( const pandora::Cluster *const  pCluster1,
const pandora::Cluster *const  pCluster2,
pandora::CartesianVector &  position1,
pandora::CartesianVector &  position2 
)
static

Get pair of closest positions for a pair of clusters.

Parameters
pCluster1the address of the first cluster
pCluster2the address of the second cluster
theclosest position in the first cluster
theclosest position in the second cluster

Definition at line 307 of file LArClusterHelper.cc.

References f.

Referenced by lar_content::NeutrinoDaughterVerticesAlgorithm::BuildDaughterShower(), lar_content::EndAssociatedPfosTool::IsCloseToParentEndpoint(), lar_content::DeltaRayRemovalTool::IsContaminated(), lar_content::CosmicRayRemovalTool::IsContaminated(), and lar_content::TwoViewCosmicRayRemovalTool::IsContaminated().

309 {
310  bool distanceFound(false);
311  float minDistanceSquared(std::numeric_limits<float>::max());
312 
313  CartesianVector closestPosition1(0.f, 0.f, 0.f);
314  CartesianVector closestPosition2(0.f, 0.f, 0.f);
315 
316  const OrderedCaloHitList &orderedCaloHitList1(pCluster1->GetOrderedCaloHitList());
317  const OrderedCaloHitList &orderedCaloHitList2(pCluster2->GetOrderedCaloHitList());
318 
319  // Loop over hits in cluster 1
320  for (OrderedCaloHitList::const_iterator iter1 = orderedCaloHitList1.begin(), iter1End = orderedCaloHitList1.end(); iter1 != iter1End; ++iter1)
321  {
322  for (CaloHitList::const_iterator hitIter1 = iter1->second->begin(), hitIter1End = iter1->second->end(); hitIter1 != hitIter1End; ++hitIter1)
323  {
324  const CartesianVector &positionVector1((*hitIter1)->GetPositionVector());
325 
326  // Loop over hits in cluster 2
327  for (OrderedCaloHitList::const_iterator iter2 = orderedCaloHitList2.begin(), iter2End = orderedCaloHitList2.end(); iter2 != iter2End; ++iter2)
328  {
329  for (CaloHitList::const_iterator hitIter2 = iter2->second->begin(), hitIter2End = iter2->second->end(); hitIter2 != hitIter2End; ++hitIter2)
330  {
331  const CartesianVector &positionVector2((*hitIter2)->GetPositionVector());
332 
333  const float distanceSquared((positionVector1 - positionVector2).GetMagnitudeSquared());
334 
335  if (distanceSquared < minDistanceSquared)
336  {
337  minDistanceSquared = distanceSquared;
338  closestPosition1 = positionVector1;
339  closestPosition2 = positionVector2;
340  distanceFound = true;
341  }
342  }
343  }
344  }
345  }
346 
347  if (!distanceFound)
348  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
349 
350  outputPosition1 = closestPosition1;
351  outputPosition2 = closestPosition2;
352 }
intermediate_table::const_iterator const_iterator
TFile f
Definition: plotHisto.C:6
void lar_content::LArClusterHelper::GetClusterBoundingBox ( const pandora::Cluster *const  pCluster,
pandora::CartesianVector &  minimumCoordinate,
pandora::CartesianVector &  maximumCoordinate 
)
static

Get minimum and maximum X, Y and Z positions of the calo hits in a cluster.

Parameters
pClusteraddress of the cluster
theminimum positions (x,y,z)
themaximum positions (x,y,z)

Definition at line 356 of file LArClusterHelper.cc.

Referenced by lar_content::ThreeViewTrackFragmentsAlgorithm::CheckMatchedClusters(), lar_content::TrainedVertexSelectionAlgorithm::GetLegacyEventShapeFeatures(), and lar_content::CosmicRayTrackRecoveryAlgorithm::SelectCleanClusters().

357 {
358  const OrderedCaloHitList &orderedCaloHitList(pCluster->GetOrderedCaloHitList());
359 
360  float xmin(std::numeric_limits<float>::max());
361  float ymin(std::numeric_limits<float>::max());
362  float zmin(std::numeric_limits<float>::max());
363  float xmax(-std::numeric_limits<float>::max());
364  float ymax(-std::numeric_limits<float>::max());
365  float zmax(-std::numeric_limits<float>::max());
366 
367  for (OrderedCaloHitList::const_iterator ochIter = orderedCaloHitList.begin(), ochIterEnd = orderedCaloHitList.end(); ochIter != ochIterEnd; ++ochIter)
368  {
369  for (CaloHitList::const_iterator hIter = ochIter->second->begin(), hIterEnd = ochIter->second->end(); hIter != hIterEnd; ++hIter)
370  {
371  const CaloHit *const pCaloHit = *hIter;
372  const CartesianVector &hit(pCaloHit->GetPositionVector());
373  xmin = std::min(hit.GetX(), xmin);
374  xmax = std::max(hit.GetX(), xmax);
375  ymin = std::min(hit.GetY(), ymin);
376  ymax = std::max(hit.GetY(), ymax);
377  zmin = std::min(hit.GetZ(), zmin);
378  zmax = std::max(hit.GetZ(), zmax);
379  }
380  }
381 
382  minimumCoordinate.SetValues(xmin, ymin, zmin);
383  maximumCoordinate.SetValues(xmax, ymax, zmax);
384 }
intermediate_table::const_iterator const_iterator
Detector simulation of raw signals on wires.
HitType lar_content::LArClusterHelper::GetClusterHitType ( const pandora::Cluster *const  pCluster)
static

Get the hit type associated with a two dimensional cluster.

Parameters
pClusterthe address of the cluster
Returns
the cluster hit type

Definition at line 21 of file LArClusterHelper.cc.

Referenced by lar_content::ParticleRecoveryAlgorithm::SimpleOverlapTensor::AddAssociation(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::AddInStrayClusters(), lar_content::OneViewDeltaRayMatchingAlgorithm::AddIntoExistingDeltaRay(), lar_content::DeltaRayMatchingContainers::AddToClusterMap(), lar_content::DeltaRayMatchingContainers::AddToClusterProximityMap(), lar_content::DeltaRayMatchingAlgorithm::AddToDaughterPfo(), lar_content::NViewTrackMatchingAlgorithm< T >::AddToSlidingFitCache(), lar_content::ThreeViewShowersAlgorithm::AddToSlidingFitCache(), lar_content::DeltaRayMatchingAlgorithm::AreClustersMatched(), lar_content::EventSlicingTool::AssignRemainingHitsToSlices(), lar_content::CrossGapsExtensionAlgorithm::BuildPointingClusterList(), lar_content::TrackHitsBaseTool::BuildSlidingFitMap(), lar_content::CosmicRaySplittingAlgorithm::BuildSlidingFitResultMap(), lar_content::TwoDSlidingFitMultiSplitAlgorithm::BuildSlidingFitResultMap(), lar_content::CosmicRayTrackRecoveryAlgorithm::BuildSlidingFitResultMap(), lar_content::VertexBasedPfoRecoveryAlgorithm::BuildSlidingFitResultMap(), lar_content::TwoDSlidingFitSplittingAndSwitchingAlgorithm::BuildSlidingFitResultMap(), lar_content::TwoDSlidingFitSplittingAndSplicingAlgorithm::BuildSlidingFitResultMap(), lar_content::TwoDSlidingFitConsolidationAlgorithm::BuildSlidingLinearFits(), lar_content::ParticleRecoveryAlgorithm::CalculateEffectiveSpan(), lar_content::TwoDLinearFitFeatureTool::CalculateVariablesSlidingLinearFit(), lar_content::ThreeDLinearFitFeatureTool::CalculateVariablesSlidingLinearFit(), lar_content::SplitShowersTool::CheckClusterVertexRelations(), lar_content::CosmicRayShowerMatchingAlgorithm::CheckMatchedClusters3D(), lar_content::CosmicRayTrackMatchingAlgorithm::CheckMatchedClusters3D(), lar_content::TracksCrossingGapsTool::CheckXPositionInGap(), lar_content::ConeClusterMopUpAlgorithm::ClusterMopUp(), lar_content::NearbyClusterMopUpAlgorithm::ClusterMopUp(), lar_content::BoundedClusterMopUpAlgorithm::ClusterMopUp(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::CollectStrayClusters(), lar_content::EventSlicingTool::CopyPfoHitsToSlices(), lar_content::OneViewDeltaRayMatchingAlgorithm::CreateDeltaRay(), lar_content::CandidateVertexCreationAlgorithm::CreateEndpointCandidates(), lar_content::CandidateVertexCreationAlgorithm::CreateEndpointVertex(), lar_content::EventSlicingTool::CreateSlices(), lar_content::CutPfoCharacterisationAlgorithm::CutPfoCharacterisationAlgorithm(), lar_content::CrossGapsExtensionAlgorithm::FillClusterAssociationMatrix(), lar_content::DeltaRayMatchingContainers::FillClusterProximityMap(), lar_content::TransverseAssociationAlgorithm::FillTransverseClusterList(), lar_content::VertexSplittingAlgorithm::FindBestSplitPosition(), lar_content::DeltaRayMergeTool::FindVertices(), lar_content::TwoViewDeltaRayMatchingAlgorithm::FormThirdViewCluster(), lar_content::ShowerGrowingAlgorithm::GetAllVertexSeedCandidates(), lar_content::VertexBasedPfoRecoveryAlgorithm::GetAvailableClusters(), lar_content::TwoViewDeltaRayMatchingAlgorithm::GetBestMatchedCluster(), lar_content::VertexBasedPfoMopUpAlgorithm::GetClusterAssociation(), lar_content::VertexRefinementAlgorithm::GetClusterLists(), lar_content::ClusterMopUpBaseAlgorithm::GetClusterLists(), lar_content::VertexSelectionBaseAlgorithm::GetClusterLists(), lar_content::SlidingConePfoMopUpAlgorithm::GetClusterMergeMap(), lar_content::SlidingConeClusterMopUpAlgorithm::GetClusterMergeMap(), lar_content::ParticleRecoveryAlgorithm::SimpleOverlapTensor::GetConnectedElements(), lar_content::DeltaRayMatchingAlgorithm::GetDistanceSquaredToPfo(), lar_content::ShowerGrowingAlgorithm::GetFigureOfMerit(), lar_content::ParticleRecoveryAlgorithm::GetInputClusters(), lar_content::VertexBasedPfoMopUpAlgorithm::GetInputPfos(), lar_content::TransverseExtensionAlgorithm::GetListOfCleanClusters(), lar_content::LongitudinalAssociationAlgorithm::GetListOfCleanClusters(), lar_content::DeltaRayGrowingAlgorithm::GetListOfSeedClusters(), lar_content::OneViewDeltaRayMatchingAlgorithm::GetNearbyAvailableClusters(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::GetNearbyMuonPfos(), lar_content::CheatingPfoCreationAlgorithm::GetNHitTypesAboveThreshold(), lar_content::NeutrinoPropertiesAlgorithm::GetNTwoDHitsInPfoChain(), lar_pandora::LArPandoraOutput::GetPandoraToArtHitMap(), lar_content::VertexBasedPfoMopUpAlgorithm::GetPfoAssociations(), lar_content::ThreeViewTrackFragmentsAlgorithm::GetProjectedPositions(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::GetProjectedPositions(), lar_content::MissingTrackSegmentTool::GetSlidingFitResultMap(), lar_content::CutClusterCharacterisationAlgorithm::GetVertexDistance(), lar_content::TrackRefinementBaseAlgorithm::InitialiseContainers(), lar_content::CrossGapsAssociationAlgorithm::IsAssociated(), lar_content::CrossGapsExtensionAlgorithm::IsAssociated(), lar_content::PfoCharacterisationBaseAlgorithm::IsClearTrack3x2D(), lar_content::DeltaRayMergeTool::IsConnected(), lar_content::OneViewDeltaRayMatchingAlgorithm::IsDeltaRayPfo(), lar_content::OneViewDeltaRayMatchingAlgorithm::IsMuonPfo(), lar_content::CrossGapsAssociationAlgorithm::IsNearCluster(), lar_content::ParticleRecoveryAlgorithm::IsOverlap(), lar_content::UndershootTracksTool::IsThreeDKink(), lar_content::OvershootTracksTool::IsThreeDKink(), lar_content::TwoViewThreeDKinkTool::IsThreeDKink(), lar_content::TransverseAssociationAlgorithm::IsTransverseAssociated(), lar_content::SlidingConeClusterMopUpAlgorithm::MakeClusterMerges(), lar_content::NViewTrackMatchingAlgorithm< T >::MakeClusterSplits(), lar_content::CosmicRayTrackRecoveryAlgorithm::MatchClusters(), lar_content::VertexBasedPfoRecoveryAlgorithm::MatchThreeViews(), lar_content::VertexBasedPfoRecoveryAlgorithm::MatchTwoViews(), lar_content::OneViewDeltaRayMatchingAlgorithm::MergeClusterGroup(), lar_content::ThreeDChargeFeatureTool::OrderCaloHitsByDistanceToVertex(), lar_content::CosmicRayBaseMatchingAlgorithm::Particle::Particle(), lar_content::MissingTrackSegmentTool::Particle::Particle(), lar_content::VertexBasedPfoRecoveryAlgorithm::Particle::Particle(), lar_content::DeltaRayMatchingAlgorithm::Particle::Particle(), lar_content::TrackSplittingTool::PassesChecks(), lar_content::CrossGapsAssociationAlgorithm::PopulateClusterAssociationMap(), lar_content::NViewDeltaRayMatchingAlgorithm< T >::PrepareInputClusters(), lar_content::DeltaRayMatchingContainers::RemoveClusterFromContainers(), lar_content::TwoViewMatchingControl< T >::SelectAllInputClusters(), lar_content::CandidateVertexCreationAlgorithm::SelectClusters(), lar_content::VertexBasedPfoRecoveryAlgorithm::SelectClusters(), lar_content::VertexBasedPfoRecoveryAlgorithm::SelectVertexClusters(), lar_content::ThreeDHitCreationAlgorithm::SeparateTwoDHits(), lar_content::OvershootTracksTool::SetSplitPosition(), lar_content::MasterAlgorithm::StitchPfos(), lar_content::TrackConsolidationAlgorithm::TrackConsolidationAlgorithm(), lar_content::TwoDSlidingFitSplittingAlgorithm::TwoDSlidingFitSplittingAlgorithm(), lar_content::ThreeViewTrackFragmentsAlgorithm::UpdateForNewCluster(), lar_content::ThreeViewMatchingControl< T >::UpdateForNewCluster(), lar_content::TwoViewMatchingControl< T >::UpdateForNewCluster(), and lar_content::NViewDeltaRayMatchingAlgorithm< T >::UpdateUponDeletion().

22 {
23  if (0 == pCluster->GetNCaloHits())
24  throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
25 
26  // TODO Find a way of confirming single hit-type clustering mode; currently only checked in ListPreparation algorithm
27  // if (!pandora->GetSettings()->SingleHitTypeClusteringMode())
28  // throw StatusCodeException(STATUS_CODE_FAILURE);
29 
30  return (*(pCluster->GetOrderedCaloHitList().begin()->second->begin()))->GetHitType();
31 }
void lar_content::LArClusterHelper::GetClustersByHitType ( const pandora::ClusterList &  inputClusters,
const pandora::HitType  hitType,
pandora::ClusterList &  clusterList 
)
static

Get the subset of clusters, from a provided list, that match the specified hit type.

Parameters
inputClustersthe input cluster list
hitTypethe specified hit type
clusterListto receive the clusters

Definition at line 54 of file LArClusterHelper.cc.

Referenced by lar_content::CosmicRayTrackRecoveryAlgorithm::MergeClusters().

55 {
56  for (ClusterList::const_iterator iter = inputClusters.begin(), iterEnd = inputClusters.end(); iter != iterEnd; ++iter)
57  {
58  if (hitType == LArClusterHelper::GetClusterHitType(*iter))
59  clusterList.push_back(*iter);
60  }
61 }
intermediate_table::const_iterator const_iterator
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
void lar_content::LArClusterHelper::GetClustersUVW ( const pandora::ClusterList &  inputClusters,
pandora::ClusterList &  clusterListU,
pandora::ClusterList &  clusterListV,
pandora::ClusterList &  clusterListW 
)
static

Divide an input cluster list into separate u, v and w lists (exception raised if alternative hit type encountered)

Parameters
inputClustersthe input cluster list
clusterListUto receive the u clusters
clusterListVto receive the v clusters
clusterListWto receive the w clusters

Definition at line 35 of file LArClusterHelper.cc.

36 {
37  for (ClusterList::const_iterator iter = inputClusters.begin(), iterEnd = inputClusters.end(); iter != iterEnd; ++iter)
38  {
39  const HitType hitType(LArClusterHelper::GetClusterHitType(*iter));
40 
41  if (TPC_VIEW_U == hitType)
42  clusterListU.push_back(*iter);
43  else if (TPC_VIEW_V == hitType)
44  clusterListV.push_back(*iter);
45  else if (TPC_VIEW_W == hitType)
46  clusterListW.push_back(*iter);
47  else
48  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
49  }
50 }
intermediate_table::const_iterator const_iterator
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
HitType
Definition: HitType.h:12
void lar_content::LArClusterHelper::GetCoordinateVector ( const pandora::Cluster *const  pCluster,
pandora::CartesianPointVector &  coordinateVector 
)
static

Get vector of hit coordinates from an input cluster.

Parameters
pClusteraddress of the cluster
coordinateVector

Definition at line 573 of file LArClusterHelper.cc.

Referenced by lar_content::VertexSelectionBaseAlgorithm::ShowerCluster::GetClusterListCoordinateVector(), lar_content::ThreeDSlidingFitResult::GetGlobalDirection(), lar_content::TwoViewTransverseTracksAlgorithm::GetPrimaryAxisDotDriftAxis(), lar_content::TwoDSlidingShowerFitResult::GetShowerEdges(), lar_content::CandidateVertexCreationAlgorithm::GetSpacepoints(), lar_content::VertexRefinementAlgorithm::RefineVertexTwoD(), and lar_content::TwoDSlidingFitResult::TwoDSlidingFitResult().

574 {
575  for (const OrderedCaloHitList::value_type &layerEntry : pCluster->GetOrderedCaloHitList())
576  {
577  for (const CaloHit *const pCaloHit : *layerEntry.second)
578  coordinateVector.push_back(pCaloHit->GetPositionVector());
579  }
580 
581  std::sort(coordinateVector.begin(), coordinateVector.end(), LArClusterHelper::SortCoordinatesByPosition);
582 }
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)
void lar_content::LArClusterHelper::GetDaughterVolumeIDs ( const pandora::Cluster *const  pCluster,
UIntSet daughterVolumeIds 
)
static

Get the set of the daughter volumes that contains the cluster.

Parameters
pClusteraddress of the cluster
daughterVolumeIdsoutput variable

Definition at line 625 of file LArClusterHelper.cc.

References lar_content::LArCaloHit::GetDaughterVolumeId().

626 {
627  const OrderedCaloHitList &orderedCaloHitList(pCluster->GetOrderedCaloHitList());
628 
629  for (OrderedCaloHitList::const_iterator ochIter = orderedCaloHitList.begin(), ochIterEnd = orderedCaloHitList.end(); ochIter != ochIterEnd; ++ochIter)
630  {
631  for (CaloHitList::const_iterator hIter = ochIter->second->begin(), hIterEnd = ochIter->second->end(); hIter != hIterEnd; ++hIter)
632  {
633  const CaloHit *const pCaloHit(*hIter);
634  const LArCaloHit *const pLArCaloHit(dynamic_cast<const LArCaloHit *>(pCaloHit));
635 
636  if (pLArCaloHit)
637  daughterVolumeIds.insert(pLArCaloHit->GetDaughterVolumeId());
638  }
639  }
640 }
intermediate_table::const_iterator const_iterator
float lar_content::LArClusterHelper::GetEnergyFromLength ( const pandora::Cluster *const  pCluster)
static

Get energy of cluster, based on length.

Parameters
pClusteraddress of the cluster
Returns
the energy

Definition at line 104 of file LArClusterHelper.cc.

References f.

105 {
106  const float dEdX(0.002f); // approximately 2 MeV/cm
107  return (dEdX * LArClusterHelper::GetLength(pCluster));
108 }
TFile f
Definition: plotHisto.C:6
static float GetLength(const pandora::Cluster *const pCluster)
Get length of cluster.
static void lar_content::LArClusterHelper::GetExtremalCoordinates ( const pandora::Cluster *const  pCluster,
pandora::CartesianVector &  innerCoordinate,
pandora::CartesianVector &  outerCoordinate 
)
static

Get positions of the two most distant calo hits in a cluster (ordered by Z)

Parameters
pClusterthe input cluster
theinner extremal position
theouter extremal position
static void lar_content::LArClusterHelper::GetExtremalCoordinates ( const pandora::OrderedCaloHitList &  orderedCaloHitList,
pandora::CartesianVector &  innerCoordinate,
pandora::CartesianVector &  outerCoordinate 
)
static

Get positions of the two most distant calo hits in an ordered calo hit list (ordered by Z)

Parameters
orderedCaloHitListthe ordered calo hit list
theinner extremal position
theouter extremal position
static void lar_content::LArClusterHelper::GetExtremalCoordinates ( const pandora::CartesianPointVector &  coordinateVector,
pandora::CartesianVector &  innerCoordinate,
pandora::CartesianVector &  outerCoordinate 
)
static

Get positions of the two most distant points in a provided list (ordered by Z)

Parameters
coordinateVectorthe hit list
theinner extremal position
theouter extremal position
static float lar_content::LArClusterHelper::GetLayerOccupancy ( const pandora::Cluster *const  pCluster)
static
static float lar_content::LArClusterHelper::GetLayerOccupancy ( const pandora::Cluster *const  pCluster1,
const pandora::Cluster *const  pCluster2 
)
static

Fraction of occupied layers in a pair of clusters.

Parameters
pCluster1address of the first cluster
pCluster2address of the second cluster
Returns
float
unsigned int lar_content::LArClusterHelper::GetLayerSpan ( const pandora::Cluster *const  pCluster)
static

Get number of layers spanned by cluster (1+Last-First)

Parameters
pClusteraddress of the cluster
Returns
the layer span

Definition at line 112 of file LArClusterHelper.cc.

References f.

113 {
114  return (1 + pCluster->GetOuterPseudoLayer() - pCluster->GetInnerPseudoLayer());
115 }
float lar_content::LArClusterHelper::GetLength ( const pandora::Cluster *const  pCluster)
static

Get length of cluster.

Parameters
pClusteraddress of the cluster
Returns
the length

Definition at line 97 of file LArClusterHelper.cc.

Referenced by lar_content::TrackMergeRefinementAlgorithm::FindBestClusterAssociation(), and lar_content::TrainedVertexSelectionAlgorithm::IsClusterShowerLike().

98 {
99  return std::sqrt(LArClusterHelper::GetLengthSquared(pCluster));
100 }
static float GetLengthSquared(const pandora::Cluster *const pCluster)
Get length squared of cluster.
float lar_content::LArClusterHelper::GetLengthSquared ( const pandora::Cluster *const  pCluster)
static

Get length squared of cluster.

Parameters
pClusteraddress of the cluster
Returns
the length squared

Definition at line 65 of file LArClusterHelper.cc.

References maxY, and minY.

Referenced by lar_content::TrackRefinementBaseAlgorithm::AddHitsToMainTrack(), lar_content::CrossGapsExtensionAlgorithm::FillClusterAssociationMatrix(), lar_content::DeltaRayMatchingAlgorithm::FindBestParentPfo(), lar_content::OvershootSplittingAlgorithm::GetListOfCleanClusters(), lar_content::LongitudinalExtensionAlgorithm::GetListOfCleanClusters(), lar_content::DeltaRayExtensionAlgorithm::GetListOfCleanClusters(), lar_content::CrossGapsExtensionAlgorithm::GetListOfCleanClusters(), lar_content::CosmicRayExtensionAlgorithm::GetListOfCleanClusters(), lar_content::TransverseExtensionAlgorithm::GetListOfCleanClusters(), lar_content::CosmicRaySplittingAlgorithm::GetListOfCleanClusters(), lar_content::TwoDSlidingFitSplittingAndSwitchingAlgorithm::GetListOfCleanClusters(), lar_content::TwoDSlidingFitSplittingAndSplicingAlgorithm::GetListOfCleanClusters(), lar_content::DeltaRayGrowingAlgorithm::GetListOfSeedClusters(), lar_content::TrackRefinementBaseAlgorithm::InitialiseContainers(), lar_content::CosmicRayTrackMatchingAlgorithm::SelectCleanClusters(), lar_content::CosmicRayTrackRecoveryAlgorithm::SelectCleanClusters(), lar_content::CandidateVertexCreationAlgorithm::SelectClusters(), lar_content::ThreeViewShowersAlgorithm::SelectInputClusters(), lar_content::NViewTrackMatchingAlgorithm< T >::SelectInputClusters(), lar_content::TwoDSlidingFitConsolidationAlgorithm::SortInputClusters(), lar_content::ParticleRecoveryAlgorithm::StandardClusterSelection(), lar_content::TrackConsolidationAlgorithm::TrackConsolidationAlgorithm(), and lar_content::TwoDSlidingFitSplittingAlgorithm::TwoDSlidingFitSplittingAlgorithm().

66 {
67  const OrderedCaloHitList &orderedCaloHitList(pCluster->GetOrderedCaloHitList());
68 
69  if (orderedCaloHitList.empty())
70  throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
71 
72  // ATTN In 2D case, we will actually calculate the quadrature sum of deltaX and deltaU/V/W
73  float minX(std::numeric_limits<float>::max()), maxX(-std::numeric_limits<float>::max());
74  float minY(std::numeric_limits<float>::max()), maxY(-std::numeric_limits<float>::max());
75  float minZ(std::numeric_limits<float>::max()), maxZ(-std::numeric_limits<float>::max());
76 
77  for (OrderedCaloHitList::const_iterator iter = orderedCaloHitList.begin(), iterEnd = orderedCaloHitList.end(); iter != iterEnd; ++iter)
78  {
79  for (CaloHitList::const_iterator hitIter = iter->second->begin(), hitIterEnd = iter->second->end(); hitIter != hitIterEnd; ++hitIter)
80  {
81  const CartesianVector &hitPosition((*hitIter)->GetPositionVector());
82  minX = std::min(hitPosition.GetX(), minX);
83  maxX = std::max(hitPosition.GetX(), maxX);
84  minY = std::min(hitPosition.GetY(), minY);
85  maxY = std::max(hitPosition.GetY(), maxY);
86  minZ = std::min(hitPosition.GetZ(), minZ);
87  maxZ = std::max(hitPosition.GetZ(), maxZ);
88  }
89  }
90 
91  const float deltaX(maxX - minX), deltaY(maxY - minY), deltaZ(maxZ - minZ);
92  return (deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ);
93 }
double minY
Definition: plot_hist.C:9
double maxY
Definition: plot_hist.C:10
intermediate_table::const_iterator const_iterator
bool lar_content::LArClusterHelper::SortByInnerLayer ( const pandora::Cluster *const  pLhs,
const pandora::Cluster *const  pRhs 
)
static

Sort clusters by inner layer, then position, then pulse-height.

Parameters
pLhsaddress of first cluster
pRhsaddress of second cluster

Definition at line 682 of file LArClusterHelper.cc.

Referenced by lar_content::CrossGapsAssociationAlgorithm::GetListOfCleanClusters(), and lar_content::LongitudinalAssociationAlgorithm::GetListOfCleanClusters().

683 {
684  const unsigned int innerLayerLhs(pLhs->GetInnerPseudoLayer());
685  const unsigned int innerLayerRhs(pRhs->GetInnerPseudoLayer());
686 
687  if (innerLayerLhs != innerLayerRhs)
688  return (innerLayerLhs < innerLayerRhs);
689 
690  return SortByPosition(pLhs, pRhs);
691 }
static bool SortByPosition(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by position, then pulse-height.
bool lar_content::LArClusterHelper::SortByLayerSpan ( const pandora::Cluster *const  pLhs,
const pandora::Cluster *const  pRhs 
)
static

Sort clusters by layer span, then inner layer, then position, then pulse-height.

Parameters
pLhsaddress of first cluster
pRhsaddress of second cluster

Definition at line 669 of file LArClusterHelper.cc.

670 {
671  const unsigned int layerSpanLhs(pLhs->GetOuterPseudoLayer() - pLhs->GetInnerPseudoLayer());
672  const unsigned int layerSpanRhs(pRhs->GetOuterPseudoLayer() - pRhs->GetInnerPseudoLayer());
673 
674  if (layerSpanLhs != layerSpanRhs)
675  return (layerSpanLhs > layerSpanRhs);
676 
677  return SortByInnerLayer(pLhs, pRhs);
678 }
static bool SortByInnerLayer(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by inner layer, then position, then pulse-height.
bool lar_content::LArClusterHelper::SortByNHits ( const pandora::Cluster *const  pLhs,
const pandora::Cluster *const  pRhs 
)
static

Sort clusters by number of hits, then layer span, then inner layer, then position, then pulse-height.

Parameters
pLhsaddress of first cluster
pRhsaddress of second cluster

Definition at line 656 of file LArClusterHelper.cc.

Referenced by lar_content::TwoDSlidingFitConsolidationAlgorithm::AddHitsToClusters(), lar_content::NeutrinoHierarchyAlgorithm::AdjustVertexAndPfoInfo(), lar_content::ClusterAssociationAlgorithm::AmbiguousPropagation(), lar_content::SplitShowersTool::ApplyChanges(), lar_content::ThreeDKinkBaseTool::ApplyChanges(), lar_content::TwoViewThreeDKinkTool::ApplyChanges(), lar_content::EventSlicingTool::AssignRemainingHitsToSlices(), lar_content::OvershootSplittingAlgorithm::BuildIntersectionMap(), lar_content::TrackHitsBaseTool::BuildSlidingFitMap(), lar_content::OvershootSplittingAlgorithm::BuildSortedIntersectionMap(), lar_content::VertexSelectionBaseAlgorithm::CalculateClusterSlidingFits(), lar_content::ConeClusterMopUpAlgorithm::ClusterMopUp(), lar_content::NearbyClusterMopUpAlgorithm::ClusterMopUp(), lar_content::BoundedClusterMopUpAlgorithm::ClusterMopUp(), lar_pandora::LArPandoraOutput::CollectClusters(), lar_content::EventSlicingTool::CopyPfoHitsToSlices(), lar_content::TrackMergeRefinementAlgorithm::CreateMainTrack(), lar_content::ParticleRecoveryAlgorithm::ExamineTensor(), lar_content::CrossGapsExtensionAlgorithm::FillClusterMergeMap(), lar_content::DeltaRayExtensionAlgorithm::FillClusterMergeMap(), lar_content::LongitudinalExtensionAlgorithm::FillClusterMergeMap(), lar_content::CosmicRayExtensionAlgorithm::FillClusterMergeMap(), lar_content::TransverseExtensionAlgorithm::FillClusterMergeMap(), lar_content::TransverseAssociationAlgorithm::FillReducedAssociationMap(), lar_content::TransverseAssociationAlgorithm::FillSymmetricAssociationMap(), lar_content::ClearTrackFragmentsTool::GetAffectedKeyClusters(), lar_content::TransverseAssociationAlgorithm::GetAssociatedClusters(), lar_content::CosmicRayTrackRecoveryAlgorithm::GetAvailableClusters(), lar_content::VertexBasedPfoRecoveryAlgorithm::GetAvailableClusters(), lar_content::SlidingConeClusterMopUpAlgorithm::GetAvailableTwoDClusters(), lar_content::DeltaRayMatchingAlgorithm::GetClusters(), lar_content::EventSlicingTool::GetClusterSliceList(), lar_content::ShowerGrowingAlgorithm::GetFigureOfMerit(), lar_content::EventSlicingTool::GetKDTreeEntries3D(), lar_content::OvershootSplittingAlgorithm::GetListOfCleanClusters(), lar_content::CrossGapsExtensionAlgorithm::GetListOfCleanClusters(), lar_content::DeltaRayGrowingAlgorithm::GetListOfCleanClusters(), lar_content::DeltaRayExtensionAlgorithm::GetListOfCleanClusters(), lar_content::LongitudinalExtensionAlgorithm::GetListOfCleanClusters(), lar_content::SimpleClusterGrowingAlgorithm::GetListOfCleanClusters(), lar_content::SimpleClusterMergingAlgorithm::GetListOfCleanClusters(), lar_content::CosmicRayExtensionAlgorithm::GetListOfCleanClusters(), lar_content::TransverseExtensionAlgorithm::GetListOfCleanClusters(), lar_content::CosmicRaySplittingAlgorithm::GetListOfCleanClusters(), lar_content::TwoDSlidingFitSplittingAndSwitchingAlgorithm::GetListOfCleanClusters(), lar_content::TransverseAssociationAlgorithm::GetListOfCleanClusters(), lar_content::TwoDSlidingFitSplittingAndSplicingAlgorithm::GetListOfCleanClusters(), lar_content::ClusterGrowingAlgorithm::GetListOfNonSeedClusters(), lar_content::DeltaRayGrowingAlgorithm::GetListOfSeedClusters(), lar_content::SimpleClusterGrowingAlgorithm::GetListOfSeedClusters(), lar_content::ThreeViewTrackFragmentsAlgorithm::GetMatchedClusters(), lar_content::MissingTrackSegmentTool::GetSegmentOverlapMap(), lar_content::SlidingConePfoMopUpAlgorithm::GetThreeDClusters(), lar_content::SlidingConeClusterMopUpAlgorithm::GetThreeDClusters(), lar_content::CrossGapsAssociationAlgorithm::IsExtremalCluster(), lar_content::HitWidthClusterMergingAlgorithm::IsExtremalCluster(), lar_content::LongitudinalAssociationAlgorithm::IsExtremalCluster(), lar_content::TransverseAssociationAlgorithm::IsExtremalCluster(), lar_content::ClusterMopUpBaseAlgorithm::MakeClusterMerges(), lar_content::SlidingConeClusterMopUpAlgorithm::MakeClusterMerges(), lar_content::NViewTrackMatchingAlgorithm< T >::MakeClusterSplits(), lar_content::MissingTrackSegmentTool::MakeDecisions(), lar_content::SlidingConePfoMopUpAlgorithm::MakePfoMerges(), lar_content::ClusterGrowingAlgorithm::MergeClusters(), lar_content::SlidingConeClusterMopUpAlgorithm::ClusterMerge::operator<(), lar_content::SlidingConePfoMopUpAlgorithm::ClusterMerge::operator<(), lar_content::ThreeViewTrackFragmentsAlgorithm::PerformMainLoop(), lar_content::ThreeViewMatchingControl< T >::PerformMainLoop(), lar_content::TwoViewMatchingControl< T >::PerformMainLoop(), lar_content::OneViewDeltaRayMatchingAlgorithm::PerformOneViewMatching(), lar_content::OvershootSplittingAlgorithm::PopulateSplitPositionMap(), lar_content::ShowerGrowingAlgorithm::ProcessSeedAssociationDetails(), lar_content::ClearTrackFragmentsTool::ProcessTensorElement(), lar_content::TwoDSlidingFitSplittingAndSplicingAlgorithm::PruneClusterExtensionList(), lar_content::TwoDSlidingFitConsolidationAlgorithm::RebuildClusters(), lar_content::TwoDSlidingFitConsolidationAlgorithm::RemoveHitsFromClusters(), lar_content::HitWidthClusterMergingAlgorithm::RemoveShortcutAssociations(), lar_content::TrackMergeRefinementAlgorithm::Run(), lar_content::CandidateVertexCreationAlgorithm::SelectClusters(), lar_content::TwoDSlidingFitConsolidationAlgorithm::SortInputClusters(), lar_content::TransverseAssociationAlgorithm::SortInputClusters(), lar_content::TwoDSlidingFitMultiSplitAlgorithm::SplitClusters(), lar_content::ThreeViewTrackFragmentsAlgorithm::UpdateForNewCluster(), lar_content::ThreeViewMatchingControl< T >::UpdateForNewCluster(), and lar_content::TwoViewMatchingControl< T >::UpdateForNewCluster().

657 {
658  const unsigned int nHitsLhs(pLhs->GetNCaloHits());
659  const unsigned int nHitsRhs(pRhs->GetNCaloHits());
660 
661  if (nHitsLhs != nHitsRhs)
662  return (nHitsLhs > nHitsRhs);
663 
664  return SortByLayerSpan(pLhs, pRhs);
665 }
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.
bool lar_content::LArClusterHelper::SortByNOccupiedLayers ( const pandora::Cluster *const  pLhs,
const pandora::Cluster *const  pRhs 
)
static

Sort clusters by number of occupied layers, and by inner layer, then energy in event of a tie.

Parameters
pLhsaddress of first cluster
pRhsaddress of second cluster

Definition at line 643 of file LArClusterHelper.cc.

644 {
645  const unsigned int nOccupiedLayersLhs(pLhs->GetOrderedCaloHitList().size());
646  const unsigned int nOccupiedLayersRhs(pRhs->GetOrderedCaloHitList().size());
647 
648  if (nOccupiedLayersLhs != nOccupiedLayersRhs)
649  return (nOccupiedLayersLhs > nOccupiedLayersRhs);
650 
651  return SortByNHits(pLhs, pRhs);
652 }
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.
bool lar_content::LArClusterHelper::SortByPosition ( const pandora::Cluster *const  pLhs,
const pandora::Cluster *const  pRhs 
)
static

Sort clusters by position, then pulse-height.

Parameters
pLhsaddress of first cluster
pRhsaddress of second cluster

Definition at line 695 of file LArClusterHelper.cc.

Referenced by lar_content::TrackMergeRefinementAlgorithm::FindBestClusterAssociation().

696 {
697  const CartesianVector deltaPositionIL(pRhs->GetCentroid(pRhs->GetInnerPseudoLayer()) - pLhs->GetCentroid(pLhs->GetInnerPseudoLayer()));
698 
699  if (std::fabs(deltaPositionIL.GetZ()) > std::numeric_limits<float>::epsilon())
700  return (deltaPositionIL.GetZ() > std::numeric_limits<float>::epsilon());
701 
702  if (std::fabs(deltaPositionIL.GetX()) > std::numeric_limits<float>::epsilon())
703  return (deltaPositionIL.GetX() > std::numeric_limits<float>::epsilon());
704 
705  if (std::fabs(deltaPositionIL.GetY()) > std::numeric_limits<float>::epsilon())
706  return (deltaPositionIL.GetY() > std::numeric_limits<float>::epsilon());
707 
708  const CartesianVector deltaPositionOL(pRhs->GetCentroid(pRhs->GetOuterPseudoLayer()) - pLhs->GetCentroid(pLhs->GetOuterPseudoLayer()));
709 
710  if (std::fabs(deltaPositionOL.GetZ()) > std::numeric_limits<float>::epsilon())
711  return (deltaPositionOL.GetZ() > std::numeric_limits<float>::epsilon());
712 
713  if (std::fabs(deltaPositionOL.GetX()) > std::numeric_limits<float>::epsilon())
714  return (deltaPositionOL.GetX() > std::numeric_limits<float>::epsilon());
715 
716  if (std::fabs(deltaPositionOL.GetY()) > std::numeric_limits<float>::epsilon())
717  return (deltaPositionOL.GetY() > std::numeric_limits<float>::epsilon());
718 
719  // Use pulse height to resolve ties
720  return SortByPulseHeight(pLhs, pRhs);
721 }
static bool SortByPulseHeight(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by pulse-height.
bool lar_content::LArClusterHelper::SortByPulseHeight ( const pandora::Cluster *const  pLhs,
const pandora::Cluster *const  pRhs 
)
static

Sort clusters by pulse-height.

Parameters
pLhsaddress of first cluster
pRhsaddress of second cluster

Definition at line 725 of file LArClusterHelper.cc.

726 {
727  return (pLhs->GetHadronicEnergy() > pRhs->GetHadronicEnergy());
728 }
bool lar_content::LArClusterHelper::SortCoordinatesByPosition ( const pandora::CartesianVector &  lhs,
const pandora::CartesianVector &  rhs 
)
static

Sort cartesian vectors by their position (use Z, followed by X, followed by Y)

Parameters
lhsfirst point
rhssecond point

Definition at line 771 of file LArClusterHelper.cc.

Referenced by lar_content::CandidateVertexCreationAlgorithm::GetSpacepoints(), and lar_content::ClusterAssociation::operator<().

772 {
773  const CartesianVector deltaPosition(rhs - lhs);
774 
775  if (std::fabs(deltaPosition.GetZ()) > std::numeric_limits<float>::epsilon())
776  return (deltaPosition.GetZ() > std::numeric_limits<float>::epsilon());
777 
778  if (std::fabs(deltaPosition.GetX()) > std::numeric_limits<float>::epsilon())
779  return (deltaPosition.GetX() > std::numeric_limits<float>::epsilon());
780 
781  return (deltaPosition.GetY() > std::numeric_limits<float>::epsilon());
782 }
bool lar_content::LArClusterHelper::SortHitsByPosition ( const pandora::CaloHit *const  pLhs,
const pandora::CaloHit *const  pRhs 
)
static

Sort calo hits by their position (use Z, followed by X, followed by Y)

Parameters
pLhsaddress of first calo hit
pRhsaddress of second calo hit

Definition at line 732 of file LArClusterHelper.cc.

Referenced by lar_content::TrackClusterCreationAlgorithm::AddFilteredCaloHits(), lar_content::EnergyDepositionAsymmetryFeatureTool::CalculateAsymmetry(), lar_content::AsymmetryFeatureBaseTool::CalculateAsymmetry(), lar_content::IsolatedClusterMopUpAlgorithm::ClusterMopUp(), lar_pandora::LArPandoraOutput::Collect3DHits(), lar_content::SimpleClusterCreationAlgorithm::CollectAssociatedHits(), lar_content::SimpleClusterCreationAlgorithm::CreateClusters(), lar_content::TrackClusterCreationAlgorithm::CreateClusters(), lar_content::CosmicRayRemovalTool::CreateSeed(), lar_content::TwoViewCosmicRayRemovalTool::CreateSeed(), lar_content::TrackClusterCreationAlgorithm::FilterCaloHits(), lar_content::CrossedTrackSplittingAlgorithm::FindCandidateSplitPositions(), lar_content::ThreeViewTrackFragmentsAlgorithm::GetFragmentOverlapResult(), lar_pandora::LArPandoraOutput::GetHitsInCluster(), lar_content::ThreeViewTrackFragmentsAlgorithm::GetMatchedHits(), lar_content::TrainedVertexSelectionAlgorithm::GetShowerLikeClusterEndPoints(), lar_content::TrackClusterCreationAlgorithm::IdentifyJoins(), lar_content::TrackClusterCreationAlgorithm::MakePrimaryAssociations(), lar_content::TrackClusterCreationAlgorithm::MakeSecondaryAssociations(), and lar_content::ThreeDHitCreationAlgorithm::SeparateTwoDHits().

733 {
734  const CartesianVector deltaPosition(pRhs->GetPositionVector() - pLhs->GetPositionVector());
735 
736  if (std::fabs(deltaPosition.GetZ()) > std::numeric_limits<float>::epsilon())
737  return (deltaPosition.GetZ() > std::numeric_limits<float>::epsilon());
738 
739  if (std::fabs(deltaPosition.GetX()) > std::numeric_limits<float>::epsilon())
740  return (deltaPosition.GetX() > std::numeric_limits<float>::epsilon());
741 
742  if (std::fabs(deltaPosition.GetY()) > std::numeric_limits<float>::epsilon())
743  return (deltaPosition.GetY() > std::numeric_limits<float>::epsilon());
744 
745  // Use pulse height to resolve ties
746  return SortHitsByPulseHeight(pLhs, pRhs);
747 }
static bool SortHitsByPulseHeight(const pandora::CaloHit *const pLhs, const pandora::CaloHit *const pRhs)
Sort calo hits by their pulse height.
bool lar_content::LArClusterHelper::SortHitsByPositionInX ( const pandora::CaloHit *const  pLhs,
const pandora::CaloHit *const  pRhs 
)
static

Sort calo hits by their position (use X, followed by Z, followed by Y)

Parameters
pLhsaddress of first calo hit
pRhsaddress of second calo hit

Definition at line 751 of file LArClusterHelper.cc.

752 {
753  const CartesianVector deltaPosition(pRhs->GetPositionVector() - pLhs->GetPositionVector());
754 
755  if (std::fabs(deltaPosition.GetX()) > std::numeric_limits<float>::epsilon())
756  return (deltaPosition.GetX() > std::numeric_limits<float>::epsilon());
757 
758  return SortHitsByPosition(pLhs, pRhs);
759 }
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)
bool lar_content::LArClusterHelper::SortHitsByPulseHeight ( const pandora::CaloHit *const  pLhs,
const pandora::CaloHit *const  pRhs 
)
static

Sort calo hits by their pulse height.

Parameters
pLhsaddress of first calo hit
pRhsaddress of second calo hit

Definition at line 763 of file LArClusterHelper.cc.

Referenced by lar_content::TrackRefinementBaseAlgorithm::SortByDistanceAlongLine::operator()().

764 {
765  // TODO: Think about the correct energy to use here (should they ever be different)
766  return (pLhs->GetHadronicEnergy() > pRhs->GetHadronicEnergy());
767 }

The documentation for this class was generated from the following files: