19 m_minMatchedFraction(0.3f),
20 m_minMatchingScore(0.95f),
21 m_minMatchedSamplingPoints(15),
22 m_minXOverlapFraction(0.9f),
23 m_minMatchedSamplingPointRatio(2)
31 for (IteratorList::const_iterator iIter2 = iteratorList.begin(), iIter2End = iteratorList.end(); iIter2 != iIter2End; ++iIter2)
36 if (((*iIter)->GetCluster1() == (*iIter2)->GetCluster1()) || ((*iIter)->GetCluster2() == (*iIter2)->GetCluster2()))
48 const unsigned int nMatchedReUpsampledSamplingPoints((*iIter)->GetOverlapResult().GetNMatchedReUpsampledSamplingPoints());
50 for (MatrixType::ElementList::const_iterator eIter = elementList.begin(); eIter != elementList.end(); ++eIter)
52 if ((*iIter) == eIter)
55 if (usedClusters.count(eIter->GetCluster1()) || usedClusters.count(eIter->GetCluster2()))
58 if (((*iIter)->GetCluster1() != eIter->GetCluster1()) && ((*iIter)->GetCluster2() != eIter->GetCluster2()))
61 if (nMatchedReUpsampledSamplingPoints < minMatchedSamplingPointRatio * eIter->GetOverlapResult().GetNMatchedReUpsampledSamplingPoints())
73 std::cout <<
"----> Running Algorithm Tool: " << this->
GetInstanceName() <<
", " << this->
GetType() << std::endl;
88 overlapMatrix.GetSortedKeyClusters(sortedKeyClusters);
90 for (
const Cluster *
const pKeyCluster : sortedKeyClusters)
92 if (!pKeyCluster->IsAvailable())
95 unsigned int n0(0), n1(0);
96 MatrixType::ElementList elementList;
97 overlapMatrix.GetConnectedElements(pKeyCluster,
true, elementList, n0, n1);
103 for (IteratorList::const_iterator iIter = iteratorList.begin(), iIterEnd = iteratorList.end(); iIter != iIterEnd; ++iIter)
112 protoParticle.
m_clusterList.push_back((*iIter)->GetCluster1());
113 protoParticle.
m_clusterList.push_back((*iIter)->GetCluster2());
114 protoParticleVector.push_back(protoParticle);
116 usedClusters.insert((*iIter)->GetCluster1());
117 usedClusters.insert((*iIter)->GetCluster2());
127 for (MatrixType::ElementList::const_iterator eIter = elementList.begin(); eIter != elementList.end(); ++eIter)
129 if (usedClusters.count(eIter->GetCluster1()) || usedClusters.count(eIter->GetCluster2()))
141 const TwoViewXOverlap &xOverlap(eIter->GetOverlapResult().GetTwoViewXOverlap());
145 iteratorList.push_back(eIter);
169 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.
TwoViewTransverseTracksAlgorithm::MatchingType::MatrixType MatrixType
std::vector< MatrixType::ElementList::const_iterator > IteratorList
float m_minXOverlapFraction
The min x overlap fraction (in each view) for particle creation.
static bool HasLongDirectConnections(IteratorList::const_iterator iIter, const IteratorList &iteratorList)
Whether a long element shares clusters with any other long elements.
float m_minMatchingScore
The min global matching score for particle creation.
void SelectLongElements(const MatrixType::ElementList &elementList, const pandora::ClusterSet &usedClusters, IteratorList &iteratorList) const
Select a list of long track-like elements from a set of connected matrix elements.
float m_minMatchedFraction
The min matched sampling point fraction for particle creation.
TwoViewLongTracksTool()
Default constructor.
unsigned int m_minMatchedSamplingPointRatio
The min ratio between 1st and 2nd highest msps for simple ambiguity resolution.
static bool IsLongerThanDirectConnections(IteratorList::const_iterator iIter, const MatrixType::ElementList &elementList, const unsigned int minMatchedSamplingPointRatio, const pandora::ClusterSet &usedClusters)
Whether a long element is significantly longer that other elements with which it shares a cluster.
bool Run(TwoViewTransverseTracksAlgorithm *const pAlgorithm, MatrixType &overlapMatrix)
Run the algorithm tool.
void FindLongTracks(const MatrixType &overlapMatrix, ProtoParticleVector &protoParticleVector) const
Find long tracks, hidden by simple ambiguities in the matrix.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
unsigned int m_minMatchedSamplingPoints
The min number of matched sampling points for particle creation.
TwoViewTransverseTracksAlgorithm class.
float GetXOverlapFraction0() const
Get the fraction of the view 0 cluster that overlaps in x.
float GetXOverlapFraction1() const
Get the fraction of the view 1 cluster that overlaps in x.
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.