Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
TwoViewClearTracksTool.cc
Go to the documentation of this file.
1
10
12
13#include <limits>
14
15using namespace pandora;
16
17namespace lar_content
18{
19
20TwoViewClearTracksTool::TwoViewClearTracksTool() : m_minXOverlapFraction(0.1f), m_minMatchingScore(0.95f), m_minLocallyMatchedFraction(0.3f)
21{
22}
23
24//------------------------------------------------------------------------------------------------------------------------------------------
25
27{
29 std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
30
31 bool particlesMade(false);
32
33 MatrixType::ElementList elementList;
34 overlapMatrix.GetUnambiguousElements(true, elementList);
35 this->CreateThreeDParticles(pAlgorithm, elementList, particlesMade);
36
37 return particlesMade;
38}
39
40//------------------------------------------------------------------------------------------------------------------------------------------
41
43 TwoViewTransverseTracksAlgorithm *const pAlgorithm, const MatrixType::ElementList &elementList, bool &particlesMade) const
44{
45 ProtoParticleVector protoParticleVector;
46
47 for (MatrixType::ElementList::const_iterator iter = elementList.begin(), iterEnd = elementList.end(); iter != iterEnd; ++iter)
48 {
49 if (iter->GetOverlapResult().GetTwoViewXOverlap().GetXOverlapFraction0() - m_minXOverlapFraction < -1.f * std::numeric_limits<float>::epsilon())
50 continue;
51 if (iter->GetOverlapResult().GetTwoViewXOverlap().GetXOverlapFraction1() - m_minXOverlapFraction < -1.f * std::numeric_limits<float>::epsilon())
52 continue;
53
54 if (iter->GetOverlapResult().GetMatchingScore() - m_minMatchingScore < std::numeric_limits<float>::epsilon())
55 continue;
56
57 if (iter->GetOverlapResult().GetLocallyMatchedFraction() - m_minLocallyMatchedFraction < std::numeric_limits<float>::epsilon())
58 continue;
59
60 ProtoParticle protoParticle;
61 protoParticle.m_clusterList.push_back(iter->GetCluster1());
62 protoParticle.m_clusterList.push_back(iter->GetCluster2());
63 protoParticleVector.push_back(protoParticle);
64 }
65
66 particlesMade |= pAlgorithm->CreateThreeDParticles(protoParticleVector);
67}
68
69//------------------------------------------------------------------------------------------------------------------------------------------
70
72{
74 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinMatchingScore", m_minMatchingScore));
75
76 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
77 XmlHelper::ReadValue(xmlHandle, "MinLocallyMatchedFraction", m_minLocallyMatchedFraction));
78
80 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinXOverlapFraction", m_minXOverlapFraction));
81
82 return STATUS_CODE_SUCCESS;
83}
84
85} // namespace lar_content
Grouping of header files for many classes of use in particle flow algorithms.
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
Definition StatusCodes.h:31
Header file for the two view clear tracks tool class.
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
float m_minMatchingScore
The min global matching score for particle creation.
void CreateThreeDParticles(TwoViewTransverseTracksAlgorithm *const pAlgorithm, const MatrixType::ElementList &elementList, bool &particlesMade) const
Create three dimensional particles for a given tensor element list.
bool Run(TwoViewTransverseTracksAlgorithm *const pAlgorithm, MatrixType &overlapMatrix)
Run the algorithm tool.
float m_minXOverlapFraction
The min x overlap fraction value for particle creation.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
float m_minLocallyMatchedFraction
The min locally matched fraction for particle creation.
bool ShouldDisplayAlgorithmInfo() const
Whether to display algorithm information during processing.
const std::string & GetType() const
Get the type.
Definition Process.h:102
const std::string & GetInstanceName() const
Get the instance name.
Definition Process.h:109
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
Definition XmlHelper.h:136
std::vector< ProtoParticle > ProtoParticleVector
pandora::ClusterList m_clusterList
List of 2D clusters in a 3D proto particle.
StatusCode
The StatusCode enum.