LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar_content::UndershootTracksTool Class Reference

UndershootTracksTool class. More...

#include "UndershootTracksTool.h"

Inheritance diagram for lar_content::UndershootTracksTool:
lar_content::ThreeDKinkBaseTool lar_content::TransverseTensorTool

Classes

class  Particle
 Particle class. More...
 

Public Types

typedef ThreeViewTransverseTracksAlgorithm::MatchingType::TensorType TensorType
 
typedef std::vector< TensorType::ElementList::const_iteratorIteratorList
 

Public Member Functions

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

Protected Types

typedef std::vector< ModificationModificationList
 

Protected Member Functions

virtual bool PassesElementCuts (TensorType::ElementList::const_iterator eIter, const pandora::ClusterSet &usedClusters) const
 Whether a provided (iterator to a) tensor element passes the selection cuts for overshoot identification. More...
 
float GetXSamplingPoint (const pandora::CartesianVector &splitPosition1, const bool isForwardInX, const TwoDSlidingFitResult &fitResult1, const TwoDSlidingFitResult &fitResult2, const TwoDSlidingFitResult &fitResult3) const
 Get a sampling point in x that is common to sliding linear fit objects in three views. More...
 

Static Protected Member Functions

static bool IsALowestInX (const LArPointingCluster &pointingClusterA, const LArPointingCluster &pointingClusterB)
 Whether pointing cluster labelled A extends to lowest x positions (as opposed to that labelled B) More...
 

Protected Attributes

unsigned int m_nCommonClusters
 The number of common clusters. More...
 
bool m_majorityRulesMode
 Whether to run in majority rules mode (always split overshoots, always merge undershoots) More...
 
float m_minMatchedFraction
 The min matched sampling point fraction for use as a key tensor element. More...
 
unsigned int m_minMatchedSamplingPoints
 The min number of matched sampling points for use as a key tensor element. More...
 
float m_minLongitudinalImpactParameter
 The min longitudinal impact parameter for connecting accompanying clusters. More...
 
int m_nLayersForKinkSearch
 The number of sliding fit layers to step in the kink search. More...
 
float m_additionalXStepForKinkSearch
 An additional (safety) step to tack-on when choosing x sampling points. More...
 

Private Member Functions

void GetIteratorListModifications (ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const IteratorList &iteratorList, ModificationList &modificationList) const
 Get modification objects for a specific elements of the tensor, identifying required splits and merges for clusters. More...
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 
bool IsThreeDKink (ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const Particle &particle, const pandora::CartesianVector &splitPosition, const bool isALowestInX) const
 Whether the provided particle is consistent with being a kink, when examined in three dimensions at the provided split position. More...
 

Private Attributes

bool m_splitMode
 Whether to run in cluster splitting mode, as opposed to cluster merging mode. More...
 
float m_maxTransverseImpactParameter
 The maximum transverse impact parameter for connecting broken clusters. More...
 
float m_minImpactParameterCosTheta
 The minimum cos theta (angle between vertex directions) for connecting broken clusters. More...
 
float m_cosThetaCutForKinkSearch
 The cos theta cut used for the kink search in three dimensions. More...
 

Detailed Description

UndershootTracksTool class.

Definition at line 19 of file UndershootTracksTool.h.

Member Typedef Documentation

typedef std::vector<Modification> lar_content::ThreeDKinkBaseTool::ModificationList
protectedinherited

Definition at line 50 of file ThreeDKinkBaseTool.h.

Constructor & Destructor Documentation

lar_content::UndershootTracksTool::UndershootTracksTool ( )

Default constructor.

Definition at line 24 of file UndershootTracksTool.cc.

24  :
26  m_splitMode(false),
30 {
31 }
TFile f
Definition: plotHisto.C:6
float m_cosThetaCutForKinkSearch
The cos theta cut used for the kink search in three dimensions.
float m_minImpactParameterCosTheta
The minimum cos theta (angle between vertex directions) for connecting broken clusters.
bool m_splitMode
Whether to run in cluster splitting mode, as opposed to cluster merging mode.
ThreeDKinkBaseTool(const unsigned int nCommonClusters)
Constructor.
float m_maxTransverseImpactParameter
The maximum transverse impact parameter for connecting broken clusters.

