31 const ClusterList *pClusterList = NULL;
32 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetCurrentList(*
this, pClusterList));
43 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->
PreparationStep(clusterVector));
46 for (
ClusterVector::iterator iter1 = clusterVector.begin(), iterEnd1 = clusterVector.end(); iter1 != iterEnd1; ++iter1)
53 if (slidingFitResultMap.end() == sIter1)
56 const TwoDSlidingFitResult &slidingFitResult1(sIter1->second);
65 if (slidingFitResultMap.end() == sIter2)
68 const TwoDSlidingFitResult &slidingFitResult2(sIter2->second);
70 if (slidingFitResult1.GetCluster() == slidingFitResult2.GetCluster())
73 CartesianVector splitPosition(0.
f, 0.
f, 0.
f);
74 CartesianVector firstDirection(0.
f, 0.
f, 0.
f);
75 CartesianVector secondDirection(0.
f, 0.
f, 0.
f);
77 if (STATUS_CODE_SUCCESS != this->
FindBestSplitPosition(slidingFitResult1, slidingFitResult2, splitPosition, firstDirection, secondDirection))
80 const Cluster *
const pCluster1 = slidingFitResult1.GetCluster();
81 const Cluster *
const pCluster2 = slidingFitResult2.GetCluster();
83 if (STATUS_CODE_SUCCESS != this->
ReplaceClusters(pCluster1, pCluster2, splitPosition, firstDirection, secondDirection))
86 slidingFitResultMap.erase(sIter1);
87 slidingFitResultMap.erase(sIter2);
virtual pandora::StatusCode FindBestSplitPosition(const TwoDSlidingFitResult &slidingFit1, const TwoDSlidingFitResult &slidingFit2, pandora::CartesianVector &splitPosition, pandora::CartesianVector &direction1, pandora::CartesianVector &direction2) const =0
Find the best split position and direction for a pair of clusters.
virtual pandora::StatusCode TidyUpStep()
Tidy up any information cached in e.g. the preparation step.
pandora::StatusCode ReplaceClusters(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::CartesianVector &splitPosition, const pandora::CartesianVector &firstDirection, const pandora::CartesianVector &secondDirection) const
Replace crossed clusters with un-crossed clusters.
std::unordered_map< const pandora::Cluster *, TwoDSlidingFitResult > TwoDSlidingFitResultMap
void GetListOfCleanClusters(const pandora::ClusterList *const pClusterList, pandora::ClusterVector &clusterVector) const
Populate cluster vector with subset of cluster list, containing clusters judged to be clean...
std::vector< art::Ptr< recob::Cluster > > ClusterVector
virtual pandora::StatusCode PreparationStep(const pandora::ClusterVector &clusterVector)
Perform any preparatory actions, such as caching information for subsequent expensive calculations...
void BuildSlidingFitResultMap(const pandora::ClusterVector &clusterVector, TwoDSlidingFitResultMap &slidingFitResultMap) const
Build the map of sliding fit results.