LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
lar_content::LArClusterHelper Class Reference

LArClusterHelper class. More...

#include "LArClusterHelper.h"

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 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 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 GetClusterSpanX (const pandora::Cluster *const pCluster, float &xmin, float &xmax)
 Get minimum and maximum X positions of the calo hits in a cluster. More...
 
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. More...
 
static void GetCoordinateVector (const pandora::Cluster *const pCluster, pandora::CartesianPointVector &coordinateVector)
 Get vector of hit coordinates from an input 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 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 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 403 of file LArClusterHelper.cc.

References f, max, and min.

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

404 {
405  averageZ = std::numeric_limits<float>::max();
406 
407  if (xmin > xmax)
408  return STATUS_CODE_INVALID_PARAMETER;
409 
410  const OrderedCaloHitList &orderedCaloHitList(pCluster->GetOrderedCaloHitList());
411 
412  float zsum(0.f);
413  int count(0);
414 
415  for (OrderedCaloHitList::const_iterator ochIter = orderedCaloHitList.begin(), ochIterEnd = orderedCaloHitList.end(); ochIter != ochIterEnd; ++ochIter)
416  {
417  for (CaloHitList::const_iterator hIter = ochIter->second->begin(), hIterEnd = ochIter->second->end(); hIter != hIterEnd; ++hIter)
418  {
419  const CaloHit *const pCaloHit = *hIter;
420  const CartesianVector &hit(pCaloHit->GetPositionVector());
421 
422  if (hit.GetX() < xmin || hit.GetX() > xmax)
423  continue;
424 
425  zsum += hit.GetZ();
426  ++count;
427  }
428  }
429 
430  if (count == 0)
431  return STATUS_CODE_NOT_FOUND;
432 
433  averageZ = zsum / static_cast<float>(count);
434  return STATUS_CODE_SUCCESS;
435 }
TFile f
Definition: plotHisto.C:6
Int_t max
Definition: plot.C:27
intermediate_table::const_iterator const_iterator
Detector simulation of raw signals on wires.
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::ShowerGrowingAlgorithm::AreClustersAssociated(), lar_content::NeutrinoDaughterVerticesAlgorithm::BuildDaughterTrack(), lar_content::OvershootSplittingAlgorithm::BuildIntersectionMap(), lar_content::SplitShowersTool::CheckClusterProximities(), lar_content::CosmicRayTrackMatchingAlgorithm::CheckMatchedClusters3D(), lar_content::NearbyClusterMopUpAlgorithm::ClusterMopUp(), lar_content::CosmicRaySplittingAlgorithm::ConfirmSplitPosition(), lar_content::DeltaRaySplittingAlgorithm::FindBestSplitPosition(), lar_content::CrossedTrackSplittingAlgorithm::FindBestSplitPosition(), lar_content::DeltaRayIdentificationAlgorithm::GetClosestDistance(), lar_content::DeltaRayMatchingAlgorithm::GetDistanceSquaredToPfo(), lar_content::GlobalAsymmetryFeatureTool::GetGlobalAsymmetryForView(), lar_content::TransverseExtensionAlgorithm::GetListOfCleanClusters(), lar_content::DeltaRayGrowingAlgorithm::GetListOfSeedClusters(), lar_content::LocalAsymmetryFeatureTool::GetLocalAsymmetryForView(), lar_content::CutClusterCharacterisationAlgorithm::GetVertexDistance(), lar_content::SimpleClusterMergingAlgorithm::IsAssociated(), lar_content::ConnectedRemnantsTool::IsConnected(), lar_content::ClusterGrowingAlgorithm::PopulateClusterMergeMap(), 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 pandora::CartesianVector lar_content::LArClusterHelper::GetClosestPosition ( const pandora::CartesianVector &  position,
const pandora::ClusterList &  clusterList 
)
static
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
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 267 of file LArClusterHelper.cc.

References f, and max.