Member Function Documentation

void lar_content::UndershootTracksTool::GetIteratorListModifications ( ThreeViewTransverseTracksAlgorithm *const  pAlgorithm,
const IteratorList iteratorList,
ModificationList modificationList 
) const
privatevirtual

Get modification objects for a specific elements of the tensor, identifying required splits and merges for clusters.

Parameters
pAlgorithmaddress of the calling algorithm
iteratorListlist of iterators to relevant tensor elements
modificationListto be populated with modifications

Implements lar_content::ThreeDKinkBaseTool.

Definition at line 35 of file UndershootTracksTool.cc.

References f, lar_content::NViewTrackMatchingAlgorithm< T >::GetCachedSlidingFitResult(), lar_content::LArPointingClusterHelper::GetClosestVertices(), lar_content::LArPointingClusterHelper::GetImpactParameters(), lar_content::ThreeDKinkBaseTool::IsALowestInX(), IsThreeDKink(), lar_content::ThreeDKinkBaseTool::Modification::m_affectedClusters, lar_content::ThreeDKinkBaseTool::Modification::m_clusterMergeMap, lar_content::ThreeDKinkBaseTool::m_majorityRulesMode, m_maxTransverseImpactParameter, m_minImpactParameterCosTheta, lar_content::ThreeDKinkBaseTool::m_minLongitudinalImpactParameter, lar_content::UndershootTracksTool::Particle::m_pClusterA, lar_content::UndershootTracksTool::Particle::m_pClusterB, lar_content::UndershootTracksTool::Particle::m_pCommonCluster1, lar_content::UndershootTracksTool::Particle::m_pCommonCluster2, m_splitMode, and lar_content::ThreeDKinkBaseTool::Modification::m_splitPositionMap.

