LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
lar_content::MissingTrackTool Class Reference

MissingTrackTool class. More...

#include "MissingTrackTool.h"

Inheritance diagram for lar_content::MissingTrackTool:
lar_content::TransverseTensorTool

Public Types

typedef ThreeDTransverseTracksAlgorithm::TensorType TensorType
 
typedef std::vector< TensorType::ElementList::const_iteratorIteratorList
 

Public Member Functions

 MissingTrackTool ()
 Default constructor. More...
 
bool Run (ThreeDTransverseTracksAlgorithm *const pAlgorithm, TensorType &overlapTensor)
 Run the algorithm tool. More...
 

Private Member Functions

pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 
void FindMissingTracks (const TensorType &overlapTensor, ProtoParticleVector &protoParticleVector) const
 Find missing tracks, due to merging of multiple particle deposits into single hits during hit creation. More...
 

Private Attributes

unsigned int m_minMatchedSamplingPoints
 The min number of matched sampling points for the unavailable tensor element. More...
 
float m_minMatchedFraction
 The min matched sampling point fraction for the unavailable tensor element. More...
 
float m_maxReducedChiSquared
 The max reduced chi squared value for the unavailable tensor element. More...
 
float m_minXOverlapFraction
 The min x overlap fraction for the two available clusters in the tensor element. More...
 

Detailed Description

MissingTrackTool class.

Definition at line 19 of file MissingTrackTool.h.

Member Typedef Documentation

Constructor & Destructor Documentation

lar_content::MissingTrackTool::MissingTrackTool ( )

Default constructor.

Definition at line 17 of file MissingTrackTool.cc.

17  :
22 {
23 }
float m_maxReducedChiSquared
The max reduced chi squared value for the unavailable tensor element.
float m_minMatchedFraction
The min matched sampling point fraction for the unavailable tensor element.
TFile f
Definition: plotHisto.C:6
float m_minXOverlapFraction
The min x overlap fraction for the two available clusters in the tensor element.
unsigned int m_minMatchedSamplingPoints
The min number of matched sampling points for the unavailable tensor element.

Member Function Documentation

void lar_content::MissingTrackTool::FindMissingTracks ( const TensorType overlapTensor,
ProtoParticleVector protoParticleVector 
) const
private

Find missing tracks, due to merging of multiple particle deposits into single hits during hit creation.

Parameters
overlapTensorthe overlap tensor
protoParticleVectorto receive the list of proto particles

Definition at line 41 of file MissingTrackTool.cc.

References lar_content::OverlapTensor< T >::GetConnectedElements(), lar_content::OverlapTensor< T >::GetSortedKeyClusters(), lar_content::ProtoParticle::m_clusterListU, lar_content::ProtoParticle::m_clusterListV, lar_content::ProtoParticle::m_clusterListW, m_maxReducedChiSquared, m_minMatchedFraction, m_minMatchedSamplingPoints, and m_minXOverlapFraction.

Referenced by Run().

42 {
43  ClusterSet usedClusters;
44  ClusterVector sortedKeyClusters;
45  overlapTensor.GetSortedKeyClusters(sortedKeyClusters);
46 
47  for (const Cluster *const pKeyCluster : sortedKeyClusters)
48  {
49  unsigned int nU(0), nV(0), nW(0);
50  TensorType::ElementList elementList;
51  overlapTensor.GetConnectedElements(pKeyCluster, false, elementList, nU, nV, nW);
52 
53  for (TensorType::ElementList::const_iterator eIter = elementList.begin(); eIter != elementList.end(); ++eIter)
54  {
55  const bool includeU(eIter->GetClusterU()->IsAvailable() && !usedClusters.count(eIter->GetClusterU()));
56  const bool includeV(eIter->GetClusterV()->IsAvailable() && !usedClusters.count(eIter->GetClusterV()));
57  const bool includeW(eIter->GetClusterW()->IsAvailable() && !usedClusters.count(eIter->GetClusterW()));
58 
59  unsigned int nAvailable(0);
60  if (includeU) ++nAvailable;
61  if (includeV) ++nAvailable;
62  if (includeW) ++nAvailable;
63 
64  if (2 != nAvailable)
65  continue;
66 
67  const TransverseOverlapResult &overlapResult(eIter->GetOverlapResult());
68 
69  if (overlapResult.GetNMatchedSamplingPoints() < m_minMatchedSamplingPoints)
70  continue;
71 
72  if (overlapResult.GetMatchedFraction() < m_minMatchedFraction)
73  continue;
74 
75  if (overlapResult.GetReducedChi2() > m_maxReducedChiSquared)
76  continue;
77 
78  if ((overlapResult.GetXOverlap().GetXSpanU() < std::numeric_limits<float>::epsilon()) ||
79  (overlapResult.GetXOverlap().GetXSpanV() < std::numeric_limits<float>::epsilon()) ||
80  (overlapResult.GetXOverlap().GetXSpanW() < std::numeric_limits<float>::epsilon()))
81  {
82  continue;
83  }
84 
85  const float xOverlapSpan(overlapResult.GetXOverlap().GetXOverlapSpan());
86 
87  if (includeU && (xOverlapSpan / overlapResult.GetXOverlap().GetXSpanU() < m_minXOverlapFraction))
88  continue;
89 
90  if (includeV && (xOverlapSpan / overlapResult.GetXOverlap().GetXSpanV() < m_minXOverlapFraction))
91  continue;
92 
93  if (includeW && (xOverlapSpan / overlapResult.GetXOverlap().GetXSpanW() < m_minXOverlapFraction))
94  continue;
95 
96  ProtoParticle protoParticle;
97  if (includeU) protoParticle.m_clusterListU.push_back(eIter->GetClusterU());
98  if (includeV) protoParticle.m_clusterListV.push_back(eIter->GetClusterV());
99  if (includeW) protoParticle.m_clusterListW.push_back(eIter->GetClusterW());
100 
101  protoParticleVector.push_back(protoParticle);
102  usedClusters.insert(eIter->GetClusterU());
103  usedClusters.insert(eIter->GetClusterV());
104  usedClusters.insert(eIter->GetClusterW());
105  }
106  }
107 }
float m_maxReducedChiSquared
The max reduced chi squared value for the unavailable tensor element.
float m_minMatchedFraction
The min matched sampling point fraction for the unavailable tensor element.
float m_minXOverlapFraction
The min x overlap fraction for the two available clusters in the tensor element.
intermediate_table::const_iterator const_iterator
std::vector< art::Ptr< recob::Cluster > > ClusterVector
unsigned int m_minMatchedSamplingPoints
The min number of matched sampling points for the unavailable tensor element.
StatusCode lar_content::MissingTrackTool::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 111 of file MissingTrackTool.cc.

