27 std::cout <<
"----> Running Algorithm Tool: " << this->
GetInstanceName() <<
", " << this->
GetType() << std::endl;
41 overlapTensor.GetSortedKeyClusters(sortedKeyClusters);
43 for (
const Cluster *
const pKeyCluster : sortedKeyClusters)
45 if (!pKeyCluster->IsAvailable())
48 unsigned int nU(0), nV(0), nW(0);
49 TensorType::ElementList elementList;
50 overlapTensor.GetConnectedElements(pKeyCluster,
true, elementList, nU, nV, nW);
52 if (elementList.empty())
55 TensorType::Element bestElement(elementList.back());
57 if (!bestElement.GetOverlapResult().IsInitialized())
60 if ((NULL == bestElement.GetClusterU()) || (NULL == bestElement.GetClusterV()) || (NULL == bestElement.GetClusterW()))
64 protoParticle.
m_clusterList.push_back(bestElement.GetClusterU());
65 protoParticle.
m_clusterList.push_back(bestElement.GetClusterV());
66 protoParticle.
m_clusterList.push_back(bestElement.GetClusterW());
67 protoParticleVector.push_back(protoParticle);
83 const XOverlap &xOverlap(eIter->GetOverlapResult().GetXOverlap());
108 return STATUS_CODE_SUCCESS;
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
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.
ThreeViewShowersAlgorithm::MatchingType::TensorType TensorType
unsigned int m_minMatchedSamplingPoints
The min number of matched sampling points for particle creation.
float m_minMatchedFraction
The min matched sampling point fraction for particle creation.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
SimpleShowersTool()
Default constructor.
float m_minXOverlapFraction
The min x overlap fraction (in each view) for particle creation.
bool Run(ThreeViewShowersAlgorithm *const pAlgorithm, TensorType &overlapTensor)
Run the algorithm tool.
void FindBestShower(const TensorType &overlapTensor, ProtoParticleVector &protoParticleVector) const
Find best shower match as a simple way to (try to) resolve ambiguities in the tensor.
bool PassesElementCuts(TensorType::ElementList::const_iterator eIter) const
Whether a provided (iterator to a) tensor element passes the selection cuts for particle creation.
ThreeViewShowersAlgorithm class.
float GetXSpanV() const
Get the x span in the v view.
float GetXOverlapSpan() const
Get the x overlap span.
float GetXSpanW() const
Get the x span in the w view.
float GetXSpanU() const
Get the x span in the u view.
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.
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
std::vector< ProtoParticle > ProtoParticleVector
pandora::ClusterList m_clusterList
List of 2D clusters in a 3D proto particle.
std::vector< const Cluster * > ClusterVector
StatusCode
The StatusCode enum.