27 std::cout <<
"----> Running Algorithm Tool: " << this->
GetInstanceName() <<
", " << this->
GetType() << std::endl;
42 overlapTensor.GetSortedKeyClusters(sortedKeyClusters);
44 for (
const Cluster *
const pKeyCluster : sortedKeyClusters)
46 if (!pKeyCluster->IsAvailable())
49 TensorType::ElementList connectedElements;
50 overlapTensor.GetConnectedElements(pKeyCluster,
true, connectedElements);
52 TensorType::ElementList::const_iterator eIter = connectedElements.end();
56 if (connectedElements.end() == eIter)
63 protoParticleVector.push_back(protoParticle);
71 for (TensorType::ElementList::const_iterator eIter = elementList.begin(); eIter != elementList.end(); ++eIter)
73 usedClusters.insert(eIter->GetClusterU());
74 usedClusters.insert(eIter->GetClusterV());
75 usedClusters.insert(eIter->GetClusterW());
82 const TensorType::ElementList &elementList,
const ClusterSet &usedClusters, TensorType::ElementList::const_iterator &bestIter)
const
84 float bestFigureOfMerit(0.f);
86 for (TensorType::ElementList::const_iterator eIter = elementList.begin(); eIter != elementList.end(); ++eIter)
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))
97 if (figureOfMerit > bestFigureOfMerit)
99 bestFigureOfMerit = figureOfMerit;
109 return STATUS_CODE_SUCCESS;
static const pandora::PandoraSettings * GetSettings(const pandora::Algorithm &algorithm)
Get the pandora settings instance.
virtual bool CreateThreeDParticles(const ProtoParticleVector &protoParticleVector)
Create particles using findings from recent algorithm processing.
void SelectBestElement(const TensorType::ElementList &elementList, const pandora::ClusterSet &usedClusters, TensorType::ElementList::const_iterator &bestIter) const
Select the best triplet of clusters.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
MopUpRemnantsTool()
Default constructor.
void FindBestShowers(const TensorType &overlapTensor, ProtoParticleVector &protoParticleVector) const
Identify candidate particles.
bool Run(ThreeViewRemnantsAlgorithm *const pAlgorithm, TensorType &overlapTensor)
Run the algorithm tool.
void GetUsedClusters(const TensorType::ElementList &elementList, pandora::ClusterSet &usedClusters) const
Copy used clusters into cluster list.
ThreeViewRemnantsAlgorithm::MatchingType::TensorType TensorType
ThreeViewRemnantsAlgorithm class.
float GetHadronicEnergy() const
Get the sum of hadronic energy measures of all constituent calo hits, units GeV.
bool ShouldDisplayAlgorithmInfo() const
Whether to display algorithm information during processing.
const std::string & GetType() const
Get the type.
const std::string & GetInstanceName() const
Get the instance name.
std::vector< ProtoParticle > ProtoParticleVector
pandora::ClusterList m_clusterList
List of 2D clusters in a 3D proto particle.
std::vector< const Cluster * > ClusterVector
std::unordered_set< const Cluster * > ClusterSet
StatusCode
The StatusCode enum.