LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
ClearLongitudinalTracksTool.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 ClearLongitudinalTracksTool::ClearLongitudinalTracksTool() :
19  m_minMatchedFraction(0.8f)
20 {
21 }
22 
23 //------------------------------------------------------------------------------------------------------------------------------------------
24 
26 {
27  if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
28  std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
29 
30  bool particlesMade(false);
31 
32  TensorType::ElementList elementList;
33  overlapTensor.GetUnambiguousElements(true, elementList);
34  this->CreateThreeDParticles(pAlgorithm, elementList, particlesMade);
35 
36  return particlesMade;
37 }
38 
39 //------------------------------------------------------------------------------------------------------------------------------------------
40 
42  bool &particlesMade) const
43 {
44  ProtoParticleVector protoParticleVector;
45 
46  for (TensorType::ElementList::const_iterator iter = elementList.begin(), iterEnd = elementList.end(); iter != iterEnd; ++iter)
47  {
48  if (iter->GetOverlapResult().GetMatchedFraction() < m_minMatchedFraction)
49  continue;
50 
51  ProtoParticle protoParticle;
52  protoParticle.m_clusterListU.push_back(iter->GetClusterU());
53  protoParticle.m_clusterListV.push_back(iter->GetClusterV());
54  protoParticle.m_clusterListW.push_back(iter->GetClusterW());
55  protoParticleVector.push_back(protoParticle);
56  }
57 
58  particlesMade |= pAlgorithm->CreateThreeDParticles(protoParticleVector);
59 }
60 
61 //------------------------------------------------------------------------------------------------------------------------------------------
62 
63 StatusCode ClearLongitudinalTracksTool::ReadSettings(const TiXmlHandle xmlHandle)
64 {
65  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
66  "MinMatchedFraction", m_minMatchedFraction));
67 
68  return STATUS_CODE_SUCCESS;
69 }
70 
71 } // 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 tracks tool class.
TFile f
Definition: plotHisto.C:6
pandora::ClusterList m_clusterListW
List of 2D W clusters in a 3D proto particle.
void CreateThreeDParticles(ThreeDLongitudinalTracksAlgorithm *const pAlgorithm, const TensorType::ElementList &elementList, bool &particlesMade) const
Create three dimensional particles for a given tensor element list.
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.
bool Run(ThreeDLongitudinalTracksAlgorithm *const pAlgorithm, TensorType &overlapTensor)
Run the algorithm tool.
float m_minMatchedFraction
The min matched sampling point fraction for particle creation.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)