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

TrackConsolidationAlgorithm class. More...

#include "TrackConsolidationAlgorithm.h"

Inheritance diagram for lar_content::TrackConsolidationAlgorithm:
lar_content::TwoDSlidingFitConsolidationAlgorithm

Public Member Functions

 TrackConsolidationAlgorithm ()
 Default constructor. More...
 

Protected Types

typedef std::unordered_map< const pandora::Cluster *, pandora::CaloHitList > ClusterToHitMap
 

Protected Member Functions

pandora::StatusCode Run ()
 

Private Member Functions

pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 
void GetReclusteredHits (const TwoDSlidingFitResultList &slidingFitResultList, const pandora::ClusterVector &showerClusters, ClusterToHitMap &caloHitsToAdd, ClusterToHitMap &caloHitsToRemove) const
 Get the list of hits to be added to track clusters and removed from shower clusters. More...
 
void GetReclusteredHits (const TwoDSlidingFitResult &slidingFitResult, const pandora::Cluster *const pTargetCluster, ClusterToHitMap &caloHitsToAdd, ClusterToHitMap &caloHitsToRemove) const
 Get the list of hits to be added to a track cluster and removed from a shower cluster. More...
 

Private Attributes

float m_maxTransverseDisplacement
 
float m_minAssociatedSpan
 
float m_minAssociatedFraction
 

Detailed Description

Member Typedef Documentation

typedef std::unordered_map<const pandora::Cluster *, pandora::CaloHitList> lar_content::TwoDSlidingFitConsolidationAlgorithm::ClusterToHitMap
protectedinherited

Definition at line 35 of file TwoDSlidingFitConsolidationAlgorithm.h.

Constructor & Destructor Documentation

Member Function Documentation

void lar_content::TrackConsolidationAlgorithm::GetReclusteredHits ( const TwoDSlidingFitResultList slidingFitResultList,
const pandora::ClusterVector &  showerClusters,
ClusterToHitMap caloHitsToAdd,
ClusterToHitMap caloHitsToRemove 
) const
privatevirtual

Get the list of hits to be added to track clusters and removed from shower clusters.

Parameters
slidingFitResultListthe list of sliding linear fits to track clusters
showerClustersthe vector of shower clusters
caloHitsToAddthe output map of hits to be added to clusters
caloHitsToRemovethe output map of hits to be removed from clusters

Implements lar_content::TwoDSlidingFitConsolidationAlgorithm.

Referenced by TrackConsolidationAlgorithm().

void lar_content::TrackConsolidationAlgorithm::GetReclusteredHits ( const TwoDSlidingFitResult slidingFitResult,
const pandora::Cluster *const  pTargetCluster,
ClusterToHitMap caloHitsToAdd,
ClusterToHitMap caloHitsToRemove 
) const
private

Get the list of hits to be added to a track cluster and removed from a shower cluster.

Parameters
slidingFitResultsliding linear fit to track cluster
pTargetClustershower cluster
caloHitsToAddthe output map of hits to be added to clusters
caloHitsToRemovethe output map of hits to be removed from clusters
StatusCode lar_content::TrackConsolidationAlgorithm::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 140 of file TrackConsolidationAlgorithm.cc.

References m_maxTransverseDisplacement, m_minAssociatedFraction, m_minAssociatedSpan, and lar_content::TwoDSlidingFitConsolidationAlgorithm::ReadSettings().

