Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
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
12
13#include "Pandora/Algorithm.h"
14
15#include <unordered_map>
16#include <vector>
17
18namespace lar_content
19{
20
29
30typedef std::vector<ProtoParticle> ProtoParticleVector;
31typedef std::unordered_map<const pandora::Cluster *, pandora::ClusterList> ClusterMergeMap;
32
33//------------------------------------------------------------------------------------------------------------------------------------------
34
39{
40public:
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
150protected:
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
177
178private:
180
182};
183
184} // namespace lar_content
185
186#endif // #ifndef LAR_MATCHING_BASE_ALGORITHM_H
Header file for the algorithm class.
Header file for the pandora content api class.
virtual bool MakeClusterMerges(const ClusterMergeMap &clusterMergeMap)
Merge clusters together.
virtual void UpdateForNewCluster(const pandora::Cluster *const pNewCluster)=0
Update to reflect addition of a new cluster to the problem space.
virtual void PrepareAllInputClusters()=0
Perform any preparatory steps required, e.g. caching expensive fit results for clusters.
virtual void SelectAllInputClusters()=0
Select a subset of input clusters for processing in this algorithm.
virtual void UpdateUponDeletion(const pandora::Cluster *const pDeletedCluster)=0
Update to reflect cluster deletion.
virtual bool CreateThreeDParticles(const ProtoParticleVector &protoParticleVector)
Create particles using findings from recent algorithm processing.
virtual const std::string & GetClusterListName(const pandora::HitType hitType) const =0
Get the cluster list name corresponding to a specified hit type.
virtual void TidyUp()=0
Tidy member variables in derived class.
virtual void SetPfoParameters(const ProtoParticle &protoParticle, PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const
Set Pfo properties.
virtual const pandora::ClusterList & GetSelectedClusterList(const pandora::HitType hitType) const =0
Get the selected cluster list corresponding to a specified hit type.
std::string m_outputPfoListName
The output pfo list name.
pandora::StatusCode Run()
Run the algorithm.
virtual void CalculateOverlapResult(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3=nullptr)=0
Calculate cluster overlap result and store in container.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
virtual const pandora::ClusterList & GetInputClusterList(const pandora::HitType hitType) const =0
Get the input cluster list corresponding to a specified hit type.
virtual void ExamineOverlapContainer()=0
Examine contents of overlap container, collect together best-matching 2D particles and modify cluster...
virtual void SelectInputClusters(const pandora::ClusterList *const pInputClusterList, pandora::ClusterList &selectedClusterList) const
Select a subset of input clusters for processing in this algorithm.
virtual void SetPfoParticleId(PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const
Set pfo particle id.
virtual void PrepareInputClusters(pandora::ClusterList &preparedClusterList)
Perform any preparatory steps required on the input clusters, e.g. caching expensive fit results.
virtual void PerformMainLoop()=0
Main loop over cluster combinations in order to populate the overlap container. Responsible for calli...
Algorithm class. Algorithm addresses are held only by the algorithm manager. They have a fully define...
Definition Algorithm.h:21
Cluster class.
Definition Cluster.h:31
std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterMergeMap
std::vector< ProtoParticle > ProtoParticleVector
pandora::ClusterList m_clusterList
List of 2D clusters in a 3D proto particle.
HitType
Calorimeter hit type enum.
MANAGED_CONTAINER< const Cluster * > ClusterList
StatusCode
The StatusCode enum.