9 #include "Pandora/AlgorithmHeaders.h" 18 TwoViewSimpleTracksTool::TwoViewSimpleTracksTool() :
19 m_minMatchedFraction(0.2
f),
20 m_minMatchingScore(0.9
f),
21 m_minMatchedSamplingPoints(5),
22 m_minXOverlapFraction(0.5
f)
30 if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
31 std::cout <<
"----> Running Algorithm Tool: " << this->GetInstanceName() <<
", " << this->GetType() << std::endl;
46 for (
const Cluster *
const pKeyCluster : sortedKeyClusters)
48 if (!pKeyCluster->IsAvailable())
51 unsigned int n0(0), n1(0);
55 if (elementList.empty())
58 for (MatrixType::ElementList::const_reverse_iterator iIter = elementList.rbegin(); iIter != elementList.rend(); ++iIter)
62 if ((
nullptr == iIter->GetCluster1()) || (
nullptr == iIter->GetCluster2()))
68 protoParticleVector.push_back(protoParticle);
80 if (!eIter->GetOverlapResult().IsInitialized())
92 const TwoViewXOverlap &xOverlap(eIter->GetOverlapResult().GetTwoViewXOverlap());
106 PANDORA_RETURN_RESULT_IF_AND_IF(
107 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"MinMatchedFraction",
m_minMatchedFraction));
109 PANDORA_RETURN_RESULT_IF_AND_IF(
110 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"MinMatchingScore",
m_minMatchingScore));
112 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
115 PANDORA_RETURN_RESULT_IF_AND_IF(
116 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"MinXOverlapFraction",
m_minXOverlapFraction));
118 return STATUS_CODE_SUCCESS;
std::vector< ProtoParticle > ProtoParticleVector
bool Run(TwoViewTransverseTracksAlgorithm *const pAlgorithm, MatrixType &overlapMatrix)
Run the algorithm tool.
float m_minMatchingScore
The min global matching score for particle creation.
TwoViewTransverseTracksAlgorithm class.
unsigned int m_minMatchedSamplingPoints
The min number of matched sampling points for particle creation.
std::vector< Element > ElementList
void GetSortedKeyClusters(pandora::ClusterVector &sortedKeyClusters) const
Get a sorted vector of key clusters (view 1 clusters with current implementation) ...
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
bool PassesElementCuts(MatrixType::ElementList::const_reverse_iterator eIter) const
Whether a provided (iterator to a) matrix element passes the selection cuts for particle creation...
pandora::ClusterList m_clusterList
List of 2D clusters in a 3D proto particle.
float m_minMatchedFraction
The min matched sampling point fraction for particle creation.
float m_minXOverlapFraction
The min x overlap fraction (in each view) for particle creation.
void GetConnectedElements(const pandora::Cluster *const pCluster, const bool ignoreUnavailable, ElementList &elementList) const
Get a list of elements connected to a specified cluster.
virtual bool CreateThreeDParticles(const ProtoParticleVector &protoParticleVector)
Create particles using findings from recent algorithm processing.
std::vector< art::Ptr< recob::Cluster > > ClusterVector
void FindBestTrack(const MatrixType &overlapMatrix, ProtoParticleVector &protoParticleVector) const
Find best track match as a simple way to (try to) resolve ambiguities in the matrix.