Referenced by lar_content::CosmicRayVertexBuildingAlgorithm::BuildCosmicRayDaughter(), lar_content::NeutrinoDaughterVerticesAlgorithm::BuildDaughterShower(), and lar_content::EndAssociatedPfosTool::IsCloseToParentEndpoint().

269 {
270  bool distanceFound(false);
271  float minDistanceSquared(std::numeric_limits<float>::max());
272 
273  CartesianVector closestPosition1(0.f, 0.f, 0.f);
274  CartesianVector closestPosition2(0.f, 0.f, 0.f);
275 
276  const OrderedCaloHitList &orderedCaloHitList1(pCluster1->GetOrderedCaloHitList());
277  const OrderedCaloHitList &orderedCaloHitList2(pCluster2->GetOrderedCaloHitList());
278 
279  // Loop over hits in cluster 1
280  for (OrderedCaloHitList::const_iterator iter1 = orderedCaloHitList1.begin(), iter1End = orderedCaloHitList1.end(); iter1 != iter1End; ++iter1)
281  {
282  for (CaloHitList::const_iterator hitIter1 = iter1->second->begin(), hitIter1End = iter1->second->end(); hitIter1 != hitIter1End; ++hitIter1)
283  {
284  const CartesianVector &positionVector1((*hitIter1)->GetPositionVector());
285 
286  // Loop over hits in cluster 2
287  for (OrderedCaloHitList::const_iterator iter2 = orderedCaloHitList2.begin(), iter2End = orderedCaloHitList2.end(); iter2 != iter2End; ++iter2)
288  {
289  for (CaloHitList::const_iterator hitIter2 = iter2->second->begin(), hitIter2End = iter2->second->end(); hitIter2 != hitIter2End; ++hitIter2)
290  {
291  const CartesianVector &positionVector2((*hitIter2)->GetPositionVector());
292 
293  const float distanceSquared((positionVector1 - positionVector2).GetMagnitudeSquared());
294 
295  if (distanceSquared < minDistanceSquared)
296  {
297  minDistanceSquared = distanceSquared;
298  closestPosition1 = positionVector1;
299  closestPosition2 = positionVector2;
300  distanceFound = true;
301  }
302  }
303  }
304  }
305  }
306 
307  if (!distanceFound)
308  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
309 
310  outputPosition1 = closestPosition1;
311  outputPosition2 = closestPosition2;
312 }
TFile f
Definition: plotHisto.C:6
Int_t max
Definition: plot.C:27
intermediate_table::const_iterator const_iterator
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 316 of file LArClusterHelper.cc.

References max, and min.

Referenced by lar_content::ThreeDTrackFragmentsAlgorithm::CheckMatchedClusters(), lar_content::SvmVertexSelectionAlgorithm::GetEventShapeFeatures(), and lar_content::CosmicRayTrackRecoveryAlgorithm::SelectCleanClusters().

317 {
318  const OrderedCaloHitList &orderedCaloHitList(pCluster->GetOrderedCaloHitList());
319 
320  float xmin(std::numeric_limits<float>::max());
321  float ymin(std::numeric_limits<float>::max());
322  float zmin(std::numeric_limits<float>::max());
323  float xmax(-std::numeric_limits<float>::max());
324  float ymax(-std::numeric_limits<float>::max());
325  float zmax(-std::numeric_limits<float>::max());
326 
327  for (OrderedCaloHitList::const_iterator ochIter = orderedCaloHitList.begin(), ochIterEnd = orderedCaloHitList.end(); ochIter != ochIterEnd; ++ochIter)
328  {
329  for (CaloHitList::const_iterator hIter = ochIter->second->begin(), hIterEnd = ochIter->second->end(); hIter != hIterEnd; ++hIter)
330  {
331  const CaloHit *const pCaloHit = *hIter;
332  const CartesianVector &hit(pCaloHit->GetPositionVector());
333  xmin = std::min(hit.GetX(), xmin);
334  xmax = std::max(hit.GetX(), xmax);
335  ymin = std::min(hit.GetY(), ymin);
336  ymax = std::max(hit.GetY(), ymax);
337  zmin = std::min(hit.GetZ(), zmin);
338  zmax = std::max(hit.GetZ(), zmax);
339  }
340  }
341 
342  minimumCoordinate.SetValues(xmin, ymin, zmin);
343  maximumCoordinate.SetValues(xmax, ymax, zmax);
344 }
Int_t max
Definition: plot.C:27
intermediate_table::const_iterator const_iterator
Detector simulation of raw signals on wires.
Int_t min
Definition: plot.C:26
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 20 of file LArClusterHelper.cc.

