LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ClearRemnantsTool.cc
Go to the documentation of this file.
1 
9 #include "Pandora/AlgorithmHeaders.h"
10 
12 
13 using namespace pandora;
14 
15 namespace lar_content
16 {
17 
18 bool ClearRemnantsTool::Run(ThreeViewRemnantsAlgorithm *const pAlgorithm, TensorType &overlapTensor)
19 {
20  if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
21  std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
22 
23  bool particlesMade(false);
24 
25  TensorType::ElementList elementList;
26  overlapTensor.GetUnambiguousElements(true, elementList);
27  this->CreateThreeDParticles(pAlgorithm, elementList, particlesMade);
28 
29  return particlesMade;
30 }
31 
32 //------------------------------------------------------------------------------------------------------------------------------------------
33 
34 void ClearRemnantsTool::CreateThreeDParticles(ThreeViewRemnantsAlgorithm *const pAlgorithm, const TensorType::ElementList &elementList, bool &particlesMade) const
35 {
36  ProtoParticleVector protoParticleVector;
37 
38  for (TensorType::ElementList::const_iterator iter = elementList.begin(), iterEnd = elementList.end(); iter != iterEnd; ++iter)
39  {
40  ProtoParticle protoParticle;
41  protoParticle.m_clusterList.push_back(iter->GetClusterU());
42  protoParticle.m_clusterList.push_back(iter->GetClusterV());
43  protoParticle.m_clusterList.push_back(iter->GetClusterW());
44  protoParticleVector.push_back(protoParticle);
45  }
46 
47  particlesMade |= pAlgorithm->CreateThreeDParticles(protoParticleVector);
48 }
49 
50 //------------------------------------------------------------------------------------------------------------------------------------------
51 
52 StatusCode ClearRemnantsTool::ReadSettings(const TiXmlHandle /*xmlHandle*/)
53 {
54  return STATUS_CODE_SUCCESS;
55 }
56 
57 } // namespace lar_content
std::vector< ProtoParticle > ProtoParticleVector
Header file for the clear remnants tool class.
std::vector< Element > ElementList
void GetUnambiguousElements(const bool ignoreUnavailable, ElementList &elementList) const
Get unambiguous elements.
pandora::ClusterList m_clusterList
List of 2D clusters in a 3D proto particle.
virtual bool CreateThreeDParticles(const ProtoParticleVector &protoParticleVector)
Create particles using findings from recent algorithm processing.
TheTensor::const_iterator const_iterator