29 ClusterList pfoClusterListU, pfoClusterListV, pfoClusterListW;
32 ClusterList daughterClusterListU, daughterClusterListV, daughterClusterListW;
35 this->
ClusterMopUp(pfoClusterListU, daughterClusterListU);
36 this->
ClusterMopUp(pfoClusterListV, daughterClusterListV);
37 this->
ClusterMopUp(pfoClusterListW, daughterClusterListW);
39 return STATUS_CODE_SUCCESS;
52 for (PfoList::const_iterator pIter = pPfoList->begin(), pIterEnd = pPfoList->end(); pIter != pIterEnd; ++pIter)
75 this->
GetClusterLists(*pClusterList,
true, clusterListU, clusterListV, clusterListW);
84 for (ClusterList::const_iterator cIter = inputClusterList.begin(), cIterEnd = inputClusterList.end(); cIter != cIterEnd; ++cIter)
86 const Cluster *
const pCluster(*cIter);
97 target.push_back(pCluster);
106 for (
const auto &remnantMapEntry : clusterAssociationMap)
107 sortedRemnantClusters.push_back(remnantMapEntry.first);
110 for (
const Cluster *
const pRemnantCluster : sortedRemnantClusters)
112 const AssociationDetails &associationDetails(clusterAssociationMap.at(pRemnantCluster));
113 const Cluster *pBestPfoCluster(
nullptr);
114 float bestFigureOfMerit(-std::numeric_limits<float>::max());
117 for (
const auto &pfoMapEntry : associationDetails)
118 sortedPfoClusters.push_back(pfoMapEntry.first);
121 for (
const Cluster *
const pPfoCluster : sortedPfoClusters)
123 const float figureOfMerit(associationDetails.at(pPfoCluster));
125 if (figureOfMerit > bestFigureOfMerit)
127 pBestPfoCluster = pPfoCluster;
128 bestFigureOfMerit = figureOfMerit;
132 if (!pBestPfoCluster)
137 *
this, pBestPfoCluster, pRemnantCluster, this->
GetListName(pBestPfoCluster), this->
GetListName(pRemnantCluster)));
Header file for the cluster mop up algorithm base class.
Header file for the cluster helper class.
Header file for the pfo helper class.
#define PANDORA_THROW_RESULT_IF(StatusCode1, Operator, Command)
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
#define PANDORA_RETURN_RESULT_IF(StatusCode1, Operator, Command)
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::StatusCode GetList(const pandora::Algorithm &algorithm, const std::string &listName, const T *&pT)
Get a named list.
pandora::StringVector m_pfoListNames
The list of pfo list names.
bool m_excludePfosContainingTracks
Whether to exclude any pfos containing clusters flagged as fixed tracks.
virtual pandora::StatusCode Run()
Run the algorithm.
std::unordered_map< const pandora::Cluster *, AssociationDetails > ClusterAssociationMap
virtual void GetPfoClusterLists(pandora::ClusterList &clusterListU, pandora::ClusterList &clusterListV, pandora::ClusterList &clusterListW) const
Get the two dimensional clusters contained in the input pfo list, divided into three different views.
virtual void ClusterMopUp(const pandora::ClusterList &pfoClusters, const pandora::ClusterList &remnantClusters) const =0
Cluster mop up for a single view. This function is responsible for instructing pandora to make cluste...
virtual void GetDaughterClusterLists(pandora::ClusterList &clusterListU, pandora::ClusterList &clusterListV, pandora::ClusterList &clusterListW) const
Get the two dimensional clusters contained in the input remant/daughter cluster lists,...
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
virtual void MakeClusterMerges(const ClusterAssociationMap &clusterAssociationMap) const
Make the cluster merges specified in the cluster association map, using list name information in the ...
virtual void GetClusterLists(const pandora::ClusterList &inputClusterList, const bool availabilityFlag, pandora::ClusterList &clusterListU, pandora::ClusterList &clusterListV, pandora::ClusterList &clusterListW) const
Get the two dimensional clusters contained in an input cluster list, divided into three different vie...
ClusterMopUpBaseAlgorithm()
Default constructor.
std::unordered_map< const pandora::Cluster *, float > AssociationDetails
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,...
static bool IsTrack(const pandora::ParticleFlowObject *const pPfo)
Return track flag based on Pfo Particle ID.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
const std::string GetListName(const T *const pT) const
Find the name of the list hosting a specific object.
pandora::StringVector m_daughterListNames
The list of potential daughter object list names.
bool IsAvailable() const
Whether the cluster is available to be added to a particle flow object.
ParticleFlowObject class.
const ClusterList & GetClusterList() const
Get the cluster list.
static StatusCode ReadVectorOfValues(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, std::vector< T > &vector)
Read a vector of values from a (space separated) list in an xml element.
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
HitType
Calorimeter hit type enum.
std::vector< const Cluster * > ClusterVector
MANAGED_CONTAINER< const Cluster * > ClusterList
StatusCode
The StatusCode enum.
MANAGED_CONTAINER< const ParticleFlowObject * > PfoList