Referenced by lar_content::ParticleRecoveryAlgorithm::SimpleOverlapTensor::AddAssociation(), lar_content::DeltaRayMatchingAlgorithm::AddToDaughterPfo(), lar_content::DeltaRayMatchingAlgorithm::AreClustersMatched(), lar_content::EventSlicingTool::AssignRemainingHitsToSlices(), lar_content::CrossGapsExtensionAlgorithm::BuildPointingClusterList(), lar_content::TrackHitsBaseTool::BuildSlidingFitMap(), 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::EventSlicingTool::CopyPfoHitsToSlices(), lar_content::CandidateVertexCreationAlgorithm::CreateEndpointCandidates(), lar_content::CandidateVertexCreationAlgorithm::CreateEndpointVertex(), lar_content::EventSlicingTool::CreateSlices(), lar_content::CrossGapsExtensionAlgorithm::FillClusterAssociationMatrix(), lar_content::VertexSplittingAlgorithm::FindBestSplitPosition(), lar_content::ShowerGrowingAlgorithm::GetAllVertexSeedCandidates(), lar_content::VertexBasedPfoRecoveryAlgorithm::GetAvailableClusters(), lar_content::VertexBasedPfoMopUpAlgorithm::GetClusterAssociation(), lar_content::ClusterMopUpBaseAlgorithm::GetClusterLists(), lar_content::VertexSelectionBaseAlgorithm::GetClusterLists(), 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::DeltaRayGrowingAlgorithm::GetListOfSeedClusters(), lar_content::CheatingPfoCreationAlgorithm::GetNHitTypesAboveThreshold(), lar_content::NeutrinoPropertiesAlgorithm::GetNTwoDHitsInPfoChain(), lar_pandora::LArPandoraOutput::GetPandoraToArtHitMap(), lar_content::VertexBasedPfoMopUpAlgorithm::GetPfoAssociations(), lar_content::ThreeDTrackFragmentsAlgorithm::GetProjectedPositions(), lar_content::CutClusterCharacterisationAlgorithm::GetVertexDistance(), lar_content::CrossGapsAssociationAlgorithm::IsAssociated(), lar_content::PfoCharacterisationBaseAlgorithm::IsClearTrack3x2D(), lar_content::ParticleRecoveryAlgorithm::IsOverlap(), lar_content::UndershootTracksTool::IsThreeDKink(), lar_content::OvershootTracksTool::IsThreeDKink(), lar_content::ThreeDBaseAlgorithm< T >::MakeClusterMerges(), lar_content::SlidingConeClusterMopUpAlgorithm::MakeClusterMerges(), lar_content::ThreeDTracksBaseAlgorithm< T >::MakeClusterSplits(), lar_content::CosmicRayTrackRecoveryAlgorithm::MatchClusters(), lar_content::VertexBasedPfoRecoveryAlgorithm::MatchThreeViews(), lar_content::VertexBasedPfoRecoveryAlgorithm::MatchTwoViews(), 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::CandidateVertexCreationAlgorithm::SelectClusters(), lar_content::VertexBasedPfoRecoveryAlgorithm::SelectClusters(), lar_content::VertexBasedPfoRecoveryAlgorithm::SelectVertexClusters(), lar_content::ThreeDHitCreationAlgorithm::SeparateTwoDHits(), lar_content::OvershootTracksTool::SetSplitPosition(), lar_content::MasterAlgorithm::StitchPfos(), lar_content::ThreeDTrackFragmentsAlgorithm::UpdateForNewCluster(), and lar_content::ThreeDBaseAlgorithm< T >::UpdateForNewCluster().

