DeltaRayMergeTool.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArThreeDReco/LArCosmicRay/DeltaRayMergeTool.h
3  *
4  * @brief Header file for the delta ray merge tool class
5  *
6  * $Log: $
7  */
8 #ifndef DELTA_RAY_MERGE_TOOL_H
9 #define DELTA_RAY_MERGE_TOOL_H 1
10 
12 
13 namespace lar_content
14 {
15 /**
16  * @brief DeltaRayMergeTool class
17  */
19 {
20 public:
21  /**
22  * @brief Default constructor
23  */
25 
26 private:
27  bool Run(ThreeViewDeltaRayMatchingAlgorithm *const pAlgorithm, TensorType &overlapTensor);
28  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
29 
30  /**
31  * @brief Identify ambiguous matches (e.g. 3:2:1) and attempt to merge clusters together
32  *
33  * @param overlapTensor the overlap tensor
34  *
35  * @return whether any merges have been made
36  */
37  bool ExamineConnectedElements(TensorType &overlapTensor) const;
38 
39  /**
40  * @brief Search for two matches with two common clusters and attempt to merge the clusters in the third view together
41  *
42  * @param elementList the tensor element list
43  *
44  * @return whether a merge was made
45  */
46  bool MakeTwoCommonViewMerges(const TensorType::ElementList &elementList) const;
47 
48  /**
49  * @brief Create a list of the shared common muon pfos of two elements
50  *
51  * @param commonMuonPfoList1 the common muon pfo list of the first element
52  * @param commonMuonPfoList2 the common muon pfo list of the second element
53  * @param commonMuonPfoList the output common muon pfo list
54  */
56  const pandora::PfoList &commonMuonPfoList1, const pandora::PfoList &commonMuonPfoList2, pandora::PfoList &commonMuonPfoList) const;
57 
58  /**
59  * @brief Determine, from a topological point of view, whether two delta ray clusters should be merged together
60  *
61  * @param element1 the first tensor element
62  * @param element2 the second tensor element
63  * @param mergeHitType the hit type of the view in which to assess the merge
64  *
65  * @return whether the clusters are topologically associated
66  */
67  bool AreAssociated(const TensorType::Element &element1, const TensorType::Element &element2, const pandora::HitType &mergeHitType) const;
68 
69  /**
70  * @brief Return the list of muon pfos that a specified delta ray cluster is directly connected to
71  *
72  * @param pDeltaRayCluster the address of the input delta ray cluster
73  * @param commonMuonPfoList the common muon pfo list of the element to which the DR cluster belongs
74  * @param connectedMuonPfoList the output list of connected muon pfos
75  */
76  void GetConnectedMuons(const pandora::Cluster *const pDeltaRayCluster, const pandora::PfoList &commonMuonPfoList,
77  pandora::PfoList &connectedMuonPfoList) const;
78 
79  /**
80  * @brief Determine whether a given cluster is connected to a cosmic ray pfo
81  *
82  * @param pCluster the address of the input cluster
83  * @param pCommonMuonPfo the address of the cosmic ray pfo
84  *
85  * @return whether the cluster is connected to the cosmic ray pfo
86  */
87  bool IsConnected(const pandora::Cluster *const pCluster, const pandora::Pfo *const pCommonMuonPfo) const;
88 
89  /**
90  * @brief Determine whether two delta ray clusters have been split
91  *
92  * @param pClusterToEnlarge the address of one delta ray cluster
93  * @param pClusterToDelete the address of the other delta ray cluster
94  *
95  * @return whether the clusters have been split
96  */
97  bool IsBrokenCluster(const pandora::Cluster *const pClusterToEnlarge, const pandora::Cluster *const pClusterToDelete) const;
98 
99  /**
100  * @brief Determine whether two delta ray clusters are actually a single cluster that is hidden behind a cosmic ray track
101  *
102  * @param pMuonPfo the address of the cosmic ray pfo
103  * @param pCluster1 the address of one delta ray cluster
104  * @param pCluster2 the address of the other delta ray cluster
105  *
106  * @return whether the delta ray clusters are one delta ray cluster, hidden behind a cosmic ray track
107  */
108  bool IsHiddenByTrack(const pandora::ParticleFlowObject *const pMuonPfo, const pandora::Cluster *const pCluster1,
109  const pandora::Cluster *const pCluster2) const;
110 
111  /**
112  * @brief Find all connection points of a delta ray cluster and a cosmic ray pfo
113  *
114  * @param pCommonMuonPfo the address of the cosmic ray pfo
115  * @param pCluster the address of the delta ray cluster
116  * @param vertexList the output list of connection points
117  */
118  void FindVertices(const pandora::Pfo *const pCommonMuonPfo, const pandora::Cluster *const pCluster, pandora::CaloHitList &vertexList) const;
119 
120  /**
121  * @brief Search for two matches with a single common cluster and attempt to merge the clusters in the other two views together
122  *
123  * @param elementList the tensor element list
124  *
125  * @return whether a merge was made
126  */
127  bool MakeOneCommonViewMerges(const TensorType::ElementList &elementList) const;
128 
129  float m_maxDRSeparationFromTrack; ///< The maximum distance of a connected delta ray from a cosmic ray track
130  float m_maxClusterSeparation; ///< The maximum separation of two broken clusters that should be merged
131  float m_maxVertexSeparation; ///< The maximum separation of the connection points of two delta ray clusters that are hidden by a CR track and should be merged
132  float m_maxGoodMatchReducedChiSquared; ///< The threshold reduced chi squared value for a potential two view merge to go ahead
133 };
134 
135 } // namespace lar_content
136 
137 #endif // #ifndef DELTA_RAY_MERGE_TOOL_H
float m_maxVertexSeparation
The maximum separation of the connection points of two delta ray clusters that are hidden by a CR tra...
float m_maxClusterSeparation
The maximum separation of two broken clusters that should be merged.
enum cvn::HType HitType
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
void GetConnectedMuons(const pandora::Cluster *const pDeltaRayCluster, const pandora::PfoList &commonMuonPfoList, pandora::PfoList &connectedMuonPfoList) const
Return the list of muon pfos that a specified delta ray cluster is directly connected to...
bool IsHiddenByTrack(const pandora::ParticleFlowObject *const pMuonPfo, const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2) const
Determine whether two delta ray clusters are actually a single cluster that is hidden behind a cosmic...
bool MakeOneCommonViewMerges(const TensorType::ElementList &elementList) const
Search for two matches with a single common cluster and attempt to merge the clusters in the other tw...
DeltaRayMergeTool class.
void CombineCommonMuonPfoLists(const pandora::PfoList &commonMuonPfoList1, const pandora::PfoList &commonMuonPfoList2, pandora::PfoList &commonMuonPfoList) const
Create a list of the shared common muon pfos of two elements.
void FindVertices(const pandora::Pfo *const pCommonMuonPfo, const pandora::Cluster *const pCluster, pandora::CaloHitList &vertexList) const
Find all connection points of a delta ray cluster and a cosmic ray pfo.
bool Run(ThreeViewDeltaRayMatchingAlgorithm *const pAlgorithm, TensorType &overlapTensor)
Run the algorithm tool.
DeltaRayMergeTool()
Default constructor.
float m_maxGoodMatchReducedChiSquared
The threshold reduced chi squared value for a potential two view merge to go ahead.
bool ExamineConnectedElements(TensorType &overlapTensor) const
Identify ambiguous matches (e.g. 3:2:1) and attempt to merge clusters together.
bool IsConnected(const pandora::Cluster *const pCluster, const pandora::Pfo *const pCommonMuonPfo) const
Determine whether a given cluster is connected to a cosmic ray pfo.
bool IsBrokenCluster(const pandora::Cluster *const pClusterToEnlarge, const pandora::Cluster *const pClusterToDelete) const
Determine whether two delta ray clusters have been split.
float m_maxDRSeparationFromTrack
The maximum distance of a connected delta ray from a cosmic ray track.
bool MakeTwoCommonViewMerges(const TensorType::ElementList &elementList) const
Search for two matches with two common clusters and attempt to merge the clusters in the third view t...
bool AreAssociated(const TensorType::Element &element1, const TensorType::Element &element2, const pandora::HitType &mergeHitType) const
Determine, from a topological point of view, whether two delta ray clusters should be merged together...