LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
MatchingBaseAlgorithm.h
Go to the documentation of this file.
1 
8 #ifndef LAR_MATCHING_BASE_ALGORITHM_H
9 #define LAR_MATCHING_BASE_ALGORITHM_H 1
10 
11 #include "Api/PandoraContentApi.h"
12 
13 #include "Pandora/Algorithm.h"
14 
15 #include <unordered_map>
16 #include <vector>
17 
18 namespace lar_content
19 {
20 
25 {
26 public:
27  pandora::ClusterList m_clusterList;
28 };
29 
30 typedef std::vector<ProtoParticle> ProtoParticleVector;
31 typedef std::unordered_map<const pandora::Cluster *, pandora::ClusterList> ClusterMergeMap;
32 
33 //------------------------------------------------------------------------------------------------------------------------------------------
34 
38 class MatchingBaseAlgorithm : public pandora::Algorithm
39 {
40 public:
45 
49  virtual ~MatchingBaseAlgorithm();
50 
56  virtual void UpdateForNewCluster(const pandora::Cluster *const pNewCluster) = 0;
57 
63  virtual void UpdateUponDeletion(const pandora::Cluster *const pDeletedCluster) = 0;
64 
72  virtual const std::string &GetClusterListName(const pandora::HitType hitType) const = 0;
73 
81  virtual const pandora::ClusterList &GetInputClusterList(const pandora::HitType hitType) const = 0;
82 
90  virtual const pandora::ClusterList &GetSelectedClusterList(const pandora::HitType hitType) const = 0;
91 
99  virtual void CalculateOverlapResult(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2,
100  const pandora::Cluster *const pCluster3 = nullptr) = 0;
101 
108  virtual void SelectInputClusters(const pandora::ClusterList *const pInputClusterList, pandora::ClusterList &selectedClusterList) const;
109 
115  virtual void PrepareInputClusters(pandora::ClusterList &preparedClusterList);
116 
124  virtual bool MakeClusterMerges(const ClusterMergeMap &clusterMergeMap);
125 
133  virtual bool CreateThreeDParticles(const ProtoParticleVector &protoParticleVector);
134 
141  virtual void SetPfoParameters(const ProtoParticle &protoParticle, PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const;
142 
148  virtual void SetPfoParticleId(PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const;
149 
150 protected:
154  virtual void SelectAllInputClusters() = 0;
155 
159  virtual void PrepareAllInputClusters() = 0;
160 
164  virtual void PerformMainLoop() = 0;
165 
169  virtual void ExamineOverlapContainer() = 0;
170 
174  virtual void TidyUp() = 0;
175 
176  virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
177 
178 private:
179  pandora::StatusCode Run();
180 
181  std::string m_outputPfoListName;
182 };
183 
184 } // namespace lar_content
185 
186 #endif // #ifndef LAR_MATCHING_BASE_ALGORITHM_H
std::vector< ProtoParticle > ProtoParticleVector
MatchingBaseAlgorithm class.
pandora::ClusterList m_clusterList
List of 2D clusters in a 3D proto particle.
HitType
Definition: HitType.h:12
std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterMergeMap
std::string m_outputPfoListName
The output pfo list name.