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

CrossGapsAssociationAlgorithm class. More...

#include "CrossGapsAssociationAlgorithm.h"

Inheritance diagram for lar_content::CrossGapsAssociationAlgorithm:
lar_content::ClusterAssociationAlgorithm

Public Member Functions

 CrossGapsAssociationAlgorithm ()
 Default constructor. More...
 

Protected Types

typedef std::unordered_map< const pandora::Cluster *, ClusterAssociationClusterAssociationMap
 

Protected Member Functions

virtual pandora::StatusCode Run ()
 

Private Member Functions

void GetListOfCleanClusters (const pandora::ClusterList *const pClusterList, pandora::ClusterVector &clusterVector) const
 Populate cluster vector with subset of cluster list, containing clusters judged to be clean. More...
 
void PopulateClusterAssociationMap (const pandora::ClusterVector &clusterVector, ClusterAssociationMap &clusterAssociationMap) const
 Populate the cluster association map. More...
 
bool IsExtremalCluster (const bool isForward, const pandora::Cluster *const pCurrentCluster, const pandora::Cluster *const pTestCluster) const
 Determine which of two clusters is extremal. More...
 
bool AreClustersAssociated (const TwoDSlidingFitResult &innerFitResult, const TwoDSlidingFitResult &outerFitResult) const
 Determine whether two clusters are associated. More...
 
bool IsAssociated (const pandora::CartesianVector &startPosition, const pandora::CartesianVector &startDirection, const TwoDSlidingFitResult &targetFitResult) const
 Sample points along the extrapolation from a starting position to a target fit result to declare cluster association. More...
 
bool IsNearCluster (const pandora::CartesianVector &samplingPoint, const TwoDSlidingFitResult &targetFitResult) const
 Whether a sampling point lies near a target 2d sliding fit result. More...
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 

Private Attributes

unsigned int m_minClusterHits
 The minimum allowed number of hits in a clean cluster. More...
 
unsigned int m_minClusterLayers
 The minimum allowed number of layers for a clean cluster. More...
 
unsigned int m_slidingFitWindow
 The layer window for the sliding linear fits. More...
 
unsigned int m_maxSamplingPoints
 The maximum number of extension sampling points considered per association check. More...
 
float m_sampleStepSize
 The sampling step size used in association checks, units cm. More...
 
unsigned int m_maxUnmatchedSampleRun
 The maximum run of unmatched (and non-gap) samples to consider before stopping. More...
 
float m_maxOnClusterDistance
 The maximum distance between a sampling point and sliding fit to target cluster. More...
 
unsigned int m_minMatchedSamplingPoints
 Minimum number of matched sampling points to declare association. More...
 
float m_minMatchedSamplingFraction
 Minimum ratio between matched sampling points and expectation to declare association. More...
 
float m_gapTolerance
 The tolerance to use when querying whether a sampling point is in a gap, units cm. More...
 

Detailed Description

Member Typedef Documentation

typedef std::unordered_map<const pandora::Cluster*, ClusterAssociation> lar_content::ClusterAssociationAlgorithm::ClusterAssociationMap
protectedinherited

Definition at line 43 of file ClusterAssociationAlgorithm.h.

Constructor & Destructor Documentation

lar_content::CrossGapsAssociationAlgorithm::CrossGapsAssociationAlgorithm ( )

Default constructor.

Definition at line 21 of file CrossGapsAssociationAlgorithm.cc.

21  :
22  m_minClusterHits(10),
25  m_maxSamplingPoints(1000),
26  m_sampleStepSize(0.5f),
31  m_gapTolerance(0.f)
32 {
33 }
float m_minMatchedSamplingFraction
Minimum ratio between matched sampling points and expectation to declare association.
unsigned int m_minClusterLayers
The minimum allowed number of layers for a clean cluster.
unsigned int m_minClusterHits
The minimum allowed number of hits in a clean cluster.
unsigned int m_maxSamplingPoints
The maximum number of extension sampling points considered per association check. ...
unsigned int m_slidingFitWindow
The layer window for the sliding linear fits.
TFile f
Definition: plotHisto.C:6
float m_gapTolerance
The tolerance to use when querying whether a sampling point is in a gap, units cm.
unsigned int m_maxUnmatchedSampleRun
The maximum run of unmatched (and non-gap) samples to consider before stopping.
float m_maxOnClusterDistance
The maximum distance between a sampling point and sliding fit to target cluster.
unsigned int m_minMatchedSamplingPoints
Minimum number of matched sampling points to declare association.
float m_sampleStepSize
The sampling step size used in association checks, units cm.

