LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
SlidingConeClusterMopUpAlgorithm.h
Go to the documentation of this file.
1 
8 #ifndef LAR_SLIDING_CONE_CLUSTER_MOP_UP_ALGORITHM_H
9 #define LAR_SLIDING_CONE_CLUSTER_MOP_UP_ALGORITHM_H 1
10 
12 
13 #include <unordered_map>
14 
15 namespace lar_content
16 {
17 
22 {
23 public:
28 
29 private:
34  {
35  public:
43  ClusterMerge(const pandora::Cluster *const pParentCluster, const float boundedFraction, const float meanRT);
44 
50  const pandora::Cluster *GetParentCluster() const;
51 
57  float GetBoundedFraction() const;
58 
64  float GetMeanRT() const;
65 
73  bool operator<(const ClusterMerge &rhs) const;
74 
75  private:
76  const pandora::Cluster *m_pParentCluster;
78  float m_meanRT;
79  };
80 
81  typedef std::vector<ClusterMerge> ClusterMergeList;
82 
83  pandora::StatusCode Run();
84 
90  void GetInteractionVertex(const pandora::Vertex *&pVertex) const;
91 
92  typedef std::unordered_map<const pandora::Cluster *, const pandora::ParticleFlowObject *> ClusterToPfoMap;
93 
100  void GetThreeDClusters(pandora::ClusterVector &clusters3D, ClusterToPfoMap &clusterToPfoMap) const;
101 
107  void GetAvailableTwoDClusters(pandora::ClusterVector &availableClusters2D) const;
108 
109  typedef std::unordered_map<const pandora::Cluster *, ClusterMergeList> ClusterMergeMap;
110 
119  void GetClusterMergeMap(const pandora::Vertex *const pVertex, const pandora::ClusterVector &clusters3D,
120  const pandora::ClusterVector &availableClusters2D, ClusterMergeMap &clusterMergeMap) const;
121 
128  void MakeClusterMerges(const ClusterToPfoMap &clusterToPfoMap, const ClusterMergeMap &clusterMergeMap) const;
129 
130  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
131 
132  pandora::StringVector m_inputPfoListNames;
133  bool m_useVertex;
134  unsigned int m_maxIterations;
138  unsigned int m_halfWindowLayers;
139  unsigned int m_nConeFitLayers;
140  unsigned int m_nConeFits;
145 };
146 
147 //------------------------------------------------------------------------------------------------------------------------------------------
148 
150  const pandora::Cluster *const pParentCluster, const float boundedFraction, const float meanRT) :
151  m_pParentCluster(pParentCluster),
152  m_boundedFraction(boundedFraction),
153  m_meanRT(meanRT)
154 {
155 }
156 
157 //------------------------------------------------------------------------------------------------------------------------------------------
158 
160 {
161  return m_pParentCluster;
162 }
163 
164 //------------------------------------------------------------------------------------------------------------------------------------------
165 
167 {
168  return m_boundedFraction;
169 }
170 
171 //------------------------------------------------------------------------------------------------------------------------------------------
172 
174 {
175  return m_meanRT;
176 }
177 
178 } // namespace lar_content
179 
180 #endif // #ifndef LAR_SLIDING_CONE_CLUSTER_MOP_UP_ALGORITHM_H
bool m_useVertex
Whether to use the interaction vertex to select useful cone directions.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
float m_boundedFraction
The bounded fraction for algorithm-specified cone angle.
void GetThreeDClusters(pandora::ClusterVector &clusters3D, ClusterToPfoMap &clusterToPfoMap) const
Get all 3d clusters contained in the input pfo lists and a mapping from clusters to pfos...
unsigned int m_nConeFits
The number of cone fits to perform, spread roughly uniformly along the shower length.
const pandora::Cluster * GetParentCluster() const
Get the address of the candidate parent (shower) cluster.
unsigned int m_maxIterations
The maximum allowed number of algorithm iterations.
float GetMeanRT() const
Get the mean transverse distance of all hits (whether contained or not)
float GetBoundedFraction() const
Get the bounded fraction for algorithm-specified cone angle.
unsigned int m_nConeFitLayers
The number of layers over which to sum fitted direction to obtain cone fit.
std::unordered_map< const pandora::Cluster *, ClusterMergeList > ClusterMergeMap
unsigned int m_maxHitsToConsider2DCluster
The maximum number of hits in a 2d cluster to allow pick-up via sliding cone fits.
float m_meanRT
The mean transverse distance of all hits (whether contained or not)
void GetClusterMergeMap(const pandora::Vertex *const pVertex, const pandora::ClusterVector &clusters3D, const pandora::ClusterVector &availableClusters2D, ClusterMergeMap &clusterMergeMap) const
Get the cluster merge map describing all potential 3d cluster merges.
float m_coneLengthMultiplier
The cone length multiplier to use when calculating bounded cluster fractions.
unsigned int m_halfWindowLayers
The number of layers to use for half-window of sliding fit.
unsigned int m_minHitsToConsider3DShower
The minimum number of hits in a 3d shower cluster to attempt cone fits.
PfoMopUpBaseAlgorithm class.
unsigned int m_maxHitsToConsider3DTrack
The maximum number of hits in a 3d track cluster to warrant inclusion in algorithm.
void MakeClusterMerges(const ClusterToPfoMap &clusterToPfoMap, const ClusterMergeMap &clusterMergeMap) const
Make cluster merges based on the provided cluster merge map.
ClusterMerge(const pandora::Cluster *const pParentCluster, const float boundedFraction, const float meanRT)
Constructor.
const pandora::Cluster * m_pParentCluster
The address of the candidate parent (shower) cluster.
float m_coneBoundedFraction
The minimum cluster bounded fraction for association.
pandora::StringVector m_inputPfoListNames
The input pfo list names.
Header file for the pfo mop up algorithm base class.
std::unordered_map< const pandora::Cluster *, const pandora::ParticleFlowObject * > ClusterToPfoMap
float m_coneTanHalfAngle
The cone tan half angle to use when calculating bounded cluster fractions.
void GetAvailableTwoDClusters(pandora::ClusterVector &availableClusters2D) const
Get all available 2d clusters contained in the input cluster lists.
void GetInteractionVertex(const pandora::Vertex *&pVertex) const
Get the neutrino interaction vertex if it is available and if the algorithm is configured to do so...
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
std::vector< art::Ptr< recob::Cluster > > ClusterVector
float m_maxConeLength
The maximum allowed cone length to use when calculating bounded cluster fractions.