LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ParticleRecoveryAlgorithm.h
Go to the documentation of this file.
1 
8 #ifndef LAR_PARTICLE_RECOVERY_ALGORITHM_H
9 #define LAR_PARTICLE_RECOVERY_ALGORITHM_H 1
10 
11 #include "Pandora/Algorithm.h"
12 
13 #include <unordered_map>
14 
15 namespace lar_content
16 {
17 
21 class ParticleRecoveryAlgorithm : public pandora::Algorithm
22 {
23 public:
28 
29 private:
34  {
35  public:
42  void AddAssociation(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2);
43 
53  void GetConnectedElements(const pandora::Cluster *const pCluster, const bool ignoreUnavailable, pandora::ClusterList &clusterListU,
54  pandora::ClusterList &clusterListV, pandora::ClusterList &clusterListW) const;
55 
61  const pandora::ClusterList &GetKeyClusters() const;
62 
63  private:
64  typedef std::unordered_map<const pandora::Cluster *, pandora::ClusterList> ClusterNavigationMap;
65 
66  pandora::ClusterList m_keyClusters;
67  ClusterNavigationMap m_clusterNavigationMapUV;
68  ClusterNavigationMap m_clusterNavigationMapVW;
69  ClusterNavigationMap m_clusterNavigationMapWU;
70  };
71 
72  pandora::StatusCode Run();
73 
81  void GetInputClusters(pandora::ClusterList &inputClusterListU, pandora::ClusterList &inputClusterListV, pandora::ClusterList &inputClusterListW) const;
82 
89  void SelectInputClusters(const pandora::ClusterList &inputClusterList, pandora::ClusterList &selectedClusterList) const;
90 
97  void StandardClusterSelection(const pandora::ClusterList &inputClusterList, pandora::ClusterList &selectedClusterList) const;
98 
105  void VertexClusterSelection(const pandora::ClusterList &inputClusterList, pandora::ClusterList &selectedClusterList) const;
106 
114  void FindOverlaps(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2, SimpleOverlapTensor &overlapTensor) const;
115 
122  bool IsOverlap(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2) const;
123 
136  void CalculateEffectiveOverlapFractions(const pandora::Cluster *const pCluster1, const float xMin1, const float xMax1,
137  const pandora::Cluster *const pCluster2, const float xMin2, const float xMax2, float &xOverlapFraction1, float &xOverlapFraction2) const;
138 
148  void CalculateEffectiveSpan(const pandora::Cluster *const pCluster, const float xMin, const float xMax, float &xMinEff, float &xMaxEff) const;
149 
155  void ExamineTensor(const SimpleOverlapTensor &overlapTensor) const;
156 
166  bool CheckConsistency(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW) const;
167 
173  void CreateTrackParticle(const pandora::ClusterList &clusterList) const;
174 
175  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
176 
177  pandora::StringVector m_inputClusterListNames;
178  std::string m_outputPfoListName;
179 
180  bool m_checkGaps;
181 
182  unsigned int m_minClusterCaloHits;
185 
189 
193  unsigned int m_slidingFitHalfWindow;
195 };
196 
197 //------------------------------------------------------------------------------------------------------------------------------------------
198 
199 inline const pandora::ClusterList &ParticleRecoveryAlgorithm::SimpleOverlapTensor::GetKeyClusters() const
200 {
201  return m_keyClusters;
202 }
203 
204 } // namespace lar_content
205 
206 #endif // #ifndef LAR_PARTICLE_RECOVERY_ALGORITHM_H
pandora::StringVector m_inputClusterListNames
The list of cluster list names.
ClusterNavigationMap m_clusterNavigationMapVW
The cluster navigation map V->W.
unsigned int m_minClusterCaloHits
The min number of hits in base cluster selection method.
void GetInputClusters(pandora::ClusterList &inputClusterListU, pandora::ClusterList &inputClusterListV, pandora::ClusterList &inputClusterListW) const
Get the input cluster lists for processing in this algorithm.
const pandora::ClusterList & GetKeyClusters() const
Get the list of key clusters.
float m_minClusterLengthSquared
The min length (squared) in base cluster selection method.
void ExamineTensor(const SimpleOverlapTensor &overlapTensor) const
Identify unambiguous cluster overlaps and resolve ambiguous overlaps, creating new track particles...
float m_maxVertexTransverseDistance
Vertex association check: max transverse distance cut.
std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterNavigationMap
bool CheckConsistency(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW) const
Whether a trio of clusters are consistent with representing projections of the same 3d trajectory...
float m_minXOverlapFractionGaps
The min x overlap fraction when there are gaps involved.
void SelectInputClusters(const pandora::ClusterList &inputClusterList, pandora::ClusterList &selectedClusterList) const
Select a subset of input clusters for processing in this algorithm.
void CalculateEffectiveSpan(const pandora::Cluster *const pCluster, const float xMin, const float xMax, float &xMinEff, float &xMaxEff) const
Calculate effective span for a given clsuter taking gaps into account.
void CreateTrackParticle(const pandora::ClusterList &clusterList) const
Create and save a track particle containing the provided clusters.
ClusterNavigationMap m_clusterNavigationMapWU
The cluster navigation map W->U.
bool IsOverlap(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2) const
Whether two clusters overlap convincingly in x.
void AddAssociation(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2)
Add an association between two clusters to the simple overlap tensor.
void FindOverlaps(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2, SimpleOverlapTensor &overlapTensor) const
Find cluster overlaps and record these in the overlap tensor.
float m_minVertexLongitudinalDistance
Vertex association check: min longitudinal distance cut.
pandora::ClusterList m_keyClusters
The list of key clusters.
ClusterNavigationMap m_clusterNavigationMapUV
The cluster navigation map U->V.
float m_minClusterXSpan
The min x span required in order to consider a cluster.
float m_pseudoChi2Cut
The selection cut on the matched chi2.
void CalculateEffectiveOverlapFractions(const pandora::Cluster *const pCluster1, const float xMin1, const float xMax1, const pandora::Cluster *const pCluster2, const float xMin2, const float xMax2, float &xOverlapFraction1, float &xOverlapFraction2) const
Calculate effective overlap fractions taking into account gaps.
unsigned int m_slidingFitHalfWindow
The half window for the fit sliding result constructor.
float m_minXOverlapFraction
The min x overlap fraction required in order to id overlapping clusters.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
bool m_checkGaps
Whether to check for gaps in the calculation of the overlap.
bool m_vertexClusterMode
Whether to demand clusters are associated with vertices of existing particles.
std::string m_outputPfoListName
The output pfo list name.
void StandardClusterSelection(const pandora::ClusterList &inputClusterList, pandora::ClusterList &selectedClusterList) const
Select a subset of input clusters for processing in this algorithm.
float m_sampleStepSize
The sampling step size used in association checks, units cm.
void VertexClusterSelection(const pandora::ClusterList &inputClusterList, pandora::ClusterList &selectedClusterList) const
Select a subset of input clusters nodally associated with the vertices of existing particles...
void GetConnectedElements(const pandora::Cluster *const pCluster, const bool ignoreUnavailable, pandora::ClusterList &clusterListU, pandora::ClusterList &clusterListV, pandora::ClusterList &clusterListW) const
Get elements connected to a specified cluster.