References m_maxReducedChiSquared, m_minMatchedFraction, m_minMatchedSamplingPoints, and m_minXOverlapFraction.

112 {
113  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
114  "MinMatchedSamplingPoints", m_minMatchedSamplingPoints));
115 
116  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
117  "MinMatchedFraction", m_minMatchedFraction));
118 
119  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
120  "MaxReducedChiSquared", m_maxReducedChiSquared));
121 
122  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
123  "MinXOverlapFraction", m_minXOverlapFraction));
124 
125  return STATUS_CODE_SUCCESS;
126 }
float m_maxReducedChiSquared
The max reduced chi squared value for the unavailable tensor element.
float m_minMatchedFraction
The min matched sampling point fraction for the unavailable tensor element.
float m_minXOverlapFraction
The min x overlap fraction for the two available clusters in the tensor element.
unsigned int m_minMatchedSamplingPoints
The min number of matched sampling points for the unavailable tensor element.
bool lar_content::MissingTrackTool::Run ( ThreeDTransverseTracksAlgorithm *const  pAlgorithm,
TensorType overlapTensor 
)
virtual

Run the algorithm tool.

Parameters
pAlgorithmaddress of the calling algorithm
overlapTensorthe overlap tensor
Returns
whether changes have been made by the tool

Implements lar_content::TransverseTensorTool.

Definition at line 27 of file MissingTrackTool.cc.

References lar_content::ThreeDBaseAlgorithm< T >::CreateThreeDParticles(), and FindMissingTracks().

28 {
29  if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
30  std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
31 
32  ProtoParticleVector protoParticleVector;
33  this->FindMissingTracks(overlapTensor, protoParticleVector);
34 
35  const bool particlesMade(pAlgorithm->CreateThreeDParticles(protoParticleVector));
36  return particlesMade;
37 }
std::vector< ProtoParticle > ProtoParticleVector
void FindMissingTracks(const TensorType &overlapTensor, ProtoParticleVector &protoParticleVector) const
Find missing tracks, due to merging of multiple particle deposits into single hits during hit creatio...

Member Data Documentation

float lar_content::MissingTrackTool::m_maxReducedChiSquared
private

The max reduced chi squared value for the unavailable tensor element.

Definition at line 42 of file MissingTrackTool.h.

Referenced by FindMissingTracks(), and ReadSettings().

float lar_content::MissingTrackTool::m_minMatchedFraction
private

The min matched sampling point fraction for the unavailable tensor element.

Definition at line 41 of file MissingTrackTool.h.

Referenced by FindMissingTracks(), and ReadSettings().

unsigned int lar_content::MissingTrackTool::m_minMatchedSamplingPoints
private

The min number of matched sampling points for the unavailable tensor element.

Definition at line 40 of file MissingTrackTool.h.

Referenced by FindMissingTracks(), and ReadSettings().

float lar_content::MissingTrackTool::m_minXOverlapFraction
private

The min x overlap fraction for the two available clusters in the tensor element.

Definition at line 43 of file MissingTrackTool.h.

Referenced by FindMissingTracks(), and ReadSettings().


The documentation for this class was generated from the following files: