Merge and delete a pair of pfos, with a specific set of conventions for cluster merging, vertex use, etc.
22 if (pPfoToEnlarge == pPfoToDelete)
23 throw StatusCodeException(STATUS_CODE_NOT_ALLOWED);
25 const PfoList daughterPfos(pPfoToDelete->GetDaughterPfoList());
26 const ClusterVector daughterClusters(pPfoToDelete->GetClusterList().begin(), pPfoToDelete->GetClusterList().end());
27 const VertexVector daughterVertices(pPfoToDelete->GetVertexList().begin(), pPfoToDelete->GetVertexList().end());
29 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Delete(*
this, pPfoToDelete, this->
GetListName(pPfoToDelete)));
31 for (
const ParticleFlowObject *
const pDaughterPfo : daughterPfos)
33 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SetPfoParentDaughterRelationship(*
this, pPfoToEnlarge, pDaughterPfo));
36 for (
const Vertex *
const pDaughterVertex : daughterVertices)
38 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Delete(*
this, pDaughterVertex, this->
GetListName(pDaughterVertex)));
41 for (
const Cluster *
const pDaughterCluster : daughterClusters)
48 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=,
49 PandoraContentApi::MergeAndDeleteClusters(
50 *
this, pParentCluster, pDaughterCluster, this->
GetListName(pParentCluster), this->
GetListName(pDaughterCluster)));
54 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::AddToPfo(*
this, pPfoToEnlarge, pDaughterCluster));
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
const std::string GetListName(const T *const pT) const
Find the name of the list hosting a specific object.
static const pandora::Cluster * GetParentCluster(const pandora::ClusterList &clusterList, const pandora::HitType hitType)
Select the parent cluster (same hit type and most hits) using a provided cluster list and hit type...
std::vector< art::Ptr< recob::Cluster > > ClusterVector
std::array< float, 2 > VertexVector(const recob::Vertex &vert, const geo::PlaneID &plane, const geo::GeometryCore *geo, const detinfo::DetectorPropertiesData &dprop)