All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ThreeViewDeltaRayMatchingAlgorithm.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArThreeDReco/LArCosmicRay/ThreeViewDeltaRayMatching.h
3  *
4  * @brief Header file for the three view delta ray matching class
5  *
6  * $Log: $
7  */
8 #ifndef LAR_THREE_VIEW_DELTA_RAY_MATCHING_ALGORITHM_H
9 #define LAR_THREE_VIEW_DELTA_RAY_MATCHING_ALGORITHM_H 1
10 
11 #include "Pandora/Algorithm.h"
12 #include "Pandora/AlgorithmTool.h"
13 
15 
18 
19 namespace lar_content
20 {
21 
22 class DeltaRayTensorTool;
23 
24 //------------------------------------------------------------------------------------------------------------------------------------------
25 
26 /**
27  * @brief ThreeViewDeltaRayMatchingAlgorithm class
28  */
29 class ThreeViewDeltaRayMatchingAlgorithm : public NViewDeltaRayMatchingAlgorithm<ThreeViewMatchingControl<DeltaRayOverlapResult>>
30 {
31 public:
34 
35  /**
36  * @brief Default constructor
37  */
39 
40  /**
41  * @brief Get the name of the clustering algorithm to be used to recluster created delta ray remnants
42  *
43  * @return the clustering algorithm name
44  */
45  std::string GetClusteringAlgName() const;
46 
47 private:
48  typedef std::vector<DeltaRayTensorTool *> TensorToolVector;
49 
50  void CalculateOverlapResult(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW);
52  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
53 
54  /**
55  * @brief To check whether a given cluster meets the requirements to be added into the matching container (tensor/matrix)
56  *
57  * @param pCluster the address of the input cluster
58  *
59  * @return whether the checks were met
60  */
61  virtual bool DoesClusterPassTensorThreshold(const pandora::Cluster *const pCluster) const;
62 
63  /**
64  * @brief Calculate the overlap result for given group of clusters
65  *
66  * @param pClusterU the cluster from the U view
67  * @param pClusterV the cluster from the V view
68  * @param pClusterW the cluster from the W view
69  * @param overlapResult to receive the overlap result
70  *
71  * @return statusCode, faster than throwing in regular use-cases
72  */
73  pandora::StatusCode CalculateOverlapResult(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV,
74  const pandora::Cluster *const pClusterW, DeltaRayOverlapResult &overlapResult) const;
75 
76  /**
77  * @brief Find the cosmic ray pfos that, in each view, lie close to the clusters of the tensor element
78  *
79  * @param pClusterU the cluster from the U view
80  * @param pClusterV the cluster from the V view
81  * @param pClusterW the cluster from the W view
82  * @param commonMuonPfoList the output list of common cosmic ray pfos
83  */
84  void FindCommonMuonParents(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV,
85  const pandora::Cluster *const pClusterW, pandora::PfoList &commonMuonPfoList) const;
86 
87  TensorToolVector m_algorithmToolVector; ///< The algorithm tool vector
88  std::string m_reclusteringAlgorithmName; ///< The name of the clustering algorithm to be used to recluster created delta ray remnants
89  unsigned int m_minClusterCaloHits; ///< The threshold number of hits for a cluster to be considered
90  unsigned int m_nMaxTensorToolRepeats; ///< The maximum number of repeat loops over tensor tools
91 };
92 
93 //------------------------------------------------------------------------------------------------------------------------------------------
94 
95 /**
96  * @brief DeltaRayTensorTool class
97  */
98 class DeltaRayTensorTool : public pandora::AlgorithmTool
99 {
100 public:
102  typedef std::vector<TensorType::ElementList::const_iterator> IteratorList;
103 
104  /**
105  * @brief Run the algorithm tool
106  *
107  * @param pAlgorithm address of the calling algorithm
108  * @param overlapTensor the overlap tensor
109  *
110  * @return whether changes have been made by the tool
111  */
112  virtual bool Run(ThreeViewDeltaRayMatchingAlgorithm *const pAlgorithm, TensorType &overlapTensor) = 0;
113 
114  ThreeViewDeltaRayMatchingAlgorithm *m_pParentAlgorithm; ///< Address of the parent matching algorithm
115 };
116 
117 //------------------------------------------------------------------------------------------------------------------------------------------
118 
120 {
122 }
123 
124 } // namespace lar_content
125 
126 #endif // #ifndef LAR_THREE_VIEW_DELTA_RAY_MATCHING_ALGORITHM_H
void ExamineOverlapContainer()
Examine contents of overlap container, collect together best-matching 2D particles and modify cluster...
unsigned int m_nMaxTensorToolRepeats
The maximum number of repeat loops over tensor tools.
NViewDeltaRayMatchingAlgorithm< ThreeViewMatchingControl< DeltaRayOverlapResult > > BaseAlgorithm
ThreeViewDeltaRayMatchingAlgorithm * m_pParentAlgorithm
Address of the parent matching algorithm.
std::string m_reclusteringAlgorithmName
The name of the clustering algorithm to be used to recluster created delta ray remnants.
TensorToolVector m_algorithmToolVector
The algorithm tool vector.
virtual bool DoesClusterPassTensorThreshold(const pandora::Cluster *const pCluster) const
To check whether a given cluster meets the requirements to be added into the matching container (tens...
std::string GetClusteringAlgName() const
Get the name of the clustering algorithm to be used to recluster created delta ray remnants...
std::vector< TensorType::ElementList::const_iterator > IteratorList
void FindCommonMuonParents(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW, pandora::PfoList &commonMuonPfoList) const
Find the cosmic ray pfos that, in each view, lie close to the clusters of the tensor element...
unsigned int m_minClusterCaloHits
The threshold number of hits for a cluster to be considered.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
ThreeViewDeltaRayMatchingAlgorithm::MatchingType::TensorType TensorType
virtual bool Run(ThreeViewDeltaRayMatchingAlgorithm *const pAlgorithm, TensorType &overlapTensor)=0
Run the algorithm tool.
DeltaRayOverlapResult class.
void CalculateOverlapResult(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW)
Calculate cluster overlap result and store in container.
Header file for the lar track overlap result class.
Header file for the three view matching control class.
ThreeViewDeltaRayMatchingAlgorithm::MatchingType::TensorType TensorType