Member Function Documentation

bool lar_content::CrossGapsAssociationAlgorithm::AreClustersAssociated ( const TwoDSlidingFitResult innerFitResult,
const TwoDSlidingFitResult outerFitResult 
) const
private

Determine whether two clusters are associated.

Parameters
innerFitResulttwo dimensional sliding fit result for the inner cluster
outerFitResulttwo dimensional sliding fit result for the outer cluster
Returns
boolean

Definition at line 118 of file CrossGapsAssociationAlgorithm.cc.

References lar_content::TwoDSlidingFitResult::GetCluster(), lar_content::TwoDSlidingFitResult::GetGlobalMaxLayerDirection(), lar_content::TwoDSlidingFitResult::GetGlobalMaxLayerPosition(), lar_content::TwoDSlidingFitResult::GetGlobalMinLayerDirection(), lar_content::TwoDSlidingFitResult::GetGlobalMinLayerPosition(), and IsAssociated().

Referenced by PopulateClusterAssociationMap().

119 {
120  if (outerFitResult.GetCluster()->GetInnerPseudoLayer() < innerFitResult.GetCluster()->GetInnerPseudoLayer())
121  throw pandora::StatusCodeException(STATUS_CODE_NOT_ALLOWED);
122 
123  if (outerFitResult.GetCluster()->GetInnerPseudoLayer() < innerFitResult.GetCluster()->GetOuterPseudoLayer())
124  return false;
125 
126  return (this->IsAssociated(innerFitResult.GetGlobalMaxLayerPosition(), innerFitResult.GetGlobalMaxLayerDirection(), outerFitResult) &&
127  this->IsAssociated(outerFitResult.GetGlobalMinLayerPosition(), outerFitResult.GetGlobalMinLayerDirection() * -1.f, innerFitResult));
128 }
bool IsAssociated(const pandora::CartesianVector &startPosition, const pandora::CartesianVector &startDirection, const TwoDSlidingFitResult &targetFitResult) const
Sample points along the extrapolation from a starting position to a target fit result to declare clus...
void lar_content::CrossGapsAssociationAlgorithm::GetListOfCleanClusters ( const pandora::ClusterList *const  pClusterList,
pandora::ClusterVector &  clusterVector 
) const
privatevirtual

Populate cluster vector with subset of cluster list, containing clusters judged to be clean.

Parameters
pClusterListaddress of the cluster list
clusterVectorto receive the populated cluster vector

Implements lar_content::ClusterAssociationAlgorithm.

Definition at line 37 of file CrossGapsAssociationAlgorithm.cc.

References m_minClusterHits, m_minClusterLayers, and lar_content::LArClusterHelper::SortByInnerLayer().

38 {
39  // ATTN May want to opt-out completely if no gap information available
40  // if (PandoraContentApi::GetGeometry(*this)->GetDetectorGapList().empty())
41  // return;
42 
43  for (const Cluster *const pCluster : *pClusterList)
44  {
45  if (pCluster->GetNCaloHits() < m_minClusterHits)
46  continue;
47 
48  if (1 + pCluster->GetOuterPseudoLayer() - pCluster->GetInnerPseudoLayer() < m_minClusterLayers)
49  continue;
50 
51  clusterVector.push_back(pCluster);
52  }
53 
54  std::sort(clusterVector.begin(), clusterVector.end(), LArClusterHelper::SortByInnerLayer);
55 }
unsigned int m_minClusterLayers
The minimum allowed number of layers for a clean cluster.
unsigned int m_minClusterHits
The minimum allowed number of hits in a clean cluster.
static bool SortByInnerLayer(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by inner layer, then position, then pulse-height.
bool lar_content::CrossGapsAssociationAlgorithm::IsAssociated ( const pandora::CartesianVector &  startPosition,
const pandora::CartesianVector &  startDirection,
const TwoDSlidingFitResult targetFitResult 
) const
private

Sample points along the extrapolation from a starting position to a target fit result to declare cluster association.

Parameters
startPositionthe start position
startDirectionthe start direction
targetFitResultthe target fit result
Returns
boolean

Definition at line 132 of file CrossGapsAssociationAlgorithm.cc.

References f, lar_content::TwoDSlidingFitResult::GetCluster(), lar_content::LArClusterHelper::GetClusterHitType(), lar_content::TwoDSlidingFitResult::GetGlobalMaxLayerPosition(), lar_content::TwoDSlidingFitResult::GetGlobalMinLayerPosition(), lar_content::LArGeometryHelper::IsInGap(), IsNearCluster(), m_gapTolerance, m_maxSamplingPoints, m_maxUnmatchedSampleRun, m_minMatchedSamplingFraction, m_minMatchedSamplingPoints, and m_sampleStepSize.

Referenced by AreClustersAssociated().

134 {
135  const HitType hitType(LArClusterHelper::GetClusterHitType(targetFitResult.GetCluster()));
136  unsigned int nSamplingPoints(0), nGapSamplingPoints(0), nMatchedSamplingPoints(0), nUnmatchedSampleRun(0);
137 
138  for (unsigned int iSample = 0; iSample < m_maxSamplingPoints; ++iSample)
139  {
140  ++nSamplingPoints;
141  const CartesianVector samplingPoint(startPosition + startDirection * static_cast<float>(iSample) * m_sampleStepSize);
142 
143  if (LArGeometryHelper::IsInGap(this->GetPandora(), samplingPoint, hitType, m_gapTolerance))
144  {
145  ++nGapSamplingPoints;
146  nUnmatchedSampleRun = 0; // ATTN Choose to also reset run when entering gap region
147  continue;
148  }
149 
150  if (this->IsNearCluster(samplingPoint, targetFitResult))
151  {
152  ++nMatchedSamplingPoints;
153  nUnmatchedSampleRun = 0;
154  }
155  else if (++nUnmatchedSampleRun > m_maxUnmatchedSampleRun)
156  {
157  break;
158  }
159  }
160 
161  const float expectation((targetFitResult.GetGlobalMaxLayerPosition() - targetFitResult.GetGlobalMinLayerPosition()).GetMagnitude() / m_sampleStepSize);
162  const float matchedSamplingFraction(expectation > 0.f ? static_cast<float>(nMatchedSamplingPoints) / expectation : 0.f);
163 
164  if ((nMatchedSamplingPoints > m_minMatchedSamplingPoints) || (matchedSamplingFraction > m_minMatchedSamplingFraction))
165  return true;
166 
167  return false;
168 }
float m_minMatchedSamplingFraction
Minimum ratio between matched sampling points and expectation to declare association.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
unsigned int m_maxSamplingPoints
The maximum number of extension sampling points considered per association check. ...
static bool IsInGap(const pandora::Pandora &pandora, const pandora::CartesianVector &testPoint2D, const pandora::HitType hitType, const float gapTolerance=0.f)
Whether a 2D test point lies in a registered gap with the associated hit type.
TFile f
Definition: plotHisto.C:6
float m_gapTolerance
The tolerance to use when querying whether a sampling point is in a gap, units cm.
unsigned int m_maxUnmatchedSampleRun
The maximum run of unmatched (and non-gap) samples to consider before stopping.
unsigned int m_minMatchedSamplingPoints
Minimum number of matched sampling points to declare association.
bool IsNearCluster(const pandora::CartesianVector &samplingPoint, const TwoDSlidingFitResult &targetFitResult) const
Whether a sampling point lies near a target 2d sliding fit result.
float m_sampleStepSize
The sampling step size used in association checks, units cm.
bool lar_content::CrossGapsAssociationAlgorithm::IsExtremalCluster ( const bool  isForward,
const pandora::Cluster *const  pCurrentCluster,
const pandora::Cluster *const  pTestCluster 
) const
privatevirtual

Determine which of two clusters is extremal.

Parameters
isForwardwhether propagation direction is forward
pCurrentClustercurrent extremal cluster
pTestClusterpotential extremal cluster
Returns
boolean

Implements lar_content::ClusterAssociationAlgorithm.

Definition at line 102 of file CrossGapsAssociationAlgorithm.cc.

References lar_content::LArClusterHelper::SortByNHits().

103 {
104  const unsigned int currentLayer(isForward ? pCurrentCluster->GetOuterPseudoLayer() : pCurrentCluster->GetInnerPseudoLayer());
105  const unsigned int testLayer(isForward ? pTestCluster->GetOuterPseudoLayer() : pTestCluster->GetInnerPseudoLayer());
106 
107  if (isForward && ((testLayer > currentLayer) || ((testLayer == currentLayer) && LArClusterHelper::SortByNHits(pTestCluster, pCurrentCluster))))
108  return true;
109 
110  if (!isForward && ((testLayer < currentLayer) || ((testLayer == currentLayer) && LArClusterHelper::SortByNHits(pTestCluster, pCurrentCluster))))
111  return true;
112 
113  return false;
114 }
static bool SortByNHits(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by number of hits, then layer span, then inner layer, then position, then pulse-height.
bool lar_content::CrossGapsAssociationAlgorithm::IsNearCluster ( const pandora::CartesianVector &  samplingPoint,
const TwoDSlidingFitResult targetFitResult 
) const
private

Whether a sampling point lies near a target 2d sliding fit result.

Parameters
samplingPointthe sampling point
targetFitResultthe target fit result
Returns
boolean

Definition at line 172 of file CrossGapsAssociationAlgorithm.cc.

References f, lar_content::TwoDSlidingFitResult::GetGlobalFitPosition(), lar_content::TwoDSlidingFitResult::GetGlobalFitPositionAtX(), lar_content::TwoDSlidingFitResult::GetLocalPosition(), m_maxOnClusterDistance, and max.

Referenced by IsAssociated().

173 {
175  targetFitResult.GetLocalPosition(samplingPoint, rL, rT);
176 
177  CartesianVector fitPosition(0.f, 0.f, 0.f);
178 
179  if (STATUS_CODE_SUCCESS == targetFitResult.GetGlobalFitPosition(rL, fitPosition))
180  {
181  if ((fitPosition - samplingPoint).GetMagnitudeSquared() < m_maxOnClusterDistance * m_maxOnClusterDistance)
182  return true;
183  }
184 
185  CartesianVector fitPositionAtX(0.f, 0.f, 0.f);
186 
187  if (STATUS_CODE_SUCCESS == targetFitResult.GetGlobalFitPositionAtX(samplingPoint.GetX(), fitPositionAtX))
188  {
189  if ((fitPositionAtX - samplingPoint).GetMagnitudeSquared() < m_maxOnClusterDistance * m_maxOnClusterDistance)
190  return true;
191  }
192 
193  return false;
194 }
TFile f
Definition: plotHisto.C:6
Int_t max
Definition: plot.C:27
float m_maxOnClusterDistance
The maximum distance between a sampling point and sliding fit to target cluster.
void lar_content::CrossGapsAssociationAlgorithm::PopulateClusterAssociationMap ( const pandora::ClusterVector &  clusterVector,
ClusterAssociationMap clusterAssociationMap 
) const
privatevirtual

Populate the cluster association map.

Parameters
clusterVectorthe cluster vector
clusterAssociationMapto receive the populated cluster association map

Implements lar_content::ClusterAssociationAlgorithm.

Definition at line 59 of file CrossGapsAssociationAlgorithm.cc.

References AreClustersAssociated(), lar_content::LArGeometryHelper::GetWireZPitch(), and m_slidingFitWindow.

60 {
61  TwoDSlidingFitResultMap slidingFitResultMap;
62  const float slidingFitPitch(LArGeometryHelper::GetWireZPitch(this->GetPandora()));
63 
64  for (const Cluster *const pCluster : clusterVector)
65  {
66  try {(void) slidingFitResultMap.insert(TwoDSlidingFitResultMap::value_type(pCluster, TwoDSlidingFitResult(pCluster, m_slidingFitWindow, slidingFitPitch)));}
67  catch (StatusCodeException &) {}
68  }
69 
70  // ATTN This method assumes that clusters have been sorted by layer
71  for (ClusterVector::const_iterator iterI = clusterVector.begin(), iterIEnd = clusterVector.end(); iterI != iterIEnd; ++iterI)
72  {
73  const Cluster *const pInnerCluster = *iterI;
74  TwoDSlidingFitResultMap::const_iterator fitIterI = slidingFitResultMap.find(pInnerCluster);
75 
76  if (slidingFitResultMap.end() == fitIterI)
77  continue;
78 
79  for (ClusterVector::const_iterator iterJ = iterI, iterJEnd = clusterVector.end(); iterJ != iterJEnd; ++iterJ)
80  {
81  const Cluster *const pOuterCluster = *iterJ;
82 
83  if (pInnerCluster == pOuterCluster)
84  continue;
85 
86  TwoDSlidingFitResultMap::const_iterator fitIterJ = slidingFitResultMap.find(pOuterCluster);
87 
88  if (slidingFitResultMap.end() == fitIterJ)
89  continue;
90 
91  if (!this->AreClustersAssociated(fitIterI->second, fitIterJ->second))
92  continue;
93 
94  clusterAssociationMap[pInnerCluster].m_forwardAssociations.insert(pOuterCluster);
95  clusterAssociationMap[pOuterCluster].m_backwardAssociations.insert(pInnerCluster);
96  }
97  }
98 }
static float GetWireZPitch(const pandora::Pandora &pandora, const float maxWirePitchDiscrepancy=0.01)
Return the wire pitch.
std::unordered_map< const pandora::Cluster *, TwoDSlidingFitResult > TwoDSlidingFitResultMap
unsigned int m_slidingFitWindow
The layer window for the sliding linear fits.
intermediate_table::const_iterator const_iterator
bool AreClustersAssociated(const TwoDSlidingFitResult &innerFitResult, const TwoDSlidingFitResult &outerFitResult) const
Determine whether two clusters are associated.
StatusCode lar_content::CrossGapsAssociationAlgorithm::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
privatevirtual

Reimplemented from lar_content::ClusterAssociationAlgorithm.

Definition at line 198 of file CrossGapsAssociationAlgorithm.cc.

References m_gapTolerance, m_maxOnClusterDistance, m_maxSamplingPoints, m_maxUnmatchedSampleRun, m_minClusterHits, m_minClusterLayers, m_minMatchedSamplingFraction, m_minMatchedSamplingPoints, m_sampleStepSize, m_slidingFitWindow, and lar_content::ClusterAssociationAlgorithm::ReadSettings().

199 {
200  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
201  "MinClusterHits", m_minClusterHits));
202 
203  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
204  "MinClusterLayers", m_minClusterLayers));
205 
206  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
207  "SlidingFitWindow", m_slidingFitWindow));
208 
209  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
210  "MaxSamplingPoints", m_maxSamplingPoints));
211 
212  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
213  "SampleStepSize", m_sampleStepSize));
214 
215  if (m_sampleStepSize < std::numeric_limits<float>::epsilon())
216  {
217  std::cout << "CrossGapsAssociationAlgorithm: Invalid value for SampleStepSize " << m_sampleStepSize << std::endl;
218  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
219  }
220 
221  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
222  "MaxUnmatchedSampleRun", m_maxUnmatchedSampleRun));
223 
224  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
225  "MaxOnClusterDistance", m_maxOnClusterDistance));
226 
227  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
228  "MinMatchedSamplingPoints", m_minMatchedSamplingPoints));
229 
230  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
231  "MinMatchedSamplingFraction", m_minMatchedSamplingFraction));
232 
233  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
234  "GapTolerance", m_gapTolerance));
235 
237 }
float m_minMatchedSamplingFraction
Minimum ratio between matched sampling points and expectation to declare association.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
unsigned int m_minClusterLayers
The minimum allowed number of layers for a clean cluster.
unsigned int m_minClusterHits
The minimum allowed number of hits in a clean cluster.
unsigned int m_maxSamplingPoints
The maximum number of extension sampling points considered per association check. ...
unsigned int m_slidingFitWindow
The layer window for the sliding linear fits.
float m_gapTolerance
The tolerance to use when querying whether a sampling point is in a gap, units cm.
unsigned int m_maxUnmatchedSampleRun
The maximum run of unmatched (and non-gap) samples to consider before stopping.
float m_maxOnClusterDistance
The maximum distance between a sampling point and sliding fit to target cluster.
unsigned int m_minMatchedSamplingPoints
Minimum number of matched sampling points to declare association.
float m_sampleStepSize
The sampling step size used in association checks, units cm.
StatusCode lar_content::ClusterAssociationAlgorithm::Run ( )
protectedvirtualinherited

Definition at line 28 of file ClusterAssociationAlgorithm.cc.

References lar_content::ClusterAssociationAlgorithm::AmbiguousPropagation(), lar_content::ClusterAssociationAlgorithm::GetListOfCleanClusters(), lar_content::ClusterAssociationAlgorithm::m_mergeMade, lar_content::ClusterAssociationAlgorithm::m_resolveAmbiguousAssociations, lar_content::ClusterAssociationAlgorithm::PopulateClusterAssociationMap(), and lar_content::ClusterAssociationAlgorithm::UnambiguousPropagation().

29 {
30  const ClusterList *pClusterList = NULL;
31  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetCurrentList(*this, pClusterList));
32 
33  ClusterVector clusterVector;
34  this->GetListOfCleanClusters(pClusterList, clusterVector);
35 
36  ClusterAssociationMap clusterAssociationMap;
37  this->PopulateClusterAssociationMap(clusterVector, clusterAssociationMap);
38 
39  m_mergeMade = true;
40 
41  while (m_mergeMade)
42  {
43  // Unambiguous propagation
44  while (m_mergeMade)
45  {
46  m_mergeMade = false;
47 
48  for (const Cluster *const pCluster : clusterVector)
49  {
50  // ATTN The clusterVector may end up with dangling pointers; only protected by this check against managed cluster list
51  if (pClusterList->end() == std::find(pClusterList->begin(), pClusterList->end(), pCluster))
52  continue;
53 
54  this->UnambiguousPropagation(pCluster, true, clusterAssociationMap);
55  this->UnambiguousPropagation(pCluster, false, clusterAssociationMap);
56  }
57  }
58 
60  continue;
61 
62  // Propagation with ambiguities
63  for (const Cluster *const pCluster : clusterVector)
64  {
65  // ATTN The clusterVector may end up with dangling pointers; only protected by this check against up-to-date association list
66  ClusterAssociationMap::const_iterator mapIter = clusterAssociationMap.find(pCluster);
67 
68  if (clusterAssociationMap.end() == mapIter)
69  continue;
70 
71  if (mapIter->second.m_backwardAssociations.empty() && !mapIter->second.m_forwardAssociations.empty())
72  this->AmbiguousPropagation(pCluster, true, clusterAssociationMap);
73 
74  if (mapIter->second.m_forwardAssociations.empty() && !mapIter->second.m_backwardAssociations.empty())
75  this->AmbiguousPropagation(pCluster, false, clusterAssociationMap);
76  }
77  }
78 
79  return STATUS_CODE_SUCCESS;
80 }
bool m_resolveAmbiguousAssociations
Whether to resolve ambiguous associations.
intermediate_table::const_iterator const_iterator
void AmbiguousPropagation(const pandora::Cluster *const pCluster, const bool isForward, ClusterAssociationMap &clusterAssociationMap) const
Ambiguous propagation.
virtual void PopulateClusterAssociationMap(const pandora::ClusterVector &clusterVector, ClusterAssociationMap &clusterAssociationMap) const =0
Populate the cluster association map.
std::vector< art::Ptr< recob::Cluster > > ClusterVector
void UnambiguousPropagation(const pandora::Cluster *const pCluster, const bool isForward, ClusterAssociationMap &clusterAssociationMap) const
Unambiguous propagation.
std::unordered_map< const pandora::Cluster *, ClusterAssociation > ClusterAssociationMap
virtual void GetListOfCleanClusters(const pandora::ClusterList *const pClusterList, pandora::ClusterVector &clusterVector) const =0
Populate cluster vector with subset of cluster list, containing clusters judged to be clean...

