OneViewDeltaRayMatchingAlgorithm.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArThreeDReco/LArCosmicRay/OneViewDeltaRayMatchingAlgorithm.h
3  *
4  * @brief Header file for the one viw delta ray matching algorithm.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_ONE_VIEW_DELTA_RAY_MATCHING_ALGORITHM_H
9 #define LAR_ONE_VIEW_DELTA_RAY_MATCHING_ALGORITHM_H 1
10 
11 #include "Pandora/Algorithm.h"
12 
14 
16 
17 namespace lar_content
18 {
19 
20 /**
21  * @brief OneViewDeltaRayMatchingAlgorithm class
22  */
23 class OneViewDeltaRayMatchingAlgorithm : public pandora::Algorithm
24 {
25 public:
26  /**
27  * @brief Default constructor
28  */
30 
31 private:
32  pandora::StatusCode Run();
33  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
34 
35  /**
36  * @brief Get the input cluster list of a given hit type
37  *
38  * @param hitType the hit type of list to retrieve
39  *
40  * @return the input cluster list of the specified hit type
41  */
42  const pandora::ClusterList GetInputClusterList(const pandora::HitType hitType);
43 
44  /**
45  * @brief Get the input cosmic ray pfo list
46  *
47  * @return the input cosmic ray pfo list
48  */
49  const pandora::PfoList GetMuonPfoList();
50 
51  /**
52  * @brief Get the input delta ray pfo list
53  *
54  * @return the input delta ray pfo list
55  */
56  const pandora::PfoList GetDeltaRayPfoList();
57 
58  /**
59  * @brief Use nearby muon pfos to project into other views and attempt to match the remaining delta ray clusters
60  *
61  * @param hitType the hit type of the input cluster and of the map to add to
62  */
63  void PerformOneViewMatching(const pandora::HitType hitType);
64 
65  /**
66  * @brief Determine whether an input cluster belongs to a cosmic ray pfo
67  *
68  * @param pCluster the address of the input cluster
69  *
70  * @return whether the input cluster belongs to a cosmic ray pfo
71  */
72  bool IsMuonPfo(const pandora::Cluster *const pCluster);
73 
74  /**
75  * @brief Use nearby muon pfos to project into other views and attempt to add a remaining delta ray cluster into an existing delta ray pfo
76  *
77  * @param pAvailableCluster the address of the delta ray cluster to add
78  * @param nearbyMuonPfoVector the vector of nearby cosmic ray pfos
79  *
80  * @return whether the input cluster was aded into an existing delta ray pfo
81  */
82  bool AddIntoExistingDeltaRay(const pandora::Cluster *const pAvailableCluster, const pandora::PfoVector &nearbyMuonPfoVector);
83 
84  /**
85  * @brief Get the best matched available or unavailable cluster of a remaining delta ray cluster group wrt a cosmic ray pfo
86  *
87  * @param deltaRayClusterGroup the input group of to be merged remaining delta ray clusters
88  * @param pNearbyMuonPfo the address of the nearby cosmic ray pfo
89  * @param hitType the hit type to project into
90  * @param findAvailable whether to search for available or unavailable delta ray clusters
91  *
92  * @return whether the best matched cluster of the specified view
93  */
94  const pandora::Cluster *GetBestProjectedCluster(const pandora::ClusterList &deltaRayClusterGroup,
95  const pandora::ParticleFlowObject *const pNearbyMuonPfo, const pandora::HitType hitType, const bool findAvailable);
96 
97  /**
98  * @brief Determine whether an input cluster belongs to a delta ray pfo
99  *
100  * @param pCluster the address of the input cluster
101  *
102  * @return whether the input cluster belongs to a delta ray pfo
103  */
104  bool IsDeltaRayPfo(const pandora::Cluster *const pCluster);
105 
106  /**
107  * @brief Determine cluster span (in x) of a group of clusters
108  *
109  * @param clusterList the input list of clusters
110  * @param spanMinX the output minimum x value
111  * @param spanMaxX the output maximum x value
112  */
113  void GetClusterSpanX(const pandora::ClusterList &clusterList, float &spanMinX, float &spanMaxX);
114 
115  /**
116  * @brief Use nearby muon pfos to project into other views and attempt to match a remaining delta ray cluster to form a delta ray pfo
117  *
118  * @param pAvailableCluster the address of the delta ray cluster to add
119  * @param nearbyMuonPfoVector the vector of nearby cosmic ray pfos
120  * @param modifiedClusters the output list of any delta ray clusters in the view of pAvailableCluster made unavailable in this process
121  */
122  void CreateDeltaRay(const pandora::Cluster *const pAvailableCluster, const pandora::PfoVector &nearbyMuonPfoVector, pandora::ClusterSet &modifiedClusters);
123 
124  /**
125  * @brief In the view of the input available cluster, gather nearby available clusters
126  *
127  * @param pCluster the input available cluster
128  * @param consideredClusters the list of investigated clusters
129  * @param foundClusters the output list of nearby available clusters (including the available cluster)
130  */
131  void GetNearbyAvailableClusters(const pandora::Cluster *const pCluster, pandora::ClusterList &consideredClusters, pandora::ClusterList &foundClusters);
132 
133  /**
134  * @brief Merge a collection of available clusters together updating hit containers accordingly
135  *
136  * @param clusterGroup the input group of clusters to merge
137  *
138  * @param the merged cluster
139  */
140  const pandora::Cluster *MergeClusterGroup(const pandora::ClusterList &clusterGroup);
141 
142  /**
143  * @brief Create a pfo from the input clusters updating the cluster to pfo map accordingly
144  *
145  * @param pCluster1 the address of the first cluster
146  * @param pCluster2 the address of the second cluster
147  * @param pCluster3 the address of the third cluster
148  */
149  void CreatePfo(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3);
150 
151  /**
152  * @brief Create a delta ray pfo from any remaining, significant clusters
153  *
154  * @param hitType the view to run in
155  */
156  void PerformRecovery(const pandora::HitType hitType);
157 
158  std::string m_muonPfoListName; ///< The list of reconstructed cosmic ray pfos
159  std::string m_deltaRayPfoListName; ///< The list of reconstructed delta ray pfos
160  std::string m_inputClusterListNameU; ///< The list of reconstructed U clusters
161  std::string m_inputClusterListNameV; ///< The list of reconstructed V clusters
162  std::string m_inputClusterListNameW; ///< The list of reconstructed W clusters
163  std::string m_outputPfoListName; ///< The list to receive the created delta ray pfos
164  DeltaRayMatchingContainers m_deltaRayMatchingContainers; ///< The class of hit, cluster and pfo ownership and proximity maps
165  float m_overlapExtension; ///< The extension to each side of the x overlap region in which to search for matched clusters
166  unsigned int m_minClusterHits; ///< The minimum number of hits for a cluster to be significant
167 };
168 
169 } // namespace lar_content
170 
171 #endif // #ifndef LAR_ONE_VIEW_DELTA_RAY_MATCHING_ALGORITHM_H
std::string m_inputClusterListNameW
The list of reconstructed W clusters.
const pandora::ClusterList GetInputClusterList(const pandora::HitType hitType)
Get the input cluster list of a given hit type.
Header file for the kd tree linker algo template class.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
enum cvn::HType HitType
std::string string
Definition: nybbler.cc:12
const pandora::PfoList GetDeltaRayPfoList()
Get the input delta ray pfo list.
bool AddIntoExistingDeltaRay(const pandora::Cluster *const pAvailableCluster, const pandora::PfoVector &nearbyMuonPfoVector)
Use nearby muon pfos to project into other views and attempt to add a remaining delta ray cluster int...
void CreateDeltaRay(const pandora::Cluster *const pAvailableCluster, const pandora::PfoVector &nearbyMuonPfoVector, pandora::ClusterSet &modifiedClusters)
Use nearby muon pfos to project into other views and attempt to match a remaining delta ray cluster t...
Header file for the delta ray matching containers class.
bool IsDeltaRayPfo(const pandora::Cluster *const pCluster)
Determine whether an input cluster belongs to a delta ray pfo.
unsigned int m_minClusterHits
The minimum number of hits for a cluster to be significant.
void CreatePfo(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3)
Create a pfo from the input clusters updating the cluster to pfo map accordingly. ...
std::string m_inputClusterListNameU
The list of reconstructed U clusters.
std::string m_muonPfoListName
The list of reconstructed cosmic ray pfos.
std::string m_inputClusterListNameV
The list of reconstructed V clusters.
const pandora::Cluster * GetBestProjectedCluster(const pandora::ClusterList &deltaRayClusterGroup, const pandora::ParticleFlowObject *const pNearbyMuonPfo, const pandora::HitType hitType, const bool findAvailable)
Get the best matched available or unavailable cluster of a remaining delta ray cluster group wrt a co...
void GetClusterSpanX(const pandora::ClusterList &clusterList, float &spanMinX, float &spanMaxX)
Determine cluster span (in x) of a group of clusters.
void PerformOneViewMatching(const pandora::HitType hitType)
Use nearby muon pfos to project into other views and attempt to match the remaining delta ray cluster...
const pandora::Cluster * MergeClusterGroup(const pandora::ClusterList &clusterGroup)
Merge a collection of available clusters together updating hit containers accordingly.
DeltaRayMatchingContainers m_deltaRayMatchingContainers
The class of hit, cluster and pfo ownership and proximity maps.
bool IsMuonPfo(const pandora::Cluster *const pCluster)
Determine whether an input cluster belongs to a cosmic ray pfo.
float m_overlapExtension
The extension to each side of the x overlap region in which to search for matched clusters...
void GetNearbyAvailableClusters(const pandora::Cluster *const pCluster, pandora::ClusterList &consideredClusters, pandora::ClusterList &foundClusters)
In the view of the input available cluster, gather nearby available clusters.
std::string m_deltaRayPfoListName
The list of reconstructed delta ray pfos.
std::string m_outputPfoListName
The list to receive the created delta ray pfos.
void PerformRecovery(const pandora::HitType hitType)
Create a delta ray pfo from any remaining, significant clusters.
const pandora::PfoList GetMuonPfoList()
Get the input cosmic ray pfo list.