LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
TwoDSlidingFitConsolidationAlgorithm.h
Go to the documentation of this file.
1 
8 #ifndef LAR_TWO_D_SLIDING_FIT_CONSOLIDATION_ALGORITHM_H
9 #define LAR_TWO_D_SLIDING_FIT_CONSOLIDATION_ALGORITHM_H 1
10 
11 #include "Pandora/Algorithm.h"
12 
14 
15 #include <unordered_map>
16 
17 namespace lar_content
18 {
19 
23 class TwoDSlidingFitConsolidationAlgorithm : public pandora::Algorithm
24 {
25 public:
30 
31 protected:
32  pandora::StatusCode Run();
33  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
34 
35  typedef std::unordered_map<const pandora::Cluster *, pandora::CaloHitList> ClusterToHitMap;
36 
45  virtual void GetReclusteredHits(const TwoDSlidingFitResultList &slidingFitResultList, const pandora::ClusterVector &showerClusters,
46  ClusterToHitMap &caloHitsToAdd, ClusterToHitMap &caloHitsToRemove) const = 0;
47 
48 private:
56  void SortInputClusters(
57  const pandora::ClusterList *const pClusterList, pandora::ClusterVector &trackClusters, pandora::ClusterVector &showerClusters) const;
58 
65  void BuildSlidingLinearFits(const pandora::ClusterVector &trackClusters, TwoDSlidingFitResultList &slidingFitResultList) const;
66 
73  pandora::StatusCode RemoveHitsFromClusters(const ClusterToHitMap &clustersToRebuild, pandora::ClusterSet &unavailableClusters) const;
74 
81  pandora::StatusCode AddHitsToClusters(const ClusterToHitMap &clustersToRebuild, pandora::ClusterSet &unavailableClusters) const;
82 
89  pandora::StatusCode RebuildClusters(const ClusterToHitMap &clustersAtStart, const pandora::ClusterSet &unavailableClusters) const;
90 
94  unsigned int m_halfWindowLayers;
95 };
96 
97 } // namespace lar_content
98 
99 #endif // #ifndef LAR_TWO_D_SLIDING_FIT_CONSOLIDATION_ALGORITHM_H
unsigned int m_halfWindowLayers
Size of layer window for sliding fit results.
std::unordered_map< const pandora::Cluster *, pandora::CaloHitList > ClusterToHitMap
float m_maxClusterLength
Maximum length of shower clusters to use in re-building.
float m_minTrackLength
Minimum length of track clusters to consolidate.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
void BuildSlidingLinearFits(const pandora::ClusterVector &trackClusters, TwoDSlidingFitResultList &slidingFitResultList) const
Apply sliding linear fits to track clusters.
Header file for the lar two dimensional sliding fit result class.
std::vector< TwoDSlidingFitResult > TwoDSlidingFitResultList
std::string m_reclusteringAlgorithmName
Name of daughter algorithm to use for cluster re-building.
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.