Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
ClearLongitudinalTracksTool.cc
Go to the documentation of this file.
1
10
12
13using namespace pandora;
14
15namespace lar_content
16{
17
19{
20}
21
22//------------------------------------------------------------------------------------------------------------------------------------------
23
25{
27 std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
28
29 bool particlesMade(false);
30
31 TensorType::ElementList elementList;
32 overlapTensor.GetUnambiguousElements(true, elementList);
33 this->CreateThreeDParticles(pAlgorithm, elementList, particlesMade);
34
35 return particlesMade;
36}
37
38//------------------------------------------------------------------------------------------------------------------------------------------
39
41 ThreeViewLongitudinalTracksAlgorithm *const pAlgorithm, const TensorType::ElementList &elementList, bool &particlesMade) const
42{
43 ProtoParticleVector protoParticleVector;
44
45 for (TensorType::ElementList::const_iterator iter = elementList.begin(), iterEnd = elementList.end(); iter != iterEnd; ++iter)
46 {
47 if (iter->GetOverlapResult().GetMatchedFraction() < m_minMatchedFraction)
48 continue;
49
50 ProtoParticle protoParticle;
51 protoParticle.m_clusterList.push_back(iter->GetClusterU());
52 protoParticle.m_clusterList.push_back(iter->GetClusterV());
53 protoParticle.m_clusterList.push_back(iter->GetClusterW());
54 protoParticleVector.push_back(protoParticle);
55 }
56
57 particlesMade |= pAlgorithm->CreateThreeDParticles(protoParticleVector);
58}
59
60//------------------------------------------------------------------------------------------------------------------------------------------
61
63{
65 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinMatchedFraction", m_minMatchedFraction));
66
67 return STATUS_CODE_SUCCESS;
68}
69
70} // 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.
bool Run(ThreeViewLongitudinalTracksAlgorithm *const pAlgorithm, TensorType &overlapTensor)
Run the algorithm tool.
void CreateThreeDParticles(ThreeViewLongitudinalTracksAlgorithm *const pAlgorithm, const TensorType::ElementList &elementList, bool &particlesMade) const
Create three dimensional particles for a given tensor element list.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
float m_minMatchedFraction
The min matched sampling point fraction for particle creation.
ThreeViewLongitudinalTracksAlgorithm::MatchingType::TensorType TensorType
virtual bool CreateThreeDParticles(const ProtoParticleVector &protoParticleVector)
Create particles using findings from recent algorithm processing.
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.