37 {
38  for (IteratorList::const_iterator iIter1 = iteratorList.begin(), iIter1End = iteratorList.end(); iIter1 != iIter1End; ++iIter1)
39  {
40  for (IteratorList::const_iterator iIter2 = iIter1; iIter2 != iIter1End; ++iIter2)
41  {
42  if (iIter1 == iIter2)
43  continue;
44 
45  try
46  {
47  const unsigned int nMatchedSamplingPoints1((*iIter1)->GetOverlapResult().GetNMatchedSamplingPoints());
48  const unsigned int nMatchedSamplingPoints2((*iIter2)->GetOverlapResult().GetNMatchedSamplingPoints());
49  IteratorList::const_iterator iIterA((nMatchedSamplingPoints1 >= nMatchedSamplingPoints2) ? iIter1 : iIter2);
50  IteratorList::const_iterator iIterB((nMatchedSamplingPoints1 >= nMatchedSamplingPoints2) ? iIter2 : iIter1);
51 
52  Particle particle(*(*iIterA), *(*iIterB));
53  const LArPointingCluster pointingClusterA(pAlgorithm->GetCachedSlidingFitResult(particle.m_pClusterA));
54  const LArPointingCluster pointingClusterB(pAlgorithm->GetCachedSlidingFitResult(particle.m_pClusterB));
55 
56  LArPointingCluster::Vertex vertexA, vertexB;
57  LArPointingClusterHelper::GetClosestVertices(pointingClusterA, pointingClusterB, vertexA, vertexB);
58 
59  float transverseAB(std::numeric_limits<float>::max()), transverseBA(std::numeric_limits<float>::max());
60  float longitudinalAB(-std::numeric_limits<float>::max()), longitudinalBA(-std::numeric_limits<float>::max());
61 
62  LArPointingClusterHelper::GetImpactParameters(vertexA, vertexB, longitudinalAB, transverseAB);
63  LArPointingClusterHelper::GetImpactParameters(vertexB, vertexA, longitudinalBA, transverseBA);
64 
65  if (std::min(longitudinalAB, longitudinalBA) < m_minLongitudinalImpactParameter)
66  continue;
67 
68  if (std::min(transverseAB, transverseBA) > m_maxTransverseImpactParameter)
69  continue;
70 
71  const float cosTheta(-vertexA.GetDirection().GetCosOpeningAngle(vertexB.GetDirection()));
72 
73  if (cosTheta < m_minImpactParameterCosTheta)
74  continue;
75 
76  const bool isALowestInX(this->IsALowestInX(pointingClusterA, pointingClusterB));
77  const CartesianVector splitPosition((vertexA.GetPosition() + vertexB.GetPosition()) * 0.5f);
78  const bool isThreeDKink(m_majorityRulesMode ? false : this->IsThreeDKink(pAlgorithm, particle, splitPosition, isALowestInX));
79 
80  if (isThreeDKink != m_splitMode)
81  continue;
82 
83  // Construct the modification object
84  Modification modification;
85 
86  if (m_splitMode)
87  {
88  const TwoDSlidingFitResult &fitResult1(pAlgorithm->GetCachedSlidingFitResult(particle.m_pCommonCluster1));
89  const TwoDSlidingFitResult &fitResult2(pAlgorithm->GetCachedSlidingFitResult(particle.m_pCommonCluster2));
90 
91  CartesianVector splitPosition1(0.f, 0.f, 0.f), splitPosition2(0.f, 0.f, 0.f);
92  if ((STATUS_CODE_SUCCESS != fitResult1.GetGlobalFitPositionAtX(splitPosition.GetX(), splitPosition1)) ||
93  (STATUS_CODE_SUCCESS != fitResult2.GetGlobalFitPositionAtX(splitPosition.GetX(), splitPosition2)))
94  {
95  continue;
96  }
97 
98  modification.m_splitPositionMap[particle.m_pCommonCluster1].push_back(splitPosition1);
99  modification.m_splitPositionMap[particle.m_pCommonCluster2].push_back(splitPosition2);
100  }
101  else
102  {
103  const bool vertexAIsLowX(vertexA.GetPosition().GetX() < vertexB.GetPosition().GetX());
104  const Cluster *const pLowXCluster(vertexAIsLowX ? particle.m_pClusterA : particle.m_pClusterB);
105  const Cluster *const pHighXCluster(vertexAIsLowX ? particle.m_pClusterB : particle.m_pClusterA);
106  modification.m_clusterMergeMap[pLowXCluster].push_back(pHighXCluster);
107  }
108 
109  modification.m_affectedClusters.push_back(particle.m_pClusterA);
110  modification.m_affectedClusters.push_back(particle.m_pClusterB);
111  modification.m_affectedClusters.push_back(particle.m_pCommonCluster1);
112  modification.m_affectedClusters.push_back(particle.m_pCommonCluster2);
113 
114  modificationList.push_back(modification);
115  }
116  catch (StatusCodeException &statusCodeException)
117  {
118  if (STATUS_CODE_FAILURE == statusCodeException.GetStatusCode())
119  throw statusCodeException;
120 
121  continue;
122  }
123  }
124  }
125 }
static void GetImpactParameters(const LArPointingCluster::Vertex &pointingVertex, const LArPointingCluster::Vertex &targetVertex, float &longitudinal, float &transverse)
Calculate impact parameters between a pair of pointing vertices.
intermediate_table::const_iterator const_iterator
static void GetClosestVertices(const bool useX, const bool useY, const bool useZ, const LArPointingCluster &pointingClusterI, const LArPointingCluster &pointingClusterJ, LArPointingCluster::Vertex &closestVertexI, LArPointingCluster::Vertex &closestVertexJ)
Given a pair of pointing clusters, receive the closest or farthest pair of vertices.
TFile f
Definition: plotHisto.C:6
float m_minImpactParameterCosTheta
The minimum cos theta (angle between vertex directions) for connecting broken clusters.
bool m_splitMode
Whether to run in cluster splitting mode, as opposed to cluster merging mode.
static bool IsALowestInX(const LArPointingCluster &pointingClusterA, const LArPointingCluster &pointingClusterB)
Whether pointing cluster labelled A extends to lowest x positions (as opposed to that labelled B) ...
bool IsThreeDKink(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const Particle &particle, const pandora::CartesianVector &splitPosition, const bool isALowestInX) const
Whether the provided particle is consistent with being a kink, when examined in three dimensions at t...
bool m_majorityRulesMode
Whether to run in majority rules mode (always split overshoots, always merge undershoots) ...
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
float m_minLongitudinalImpactParameter
The min longitudinal impact parameter for connecting accompanying clusters.
float m_maxTransverseImpactParameter
The maximum transverse impact parameter for connecting broken clusters.
float lar_content::ThreeDKinkBaseTool::GetXSamplingPoint ( const pandora::CartesianVector &  splitPosition1,
const bool  isForwardInX,
const TwoDSlidingFitResult fitResult1,
const TwoDSlidingFitResult fitResult2,
const TwoDSlidingFitResult fitResult3 
) const
protectedinherited

