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 unsigned int nU(0), nV(0), nW(0);
50 TensorType::ElementList elementList;
51 overlapTensor.GetConnectedElements(pKeyCluster,
true, elementList, nU, nV, nW);
53 if (nU * nV * nW == 0)
58 for (TensorType::ElementList::const_iterator iter = elementList.begin(); iter != elementList.end(); ++iter)
60 if (usedClusters.count(iter->GetClusterU()) || usedClusters.count(iter->GetClusterV()) || usedClusters.count(iter->GetClusterW()))
66 if (std::max(iter->GetOverlapResult().GetInnerChi2(), iter->GetOverlapResult().GetOuterChi2()) >
m_maxEndPointChi2)
73 protoParticleVector.push_back(protoParticle);
75 usedClusters.insert(iter->GetClusterU());
76 usedClusters.insert(iter->GetClusterV());
77 usedClusters.insert(iter->GetClusterW());
86 return (lhs.GetOverlapResult().GetInnerChi2() + lhs.GetOverlapResult().GetOuterChi2() <
87 rhs.GetOverlapResult().GetInnerChi2() + rhs.GetOverlapResult().GetOuterChi2());
99 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.
ThreeViewLongitudinalTracksAlgorithm::MatchingType::TensorType TensorType
static bool SortByChiSquared(const TensorType::Element &lhs, const TensorType::Element &rhs)
Sort tensor elements by chi-squared.
MatchedEndPointsTool()
Default constructor.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
bool Run(ThreeViewLongitudinalTracksAlgorithm *const pAlgorithm, TensorType &overlapTensor)
Run the algorithm tool.
float m_minMatchedFraction
The min matched sampling point fraction for particle creation.
void FindMatchedTracks(const TensorType &overlapTensor, ProtoParticleVector &protoParticleVector) const
Find matched tracks, hidden by ambiguities in the tensor.
float m_maxEndPointChi2
The max chi2 of matched vertex and end points for particle creation.
virtual bool CreateThreeDParticles(const ProtoParticleVector &protoParticleVector)
Create particles using findings from recent algorithm processing.
ThreeViewLongitudinalTracksAlgorithm class.
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
std::unordered_set< const Cluster * > ClusterSet
StatusCode
The StatusCode enum.