25 std::string originalListName;
32 if (STATUS_CODE_NOT_FOUND == listChangeStatusCode)
35 std::cout <<
"ClusterSplittingAlgorithm: cluster list not found " << clusterListName << std::endl;
40 if (STATUS_CODE_SUCCESS != listChangeStatusCode)
41 return listChangeStatusCode;
47 return STATUS_CODE_SUCCESS;
57 ClusterList internalClusterList(pClusterList->begin(), pClusterList->end());
60 for (ClusterList::iterator iter = internalClusterList.begin(); iter != internalClusterList.end(); ++iter)
62 const Cluster *
const pCluster = *iter;
65 if (STATUS_CODE_SUCCESS != this->
SplitCluster(pCluster, clusterSplittingList))
68 internalClusterList.splice(internalClusterList.end(), clusterSplittingList);
72 return STATUS_CODE_SUCCESS;
80 PandoraContentApi::Cluster::Parameters firstParameters, secondParameters;
82 if (STATUS_CODE_SUCCESS != this->
DivideCaloHits(pCluster, firstParameters.m_caloHitList, secondParameters.m_caloHitList))
83 return STATUS_CODE_NOT_FOUND;
85 if (firstParameters.m_caloHitList.empty() || secondParameters.m_caloHitList.empty())
86 return STATUS_CODE_NOT_ALLOWED;
90 std::string clusterListToSaveName, clusterListToDeleteName;
96 const Cluster *pFirstCluster(NULL), *pSecondCluster(NULL);
97 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Cluster::Create(*
this, firstParameters, pFirstCluster));
98 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Cluster::Create(*
this, secondParameters, pSecondCluster));
100 clusterSplittingList.push_back(pFirstCluster);
101 clusterSplittingList.push_back(pSecondCluster);
106 return STATUS_CODE_SUCCESS;
116 return STATUS_CODE_SUCCESS;
Header file for the cluster splitting algorithm class.
Header file for the cluster helper class.
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, 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 InitializeFragmentation(const pandora::Algorithm &algorithm, const pandora::ClusterList &inputClusterList, std::string &originalClustersListName, std::string &fragmentClustersListName)
Initialize cluster fragmentation operations on clusters in the algorithm input list....
static pandora::StatusCode EndFragmentation(const pandora::Algorithm &algorithm, const std::string &clusterListToSaveName, const std::string &clusterListToDeleteName)
End cluster fragmentation operations on clusters in the algorithm input list.
static pandora::StatusCode GetCurrentList(const pandora::Algorithm &algorithm, const T *&pT)
Get the current list.
static const pandora::PandoraSettings * GetSettings(const pandora::Algorithm &algorithm)
Get the pandora settings instance.
pandora::StatusCode RunUsingCurrentList() const
Run the algorithm using the current cluster list as input.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
virtual pandora::StatusCode DivideCaloHits(const pandora::Cluster *const pCluster, pandora::CaloHitList &firstCaloHitList, pandora::CaloHitList &secondCaloHitList) const =0
Divide calo hits in a cluster into two lists, each associated with a separate fragment cluster.
virtual pandora::StatusCode Run()
Run the algorithm.
pandora::StringVector m_inputClusterListNames
The list of input cluster list names - if empty, use the current cluster list.
pandora::StatusCode SplitCluster(const pandora::Cluster *const pCluster, pandora::ClusterList &clusterSplittingList) const
Split cluster into two fragments.
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,...
bool ShouldDisplayAlgorithmInfo() const
Whether to display algorithm information during processing.
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.
MANAGED_CONTAINER< const Cluster * > ClusterList
StatusCode
The StatusCode enum.