Get a sampling point in x that is common to sliding linear fit objects in three views.

Parameters
splitPosition1the split position in view 1
isForwardInXwhether to work forwards (or backwards) in x
fitResult1the sliding fit result in view 1
fitResult2the sliding fit result in view 2
fitResult3the sliding fit result in view 3
Returns
the sampling point

Definition at line 59 of file ThreeDKinkBaseTool.cc.

References f, lar_content::TwoDSlidingFitResult::GetGlobalFitPosition(), lar_content::TwoDSlidingFitResult::GetL(), lar_content::TwoDSlidingFitResult::GetLayer(), lar_content::TwoDSlidingFitResult::GetLocalPosition(), lar_content::TwoDSlidingFitResult::GetMaxLayer(), lar_content::TwoDSlidingFitResult::GetMinAndMaxX(), lar_content::TwoDSlidingFitResult::GetMinLayer(), lar_content::ThreeDKinkBaseTool::m_additionalXStepForKinkSearch, and lar_content::ThreeDKinkBaseTool::m_nLayersForKinkSearch.

Referenced by IsThreeDKink(), and lar_content::OvershootTracksTool::IsThreeDKink().

61 {
62  // Nearest common x position
63  float xMin1(std::numeric_limits<float>::max()), xMax1(-std::numeric_limits<float>::max());
64  float xMin2(std::numeric_limits<float>::max()), xMax2(-std::numeric_limits<float>::max());
65  float xMin3(std::numeric_limits<float>::max()), xMax3(-std::numeric_limits<float>::max());
66  fitResult1.GetMinAndMaxX(xMin1, xMax1);
67  fitResult2.GetMinAndMaxX(xMin2, xMax2);
68  fitResult3.GetMinAndMaxX(xMin3, xMax3);
69 
70  const float commonX(isForwardInX ? std::max(xMin1, std::max(xMin2, xMin3)) : std::min(xMax1, std::min(xMax2, xMax3)));
71 
72  if (isForwardInX && ((commonX > xMax1) || (commonX > xMax2) || (commonX > xMax3)))
73  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
74 
75  if (!isForwardInX && ((commonX < xMin1) || (commonX < xMin2) || (commonX < xMin3)))
76  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
77 
78  // Layer step x position
79  float rL1(0.f), rT1(0.f);
80  fitResult1.GetLocalPosition(splitPosition1, rL1, rT1);
81  const int splitLayer(fitResult1.GetLayer(rL1));
82 
83  const int lowLayer(std::max(fitResult1.GetMinLayer(), std::min(fitResult1.GetMaxLayer(), splitLayer - m_nLayersForKinkSearch)));
84  const int highLayer(std::max(fitResult1.GetMinLayer(), std::min(fitResult1.GetMaxLayer(), splitLayer + m_nLayersForKinkSearch)));
85 
86  CartesianVector minus(0.f, 0.f, 0.f), plus(0.f, 0.f, 0.f);
87  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, fitResult1.GetGlobalFitPosition(fitResult1.GetL(lowLayer), minus));
88  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, fitResult1.GetGlobalFitPosition(fitResult1.GetL(highLayer), plus));
89 
90  if (minus.GetX() > plus.GetX())
91  {
92  CartesianVector temporary(minus);
93  minus = plus;
94  plus = temporary;
95  }
96 
97  const float layerStepX(isForwardInX ? plus.GetX() : minus.GetX());
98 
99  // Final x position selection
100  const float chosenX(isForwardInX ? std::max(layerStepX, commonX) : std::min(layerStepX, commonX));
101  const float finalX(isForwardInX ? chosenX + m_additionalXStepForKinkSearch : chosenX - m_additionalXStepForKinkSearch);
102  return finalX;
103 }
TFile f
Definition: plotHisto.C:6
int m_nLayersForKinkSearch
The number of sliding fit layers to step in the kink search.
float m_additionalXStepForKinkSearch
An additional (safety) step to tack-on when choosing x sampling points.
bool lar_content::ThreeDKinkBaseTool::IsALowestInX ( const LArPointingCluster pointingClusterA,
const LArPointingCluster pointingClusterB 
)
staticprotectedinherited