21 {
22  if (0 == pCluster->GetNCaloHits())
23  throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
24 
25  // TODO Find a way of confirming single hit-type clustering mode; currently only checked in ListPreparation algorithm
26  // if (!pandora->GetSettings()->SingleHitTypeClusteringMode())
27  // throw StatusCodeException(STATUS_CODE_FAILURE);
28 
29  return (*(pCluster->GetOrderedCaloHitList().begin()->second->begin()))->GetHitType();
30 }
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 49 of file LArClusterHelper.cc.

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

50 {
51  for (ClusterList::const_iterator iter = inputClusters.begin(), iterEnd = inputClusters.end(); iter != iterEnd; ++iter)
52  {
53  if (hitType == LArClusterHelper::GetClusterHitType(*iter))
54  clusterList.push_back(*iter);
55  }
56 }
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
intermediate_table::const_iterator const_iterator
void lar_content::LArClusterHelper::GetClusterSpanX ( const pandora::Cluster *const  pCluster,
float &  xmin,
float &  xmax 
)
static

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

Parameters
pClusteraddress of the cluster
theminimum position of x
themaximum position of x

Definition at line 348 of file LArClusterHelper.cc.

References max, and min.

Referenced by lar_content::DeltaRayMatchingAlgorithm::AreClustersMatched(), lar_content::ThreeDRemnantsAlgorithm::CalculateOverlapResult(), lar_content::ParticleRecoveryAlgorithm::CheckConsistency(), lar_content::CosmicRayTaggingTool::CheckIfInTime(), lar_content::CosmicRayShowerMatchingAlgorithm::CheckMatchedClusters3D(), lar_content::ThreeDTrackFragmentsAlgorithm::GetProjectedPositions(), lar_content::ParticleRecoveryAlgorithm::IsOverlap(), lar_content::CosmicRayShowerMatchingAlgorithm::MatchClusters(), lar_content::CosmicRayTrackMatchingAlgorithm::MatchClusters(), lar_content::ThreeDTrackFragmentsAlgorithm::PerformMainLoop(), and lar_content::ParticleRecoveryAlgorithm::StandardClusterSelection().

349 {
350  const OrderedCaloHitList &orderedCaloHitList(pCluster->GetOrderedCaloHitList());
353 
354  for (OrderedCaloHitList::const_iterator ochIter = orderedCaloHitList.begin(), ochIterEnd = orderedCaloHitList.end(); ochIter != ochIterEnd; ++ochIter)
355  {
356  for (CaloHitList::const_iterator hIter = ochIter->second->begin(), hIterEnd = ochIter->second->end(); hIter != hIterEnd; ++hIter)
357  {
358  const CaloHit *const pCaloHit = *hIter;
359  const CartesianVector &hit(pCaloHit->GetPositionVector());
360  xmin = std::min(hit.GetX(), xmin);
361  xmax = std::max(hit.GetX(), xmax);
362  }
363  }
364 }
Int_t max
Definition: plot.C:27
intermediate_table::const_iterator const_iterator
Detector simulation of raw signals on wires.
Int_t min
Definition: plot.C:26
void lar_content::LArClusterHelper::GetClusterSpanZ ( const pandora::Cluster *const  pCluster,
const float  xmin,
const float  xmax,
float &  zmin,
float &  zmax 
)
static

Get upper and lower 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
zminthe lower z for this range of x
zmaxthe upper z for this range in x

Definition at line 368 of file LArClusterHelper.cc.

References max, and min.

Referenced by lar_content::DeltaRayMatchingAlgorithm::AreClustersMatched().

