27 m_maxTransverseImpactParameter(5.f),
28 m_minImpactParameterCosTheta(0.5f),
29 m_cosThetaCutForKinkSearch(0.75f)
38 for (IteratorList::const_iterator iIter1 = iteratorList.begin(), iIter1End = iteratorList.end(); iIter1 != iIter1End; ++iIter1)
40 for (IteratorList::const_iterator iIter2 = iIter1; iIter2 != iIter1End; ++iIter2)
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);
52 Particle particle(*(*iIterA), *(*iIterB));
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());
76 const bool isALowestInX(this->
IsALowestInX(pointingClusterA, pointingClusterB));
91 CartesianVector splitPosition1(0.f, 0.f, 0.f), splitPosition2(0.f, 0.f, 0.f);
104 const Cluster *
const pLowXCluster(vertexAIsLowX ? particle.m_pClusterA : particle.m_pClusterB);
105 const Cluster *
const pHighXCluster(vertexAIsLowX ? particle.m_pClusterB : particle.m_pClusterA);
114 modificationList.push_back(modification);
118 if (STATUS_CODE_FAILURE == statusCodeException.
GetStatusCode())
119 throw statusCodeException;
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());
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);
155 (STATUS_CODE_SUCCESS != lowXFitResult.GetGlobalFitPositionAtX(minusX, minus3)) ||
156 (STATUS_CODE_SUCCESS != highXFitResult.GetGlobalFitPositionAtX(plusX, plus3)))
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());
176 const float dotProduct(minusToSplit.
GetDotProduct(splitToPlus));
193 m_pClusterA = (elementA.GetClusterU() != elementB.GetClusterU())
194 ? elementA.GetClusterU()
195 : (elementA.GetClusterV() != elementB.GetClusterV()) ? elementA.GetClusterV() : elementA.GetClusterW();
196 m_pClusterB = (elementA.GetClusterU() != elementB.GetClusterU())
197 ? elementB.GetClusterU()
198 : (elementA.GetClusterV() != elementB.GetClusterV()) ? elementB.GetClusterV() : elementB.GetClusterW();
200 ? elementA.GetClusterU()
201 : (elementA.GetClusterV() == elementB.GetClusterV()) ? elementA.GetClusterV() : elementA.GetClusterW();
203 ? elementA.GetClusterU()
205 ? elementA.GetClusterV()
206 : elementA.GetClusterW();
Header file for the cluster helper class.
Header file for the geometry helper class.
Header file for the lar pointing cluster 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 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 & GetDirection() const
Get the vertex direction.
const pandora::CartesianVector & GetPosition() const
Get the vertex position.
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.
static void GetImpactParameters(const LArPointingCluster::Vertex &pointingVertex, const LArPointingCluster::Vertex &targetVertex, float &longitudinal, float &transverse)
Calculate impact parameters between a pair of pointing vertices.
LArPointingCluster class.
const TwoDSlidingFitResult & GetCachedSlidingFitResult(const pandora::Cluster *const pCluster) const
Get a sliding fit result from the algorithm cache.
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.
pandora::StatusCode GetGlobalFitPositionAtX(const float x, pandora::CartesianVector &position) const
Get global fit position for a given input x coordinate.
const pandora::Cluster * m_pClusterA
Address of non-shared cluster in element A.
const pandora::Cluster * m_pCommonCluster1
Address of the common cluster in view 1.
const pandora::Cluster * m_pClusterB
Address of non-shared cluster in element B.
const pandora::Cluster * m_pCommonCluster2
Address of the common cluster in view 2.
Particle(const TensorType::Element &elementA, const TensorType::Element &elementB)
Constructor.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
float m_maxTransverseImpactParameter
The maximum transverse impact parameter for connecting broken clusters.
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 pandora::CartesianVector &splitPosition, const bool isALowestInX) const
Whether the provided particle is consistent with being a kink, when examined in three dimensions at t...
float m_minImpactParameterCosTheta
The minimum cos theta (angle between vertex directions) for connecting broken clusters.
float m_cosThetaCutForKinkSearch
The cos theta cut used for the kink search in three dimensions.
UndershootTracksTool()
Default constructor.
float GetCosOpeningAngle(const CartesianVector &rhs) const
Get the cosine of the opening angle of the cartesian vector with respect to a second cartesian vector...
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.