Whether pointing cluster labelled A extends to lowest x positions (as opposed to that labelled B)

Parameters
pointingClusterApointing cluster A
pointingClusterBpointing cluster B

Definition at line 107 of file ThreeDKinkBaseTool.cc.

References lar_content::LArPointingCluster::GetInnerVertex(), lar_content::LArPointingCluster::GetOuterVertex(), and lar_content::LArPointingCluster::Vertex::GetPosition().

Referenced by GetIteratorListModifications(), and lar_content::OvershootTracksTool::GetIteratorListModifications().

108 {
109  if ((pointingClusterA.GetInnerVertex().GetPosition().GetX() < pointingClusterB.GetInnerVertex().GetPosition().GetX()) &&
110  (pointingClusterA.GetInnerVertex().GetPosition().GetX() < pointingClusterB.GetOuterVertex().GetPosition().GetX()))
111  {
112  return true;
113  }
114 
115  if ((pointingClusterA.GetOuterVertex().GetPosition().GetX() < pointingClusterB.GetInnerVertex().GetPosition().GetX()) &&
116  (pointingClusterA.GetOuterVertex().GetPosition().GetX() < pointingClusterB.GetOuterVertex().GetPosition().GetX()))
117  {
118  return true;
119  }
120 
121  return false;
122 }
bool lar_content::UndershootTracksTool::IsThreeDKink ( ThreeViewTransverseTracksAlgorithm *const  pAlgorithm,
const Particle particle,
const pandora::CartesianVector &  splitPosition,
const bool  isALowestInX 
) const
private

Whether the provided particle is consistent with being a kink, when examined in three dimensions at the provided split position.

Parameters
pAlgorithmthe calling algorithm
particlethe particle
splitPositionthe candidate split position
isALowestInXwhether cluster associated with tensor element a extends to lowest x positions
Returns
boolean

Definition at line 129 of file UndershootTracksTool.cc.

References f, lar_content::NViewTrackMatchingAlgorithm< T >::GetCachedSlidingFitResult(), lar_content::LArClusterHelper::GetClusterHitType(), lar_content::ThreeDKinkBaseTool::GetXSamplingPoint(), m_cosThetaCutForKinkSearch, lar_content::UndershootTracksTool::Particle::m_pClusterA, lar_content::UndershootTracksTool::Particle::m_pClusterB, lar_content::UndershootTracksTool::Particle::m_pCommonCluster1, lar_content::UndershootTracksTool::Particle::m_pCommonCluster2, and lar_content::LArGeometryHelper::MergeThreePositions3D().

Referenced by GetIteratorListModifications().