370 {
371  if (xmin > xmax)
372  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
373 
374  const OrderedCaloHitList &orderedCaloHitList(pCluster->GetOrderedCaloHitList());
375 
378 
379  bool foundHits(false);
380 
381  for (OrderedCaloHitList::const_iterator ochIter = orderedCaloHitList.begin(), ochIterEnd = orderedCaloHitList.end(); ochIter != ochIterEnd; ++ochIter)
382  {
383  for (CaloHitList::const_iterator hIter = ochIter->second->begin(), hIterEnd = ochIter->second->end(); hIter != hIterEnd; ++hIter)
384  {
385  const CaloHit *const pCaloHit = *hIter;
386  const CartesianVector &hit(pCaloHit->GetPositionVector());
387 
388  if (hit.GetX() < xmin || hit.GetX() > xmax)
389  continue;
390 
391  zmin = std::min(hit.GetZ(), zmin);
392  zmax = std::max(hit.GetZ(), zmax);
393  foundHits = true;
394  }
395  }
396 
397  if (!foundHits)
398  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
399 }
Int_t max
Definition: plot.C:27
intermediate_table::const_iterator const_iterator
Detector simulation of raw signals on wires.
Int_t min
Definition: plot.C:26
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 34 of file LArClusterHelper.cc.

35 {
36  for (ClusterList::const_iterator iter = inputClusters.begin(), iterEnd = inputClusters.end(); iter != iterEnd; ++iter)
37  {
38  const HitType hitType(LArClusterHelper::GetClusterHitType(*iter));
39 
40  if (TPC_VIEW_U == hitType) clusterListU.push_back(*iter);
41  else if (TPC_VIEW_V == hitType) clusterListV.push_back(*iter);
42  else if (TPC_VIEW_W == hitType) clusterListW.push_back(*iter);
43  else throw StatusCodeException(STATUS_CODE_NOT_FOUND);
44  }
45 }
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
intermediate_table::const_iterator const_iterator
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 590 of file LArClusterHelper.cc.

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

591 {
592  for (const OrderedCaloHitList::value_type &layerEntry : pCluster->GetOrderedCaloHitList())
593  {
594  for (const CaloHit *const pCaloHit : *layerEntry.second)
595  coordinateVector.push_back(pCaloHit->GetPositionVector());
596  }
597 
598  std::sort(coordinateVector.begin(), coordinateVector.end(), LArClusterHelper::SortCoordinatesByPosition);
599 }
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)
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 99 of file LArClusterHelper.cc.

References f.

100 {
101  const float dEdX(0.002f); // approximately 2 MeV/cm
102  return (dEdX * LArClusterHelper::GetLength(pCluster));
103 }
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 107 of file LArClusterHelper.cc.

References f, max, and min.

108 {
109  return (1 + pCluster->GetOuterPseudoLayer() - pCluster->GetInnerPseudoLayer());
110 }
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 92 of file LArClusterHelper.cc.

Referenced by lar_content::SvmVertexSelectionAlgorithm::IsClusterShowerLike().

93 {
94  return std::sqrt(LArClusterHelper::GetLengthSquared(pCluster));
95 }
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 60 of file LArClusterHelper.cc.

References max, maxY, min, and minY.

Referenced by 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::CosmicRayTrackMatchingAlgorithm::SelectCleanClusters(), lar_content::CosmicRayTrackRecoveryAlgorithm::SelectCleanClusters(), lar_content::CandidateVertexCreationAlgorithm::SelectClusters(), lar_content::ThreeDShowersAlgorithm::SelectInputClusters(), lar_content::ThreeDTracksBaseAlgorithm< T >::SelectInputClusters(), lar_content::TwoDSlidingFitConsolidationAlgorithm::SortInputClusters(), lar_content::ParticleRecoveryAlgorithm::StandardClusterSelection(), lar_content::TrackConsolidationAlgorithm::TrackConsolidationAlgorithm(), and lar_content::TwoDSlidingFitSplittingAlgorithm::TwoDSlidingFitSplittingAlgorithm().