Member Data Documentation

float lar_content::CrossGapsAssociationAlgorithm::m_gapTolerance
private

The tolerance to use when querying whether a sampling point is in a gap, units cm.

Definition at line 79 of file CrossGapsAssociationAlgorithm.h.

Referenced by IsAssociated(), and ReadSettings().

float lar_content::CrossGapsAssociationAlgorithm::m_maxOnClusterDistance
private

The maximum distance between a sampling point and sliding fit to target cluster.

Definition at line 76 of file CrossGapsAssociationAlgorithm.h.

Referenced by IsNearCluster(), and ReadSettings().

unsigned int lar_content::CrossGapsAssociationAlgorithm::m_maxSamplingPoints
private

The maximum number of extension sampling points considered per association check.

Definition at line 73 of file CrossGapsAssociationAlgorithm.h.

Referenced by IsAssociated(), and ReadSettings().

unsigned int lar_content::CrossGapsAssociationAlgorithm::m_maxUnmatchedSampleRun
private

The maximum run of unmatched (and non-gap) samples to consider before stopping.

Definition at line 75 of file CrossGapsAssociationAlgorithm.h.

Referenced by IsAssociated(), and ReadSettings().

unsigned int lar_content::CrossGapsAssociationAlgorithm::m_minClusterHits
private