131 {
132  try
133  {
134  const TwoDSlidingFitResult &fitResultCommon1(pAlgorithm->GetCachedSlidingFitResult(particle.m_pCommonCluster1));
135  const TwoDSlidingFitResult &fitResultCommon2(pAlgorithm->GetCachedSlidingFitResult(particle.m_pCommonCluster2));
136  const TwoDSlidingFitResult &lowXFitResult(isALowestInX ? pAlgorithm->GetCachedSlidingFitResult(particle.m_pClusterA)
137  : pAlgorithm->GetCachedSlidingFitResult(particle.m_pClusterB));
138  const TwoDSlidingFitResult &highXFitResult(isALowestInX ? pAlgorithm->GetCachedSlidingFitResult(particle.m_pClusterB)
139  : pAlgorithm->GetCachedSlidingFitResult(particle.m_pClusterA));
140 
141  const float minusX(this->GetXSamplingPoint(splitPosition, false, lowXFitResult, fitResultCommon1, fitResultCommon2));
142  const float plusX(this->GetXSamplingPoint(splitPosition, true, highXFitResult, fitResultCommon1, fitResultCommon2));
143  const float splitX(splitPosition.GetX());
144 
145  CartesianVector minus1(0.f, 0.f, 0.f), split1(0.f, 0.f, 0.f), plus1(0.f, 0.f, 0.f);
146  CartesianVector minus2(0.f, 0.f, 0.f), split2(0.f, 0.f, 0.f), plus2(0.f, 0.f, 0.f);
147  CartesianVector minus3(0.f, 0.f, 0.f), split3(splitPosition), plus3(0.f, 0.f, 0.f);
148 
149  if ((STATUS_CODE_SUCCESS != fitResultCommon1.GetGlobalFitPositionAtX(minusX, minus1)) ||
150  (STATUS_CODE_SUCCESS != fitResultCommon1.GetGlobalFitPositionAtX(splitX, split1)) ||
151  (STATUS_CODE_SUCCESS != fitResultCommon1.GetGlobalFitPositionAtX(plusX, plus1)) ||
152  (STATUS_CODE_SUCCESS != fitResultCommon2.GetGlobalFitPositionAtX(minusX, minus2)) ||
153  (STATUS_CODE_SUCCESS != fitResultCommon2.GetGlobalFitPositionAtX(splitX, split2)) ||
154  (STATUS_CODE_SUCCESS != fitResultCommon2.GetGlobalFitPositionAtX(plusX, plus2)) ||
155  (STATUS_CODE_SUCCESS != lowXFitResult.GetGlobalFitPositionAtX(minusX, minus3)) ||
156  (STATUS_CODE_SUCCESS != highXFitResult.GetGlobalFitPositionAtX(plusX, plus3)))
157  {
158  return false; // majority rules, by default
159  }
160 
161  // Extract results
162  const HitType hitType1(LArClusterHelper::GetClusterHitType(particle.m_pCommonCluster1));
163  const HitType hitType2(LArClusterHelper::GetClusterHitType(particle.m_pCommonCluster2));
164  const HitType hitType3(LArClusterHelper::GetClusterHitType(particle.m_pClusterA));
165 
166  CartesianVector minus(0.f, 0.f, 0.f), split(0.f, 0.f, 0.f), plus(0.f, 0.f, 0.f);
167  float chi2Minus(std::numeric_limits<float>::max()), chi2Split(std::numeric_limits<float>::max()),
168  chi2Plus(std::numeric_limits<float>::max());
169  LArGeometryHelper::MergeThreePositions3D(this->GetPandora(), hitType1, hitType2, hitType3, minus1, minus2, minus3, minus, chi2Minus);
170  LArGeometryHelper::MergeThreePositions3D(this->GetPandora(), hitType1, hitType2, hitType3, split1, split2, split3, split, chi2Split);
171  LArGeometryHelper::MergeThreePositions3D(this->GetPandora(), hitType1, hitType2, hitType3, plus1, plus2, plus3, plus, chi2Plus);
172 
173  // Apply final cuts
174  const CartesianVector minusToSplit((split - minus).GetUnitVector());
175  const CartesianVector splitToPlus((plus - split).GetUnitVector());
176  const float dotProduct(minusToSplit.GetDotProduct(splitToPlus));
177 
178  if (dotProduct < m_cosThetaCutForKinkSearch)
179  return true;
180  }
181  catch (StatusCodeException &s)
182  {
183  }
184 
185  return false;
186 }
float GetXSamplingPoint(const pandora::CartesianVector &splitPosition1, const bool isForwardInX, const TwoDSlidingFitResult &fitResult1, const TwoDSlidingFitResult &fitResult2, const TwoDSlidingFitResult &fitResult3) const
Get a sampling point in x that is common to sliding linear fit objects in three views.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
TFile f
Definition: plotHisto.C:6
float m_cosThetaCutForKinkSearch
The cos theta cut used for the kink search in three dimensions.
static void MergeThreePositions3D(const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const pandora::HitType view3, const pandora::CartesianVector &position1, const pandora::CartesianVector &position2, const pandora::CartesianVector &position3, pandora::CartesianVector &position3D, float &chiSquared)
Merge 2D positions from three views to give unified 3D position.
HitType
Definition: HitType.h:12
bool lar_content::ThreeDKinkBaseTool::PassesElementCuts ( TensorType::ElementList::const_iterator  eIter,
const pandora::ClusterSet &  usedClusters 
) const
protectedvirtualinherited

