ClearTrackFragmentsTool.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArThreeDReco/LArTrackFragments/ClearTrackFragmentsTool.h
3  *
4  * @brief Header file for the clear track fragments tool class.
5  *
6  * $Log: $
7  */
8 #ifndef CLEAR_TRACK_FRAGMENTS_TOOL_H
9 #define CLEAR_TRACK_FRAGMENTS_TOOL_H 1
10 
12 
13 namespace lar_content
14 {
15 
16 /**
17  * @brief ClearTrackFragmentsTool class
18  */
20 {
21 public:
22  /**
23  * @brief Default constructor
24  */
26 
27  bool Run(ThreeViewTrackFragmentsAlgorithm *const pAlgorithm, TensorType &overlapTensor);
28 
29 private:
30  /**
31  * @brief Find suitable matching track fragments in the overlap tensor to use for 3D particle creation,
32  * return value indicates whether particles are made
33  *
34  * @param pAlgorithm address of the calling algorithm
35  * @param overlapTensor the overlap tensor
36  *
37  * @return boolean
38  */
39  bool FindTrackFragments(ThreeViewTrackFragmentsAlgorithm *const pAlgorithm, const TensorType &overlapTensor) const;
40 
41  /**
42  * @brief Get the list of elements connected to a given cluster and check its suitability (no ambiguities)
43  *
44  * @param overlapTensor the overlap tensor
45  * @param pCluster address of the key cluster
46  * @param elementList to receive the element list
47  *
48  * @return boolean
49  */
50  bool GetAndCheckElementList(const TensorType &overlapTensor, const pandora::Cluster *const pCluster, TensorType::ElementList &elementList) const;
51 
52  /**
53  * @brief Check whether the overlap result passes matched sampling point and number of matched hit checks
54  *
55  * @param overlapResult the overlap result
56  *
57  * @return boolean
58  */
59  bool CheckOverlapResult(const TensorType::OverlapResult &overlapResult) const;
60 
61  /**
62  * @brief Select a list of clear track-like elements from a set of connected tensor elements
63  *
64  * @param elementList the full list of connected tensor elements
65  * @param iteratorList to receive a list of iterators to long track-like elements
66  */
67  void SelectClearElements(const TensorType::ElementList &elementList, IteratorList &iteratorList) const;
68 
69  /**
70  * @brief Process a tensor element, reclustering the fragments as required
71  *
72  * @param pAlgorithm address of the calling algorithm
73  * @param overlapTensor the overlap tensor
74  * @param overlapResult the overlap result
75  * @param pFragmentCluster to receive the address of the new fragment cluster
76  */
77  void ProcessTensorElement(ThreeViewTrackFragmentsAlgorithm *const pAlgorithm, const TensorType &overlapTensor,
78  const TensorType::OverlapResult &overlapResult, const pandora::Cluster *&pFragmentCluster) const;
79 
80  /**
81  * @brief Rearrange the hits in a cluster from the fragment list, using the Pandora fragmentation mechanism
82  *
83  * @param pAlgorithm address of the calling algorithm
84  * @param pCluster address of the input cluster
85  * @param daughterHits the full list of hits to place in the new fragment cluster
86  * @param separateHits the full list of hits that are not to be placed in the new fragment cluster
87  * @param deletedClusters to receive the set of deleted clusters
88  * @param badClusters the set of clusters that should not be dereferenced
89  * @param pFragmentCluster to receive the address of the new fragment cluster
90  */
91  void Recluster(ThreeViewTrackFragmentsAlgorithm *const pAlgorithm, const pandora::Cluster *const pCluster,
92  const pandora::CaloHitList &daughterHits, const pandora::CaloHitList &separateHits, pandora::ClusterSet &deletedClusters,
93  pandora::ClusterSet &badClusters, const pandora::Cluster *&pFragmentCluster) const;
94 
95  /**
96  * @brief Rebuild clusters after fragmentation
97  *
98  * @param pAlgorithm address of the calling algorithm
99  * @param modifiedClusters the list of clusters to rebuild
100  * @param newClusters the list of new clusters
101  */
102  void RebuildClusters(ThreeViewTrackFragmentsAlgorithm *const pAlgorithm, const pandora::ClusterList &modifiedClusters,
103  pandora::ClusterList &newClusters) const;
104 
105  /**
106  * @brief Get a list of the tensor key clusters for which tensor elements have been impacted by fragmentation operations
107  *
108  * @param overlapTensor the overlap tensor
109  * @param clustersToRemoveFromTensor the list of clusters removed from the tensor by fragmentation operations
110  * @param affectedKeyClusters to receive the list of tensor key clusters that have been affected by fragmentation operations
111  */
112  void GetAffectedKeyClusters(const TensorType &overlapTensor, const pandora::ClusterList &clustersToRemoveFromTensor,
113  pandora::ClusterList &affectedKeyClusters) const;
114 
115  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
116 
117  float m_minMatchedSamplingPointFraction; ///< The minimum fraction of matched sampling points
118  unsigned int m_minMatchedHits; ///< The minimum number of matched calo hits
119 };
120 
121 } // namespace lar_content
122 
123 #endif // #ifndef CLEAR_TRACK_FRAGMENTS_TOOL_H
FragmentOverlapResult class.
unsigned int m_minMatchedHits
The minimum number of matched calo hits.
ClearTrackFragmentsTool class.
void RebuildClusters(ThreeViewTrackFragmentsAlgorithm *const pAlgorithm, const pandora::ClusterList &modifiedClusters, pandora::ClusterList &newClusters) const
Rebuild clusters after fragmentation.
bool Run(ThreeViewTrackFragmentsAlgorithm *const pAlgorithm, TensorType &overlapTensor)
Run the algorithm tool.
float m_minMatchedSamplingPointFraction
The minimum fraction of matched sampling points.
void Recluster(ThreeViewTrackFragmentsAlgorithm *const pAlgorithm, const pandora::Cluster *const pCluster, const pandora::CaloHitList &daughterHits, const pandora::CaloHitList &separateHits, pandora::ClusterSet &deletedClusters, pandora::ClusterSet &badClusters, const pandora::Cluster *&pFragmentCluster) const
Rearrange the hits in a cluster from the fragment list, using the Pandora fragmentation mechanism...
void ProcessTensorElement(ThreeViewTrackFragmentsAlgorithm *const pAlgorithm, const TensorType &overlapTensor, const TensorType::OverlapResult &overlapResult, const pandora::Cluster *&pFragmentCluster) const
Process a tensor element, reclustering the fragments as required.
bool FindTrackFragments(ThreeViewTrackFragmentsAlgorithm *const pAlgorithm, const TensorType &overlapTensor) const
Find suitable matching track fragments in the overlap tensor to use for 3D particle creation...
std::vector< TensorType::ElementList::const_iterator > IteratorList
void SelectClearElements(const TensorType::ElementList &elementList, IteratorList &iteratorList) const
Select a list of clear track-like elements from a set of connected tensor elements.
bool GetAndCheckElementList(const TensorType &overlapTensor, const pandora::Cluster *const pCluster, TensorType::ElementList &elementList) const
Get the list of elements connected to a given cluster and check its suitability (no ambiguities) ...
Header file for the three view fragments algorithm base class.
void GetAffectedKeyClusters(const TensorType &overlapTensor, const pandora::ClusterList &clustersToRemoveFromTensor, pandora::ClusterList &affectedKeyClusters) const
Get a list of the tensor key clusters for which tensor elements have been impacted by fragmentation o...
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
bool CheckOverlapResult(const TensorType::OverlapResult &overlapResult) const
Check whether the overlap result passes matched sampling point and number of matched hit checks...