25 m_maxVertexXSeparation(2.f),
26 m_cosThetaCutForKinkSearch(0.94f)
35 for (IteratorList::const_iterator iIter1 = iteratorList.begin(), iIter1End = iteratorList.end(); iIter1 != iIter1End; ++iIter1)
37 for (IteratorList::const_iterator iIter2 = iIter1; iIter2 != iIter1End; ++iIter2)
44 const unsigned int nMatchedSamplingPoints1((*iIter1)->GetOverlapResult().GetNMatchedSamplingPoints());
45 const unsigned int nMatchedSamplingPoints2((*iIter2)->GetOverlapResult().GetNMatchedSamplingPoints());
46 IteratorList::const_iterator iIterA((nMatchedSamplingPoints1 >= nMatchedSamplingPoints2) ? iIter1 : iIter2);
47 IteratorList::const_iterator iIterB((nMatchedSamplingPoints1 >= nMatchedSamplingPoints2) ? iIter2 : iIter1);
49 Particle particle(*(*iIterA), *(*iIterB));
64 const bool isA1LowestInX(this->
IsALowestInX(pointingClusterA1, pointingClusterB1));
65 const bool isA2LowestInX(this->
IsALowestInX(pointingClusterA2, pointingClusterB2));
76 modification.
m_splitPositionMap[particle.m_pCommonCluster].push_back(particle.m_splitPosition);
81 const Cluster *
const pLowXCluster1(vertex1AIsLowX ? particle.m_pClusterA1 : particle.m_pClusterB1);
82 const Cluster *
const pHighXCluster1(vertex1AIsLowX ? particle.m_pClusterB1 : particle.m_pClusterA1);
86 const Cluster *
const pLowXCluster2(vertex2AIsLowX ? particle.m_pClusterA2 : particle.m_pClusterB2);
87 const Cluster *
const pHighXCluster2(vertex2AIsLowX ? particle.m_pClusterB2 : particle.m_pClusterA2);
97 modificationList.push_back(modification);
101 if (STATUS_CODE_FAILURE == statusCodeException.
GetStatusCode())
102 throw statusCodeException;
114 float longitudinalAB(-std::numeric_limits<float>::max()), transverseAB(std::numeric_limits<float>::max());
117 float longitudinalBA(-std::numeric_limits<float>::max()), transverseBA(std::numeric_limits<float>::max());
131 bool splitAtElementA(
false), splitAtElementB(
false);
135 splitAtElementA =
true;
139 splitAtElementB =
true;
142 if (!splitAtElementA && !splitAtElementB)
149 float chiSquared(std::numeric_limits<float>::max());
180 if ((STATUS_CODE_SUCCESS != lowXFitResult1.GetGlobalFitPositionAtX(minusX, minus1)) ||
181 (STATUS_CODE_SUCCESS != highXFitResult1.GetGlobalFitPositionAtX(plusX, plus1)) ||
182 (STATUS_CODE_SUCCESS != lowXFitResult2.GetGlobalFitPositionAtX(minusX, minus2)) ||
183 (STATUS_CODE_SUCCESS != highXFitResult2.GetGlobalFitPositionAtX(plusX, plus2)) ||
184 (STATUS_CODE_SUCCESS != fitResultCommon3.GetGlobalFitPositionAtX(minusX, minus3)) ||
185 (STATUS_CODE_SUCCESS != fitResultCommon3.GetGlobalFitPositionAtX(plusX, plus3)))
195 CartesianVector minus(0.f, 0.f, 0.f), split(0.f, 0.f, 0.f), plus(0.f, 0.f, 0.f);
196 float chi2Minus(std::numeric_limits<float>::max()), chi2Split(std::numeric_limits<float>::max()),
197 chi2Plus(std::numeric_limits<float>::max());
205 const float dotProduct(minusToSplit.
GetDotProduct(splitToPlus));
221 m_splitPosition(0.f, 0.f, 0.f),
222 m_splitPosition1(0.f, 0.f, 0.f),
223 m_splitPosition2(0.f, 0.f, 0.f)
225 const HitType commonView((elementA.GetClusterU() == elementB.GetClusterU())
227 : (elementA.GetClusterV() == elementB.GetClusterV())
235 (
TPC_VIEW_U == commonView) ? elementA.GetClusterU() : (
TPC_VIEW_V == commonView) ? elementA.GetClusterV() : elementA.GetClusterW();
Header file for the cluster helper class.
Header file for the geometry helper class.
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
static float MergeTwoPositions(const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const float position1, const float position2)
Merge two views (U,V) to give a third view (Z).
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.
const pandora::CartesianVector & GetPosition() const
Get the vertex position.
static void GetImpactParameters(const LArPointingCluster::Vertex &pointingVertex, const LArPointingCluster::Vertex &targetVertex, float &longitudinal, float &transverse)
Calculate impact parameters between a pair of pointing vertices.
static void GetClosestVerticesInX(const LArPointingCluster &pointingClusterI, const LArPointingCluster &pointingClusterJ, LArPointingCluster::Vertex &closestVertexI, LArPointingCluster::Vertex &closestVertexJ)
Given a pair of pointing clusters, find the pair of vertices with smallest x-separation.
LArPointingCluster class.
const TwoDSlidingFitResult & GetCachedSlidingFitResult(const pandora::Cluster *const pCluster) const
Get a sliding fit result from the algorithm cache.
pandora::CartesianVector m_splitPosition1
The candidate split position in view 1.
pandora::CartesianVector m_splitPosition
The candidate split position for the common cluster.
const pandora::Cluster * m_pClusterB2
Address of cluster in element B, view 2.
Particle(const TensorType::Element &elementA, const TensorType::Element &elementB)
Constructor.
const pandora::Cluster * m_pClusterA2
Address of cluster in element A, view 2.
pandora::CartesianVector m_splitPosition2
The candidate split position in view 2.
const pandora::Cluster * m_pCommonCluster
Address of the common cluster.
const pandora::Cluster * m_pClusterB1
Address of cluster in element B, view 1.
const pandora::Cluster * m_pClusterA1
Address of cluster in element A, view 1.
bool PassesVertexCuts(const LArPointingCluster::Vertex &vertexA, const LArPointingCluster::Vertex &vertexB) const
Whether a pair of vertices pass longitudinal projection cuts.
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 merge...
bool m_splitMode
Whether to run in cluster splitting mode, as opposed to cluster merging mode.
bool IsThreeDKink(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const Particle &particle, const bool isA1LowestInX, const bool isA2LowestInX) const
Whether the provided particle is consistent with being a kink, when examined in three dimensions at t...
void SetSplitPosition(const LArPointingCluster::Vertex &vertexA1, const LArPointingCluster::Vertex &vertexA2, const LArPointingCluster::Vertex &vertexB1, const LArPointingCluster::Vertex &vertexB2, Particle &particle) const
Set split position for a provided particle.
float m_cosThetaCutForKinkSearch
The cos theta cut used for the kink search in three dimensions.
OvershootTracksTool()
Default constructor.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
float m_maxVertexXSeparation
The max separation between accompanying clusters vertex x positions to make split.
ThreeDKinkBaseTool class.
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)
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.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
pandora::ClusterList m_affectedClusters
The list of affected clusters.
float m_minLongitudinalImpactParameter
The min longitudinal impact parameter for connecting accompanying clusters.
bool m_majorityRulesMode
Whether to run in majority rules mode (always split overshoots, always merge undershoots)
std::vector< Modification > ModificationList
ClusterMergeMap m_clusterMergeMap
The cluster merge map.
SplitPositionMap m_splitPositionMap
The split position map.
ThreeViewTransverseTracksAlgorithm class.
std::vector< TensorType::ElementList::const_iterator > IteratorList
TwoDSlidingFitResult class.
float GetX() const
Get the cartesian x coordinate.
float GetDotProduct(const CartesianVector &rhs) const
Get the dot product of the cartesian vector with a second cartesian vector.
const Pandora & GetPandora() const
Get the associated pandora instance.
StatusCodeException class.
StatusCode GetStatusCode() const
Get status code.
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
HitType
Calorimeter hit type enum.
StatusCode
The StatusCode enum.