19 m_minMatchedFraction(0.9f),
20 m_minMatchedSamplingPoints(20),
21 m_minXOverlapFraction(0.9f),
22 m_minMatchedSamplingPointRatio(2)
30 for (IteratorList::const_iterator iIter2 = iteratorList.begin(), iIter2End = iteratorList.end(); iIter2 != iIter2End; ++iIter2)
35 if (((*iIter)->GetClusterU() == (*iIter2)->GetClusterU()) || ((*iIter)->GetClusterV() == (*iIter2)->GetClusterV()) ||
36 ((*iIter)->GetClusterW() == (*iIter2)->GetClusterW()))
48 const unsigned int nMatchedSamplingPoints((*iIter)->GetOverlapResult().GetNMatchedSamplingPoints());
50 for (TensorType::ElementList::const_iterator eIter = elementList.begin(); eIter != elementList.end(); ++eIter)
52 if ((*iIter) == eIter)
55 if (usedClusters.count(eIter->GetClusterU()) || usedClusters.count(eIter->GetClusterV()) || usedClusters.count(eIter->GetClusterW()))
58 if (((*iIter)->GetClusterU() != eIter->GetClusterU()) && ((*iIter)->GetClusterV() != eIter->GetClusterV()) &&
59 ((*iIter)->GetClusterW() != eIter->GetClusterW()))
62 if (nMatchedSamplingPoints < minMatchedSamplingPointRatio * eIter->GetOverlapResult().GetNMatchedSamplingPoints())
74 std::cout <<
"----> Running Algorithm Tool: " << this->
GetInstanceName() <<
", " << this->
GetType() << std::endl;
89 overlapTensor.GetSortedKeyClusters(sortedKeyClusters);
91 for (
const Cluster *
const pKeyCluster : sortedKeyClusters)
93 if (!pKeyCluster->IsAvailable())
96 unsigned int nU(0), nV(0), nW(0);
97 TensorType::ElementList elementList;
98 overlapTensor.GetConnectedElements(pKeyCluster,
true, elementList, nU, nV, nW);
104 for (IteratorList::const_iterator iIter = iteratorList.begin(), iIterEnd = iteratorList.end(); iIter != iIterEnd; ++iIter)
113 protoParticle.
m_clusterList.push_back((*iIter)->GetClusterU());
114 protoParticle.
m_clusterList.push_back((*iIter)->GetClusterV());
115 protoParticle.
m_clusterList.push_back((*iIter)->GetClusterW());
116 protoParticleVector.push_back(protoParticle);
118 usedClusters.insert((*iIter)->GetClusterU());
119 usedClusters.insert((*iIter)->GetClusterV());
120 usedClusters.insert((*iIter)->GetClusterW());
129 for (TensorType::ElementList::const_iterator eIter = elementList.begin(); eIter != elementList.end(); ++eIter)
131 if (usedClusters.count(eIter->GetClusterU()) || usedClusters.count(eIter->GetClusterV()) || usedClusters.count(eIter->GetClusterW()))
140 const XOverlap &xOverlap(eIter->GetOverlapResult().GetXOverlap());
146 iteratorList.push_back(eIter);
167 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.
bool Run(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, TensorType &overlapTensor)
Run the algorithm tool.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
void FindLongTracks(const TensorType &overlapTensor, ProtoParticleVector &protoParticleVector) const
Find long tracks, hidden by simple ambiguities in the tensor.
static bool HasLongDirectConnections(IteratorList::const_iterator iIter, const IteratorList &iteratorList)
Whether a long element shares clusters with any other long elements.
static bool IsLongerThanDirectConnections(IteratorList::const_iterator iIter, const TensorType::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.
LongTracksTool()
Default constructor.
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.
unsigned int m_minMatchedSamplingPointRatio
The min ratio between 1st and 2nd highest msps for simple ambiguity resolution.
void SelectLongElements(const TensorType::ElementList &elementList, const pandora::ClusterSet &usedClusters, IteratorList &iteratorList) const
Select a list of long track-like elements from a set of connected tensor elements.
float m_minXOverlapFraction
The min x overlap fraction (in each view) for particle creation.
virtual bool CreateThreeDParticles(const ProtoParticleVector &protoParticleVector)
Create particles using findings from recent algorithm processing.
ThreeViewTransverseTracksAlgorithm class.
ThreeViewTransverseTracksAlgorithm::MatchingType::TensorType TensorType
std::vector< TensorType::ElementList::const_iterator > IteratorList
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
std::unordered_set< const Cluster * > ClusterSet
StatusCode
The StatusCode enum.