Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
ClearTracksTool.cc
Go to the documentation of this file.
1
11
12using namespace pandora;
13
14namespace lar_content
15{
16
17ClearTracksTool::ClearTracksTool() : m_minMatchedFraction(0.9f), m_minXOverlapFraction(0.9f)
18{
19}
20
21//------------------------------------------------------------------------------------------------------------------------------------------
22
24{
26 std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
27
28 bool particlesMade(false);
29
30 TensorType::ElementList elementList;
31 overlapTensor.GetUnambiguousElements(true, elementList);
32 this->CreateThreeDParticles(pAlgorithm, elementList, particlesMade);
33
34 return particlesMade;
35}
36
37//------------------------------------------------------------------------------------------------------------------------------------------
38
40 ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const TensorType::ElementList &elementList, bool &particlesMade) const
41{
42 ProtoParticleVector protoParticleVector;
43
44 for (TensorType::ElementList::const_iterator iter = elementList.begin(), iterEnd = elementList.end(); iter != iterEnd; ++iter)
45 {
46 if (iter->GetOverlapResult().GetMatchedFraction() < m_minMatchedFraction)
47 continue;
48
49 const XOverlap &xOverlap(iter->GetOverlapResult().GetXOverlap());
50
51 if ((xOverlap.GetXSpanU() < std::numeric_limits<float>::epsilon()) || (xOverlap.GetXOverlapSpan() / xOverlap.GetXSpanU() < m_minXOverlapFraction))
52 continue;
53
54 if ((xOverlap.GetXSpanV() < std::numeric_limits<float>::epsilon()) || (xOverlap.GetXOverlapSpan() / xOverlap.GetXSpanV() < m_minXOverlapFraction))
55 continue;
56
57 if ((xOverlap.GetXSpanW() < std::numeric_limits<float>::epsilon()) || (xOverlap.GetXOverlapSpan() / xOverlap.GetXSpanW() < m_minXOverlapFraction))
58 continue;
59
60 ProtoParticle protoParticle;
61 protoParticle.m_clusterList.push_back(iter->GetClusterU());
62 protoParticle.m_clusterList.push_back(iter->GetClusterV());
63 protoParticle.m_clusterList.push_back(iter->GetClusterW());
64 protoParticleVector.push_back(protoParticle);
65 }
66
67 particlesMade |= pAlgorithm->CreateThreeDParticles(protoParticleVector);
68}
69
70//------------------------------------------------------------------------------------------------------------------------------------------
71
73{
75 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinMatchedFraction", m_minMatchedFraction));
76
78 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinXOverlapFraction", m_minXOverlapFraction));
79
80 return STATUS_CODE_SUCCESS;
81}
82
83} // namespace lar_content
Grouping of header files for many classes of use in particle flow algorithms.
Header file for the clear tracks tool class.
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
Definition StatusCodes.h:31
static const pandora::PandoraSettings * GetSettings(const pandora::Algorithm &algorithm)
Get the pandora settings instance.
float m_minXOverlapFraction
The min x overlap fraction (in each view) for particle creation.
bool Run(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, TensorType &overlapTensor)
Run the algorithm tool.
float m_minMatchedFraction
The min matched sampling point fraction for particle creation.
ClearTracksTool()
Default constructor.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
void CreateThreeDParticles(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const TensorType::ElementList &elementList, bool &particlesMade) const
Create three dimensional particles for a given tensor element list.
virtual bool CreateThreeDParticles(const ProtoParticleVector &protoParticleVector)
Create particles using findings from recent algorithm processing.
ThreeViewTransverseTracksAlgorithm::MatchingType::TensorType TensorType
XOverlap class.
Definition LArXOverlap.h:18
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.
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.