141 {
142  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
143  XmlHelper::ReadValue(xmlHandle, "MaxTransverseDisplacement", m_maxTransverseDisplacement));
144 
145  PANDORA_RETURN_RESULT_IF_AND_IF(
146  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinAssociatedSpan", m_minAssociatedSpan));
147 
148  PANDORA_RETURN_RESULT_IF_AND_IF(
149  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinAssociatedFraction", m_minAssociatedFraction));
150 
152 }
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
StatusCode lar_content::TwoDSlidingFitConsolidationAlgorithm::Run ( )
protectedinherited

Definition at line 30 of file TwoDSlidingFitConsolidationAlgorithm.cc.

References lar_content::TwoDSlidingFitConsolidationAlgorithm::AddHitsToClusters(), lar_content::TwoDSlidingFitConsolidationAlgorithm::BuildSlidingLinearFits(), lar_content::TwoDSlidingFitConsolidationAlgorithm::GetReclusteredHits(), lar_content::TwoDSlidingFitConsolidationAlgorithm::RebuildClusters(), lar_content::TwoDSlidingFitConsolidationAlgorithm::RemoveHitsFromClusters(), and lar_content::TwoDSlidingFitConsolidationAlgorithm::SortInputClusters().

31 {
32  const ClusterList *pClusterList = NULL;
33  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetCurrentList(*this, pClusterList));
34 
35  // Select tracks and showers for re-clustering (Note: samples not mutually exclusive)
36  ClusterVector trackClusters, showerClusters;
37  this->SortInputClusters(pClusterList, trackClusters, showerClusters);
38 
39  // Build sliding linear fits from track clusters
40  TwoDSlidingFitResultList slidingFitResultList;
41  this->BuildSlidingLinearFits(trackClusters, slidingFitResultList);
42 
43  // Recluster the hits
44  ClusterToHitMap clustersToExpand, clustersToContract;
45  this->GetReclusteredHits(slidingFitResultList, showerClusters, clustersToExpand, clustersToContract);
46 
47  // Consolidate and re-build clusters
48  ClusterSet unavailableClusters;
49  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->RemoveHitsFromClusters(clustersToContract, unavailableClusters));
50  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->AddHitsToClusters(clustersToExpand, unavailableClusters));
51  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->RebuildClusters(clustersToContract, unavailableClusters));
52 
53  return STATUS_CODE_SUCCESS;
54 }
std::unordered_map< const pandora::Cluster *, pandora::CaloHitList > ClusterToHitMap
void BuildSlidingLinearFits(const pandora::ClusterVector &trackClusters, TwoDSlidingFitResultList &slidingFitResultList) const
Apply sliding linear fits to track clusters.
std::vector< TwoDSlidingFitResult > TwoDSlidingFitResultList
void SortInputClusters(const pandora::ClusterList *const pClusterList, pandora::ClusterVector &trackClusters, pandora::ClusterVector &showerClusters) const
Sort input cluster list into track-like clusters and shower-like clusters.
virtual void GetReclusteredHits(const TwoDSlidingFitResultList &slidingFitResultList, const pandora::ClusterVector &showerClusters, ClusterToHitMap &caloHitsToAdd, ClusterToHitMap &caloHitsToRemove) const =0
Get the list of hits to be added or removed from clusters.
std::vector< art::Ptr< recob::Cluster > > ClusterVector
pandora::StatusCode AddHitsToClusters(const ClusterToHitMap &clustersToRebuild, pandora::ClusterSet &unavailableClusters) const
Add hits to clusters.
pandora::StatusCode RemoveHitsFromClusters(const ClusterToHitMap &clustersToRebuild, pandora::ClusterSet &unavailableClusters) const
Remove hits from clusters.
pandora::StatusCode RebuildClusters(const ClusterToHitMap &clustersAtStart, const pandora::ClusterSet &unavailableClusters) const
Re-build clusters.

Member Data Documentation

float lar_content::TrackConsolidationAlgorithm::m_maxTransverseDisplacement
private

Definition at line 54 of file TrackConsolidationAlgorithm.h.

Referenced by ReadSettings(), and TrackConsolidationAlgorithm().

float lar_content::TrackConsolidationAlgorithm::m_minAssociatedFraction
private

Definition at line 56 of file TrackConsolidationAlgorithm.h.

Referenced by ReadSettings(), and TrackConsolidationAlgorithm().

float lar_content::TrackConsolidationAlgorithm::m_minAssociatedSpan
private

Definition at line 55 of file TrackConsolidationAlgorithm.h.

Referenced by ReadSettings(), and TrackConsolidationAlgorithm().


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