LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
ThreeDTracksBaseAlgorithm.h
Go to the documentation of this file.
1 
8 #ifndef LAR_THREE_D_TRACKS_BASE_ALGORITHM_H
9 #define LAR_THREE_D_TRACKS_BASE_ALGORITHM_H 1
10 
12 
14 
15 #include <unordered_map>
16 
17 namespace lar_content
18 {
19 
20 typedef std::unordered_map<const pandora::Cluster*, pandora::CartesianPointVector> SplitPositionMap;
21 
22 //------------------------------------------------------------------------------------------------------------------------------------------
23 
27 template<typename T>
29 {
30 public:
35 
40 
46  const TwoDSlidingFitResult &GetCachedSlidingFitResult(const pandora::Cluster *const pCluster) const;
47 
53  unsigned int GetSlidingFitWindow() const;
54 
62  virtual bool MakeClusterSplits(const SplitPositionMap &splitPositionMap);
63 
74  virtual bool MakeClusterSplit(const pandora::CartesianVector &splitPosition, const pandora::Cluster *&pCurrentCluster,
75  const pandora::Cluster *&pLowXCluster, const pandora::Cluster *&pHighXCluster) const;
76 
83  static bool SortSplitPositions(const pandora::CartesianVector &lhs, const pandora::CartesianVector &rhs);
84 
85  virtual void UpdateForNewCluster(const pandora::Cluster *const pNewCluster);
86  virtual void UpdateUponDeletion(const pandora::Cluster *const pDeletedCluster);
87  virtual void SelectInputClusters(const pandora::ClusterList *const pInputClusterList, pandora::ClusterList &selectedClusterList) const;
88  virtual void SetPfoParameters(const ProtoParticle &protoParticle, PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const;
89 
90 protected:
91  virtual void PreparationStep();
92 
98  virtual void PreparationStep(pandora::ClusterList &clusterList);
99 
100  virtual void TidyUp();
101 
107  void AddToSlidingFitCache(const pandora::Cluster *const pCluster);
108 
114  void RemoveFromSlidingFitCache(const pandora::Cluster *const pCluster);
115 
116  virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
117 
118  unsigned int m_slidingFitWindow;
120 
121  unsigned int m_minClusterCaloHits;
123 };
124 
125 //------------------------------------------------------------------------------------------------------------------------------------------
126 
127 template<typename T>
129 {
130  return m_slidingFitWindow;
131 }
132 
133 } // namespace lar_content
134 
135 #endif // #ifndef LAR_THREE_D_TRACKS_BASE_ALGORITHM_H
virtual void UpdateUponDeletion(const pandora::Cluster *const pDeletedCluster)
Update to reflect cluster deletion.
ThreeDBaseAlgorithm class.
std::unordered_map< const pandora::Cluster *, pandora::CartesianPointVector > SplitPositionMap
virtual bool MakeClusterSplits(const SplitPositionMap &splitPositionMap)
Make cluster splits.
const TwoDSlidingFitResult & GetCachedSlidingFitResult(const pandora::Cluster *const pCluster) const
Get a sliding fit result from the algorithm cache.
std::unordered_map< const pandora::Cluster *, TwoDSlidingFitResult > TwoDSlidingFitResultMap
virtual void TidyUp()
Tidy member variables in derived class.
TwoDSlidingFitResultMap m_slidingFitResultMap
The sliding fit result map.
ThreeDTransverseTracksAlgorithm class.
void AddToSlidingFitCache(const pandora::Cluster *const pCluster)
Add a new sliding fit result, for the specified cluster, to the algorithm cache.
static bool SortSplitPositions(const pandora::CartesianVector &lhs, const pandora::CartesianVector &rhs)
Sort split position cartesian vectors by increasing x coordinate.
Header file for the three dimension algorithm base class.
virtual void SelectInputClusters(const pandora::ClusterList *const pInputClusterList, pandora::ClusterList &selectedClusterList) const
Select a subset of input clusters for processing in this algorithm.
unsigned int m_minClusterCaloHits
The min number of hits in base cluster selection method.
Header file for the lar two dimensional sliding fit result class.
virtual void PreparationStep()
Perform any preparatory steps required, e.g. caching expensive fit results for clusters.
unsigned int m_slidingFitWindow
The layer window for the sliding linear fits.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
virtual bool MakeClusterSplit(const pandora::CartesianVector &splitPosition, const pandora::Cluster *&pCurrentCluster, const pandora::Cluster *&pLowXCluster, const pandora::Cluster *&pHighXCluster) const
Make a cluster split.
float m_minClusterLengthSquared
The min length (squared) in base cluster selection method.
virtual void UpdateForNewCluster(const pandora::Cluster *const pNewCluster)
Update to reflect addition of a new cluster to the problem space.
virtual void SetPfoParameters(const ProtoParticle &protoParticle, PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const
Calculate Pfo properties from proto particle.
void RemoveFromSlidingFitCache(const pandora::Cluster *const pCluster)
Remova an existing sliding fit result, for the specified cluster, from the algorithm cache...
unsigned int GetSlidingFitWindow() const
Get the layer window for the sliding linear fits.