The minimum allowed number of hits in a clean cluster.

Definition at line 70 of file CrossGapsAssociationAlgorithm.h.

Referenced by GetListOfCleanClusters(), and ReadSettings().

unsigned int lar_content::CrossGapsAssociationAlgorithm::m_minClusterLayers
private

The minimum allowed number of layers for a clean cluster.

Definition at line 71 of file CrossGapsAssociationAlgorithm.h.

Referenced by GetListOfCleanClusters(), and ReadSettings().

float lar_content::CrossGapsAssociationAlgorithm::m_minMatchedSamplingFraction
private

Minimum ratio between matched sampling points and expectation to declare association.

Definition at line 78 of file CrossGapsAssociationAlgorithm.h.

Referenced by IsAssociated(), and ReadSettings().

unsigned int lar_content::CrossGapsAssociationAlgorithm::m_minMatchedSamplingPoints
private

Minimum number of matched sampling points to declare association.

Definition at line 77 of file CrossGapsAssociationAlgorithm.h.

Referenced by IsAssociated(), and ReadSettings().

float lar_content::CrossGapsAssociationAlgorithm::m_sampleStepSize
private

The sampling step size used in association checks, units cm.

Definition at line 74 of file CrossGapsAssociationAlgorithm.h.

Referenced by IsAssociated(), and ReadSettings().

unsigned int lar_content::CrossGapsAssociationAlgorithm::m_slidingFitWindow
private

The layer window for the sliding linear fits.

Definition at line 72 of file CrossGapsAssociationAlgorithm.h.

Referenced by PopulateClusterAssociationMap(), and ReadSettings().


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