34 if (!pInputClusterList)
37 selectedClusterList = *pInputClusterList;
53 for (
const auto &mapEntry : clusterMergeMap)
54 parentClusters.push_back(mapEntry.first);
57 for (
const Cluster *
const pParentCluster : parentClusters)
65 ClusterList daughterClusters(clusterMergeMap.at(pParentCluster));
68 for (
const Cluster *
const pDaughterCluster : daughterClusters)
70 if (deletedClusters.count(pParentCluster) || deletedClusters.count(pDaughterCluster))
79 deletedClusters.insert(pDaughterCluster);
83 return !(deletedClusters.empty());
90 bool particlesMade(
false);
91 const PfoList *pPfoList(
nullptr);
92 std::string pfoListName;
95 for (
const ProtoParticle &protoParticle : protoParticleVector)
97 PandoraContentApi::ParticleFlowObject::Parameters pfoParameters;
101 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::Create(*
this, pfoParameters, pPfo));
102 particlesMade =
true;
105 if (!pPfoList->empty())
111 return particlesMade;
121 pfoParameters.m_energy = 0.f;
130 pfoParameters.m_particleId = E_MINUS;
149 if (STATUS_CODE_SUCCESS != statusCodeException.
GetStatusCode())
150 throw statusCodeException;
153 return STATUS_CODE_SUCCESS;
162 return STATUS_CODE_SUCCESS;
Header file for the cluster helper class.
Header file for the three dimension algorithm base class.
#define PANDORA_THROW_RESULT_IF(StatusCode1, Operator, Command)
#define PANDORA_RETURN_RESULT_IF(StatusCode1, Operator, Command)
static pandora::StatusCode ReplaceCurrentList(const pandora::Algorithm &algorithm, const std::string &newListName)
Replace the current list with a pre-saved list; use this new list as a permanent replacement for the ...
static pandora::StatusCode CreateTemporaryListAndSetCurrent(const pandora::Algorithm &algorithm, const T *&pT, std::string &temporaryListName)
Create a temporary list and set it to be the current list, enabling object creation.
static pandora::StatusCode MergeAndDeleteClusters(const pandora::Algorithm &algorithm, const pandora::Cluster *const pClusterToEnlarge, const pandora::Cluster *const pClusterToDelete)
Merge two clusters in the current list, enlarging one cluster and deleting the second.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
static bool SortByNHits(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by number of hits, then layer span, then inner layer, then position,...
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.
MatchingBaseAlgorithm()
Default constructor.
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 ~MatchingBaseAlgorithm()
Destructor.
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.
std::string m_outputPfoListName
The output pfo list name.
pandora::StatusCode Run()
Run the algorithm.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
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...
ParticleFlowObject class.
static float GetParticleMass(const int pdgCode)
Get the mass of a particle type.
static int GetParticleCharge(const int pdgCode)
Get the charge of a particle type.
StatusCodeException class.
StatusCode GetStatusCode() const
Get status code.
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
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
std::unordered_set< const Cluster * > ClusterSet
StatusCode
The StatusCode enum.
MANAGED_CONTAINER< const ParticleFlowObject * > PfoList