SplitShowersTool.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArThreeDReco/LArShowerMatching/SplitShowersTool.h
3  *
4  * @brief Header file for the split showers tool class.
5  *
6  * $Log: $
7  */
8 #ifndef SPLIT_SHOWERS_TOOL_H
9 #define SPLIT_SHOWERS_TOOL_H 1
10 
12 
13 namespace lar_content
14 {
15 
16 /**
17  * @brief SplitShowersTool class
18  */
20 {
21 public:
22  /**
23  * @brief Default constructor
24  */
26 
27  bool Run(ThreeViewShowersAlgorithm *const pAlgorithm, TensorType &overlapTensor);
28 
29 private:
30  /**
31  * @brief Find split showers, using information from the overlap tensor
32  *
33  * @param pAlgorithm address of the calling algorithm
34  * @param overlapTensor the overlap tensor
35  * @param clusterMergeMap to receive the list of cluster merges
36  */
37  void FindSplitShowers(ThreeViewShowersAlgorithm *const pAlgorithm, const TensorType &overlapTensor, ClusterMergeMap &clusterMergeMap) const;
38 
39  /**
40  * @brief Whether a provided (iterator to a) tensor element passes the selection cuts for undershoots identification
41  *
42  * @param eIter the iterator to the tensor element
43  * @param usedClusters the list of used clusters
44  */
45  bool PassesElementCuts(TensorType::ElementList::const_iterator eIter, const pandora::ClusterSet &usedClusters) const;
46 
47  /**
48  * @brief Select elements representing possible components of interest due to undershoots in clustering
49  *
50  * @param eIter iterator to a candidate element
51  * @param elementList the provided element list
52  * @param usedClusters the list of used clusters
53  * @param iteratorList to receive a list of iterators to relevant elements
54  */
56  const pandora::ClusterSet &usedClusters, IteratorList &iteratorList) const;
57 
58  /**
59  * @brief Get cluster merges specific elements of the tensor
60  *
61  * @param pAlgorithm address of the calling algorithm
62  * @param iteratorList list of iterators to relevant tensor elements
63  * @param usedClusters the list of used clusters
64  * @param clusterMergeMap to be populated with cluster merges
65  */
66  void FindShowerMerges(ThreeViewShowersAlgorithm *const pAlgorithm, const IteratorList &iteratorList, pandora::ClusterSet &usedClusters,
67  ClusterMergeMap &clusterMergeMap) const;
68 
69  /**
70  * @brief Check the clusters in a provided cluster list are in suitable proximity for merging
71  *
72  * @param pAlgorithm address of the calling algorithm
73  * @param clusterList the cluster list
74  */
75  bool CheckClusterProximities(ThreeViewShowersAlgorithm *const pAlgorithm, const pandora::ClusterList &clusterList) const;
76 
77  /**
78  * @brief Check the consistency of the clusters in a provided cluster list with the event vertex, if available
79  *
80  * @param pAlgorithm address of the calling algorithm
81  * @param clusterList the cluster list
82  */
83  bool CheckClusterVertexRelations(ThreeViewShowersAlgorithm *const pAlgorithm, const pandora::ClusterList &clusterList) const;
84 
85  /**
86  * @brief Check the consistency of the split positions in the provided u, v and w cluster lists
87  *
88  * @param pAlgorithm address of the calling algorithm
89  * @param clusterListU the u cluster list
90  * @param clusterListV the v cluster list
91  * @param clusterListW the w cluster list
92  */
93  bool CheckClusterSplitPositions(ThreeViewShowersAlgorithm *const pAlgorithm, const pandora::ClusterList &clusterListU,
94  const pandora::ClusterList &clusterListV, const pandora::ClusterList &clusterListW) const;
95 
96  /**
97  * @brief Get the x coordinate representing the midpoint between two clusters (hypothesis: clusters represent a split shower)
98  *
99  * @param pAlgorithm address of the calling algorithm
100  * @param pClusterA the address of cluster A
101  * @param pClusterB the address of cluster B
102  * @param splitXPosition to receive the split position estimate
103  * @param overlapX to receive the overlap estimate
104  */
105  void GetSplitXDetails(ThreeViewShowersAlgorithm *const pAlgorithm, const pandora::Cluster *const pClusterA,
106  const pandora::Cluster *const pClusterB, float &splitXPosition, float &overlapX) const;
107 
108  /**
109  * @brief Populate the cluster merge map, based on the information contained in the provided cluster list
110  *
111  * @param pAlgorithm address of the calling algorithm
112  * @param clusterList the cluster list
113  * @param clusterMergeMap to receive the populated cluster merge map
114  */
115  void SpecifyClusterMerges(ThreeViewShowersAlgorithm *const pAlgorithm, const pandora::ClusterList &clusterList, ClusterMergeMap &clusterMergeMap) const;
116 
117  /**
118  * @brief Apply the changes cached in a cluster merge map and update the tensor accordingly
119  *
120  * @param pAlgorithm address of the calling algorithm
121  * @param clusterMergeMap the cluster merge map
122  *
123  * @return whether changes to the tensor have been made
124  */
125  bool ApplyChanges(ThreeViewShowersAlgorithm *const pAlgorithm, const ClusterMergeMap &clusterMergeMap) const;
126 
127  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
128 
129  unsigned int m_nCommonClusters; ///< The number of common clusters
130  float m_minMatchedFraction; ///< The min matched sampling point fraction for use as a key tensor element
131  unsigned int m_minMatchedSamplingPoints; ///< The min number of matched sampling points for use as a key tensor element
132 
133  bool m_checkClusterProximities; ///< Whether to check the proximities of the candidate split shower clusters
134  float m_maxClusterSeparation; ///< The maximum separation for clusters to be merged
135 
136  bool m_checkClusterVertexRelations; ///< Whether to check the consistency of the clusters with the event vertex
137  float m_minVertexLongitudinalDistance; ///< Vertex association check: min longitudinal distance cut
138  float m_maxVertexLongitudinalDistance; ///< Vertex association check: max longitudinal distance cut
139  float m_maxVertexTransverseDistance; ///< Vertex association check: max transverse distance cut
140  float m_vertexAngularAllowance; ///< Vertex association check: pointing angular allowance in degrees
141  unsigned int m_maxVertexAssociations; ///< The maximum number of vertex associations for clusters to be merged
142 
143  bool m_checkClusterSplitPositions; ///< Whether to check the cluster split positions, if there are splits in multiple views
144  float m_vetoMergeXDifference; ///< The x distance between split positions in two views below which may refuse a merge
145  float m_vetoMergeXOverlap; ///< The x overlap between candidate cluster sliding fits below which may refuse a merge
146 };
147 
148 } // namespace lar_content
149 
150 #endif // #ifndef SPLIT_SHOWERS_TOOL_H
bool CheckClusterVertexRelations(ThreeViewShowersAlgorithm *const pAlgorithm, const pandora::ClusterList &clusterList) const
Check the consistency of the clusters in a provided cluster list with the event vertex, if available.
float m_maxVertexLongitudinalDistance
Vertex association check: max longitudinal distance cut.
void GetSplitXDetails(ThreeViewShowersAlgorithm *const pAlgorithm, const pandora::Cluster *const pClusterA, const pandora::Cluster *const pClusterB, float &splitXPosition, float &overlapX) const
Get the x coordinate representing the midpoint between two clusters (hypothesis: clusters represent a...
bool CheckClusterProximities(ThreeViewShowersAlgorithm *const pAlgorithm, const pandora::ClusterList &clusterList) const
Check the clusters in a provided cluster list are in suitable proximity for merging.
float m_maxVertexTransverseDistance
Vertex association check: max transverse distance cut.
unsigned int m_nCommonClusters
The number of common clusters.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
SplitShowersTool()
Default constructor.
std::vector< TensorType::ElementList::const_iterator > IteratorList
bool m_checkClusterProximities
Whether to check the proximities of the candidate split shower clusters.
float m_vetoMergeXOverlap
The x overlap between candidate cluster sliding fits below which may refuse a merge.
void FindShowerMerges(ThreeViewShowersAlgorithm *const pAlgorithm, const IteratorList &iteratorList, pandora::ClusterSet &usedClusters, ClusterMergeMap &clusterMergeMap) const
Get cluster merges specific elements of the tensor.
bool CheckClusterSplitPositions(ThreeViewShowersAlgorithm *const pAlgorithm, const pandora::ClusterList &clusterListU, const pandora::ClusterList &clusterListV, const pandora::ClusterList &clusterListW) const
Check the consistency of the split positions in the provided u, v and w cluster lists.
unsigned int m_minMatchedSamplingPoints
The min number of matched sampling points for use as a key tensor element.
void FindSplitShowers(ThreeViewShowersAlgorithm *const pAlgorithm, const TensorType &overlapTensor, ClusterMergeMap &clusterMergeMap) const
Find split showers, using information from the overlap tensor.
SplitShowersTool class.
float m_maxClusterSeparation
The maximum separation for clusters to be merged.
bool Run(ThreeViewShowersAlgorithm *const pAlgorithm, TensorType &overlapTensor)
Run the algorithm tool.
bool PassesElementCuts(TensorType::ElementList::const_iterator eIter, const pandora::ClusterSet &usedClusters) const
Whether a provided (iterator to a) tensor element passes the selection cuts for undershoots identific...
void SpecifyClusterMerges(ThreeViewShowersAlgorithm *const pAlgorithm, const pandora::ClusterList &clusterList, ClusterMergeMap &clusterMergeMap) const
Populate the cluster merge map, based on the information contained in the provided cluster list...
bool m_checkClusterSplitPositions
Whether to check the cluster split positions, if there are splits in multiple views.
float m_vetoMergeXDifference
The x distance between split positions in two views below which may refuse a merge.
bool ApplyChanges(ThreeViewShowersAlgorithm *const pAlgorithm, const ClusterMergeMap &clusterMergeMap) const
Apply the changes cached in a cluster merge map and update the tensor accordingly.
float m_minMatchedFraction
The min matched sampling point fraction for use as a key tensor element.
std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterMergeMap
float m_vertexAngularAllowance
Vertex association check: pointing angular allowance in degrees.
float m_minVertexLongitudinalDistance
Vertex association check: min longitudinal distance cut.
bool m_checkClusterVertexRelations
Whether to check the consistency of the clusters with the event vertex.
Header file for the three view showers algorithm class.
void SelectTensorElements(TensorType::ElementList::const_iterator eIter, const TensorType::ElementList &elementList, const pandora::ClusterSet &usedClusters, IteratorList &iteratorList) const
Select elements representing possible components of interest due to undershoots in clustering...
unsigned int m_maxVertexAssociations
The maximum number of vertex associations for clusters to be merged.