LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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(ThreeDRemnantsAlgorithm *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(ThreeDRemnantsAlgorithm *const pAlgorithm, const TensorType::ElementList &elementList,
35  bool &particlesMade) const
36 {
37  ProtoParticleVector protoParticleVector;
38 
39  for (TensorType::ElementList::const_iterator iter = elementList.begin(), iterEnd = elementList.end(); iter != iterEnd; ++iter)
40  {
41  ProtoParticle protoParticle;
42  protoParticle.m_clusterListU.push_back(iter->GetClusterU());
43  protoParticle.m_clusterListV.push_back(iter->GetClusterV());
44  protoParticle.m_clusterListW.push_back(iter->GetClusterW());
45  protoParticleVector.push_back(protoParticle);
46  }
47 
48  particlesMade |= pAlgorithm->CreateThreeDParticles(protoParticleVector);
49 }
50 
51 //------------------------------------------------------------------------------------------------------------------------------------------
52 
53 StatusCode ClearRemnantsTool::ReadSettings(const TiXmlHandle /*xmlHandle*/)
54 {
55  return STATUS_CODE_SUCCESS;
56 }
57 
58 } // namespace lar_content
std::vector< ProtoParticle > ProtoParticleVector
virtual bool CreateThreeDParticles(const ProtoParticleVector &protoParticleVector)
Create particles using findings from recent algorithm processing.
Header file for the clear remnants tool class.
pandora::ClusterList m_clusterListW
List of 2D W clusters in a 3D proto particle.
std::vector< Element > ElementList
void GetUnambiguousElements(const bool ignoreUnavailable, ElementList &elementList) const
Get unambiguous elements.
pandora::ClusterList m_clusterListV
List of 2D V clusters in a 3D proto particle.
pandora::ClusterList m_clusterListU
List of 2D U clusters in a 3D proto particle.
ThreeDRemnantsAlgorithm class.
TheTensor::const_iterator const_iterator