61 {
62  const OrderedCaloHitList &orderedCaloHitList(pCluster->GetOrderedCaloHitList());
63 
64  if (orderedCaloHitList.empty())
65  throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
66 
67  // ATTN In 2D case, we will actually calculate the quadrature sum of deltaX and deltaU/V/W
71 
72  for (OrderedCaloHitList::const_iterator iter = orderedCaloHitList.begin(), iterEnd = orderedCaloHitList.end(); iter != iterEnd; ++iter)
73  {
74  for (CaloHitList::const_iterator hitIter = iter->second->begin(), hitIterEnd = iter->second->end(); hitIter != hitIterEnd; ++hitIter)
75  {
76  const CartesianVector &hitPosition((*hitIter)->GetPositionVector());
77  minX = std::min(hitPosition.GetX(), minX);
78  maxX = std::max(hitPosition.GetX(), maxX);
79  minY = std::min(hitPosition.GetY(), minY);
80  maxY = std::max(hitPosition.GetY(), maxY);
81  minZ = std::min(hitPosition.GetZ(), minZ);
82  maxZ = std::max(hitPosition.GetZ(), maxZ);
83  }
84  }
85 
86  const float deltaX(maxX - minX), deltaY(maxY - minY), deltaZ(maxZ - minZ);
87  return (deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ);
88 }
double minY
Definition: plot_hist.C:9
double maxY
Definition: plot_hist.C:10
Int_t max
Definition: plot.C:27
intermediate_table::const_iterator const_iterator
Int_t min
Definition: plot.C:26
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 642 of file LArClusterHelper.cc.

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

643 {
644  const unsigned int innerLayerLhs(pLhs->GetInnerPseudoLayer());
645  const unsigned int innerLayerRhs(pRhs->GetInnerPseudoLayer());
646 
647  if (innerLayerLhs != innerLayerRhs)
648  return (innerLayerLhs < innerLayerRhs);
649 
650  return SortByPosition(pLhs, pRhs);
651 }
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 629 of file LArClusterHelper.cc.

630 {
631  const unsigned int layerSpanLhs(pLhs->GetOuterPseudoLayer() - pLhs->GetInnerPseudoLayer());
632  const unsigned int layerSpanRhs(pRhs->GetOuterPseudoLayer() - pRhs->GetInnerPseudoLayer());
633 
634  if (layerSpanLhs != layerSpanRhs)
635  return (layerSpanLhs > layerSpanRhs);
636 
637  return SortByInnerLayer(pLhs, pRhs);
638 }
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 616 of file LArClusterHelper.cc.

