CosmicRayTrackRecoveryAlgorithm.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArThreeDReco/LArCosmicRay/CosmicRayTrackRecoveryAlgorithm.h
3  *
4  * @brief Header file for the cosmic ray longitudinal track recovery algorithm class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_COSMIC_RAY_TRACK_RECOVERY_ALGORITHM_H
9 #define LAR_COSMIC_RAY_TRACK_RECOVERY_ALGORITHM_H 1
10 
11 #include "Pandora/Algorithm.h"
12 
14 
15 namespace lar_content
16 {
17 
18 /**
19  * @brief CosmicRayTrackRecoveryAlgorithm class
20  */
21 class CosmicRayTrackRecoveryAlgorithm : public pandora::Algorithm
22 
23 {
24 public:
25  /**
26  * @brief Default constructor
27  */
29 
30 private:
31  pandora::StatusCode Run();
32  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
33 
34  /**
35  * @brief Particle class
36  */
37  class Particle
38  {
39  public:
40  pandora::ClusterList m_clusterList;
41  };
42 
43  typedef std::vector<Particle> ParticleList;
44  typedef std::unordered_map<const pandora::Cluster *, pandora::ClusterList> ClusterAssociationMap;
45  typedef std::set<unsigned int> UIntSet;
46 
47  /**
48  * @brief Get a vector of available clusters
49  *
50  * @param inputClusterListName the input name of the cluster list
51  * @param clusterVector the output vector of available clusters
52  */
53  pandora::StatusCode GetAvailableClusters(const std::string &inputClusterListName, pandora::ClusterVector &clusterVector) const;
54 
55  /**
56  * @brief Select a set of clusters judged to be clean
57  *
58  * @param inputVector the input vector of all available clusters
59  * @param outputVector the output vector of clean clusters
60  */
61  void SelectCleanClusters(const pandora::ClusterVector &inputVector, pandora::ClusterVector &outputVector) const;
62 
63  /**
64  * @brief Build the map of sliding fit results
65  *
66  * @param clusterVector the input cluster vector
67  * @param slidingFitResultMap the output sliding fit result map
68  */
69  void BuildSlidingFitResultMap(const pandora::ClusterVector &clusterVector, TwoDSlidingFitResultMap &slidingFitResultMap) const;
70 
71  /**
72  * @brief Match a pair of cluster vectors and populate the cluster association map
73  *
74  * @param clusterVector1 the input vector of clusters from the first view
75  * @param clusterVector2 the input vector of clusters from the second view
76  * @param slidingFitResultMap the input map of sliding linear fit results
77  * @param clusterAssociationMap the output map of cluster associations
78  */
79  void MatchViews(const pandora::ClusterVector &clusterVector1, const pandora::ClusterVector &clusterVector2,
80  const TwoDSlidingFitResultMap &slidingFitResultMap, ClusterAssociationMap &clusterAssociationMap) const;
81 
82  /**
83  * @brief Match a seed cluster with a list of target clusters and populate the cluster association map
84  *
85  * @param pSeedCluster the input seed cluster
86  * @param targetClusters the input list of target clusters
87  * @param slidingFitResultMap the input map of sliding linear fit results
88  * @param clusterAssociationMap the output map of cluster associations
89  */
90  void MatchClusters(const pandora::Cluster *const pSeedCluster, const pandora::ClusterVector &targetClusters,
91  const TwoDSlidingFitResultMap &slidingFitResultMap, ClusterAssociationMap &clusterAssociationMap) const;
92 
93  /**
94  * @brief Create candidate particles using three primary clusters
95  *
96  * @param clusterVectorU input vector of clusters from the U view
97  * @param clusterVectorV input vector of clusters from the V view
98  * @param clusterVectorW input vector of clusters from the W view
99  * @param clusterAssociationMapUV map of cluster associations between the U and V views
100  * @param clusterAssociationMapVW map of cluster associations between the V and W views
101  * @param clusterAssociationMapWU map of cluster associations between the W and U views
102  * @param particleList the output list of candidate particles
103  */
104  void MatchThreeViews(const pandora::ClusterVector &clusterVectorU, const pandora::ClusterVector &clusterVectorV,
105  const pandora::ClusterVector &clusterVectorW, const ClusterAssociationMap &clusterAssociationMapUV,
106  const ClusterAssociationMap &clusterAssociationMapVW, const ClusterAssociationMap &clusterAssociationMapWU, ParticleList &particleList) const;
107 
108  /**
109  * @brief Create candidate particles using two primary clusters and one pair of broken clusters
110  *
111  * @param clusterVectorU input vector of clusters from the U view
112  * @param clusterVectorV input vector of clusters from the V view
113  * @param clusterVectorW input vector of clusters from the W view
114  * @param clusterAssociationMapUV map of cluster associations between the U and V views
115  * @param clusterAssociationMapVW map of cluster associations between the V and W views
116  * @param clusterAssociationMapWU map of cluster associations between the W and U views
117  * @param particleList the output list of candidate particles
118  */
119  void MatchTwoViews(const pandora::ClusterVector &clusterVectorU, const pandora::ClusterVector &clusterVectorV,
120  const pandora::ClusterVector &clusterVectorW, const ClusterAssociationMap &clusterAssociationMapUV,
121  const ClusterAssociationMap &clusterAssociationMapVW, const ClusterAssociationMap &clusterAssociationMapWU, ParticleList &particleList) const;
122 
123  /**
124  * @brief Create candidate particles using one primary cluster and one pair of broken clusters
125  *
126  * @param clusterVectorU input vector of clusters from the U view
127  * @param clusterVectorV input vector of clusters from the V view
128  * @param clusterVectorW input vector of clusters from the W view
129  * @param clusterAssociationMapUV map of cluster associations between the U and V views
130  * @param clusterAssociationMapVW map of cluster associations between the V and W views
131  * @param clusterAssociationMapWU map of cluster associations between the W and U views
132  * @param particleList the output list of candidate particles
133  */
134  void MatchOneView(const pandora::ClusterVector &clusterVectorU, const pandora::ClusterVector &clusterVectorV,
135  const pandora::ClusterVector &clusterVectorW, const ClusterAssociationMap &clusterAssociationMapUV,
136  const ClusterAssociationMap &clusterAssociationMapVW, const ClusterAssociationMap &clusterAssociationMapWU, ParticleList &particleList) const;
137 
138  /**
139  * @brief Build the list of clusters already used to create particles
140  *
141  * @param particleList the current list of candidate particles
142  * @param vetoList the list of clusters that belong to the candidate particles
143  */
144  void BuildVetoList(const ParticleList &particleList, pandora::ClusterSet &vetoList) const;
145 
146  /**
147  * @brief Remove particles with duplicate clusters
148  *
149  * @param inputParticleList the input list of candidate particles
150  * @param outputParticleList the input list of candidate particles with duplications removed
151  */
152  void RemoveAmbiguities(const ParticleList &inputParticleList, ParticleList &outputParticleList) const;
153 
154  /**
155  * @brief Merge broken clusters into a single cluster
156  *
157  * @param inputClusterList the input list of broken clusters
158  * @param outputClusterList the output list of merged clusters
159  */
160  void MergeClusters(const pandora::ClusterList &inputClusterList, pandora::ClusterList &outputClusterList) const;
161 
162  /**
163  * @brief Build particle flow objects
164  *
165  * @param particleList the input list of candidate particles
166  */
167  void BuildParticles(const ParticleList &particleList);
168 
169  float m_clusterMinLength; ///<
170  float m_clusterMinSpanZ; ///<
172  float m_clusterMaxDeltaX; ///<
173  unsigned int m_clusterMinHits; ///<
174 
179 };
180 
181 } // namespace lar_content
182 
183 #endif // #ifndef LAR_COSMIC_RAY_TRACK_RECOVERY_ALGORITHM_H
void BuildSlidingFitResultMap(const pandora::ClusterVector &clusterVector, TwoDSlidingFitResultMap &slidingFitResultMap) const
Build the map of sliding fit results.
void RemoveAmbiguities(const ParticleList &inputParticleList, ParticleList &outputParticleList) const
Remove particles with duplicate clusters.
void MatchTwoViews(const pandora::ClusterVector &clusterVectorU, const pandora::ClusterVector &clusterVectorV, const pandora::ClusterVector &clusterVectorW, const ClusterAssociationMap &clusterAssociationMapUV, const ClusterAssociationMap &clusterAssociationMapVW, const ClusterAssociationMap &clusterAssociationMapWU, ParticleList &particleList) const
Create candidate particles using two primary clusters and one pair of broken clusters.
std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterAssociationMap
void BuildParticles(const ParticleList &particleList)
Build particle flow objects.
void MatchOneView(const pandora::ClusterVector &clusterVectorU, const pandora::ClusterVector &clusterVectorV, const pandora::ClusterVector &clusterVectorW, const ClusterAssociationMap &clusterAssociationMapUV, const ClusterAssociationMap &clusterAssociationMapVW, const ClusterAssociationMap &clusterAssociationMapWU, ParticleList &particleList) const
Create candidate particles using one primary cluster and one pair of broken clusters.
std::string string
Definition: nybbler.cc:12
void MatchClusters(const pandora::Cluster *const pSeedCluster, const pandora::ClusterVector &targetClusters, const TwoDSlidingFitResultMap &slidingFitResultMap, ClusterAssociationMap &clusterAssociationMap) const
Match a seed cluster with a list of target clusters and populate the cluster association map...
void BuildVetoList(const ParticleList &particleList, pandora::ClusterSet &vetoList) const
Build the list of clusters already used to create particles.
void MatchThreeViews(const pandora::ClusterVector &clusterVectorU, const pandora::ClusterVector &clusterVectorV, const pandora::ClusterVector &clusterVectorW, const ClusterAssociationMap &clusterAssociationMapUV, const ClusterAssociationMap &clusterAssociationMapVW, const ClusterAssociationMap &clusterAssociationMapWU, ParticleList &particleList) const
Create candidate particles using three primary clusters.
pandora::StatusCode GetAvailableClusters(const std::string &inputClusterListName, pandora::ClusterVector &clusterVector) const
Get a vector of available clusters.
Header file for the lar two dimensional sliding fit result class.
void SelectCleanClusters(const pandora::ClusterVector &inputVector, pandora::ClusterVector &outputVector) const
Select a set of clusters judged to be clean.
std::unordered_map< const pandora::Cluster *, TwoDSlidingFitResult > TwoDSlidingFitResultMap
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
std::vector< art::Ptr< recob::Cluster > > ClusterVector
void MatchViews(const pandora::ClusterVector &clusterVector1, const pandora::ClusterVector &clusterVector2, const TwoDSlidingFitResultMap &slidingFitResultMap, ClusterAssociationMap &clusterAssociationMap) const
Match a pair of cluster vectors and populate the cluster association map.
void MergeClusters(const pandora::ClusterList &inputClusterList, pandora::ClusterList &outputClusterList) const
Merge broken clusters into a single cluster.