LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
CosmicRayBaseMatchingAlgorithm.h
Go to the documentation of this file.
1 
8 #ifndef LAR_COSMIC_RAY_BASE_MATCHING_ALGORITHM_H
9 #define LAR_COSMIC_RAY_BASE_MATCHING_ALGORITHM_H 1
10 
11 #include "Pandora/Algorithm.h"
12 #include "Pandora/AlgorithmHeaders.h"
13 
14 #include <unordered_map>
15 
16 namespace lar_content
17 {
18 
22 class CosmicRayBaseMatchingAlgorithm : public pandora::Algorithm
23 {
24 protected:
25  pandora::StatusCode Run();
26  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
27 
31  class Particle
32  {
33  public:
41  Particle(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW);
42 
43  const pandora::Cluster *m_pClusterU;
44  const pandora::Cluster *m_pClusterV;
45  const pandora::Cluster *m_pClusterW;
46  };
47 
48  typedef std::vector<Particle> ParticleList;
49  typedef std::unordered_map<const pandora::Cluster*, pandora::ClusterList> ClusterAssociationMap;
50 
57  virtual void SelectCleanClusters(const pandora::ClusterVector &inputVector, pandora::ClusterVector &outputVector) const = 0;
58 
67  virtual bool MatchClusters(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2) const = 0;
68 
78  virtual bool CheckMatchedClusters3D(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2,
79  const pandora::Cluster *const pCluster3) const = 0;
80 
87  virtual void SetPfoParameters(const CosmicRayBaseMatchingAlgorithm::Particle &protoParticle,
88  PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const = 0;
89 
90 private:
97  pandora::StatusCode GetAvailableClusters(const std::string inputClusterListName, pandora::ClusterVector &clusterVector) const;
105  void MatchClusters(const pandora::ClusterVector &clusterVector1, const pandora::ClusterVector &clusterVector2,
107 
119  ParticleList &particleList) const;
120 
132  ParticleList &particleList) const;
133 
141  ParticleList &particleList) const;
142 
149  void ResolveAmbiguities(const ParticleList &inputList, ParticleList &outputList) const;
150 
156  void BuildParticles(const ParticleList &particleList);
157 
161  std::string m_outputPfoListName;
162 };
163 
164 } // namespace lar_content
165 
166 #endif // #ifndef LAR_COSMIC_RAY_BASE_MATCHING_ALGORITHM_H
std::string m_inputClusterListNameV
The name of the view V cluster list.
void BuildParticles(const ParticleList &particleList)
Build PFO objects from candidate particles.
void MatchThreeViews(const CosmicRayBaseMatchingAlgorithm::ClusterAssociationMap &matchedClusters12, const CosmicRayBaseMatchingAlgorithm::ClusterAssociationMap &matchedClusters23, const CosmicRayBaseMatchingAlgorithm::ClusterAssociationMap &matchedClusters31, ParticleList &particleList) const
Match clusters from three views and form into particles.
virtual void SetPfoParameters(const CosmicRayBaseMatchingAlgorithm::Particle &protoParticle, PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const =0
Calculate Pfo properties from proto particle.
const pandora::Cluster * m_pClusterV
Address of cluster in V view.
std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterAssociationMap
virtual bool MatchClusters(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2) const =0
Match a pair of clusters from two views.
const pandora::Cluster * m_pClusterW
Address of cluster in W view.
std::string m_outputPfoListName
The name of the output PFO list.
const pandora::Cluster * m_pClusterU
Address of cluster in U view.
void MatchTwoViews(const CosmicRayBaseMatchingAlgorithm::ClusterAssociationMap &matchedClusters12, const CosmicRayBaseMatchingAlgorithm::ClusterAssociationMap &matchedClusters23, const CosmicRayBaseMatchingAlgorithm::ClusterAssociationMap &matchedClusters31, ParticleList &particleList) const
Match clusters from two views and form into particles.
virtual bool CheckMatchedClusters3D(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3) const =0
Check that three clusters have a consistent 3D position.
std::vector< art::Ptr< recob::Cluster > > ClusterVector
pandora::StatusCode GetAvailableClusters(const std::string inputClusterListName, pandora::ClusterVector &clusterVector) const
Get a vector of available clusters.
Particle(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW)
Constructor.
std::string m_inputClusterListNameU
The name of the view U cluster list.
std::string m_inputClusterListNameW
The name of the view W cluster list.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
void ResolveAmbiguities(const ParticleList &inputList, ParticleList &outputList) const
Remove ambiguities between candidate particles.
virtual void SelectCleanClusters(const pandora::ClusterVector &inputVector, pandora::ClusterVector &outputVector) const =0
Select a set of clusters judged to be clean.