Referenced by lar_content::TwoDSlidingFitConsolidationAlgorithm::AddHitsToClusters(), lar_content::ClusterAssociationAlgorithm::AmbiguousPropagation(), lar_content::SplitShowersTool::ApplyChanges(), lar_content::ThreeDKinkBaseTool::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::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::SimpleClusterGrowingAlgorithm::GetListOfCleanClusters(), lar_content::DeltaRayExtensionAlgorithm::GetListOfCleanClusters(), lar_content::LongitudinalExtensionAlgorithm::GetListOfCleanClusters(), lar_content::SimpleClusterMergingAlgorithm::GetListOfCleanClusters(), lar_content::DeltaRayGrowingAlgorithm::GetListOfCleanClusters(), lar_content::TransverseExtensionAlgorithm::GetListOfCleanClusters(), lar_content::CosmicRayExtensionAlgorithm::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::ThreeDTrackFragmentsAlgorithm::GetMatchedClusters(), lar_content::MissingTrackSegmentTool::GetSegmentOverlapMap(), lar_content::SlidingConePfoMopUpAlgorithm::GetThreeDClusters(), lar_content::SlidingConeClusterMopUpAlgorithm::GetThreeDClusters(), lar_content::CrossGapsAssociationAlgorithm::IsExtremalCluster(), lar_content::LongitudinalAssociationAlgorithm::IsExtremalCluster(), lar_content::TransverseAssociationAlgorithm::IsExtremalCluster(), lar_content::ClusterMopUpBaseAlgorithm::MakeClusterMerges(), lar_content::ThreeDBaseAlgorithm< T >::MakeClusterMerges(), lar_content::SlidingConeClusterMopUpAlgorithm::MakeClusterMerges(), lar_content::ThreeDTracksBaseAlgorithm< 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::ThreeDTrackFragmentsAlgorithm::PerformMainLoop(), lar_content::ThreeDBaseAlgorithm< T >::PerformMainLoop(), 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::ThreeDBaseAlgorithm< T >::RemoveUnavailableTensorElements(), lar_content::CandidateVertexCreationAlgorithm::SelectClusters(), lar_content::TwoDSlidingFitConsolidationAlgorithm::SortInputClusters(), lar_content::TransverseAssociationAlgorithm::SortInputClusters(), lar_content::TwoDSlidingFitMultiSplitAlgorithm::SplitClusters(), lar_content::ThreeDTrackFragmentsAlgorithm::UpdateForNewCluster(), and lar_content::ThreeDBaseAlgorithm< T >::UpdateForNewCluster().

617 {
618  const unsigned int nHitsLhs(pLhs->GetNCaloHits());
619  const unsigned int nHitsRhs(pRhs->GetNCaloHits());
620 
621  if (nHitsLhs != nHitsRhs)
622  return (nHitsLhs > nHitsRhs);
623 
624  return SortByLayerSpan(pLhs, pRhs);
625 }
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 603 of file LArClusterHelper.cc.

604 {
605  const unsigned int nOccupiedLayersLhs(pLhs->GetOrderedCaloHitList().size());
606  const unsigned int nOccupiedLayersRhs(pRhs->GetOrderedCaloHitList().size());
607 
608  if (nOccupiedLayersLhs != nOccupiedLayersRhs)
609  return (nOccupiedLayersLhs > nOccupiedLayersRhs);
610 
611  return SortByNHits(pLhs, pRhs);
612 }
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 655 of file LArClusterHelper.cc.

656 {
657  const CartesianVector deltaPositionIL(pRhs->GetCentroid(pRhs->GetInnerPseudoLayer()) - pLhs->GetCentroid(pLhs->GetInnerPseudoLayer()));
658 
659  if (std::fabs(deltaPositionIL.GetZ()) > std::numeric_limits<float>::epsilon())
660  return (deltaPositionIL.GetZ() > std::numeric_limits<float>::epsilon());
661 
662  if (std::fabs(deltaPositionIL.GetX()) > std::numeric_limits<float>::epsilon())
663  return (deltaPositionIL.GetX() > std::numeric_limits<float>::epsilon());
664 
665  if (std::fabs(deltaPositionIL.GetY()) > std::numeric_limits<float>::epsilon())
666  return (deltaPositionIL.GetY() > std::numeric_limits<float>::epsilon());
667 
668  const CartesianVector deltaPositionOL(pRhs->GetCentroid(pRhs->GetOuterPseudoLayer()) - pLhs->GetCentroid(pLhs->GetOuterPseudoLayer()));
669 
670  if (std::fabs(deltaPositionOL.GetZ()) > std::numeric_limits<float>::epsilon())
671  return (deltaPositionOL.GetZ() > std::numeric_limits<float>::epsilon());
672 
673  if (std::fabs(deltaPositionOL.GetX()) > std::numeric_limits<float>::epsilon())
674  return (deltaPositionOL.GetX() > std::numeric_limits<float>::epsilon());
675 
676  if (std::fabs(deltaPositionOL.GetY()) > std::numeric_limits<float>::epsilon())
677  return (deltaPositionOL.GetY() > std::numeric_limits<float>::epsilon());
678 
679  // Use pulse height to resolve ties
680  return SortByPulseHeight(pLhs, pRhs);
681 }
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 685 of file LArClusterHelper.cc.

