9 #include "Pandora/AlgorithmHeaders.h"
18 MopUpRemnantsTool::MopUpRemnantsTool()
26 if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
27 std::cout <<
"----> Running Algorithm Tool: " << this->GetInstanceName() <<
", " << this->GetType() << std::endl;
30 this->FindBestShowers(overlapTensor, protoParticleVector);
40 ClusterSet usedClusters;
44 for (
const Cluster *
const pKeyCluster : sortedKeyClusters)
46 if (!pKeyCluster->IsAvailable())
53 this->SelectBestElement(connectedElements, usedClusters, eIter);
54 this->GetUsedClusters(connectedElements, usedClusters);
56 if (connectedElements.end() == eIter)
63 protoParticleVector.push_back(protoParticle);
73 usedClusters.insert(eIter->GetClusterU());
74 usedClusters.insert(eIter->GetClusterV());
75 usedClusters.insert(eIter->GetClusterW());
81 void MopUpRemnantsTool::SelectBestElement(
84 float bestFigureOfMerit(0.f);
88 const Cluster *
const pClusterU = eIter->GetClusterU();
89 const Cluster *
const pClusterV = eIter->GetClusterV();
90 const Cluster *
const pClusterW = eIter->GetClusterW();
92 if (usedClusters.count(pClusterU) || usedClusters.count(pClusterV) || usedClusters.count(pClusterW))
95 const float figureOfMerit(pClusterU->GetHadronicEnergy() + pClusterV->GetHadronicEnergy() + pClusterW->GetHadronicEnergy());
97 if (figureOfMerit > bestFigureOfMerit)
99 bestFigureOfMerit = figureOfMerit;
107 StatusCode MopUpRemnantsTool::ReadSettings(
const TiXmlHandle )
109 return STATUS_CODE_SUCCESS;
std::vector< ProtoParticle > ProtoParticleVector
void GetConnectedElements(const pandora::Cluster *const pCluster, const bool ignoreUnavailable, ElementList &elementList) const
Get a list of elements connected to a specified cluster.
std::vector< Element > ElementList
pandora::ClusterList m_clusterList
List of 2D clusters in a 3D proto particle.
void GetSortedKeyClusters(pandora::ClusterVector &sortedKeyClusters) const
Get a sorted vector of key clusters (U clusters with current implementation)
required by fuzzyCluster table::sbnd_g4_services gaushitTruthMatch pandora
virtual bool CreateThreeDParticles(const ProtoParticleVector &protoParticleVector)
Create particles using findings from recent algorithm processing.
std::vector< art::Ptr< recob::Cluster > > ClusterVector
ThreeViewRemnantsAlgorithm class.
BEGIN_PROLOG could also be cout
TheTensor::const_iterator const_iterator