Whether a provided (iterator to a) tensor element passes the selection cuts for overshoot identification.

Parameters
eIterthe iterator to the tensor element
usedClustersthe list of used clusters

Definition at line 43 of file ThreeDKinkBaseTool.cc.

References lar_content::ThreeDKinkBaseTool::m_minMatchedFraction, and lar_content::ThreeDKinkBaseTool::m_minMatchedSamplingPoints.

Referenced by lar_content::ThreeDKinkBaseTool::GetModifications(), and lar_content::ThreeDKinkBaseTool::SelectTensorElements().

44 {
45  if (usedClusters.count(eIter->GetClusterU()) || usedClusters.count(eIter->GetClusterV()) || usedClusters.count(eIter->GetClusterW()))
46  return false;
47 
48  if (eIter->GetOverlapResult().GetMatchedFraction() < m_minMatchedFraction)
49  return false;
50 
51  if (eIter->GetOverlapResult().GetNMatchedSamplingPoints() < m_minMatchedSamplingPoints)
52  return false;
53 
54  return true;
55 }
unsigned int m_minMatchedSamplingPoints
The min number of matched sampling points for use as a key tensor element.
float m_minMatchedFraction
The min matched sampling point fraction for use as a key tensor element.
StatusCode lar_content::UndershootTracksTool::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 213 of file UndershootTracksTool.cc.

References m_cosThetaCutForKinkSearch, m_maxTransverseImpactParameter, m_minImpactParameterCosTheta, m_splitMode, and lar_content::ThreeDKinkBaseTool::ReadSettings().

214 {
215  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "SplitMode", m_splitMode));
216 
217  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
218  XmlHelper::ReadValue(xmlHandle, "MaxTransverseImpactParameter", m_maxTransverseImpactParameter));
219 
220  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
221  XmlHelper::ReadValue(xmlHandle, "MinImpactParameterCosTheta", m_minImpactParameterCosTheta));
222 
223  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
224  XmlHelper::ReadValue(xmlHandle, "CosThetaCutForKinkSearch", m_cosThetaCutForKinkSearch));
225 
226  return ThreeDKinkBaseTool::ReadSettings(xmlHandle);
227 }
float m_cosThetaCutForKinkSearch
The cos theta cut used for the kink search in three dimensions.
float m_minImpactParameterCosTheta
The minimum cos theta (angle between vertex directions) for connecting broken clusters.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
bool m_splitMode
Whether to run in cluster splitting mode, as opposed to cluster merging mode.
float m_maxTransverseImpactParameter
The maximum transverse impact parameter for connecting broken clusters.
bool lar_content::ThreeDKinkBaseTool::Run ( ThreeViewTransverseTracksAlgorithm *const  pAlgorithm,
TensorType overlapTensor 
)
virtualinherited

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 126 of file ThreeDKinkBaseTool.cc.

References lar_content::ThreeDKinkBaseTool::ApplyChanges(), and lar_content::ThreeDKinkBaseTool::GetModifications().