686 {
687  return (pLhs->GetHadronicEnergy() > pRhs->GetHadronicEnergy());
688 }
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 719 of file LArClusterHelper.cc.

Referenced by lar_content::CandidateVertexCreationAlgorithm::GetSpacepoints().

720 {
721  const CartesianVector deltaPosition(rhs - lhs);
722 
723  if (std::fabs(deltaPosition.GetZ()) > std::numeric_limits<float>::epsilon())
724  return (deltaPosition.GetZ() > std::numeric_limits<float>::epsilon());
725 
726  if (std::fabs(deltaPosition.GetX()) > std::numeric_limits<float>::epsilon())
727  return (deltaPosition.GetX() > std::numeric_limits<float>::epsilon());
728 
729  return (deltaPosition.GetY() > std::numeric_limits<float>::epsilon());
730 }
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 692 of file LArClusterHelper.cc.

Referenced by lar_content::TrackClusterCreationAlgorithm::AddFilteredCaloHits(), lar_content::ShowerAsymmetryFeatureTool::CalculateAsymmetryParameters(), lar_content::GlobalAsymmetryFeatureTool::CalculateGlobalAsymmetry(), lar_content::LocalAsymmetryFeatureTool::CalculateLocalAsymmetry(), lar_content::IsolatedClusterMopUpAlgorithm::ClusterMopUp(), lar_pandora::LArPandoraOutput::Collect3DHits(), lar_content::SimpleClusterCreationAlgorithm::CollectAssociatedHits(), lar_content::SimpleClusterCreationAlgorithm::CreateClusters(), lar_content::TrackClusterCreationAlgorithm::CreateClusters(), lar_content::TrackClusterCreationAlgorithm::FilterCaloHits(), lar_content::CrossedTrackSplittingAlgorithm::FindCandidateSplitPositions(), lar_content::ThreeDTrackFragmentsAlgorithm::GetFragmentOverlapResult(), lar_pandora::LArPandoraOutput::GetHitsInCluster(), lar_content::ThreeDTrackFragmentsAlgorithm::GetMatchedHits(), lar_content::SvmVertexSelectionAlgorithm::GetShowerLikeClusterEndPoints(), lar_content::TrackClusterCreationAlgorithm::IdentifyJoins(), lar_content::TrackClusterCreationAlgorithm::MakePrimaryAssociations(), lar_content::TrackClusterCreationAlgorithm::MakeSecondaryAssociations(), and lar_content::ThreeDHitCreationAlgorithm::SeparateTwoDHits().

693 {
694  const CartesianVector deltaPosition(pRhs->GetPositionVector() - pLhs->GetPositionVector());
695 
696  if (std::fabs(deltaPosition.GetZ()) > std::numeric_limits<float>::epsilon())
697  return (deltaPosition.GetZ() > std::numeric_limits<float>::epsilon());
698 
699  if (std::fabs(deltaPosition.GetX()) > std::numeric_limits<float>::epsilon())
700  return (deltaPosition.GetX() > std::numeric_limits<float>::epsilon());
701 
702  if (std::fabs(deltaPosition.GetY()) > std::numeric_limits<float>::epsilon())
703  return (deltaPosition.GetY() > std::numeric_limits<float>::epsilon());
704 
705  // Use pulse height to resolve ties
706  return SortHitsByPulseHeight(pLhs, pRhs);
707 }
static bool SortHitsByPulseHeight(const pandora::CaloHit *const pLhs, const pandora::CaloHit *const pRhs)
Sort calo hits by their pulse height.
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 711 of file LArClusterHelper.cc.

712 {
713  // TODO: Think about the correct energy to use here (should they ever be different)
714  return (pLhs->GetHadronicEnergy() > pRhs->GetHadronicEnergy());
715 }

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