127 {
128  if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
129  std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
130 
131  ModificationList modificationList;
132  this->GetModifications(pAlgorithm, overlapTensor, modificationList);
133  const bool changesMade(this->ApplyChanges(pAlgorithm, modificationList));
134 
135  return changesMade;
136 }
std::vector< Modification > ModificationList
bool ApplyChanges(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const ModificationList &modificationList) const
Apply the changes cached in a modification list and update the tensor accordingly.
void GetModifications(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const TensorType &overlapTensor, ModificationList &modificationList) const
Get modification objects, identifying required splits and merges for clusters.

Member Data Documentation

float lar_content::ThreeDKinkBaseTool::m_additionalXStepForKinkSearch
protectedinherited

An additional (safety) step to tack-on when choosing x sampling points.

Definition at line 100 of file ThreeDKinkBaseTool.h.

Referenced by lar_content::ThreeDKinkBaseTool::GetXSamplingPoint(), and lar_content::ThreeDKinkBaseTool::ReadSettings().

float lar_content::UndershootTracksTool::m_cosThetaCutForKinkSearch
private

The cos theta cut used for the kink search in three dimensions.

Definition at line 68 of file UndershootTracksTool.h.

Referenced by IsThreeDKink(), and ReadSettings().

bool lar_content::ThreeDKinkBaseTool::m_majorityRulesMode
protectedinherited

Whether to run in majority rules mode (always split overshoots, always merge undershoots)

Definition at line 95 of file ThreeDKinkBaseTool.h.

Referenced by GetIteratorListModifications(), lar_content::OvershootTracksTool::GetIteratorListModifications(), and lar_content::ThreeDKinkBaseTool::ReadSettings().

float lar_content::UndershootTracksTool::m_maxTransverseImpactParameter
private

The maximum transverse impact parameter for connecting broken clusters.

Definition at line 66 of file UndershootTracksTool.h.

Referenced by GetIteratorListModifications(), and ReadSettings().

float lar_content::UndershootTracksTool::m_minImpactParameterCosTheta
private

The minimum cos theta (angle between vertex directions) for connecting broken clusters.

Definition at line 67 of file UndershootTracksTool.h.

Referenced by GetIteratorListModifications(), and ReadSettings().

float lar_content::ThreeDKinkBaseTool::m_minLongitudinalImpactParameter
protectedinherited

The min longitudinal impact parameter for connecting accompanying clusters.

Definition at line 98 of file ThreeDKinkBaseTool.h.

Referenced by GetIteratorListModifications(), lar_content::OvershootTracksTool::PassesVertexCuts(), and lar_content::ThreeDKinkBaseTool::ReadSettings().

float lar_content::ThreeDKinkBaseTool::m_minMatchedFraction
protectedinherited

The min matched sampling point fraction for use as a key tensor element.

Definition at line 96 of file ThreeDKinkBaseTool.h.

Referenced by lar_content::ThreeDKinkBaseTool::PassesElementCuts(), and lar_content::ThreeDKinkBaseTool::ReadSettings().

unsigned int lar_content::ThreeDKinkBaseTool::m_minMatchedSamplingPoints
protectedinherited

The min number of matched sampling points for use as a key tensor element.

Definition at line 97 of file ThreeDKinkBaseTool.h.

Referenced by lar_content::ThreeDKinkBaseTool::PassesElementCuts(), and lar_content::ThreeDKinkBaseTool::ReadSettings().

unsigned int lar_content::ThreeDKinkBaseTool::m_nCommonClusters
protectedinherited
int lar_content::ThreeDKinkBaseTool::m_nLayersForKinkSearch
protectedinherited

The number of sliding fit layers to step in the kink search.

Definition at line 99 of file ThreeDKinkBaseTool.h.

Referenced by lar_content::ThreeDKinkBaseTool::GetXSamplingPoint(), and lar_content::ThreeDKinkBaseTool::ReadSettings().

bool lar_content::UndershootTracksTool::m_splitMode
private

Whether to run in cluster splitting mode, as opposed to cluster merging mode.

Definition at line 65 of file UndershootTracksTool.h.

Referenced by GetIteratorListModifications(), and ReadSettings().


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