25 TwoDSlidingFitResult::TwoDSlidingFitResult(
const Cluster *
const pCluster,
const unsigned int layerFitHalfWindow,
const float layerPitch) :
27 m_layerFitHalfWindow(layerFitHalfWindow),
28 m_layerPitch(layerPitch),
29 m_axisIntercept(0.
f, 0.
f, 0.
f),
30 m_axisDirection(0.
f, 0.
f, 0.
f),
31 m_orthoDirection(0.
f, 0.
f, 0.
f)
33 CartesianPointVector pointVector;
60 const CartesianVector &axisIntercept,
const CartesianVector &axisDirection,
const CartesianVector &orthoDirection) :
68 CartesianPointVector pointVector;
77 const CartesianVector &axisIntercept,
const CartesianVector &axisDirection,
const CartesianVector &orthoDirection) :
93 const CartesianVector &axisIntercept,
const CartesianVector &axisDirection,
const CartesianVector &orthoDirection,
112 throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
129 throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
139 throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
148 if (
m_layerPitch < std::numeric_limits<float>::epsilon())
149 throw StatusCodeException(STATUS_CODE_FAILURE);
175 float pL(0.
f), pT(0.
f);
178 if (std::fabs(pL) < std::numeric_limits<float>::epsilon())
179 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
195 const float pL(1.
f / std::sqrt(1.
f + dTdL * dTdL));
196 const float pT(dTdL / std::sqrt(1.
f + dTdL * dTdL));
198 CartesianVector globalCoordinates(0.
f, 0.
f, 0.
f);
208 throw StatusCodeException(STATUS_CODE_FAILURE);
211 CartesianVector position(0.
f, 0.
f, 0.
f);
221 throw StatusCodeException(STATUS_CODE_FAILURE);
224 CartesianVector position(0.
f, 0.
f, 0.
f);
234 throw StatusCodeException(STATUS_CODE_FAILURE);
237 CartesianVector direction(0.
f, 0.
f, 0.
f);
247 throw StatusCodeException(STATUS_CODE_FAILURE);
250 CartesianVector direction(0.
f, 0.
f, 0.
f);
260 throw StatusCodeException(STATUS_CODE_FAILURE);
263 return iter->second.GetRms();
271 throw StatusCodeException(STATUS_CODE_FAILURE);
274 return iter->second.GetRms();
284 if (STATUS_CODE_SUCCESS != statusCode)
285 throw StatusCodeException(statusCode);
287 return this->
GetFitRms(layerInterpolation);
296 CartesianVector firstDirection(0.
f,0.
f,0.
f);
297 CartesianVector secondDirection(0.
f,0.
f,0.
f);
299 const StatusCode firstStatusCode(this->
GetGlobalFitDirection(rL - halfWindowLength, firstDirection));
300 const StatusCode secondStatusCode(this->
GetGlobalFitDirection(rL + halfWindowLength, secondDirection));
302 if (STATUS_CODE_SUCCESS != firstStatusCode)
303 throw StatusCodeException(firstStatusCode);
305 if (STATUS_CODE_SUCCESS != secondStatusCode)
306 throw StatusCodeException(secondStatusCode);
308 return firstDirection.GetDotProduct(secondDirection);
318 if (STATUS_CODE_SUCCESS != statusCode)
322 return STATUS_CODE_SUCCESS;
332 if (STATUS_CODE_SUCCESS != statusCode)
336 return STATUS_CODE_SUCCESS;
346 if (STATUS_CODE_SUCCESS != statusCode)
349 if (layerInterpolationList.size() != 1)
350 return STATUS_CODE_NOT_FOUND;
353 return STATUS_CODE_SUCCESS;
363 if (STATUS_CODE_SUCCESS != statusCode)
366 if (layerInterpolationList.size() != 1)
367 return STATUS_CODE_NOT_FOUND;
370 return STATUS_CODE_SUCCESS;
377 float rL(0.
f), rT(0.
f);
389 if (STATUS_CODE_SUCCESS != statusCode)
393 iter != iterEnd; ++iter)
398 return STATUS_CODE_SUCCESS;
408 if (STATUS_CODE_SUCCESS != statusCode)
412 return STATUS_CODE_SUCCESS;
418 CartesianVector &direction)
const 423 if (STATUS_CODE_SUCCESS != statusCode)
428 return STATUS_CODE_SUCCESS;
437 if (STATUS_CODE_NOT_FOUND != statusCode)
440 const int thisLayer(this->
GetLayer(rL));
444 if (thisLayer <= minLayer)
448 else if (thisLayer >= maxLayer)
454 return STATUS_CODE_FAILURE;
457 return STATUS_CODE_SUCCESS;
466 if (STATUS_CODE_NOT_FOUND != statusCode)
469 const int thisLayer(this->
GetLayer(rL));
473 if (thisLayer <= minLayer)
477 else if (thisLayer >= maxLayer)
483 return STATUS_CODE_FAILURE;
486 return STATUS_CODE_SUCCESS;
495 if (STATUS_CODE_NOT_FOUND != statusCode)
504 const int innerLayer((minLayerX < maxLayerX) ? minLayer : maxLayer);
505 const int outerLayer((minLayerX < maxLayerX) ? maxLayer : minLayer);
513 if (innerDirection.GetX() > -std::numeric_limits<float>::epsilon() || outerDirection.GetX() < +std::numeric_limits<float>::epsilon() ||
514 outerVertex.GetX() - innerVertex.GetX() < +std::numeric_limits<float>::epsilon())
516 return STATUS_CODE_NOT_FOUND;
518 else if (x >= outerVertex.GetX())
520 position = outerVertex + outerDirection * ((x - outerVertex.GetX()) / outerDirection.GetX());
522 else if (x <= innerVertex.GetX())
524 position = innerVertex + innerDirection * ((x - innerVertex.GetX()) / innerDirection.GetX());
528 return STATUS_CODE_NOT_FOUND;
532 return STATUS_CODE_SUCCESS;
549 throw StatusCodeException(STATUS_CODE_NOT_FOUND);
557 if (coordinateVector.size() < 2)
558 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
560 CartesianVector centroid(0.
f, 0.
f, 0.
f);
566 CartesianVector fitDirection(eigenVecs.at(0));
569 if (fitDirection.GetZ() < 0.f)
570 fitDirection *= -1.
f;
572 for (
const CartesianVector &coordinate : coordinateVector)
573 minProjection =
std::min(minProjection, fitDirection.GetDotProduct(coordinate - centroid));
576 const float fitProjection(layerPitch * std::floor(minProjection / layerPitch));
582 CartesianVector yAxis(0.
f, 1.
f, 0.
f);
590 if (
m_layerPitch < std::numeric_limits<float>::epsilon())
591 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
593 if ((
m_axisDirection.GetMagnitudeSquared() < std::numeric_limits<float>::epsilon()) ||
594 (
m_orthoDirection.GetMagnitudeSquared() < std::numeric_limits<float>::epsilon()))
595 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
598 throw StatusCodeException(STATUS_CODE_FAILURE);
602 float rL(0.
f), rT(0.
f);
613 throw StatusCodeException(STATUS_CODE_FAILURE);
616 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
618 unsigned int slidingNPoints(0);
619 double slidingSumT(0.), slidingSumL(0.), slidingSumTT(0.), slidingSumLT(0.), slidingSumLL(0.);
622 const int innerLayer(layerFitContributionMap.begin()->first);
625 for (
int iLayer = innerLayer; iLayer < innerLayer + layerFitHalfWindow; ++iLayer)
629 if (layerFitContributionMap.end() != lyrIter)
631 slidingSumT += lyrIter->second.GetSumT();
632 slidingSumL += lyrIter->second.GetSumL();
633 slidingSumTT += lyrIter->second.GetSumTT();
634 slidingSumLT += lyrIter->second.GetSumLT();
635 slidingSumLL += lyrIter->second.GetSumLL();
636 slidingNPoints += lyrIter->second.GetNPoints();
640 const int outerLayer(layerFitContributionMap.rbegin()->first);
642 for (
int iLayer = innerLayer; iLayer <= outerLayer; ++iLayer)
644 const int fwdLayer(iLayer + layerFitHalfWindow);
647 if (layerFitContributionMap.end() != fwdIter)
649 slidingSumT += fwdIter->second.GetSumT();
650 slidingSumL += fwdIter->second.GetSumL();
651 slidingSumTT += fwdIter->second.GetSumTT();
652 slidingSumLT += fwdIter->second.GetSumLT();
653 slidingSumLL += fwdIter->second.GetSumLL();
654 slidingNPoints += fwdIter->second.GetNPoints();
657 const int bwdLayer(iLayer - layerFitHalfWindow - 1);
660 if (layerFitContributionMap.end() != bwdIter)
662 slidingSumT -= bwdIter->second.GetSumT();
663 slidingSumL -= bwdIter->second.GetSumL();
664 slidingSumTT -= bwdIter->second.GetSumTT();
665 slidingSumLT -= bwdIter->second.GetSumLT();
666 slidingSumLL -= bwdIter->second.GetSumLL();
667 slidingNPoints -= bwdIter->second.GetNPoints();
671 if (slidingNPoints <= 2)
675 if (layerFitContributionMap.end() == layerFitContributionMap.find(iLayer))
678 const double denominator(slidingSumLL - slidingSumL * slidingSumL / static_cast<double>(slidingNPoints));
680 if (std::fabs(denominator) < std::numeric_limits<float>::epsilon())
683 const double gradient((slidingSumLT - slidingSumL * slidingSumT / static_cast<double>(slidingNPoints)) / denominator);
684 const double intercept((slidingSumLL * slidingSumT / static_cast<double>(slidingNPoints) - slidingSumL * slidingSumLT / static_cast<double>(slidingNPoints)) / denominator);
685 double variance((slidingSumTT - 2. * intercept * slidingSumT - 2. * gradient * slidingSumLT + intercept * intercept * static_cast<double>(slidingNPoints) + 2. * gradient * intercept * slidingSumL + gradient * gradient * slidingSumLL) / (1. + gradient * gradient));
687 if (variance < -std::numeric_limits<float>::epsilon())
690 if (variance < std::numeric_limits<float>::epsilon())
693 const double rms(std::sqrt(variance / static_cast<double>(slidingNPoints)));
694 const double l(this->
GetL(iLayer));
695 const double fitT(intercept + gradient * l);
702 throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
710 throw StatusCodeException(STATUS_CODE_FAILURE);
712 unsigned int nSustainedSteps(0);
713 float sustainedDirectionStartX(0.
f), sustainedDirectionEndX(0.
f);
715 CartesianVector previousPosition(0.
f, 0.
f, 0.
f);
723 CartesianVector position(0.
f, 0.
f, 0.
f);
729 if (previousDirection == currentDirection)
733 if (nSustainedSteps > 2)
735 sustainedDirection = currentDirection;
736 sustainedDirectionEndIter = iter;
737 sustainedDirectionEndX = position.GetX();
742 if ((
POSITIVE_IN_X == sustainedDirection) || (NEGATIVE_IN_X == sustainedDirection))
743 m_fitSegmentList.push_back(
FitSegment(sustainedDirectionStartIter->first, sustainedDirectionEndIter->first, sustainedDirectionStartX, sustainedDirectionEndX));
747 sustainedDirectionStartIter = iter;
748 sustainedDirectionStartX = position.GetX();
751 previousPosition = position;
752 previousDirection = currentDirection;
756 m_fitSegmentList.push_back(
FitSegment(sustainedDirectionStartIter->first, sustainedDirectionEndIter->first, sustainedDirectionStartX, sustainedDirectionEndX));
764 throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
771 CartesianVector globalPosition(0.
f, 0.
f, 0.
f);
772 this->
GetGlobalPosition(iter->second.GetL(), iter->second.GetFitT(), globalPosition);
773 const float coordinate(isX ? globalPosition.GetX() : globalPosition.GetZ());
790 throw StatusCodeException(STATUS_CODE_FAILURE);
792 CartesianVector firstLayerPosition(0.
f, 0.
f, 0.
f);
793 this->
GetGlobalPosition(firstLayerIter->second.GetL(), firstLayerIter->second.GetFitT(), firstLayerPosition);
795 if (firstLayerIter == secondLayerIter)
796 return firstLayerPosition;
798 CartesianVector secondLayerPosition(0.
f, 0.
f, 0.
f);
799 this->
GetGlobalPosition(secondLayerIter->second.GetL(), secondLayerIter->second.GetFitT(), secondLayerPosition);
801 if (firstWeight + secondWeight < std::numeric_limits<float>::epsilon())
802 throw StatusCodeException(STATUS_CODE_FAILURE);
804 return ((firstLayerPosition * firstWeight + secondLayerPosition * secondWeight) * (1.f / (firstWeight + secondWeight)));
818 throw StatusCodeException(STATUS_CODE_FAILURE);
820 CartesianVector firstLayerDirection(0.
f,0.
f,0.
f);
823 if (firstLayerIter == secondLayerIter)
824 return firstLayerDirection;
826 CartesianVector secondLayerDirection(0.
f,0.
f,0.
f);
829 if (firstWeight + secondWeight < std::numeric_limits<float>::epsilon())
830 throw StatusCodeException(STATUS_CODE_FAILURE);
832 return ((firstLayerDirection * firstWeight + secondLayerDirection * secondWeight).GetUnitVector());
846 throw StatusCodeException(STATUS_CODE_FAILURE);
848 const float firstLayerRms(firstLayerIter->second.GetRms());
850 if (firstLayerIter == secondLayerIter)
851 return firstLayerRms;
853 const float secondLayerRms(secondLayerIter->second.GetRms());
855 if (firstWeight + secondWeight < std::numeric_limits<float>::epsilon())
856 throw StatusCodeException(STATUS_CODE_FAILURE);
858 return ((firstLayerRms * firstWeight + secondLayerRms * secondWeight) / (firstWeight + secondWeight));
865 double firstWeight(0.), secondWeight(0.);
870 if (STATUS_CODE_SUCCESS != statusCode)
874 layerInterpolation =
LayerInterpolation(firstLayerIter, secondLayerIter, firstWeight, secondWeight);
876 return STATUS_CODE_SUCCESS;
883 double firstWeight(0.), secondWeight(0.);
888 if (STATUS_CODE_SUCCESS != statusCode)
892 layerInterpolation =
LayerInterpolation(firstLayerIter, secondLayerIter, firstWeight, secondWeight);
894 return STATUS_CODE_SUCCESS;
906 if (STATUS_CODE_SUCCESS == statusCode)
908 layerInterpolationList.push_back(layerInterpolation);
910 else if (STATUS_CODE_NOT_FOUND != statusCode)
916 return STATUS_CODE_SUCCESS;
925 throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
929 const int thisLayer(this->
GetLayer(rL));
932 if (minLayer == thisLayer && thisLayer == maxLayer)
936 return STATUS_CODE_SUCCESS;
940 const int startLayer((thisLayer >= maxLayer) ? thisLayer - 1 : thisLayer);
942 if ((startLayer < minLayer) || (startLayer >= maxLayer))
943 return STATUS_CODE_NOT_FOUND;
948 for (
int iLayer = startLayer; iLayer >= minLayer; --iLayer)
957 return STATUS_CODE_NOT_FOUND;
962 for (
int iLayer = startLayer + 1; iLayer <= maxLayer; ++iLayer)
971 return STATUS_CODE_NOT_FOUND;
973 return STATUS_CODE_SUCCESS;
982 throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
986 throw StatusCodeException(STATUS_CODE_FAILURE);
990 throw StatusCodeException(STATUS_CODE_FAILURE);
992 CartesianVector minPosition(0.
f, 0.
f, 0.
f), maxPosition(0.
f, 0.
f, 0.
f);
993 this->
GetGlobalPosition(minLayerIter->second.GetL(), minLayerIter->second.GetFitT(), minPosition);
994 this->
GetGlobalPosition(maxLayerIter->second.GetL(), maxLayerIter->second.GetFitT(), maxPosition);
996 if ((std::fabs(maxPosition.GetX() - minPosition.GetX()) < std::numeric_limits<float>::epsilon()))
997 return STATUS_CODE_NOT_FOUND;
1000 const float minL(minLayerIter->second.GetL());
1001 const float maxL(maxLayerIter->second.GetL());
1002 const float startL(minL + (maxL - minL) * (x - minPosition.GetX()) / (maxPosition.GetX() - minPosition.GetX()));
1007 CartesianVector startLayerPosition(0.
f, 0.
f, 0.
f);
1009 for (
int iLayer = startLayer; iLayer <= maxLayer; ++iLayer)
1018 return STATUS_CODE_NOT_FOUND;
1020 this->
GetGlobalPosition(startLayerIter->second.GetL(), startLayerIter->second.GetFitT(), startLayerPosition);
1022 const bool startIsAhead((startLayerPosition.GetX() -
x) > std::numeric_limits<float>::epsilon());
1023 const bool increasesWithLayers(maxPosition.GetX() > minPosition.GetX());
1024 const int increment = ((startIsAhead == increasesWithLayers) ? -1 : +1);
1032 CartesianVector firstLayerPosition(0.
f, 0.
f, 0.
f);
1033 CartesianVector secondLayerPosition(0.
f, 0.
f, 0.
f);
1035 for (
int iLayer = startLayerIter->first; (iLayer >= minLayer) && (iLayer <= maxLayer); iLayer += increment)
1041 firstLayerIter = secondLayerIter;
1042 firstLayerPosition = secondLayerPosition;
1043 secondLayerIter = tempIter;
1045 this->
GetGlobalPosition(secondLayerIter->second.GetL(), secondLayerIter->second.GetFitT(), secondLayerPosition);
1046 const bool isAhead(secondLayerPosition.GetX() >
x);
1048 if (startIsAhead != isAhead)
1055 return STATUS_CODE_NOT_FOUND;
1057 return STATUS_CODE_SUCCESS;
1066 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
1068 const double deltaL(rL - firstLayerIter->second.GetL());
1069 const double deltaLLayers(secondLayerIter->second.GetL() - firstLayerIter->second.GetL());
1071 if (std::fabs(deltaLLayers) > std::numeric_limits<float>::epsilon())
1073 firstWeight = 1. - deltaL / deltaLLayers;
1074 secondWeight = deltaL / deltaLLayers;
1089 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
1091 CartesianVector firstLayerPosition(0.
f, 0.
f, 0.
f);
1092 CartesianVector secondLayerPosition(0.
f, 0.
f, 0.
f);
1094 this->
GetGlobalPosition(firstLayerIter->second.GetL(), firstLayerIter->second.GetFitT(), firstLayerPosition);
1095 this->
GetGlobalPosition(secondLayerIter->second.GetL(), secondLayerIter->second.GetFitT(), secondLayerPosition);
1097 const double deltaP(x - firstLayerPosition.GetX());
1098 const double deltaPLayers(secondLayerPosition.GetX() - firstLayerPosition.GetX());
1100 if (std::fabs(deltaPLayers) > std::numeric_limits<float>::epsilon())
1102 firstWeight = 1. - deltaP / deltaPLayers;
1103 secondWeight = deltaP / deltaPLayers;
void FillLayerFitContributionMap(const pandora::CartesianPointVector &coordinateVector)
Fill the layer fit contribution map.
unsigned int GetLayerFitHalfWindow() const
Get the layer fit half window.
void GetMinAndMaxCoordinate(const bool isX, float &min, float &max) const
Get the minimum and maximum x or z coordinates associated with the sliding fit.
pandora::CartesianVector m_axisIntercept
The axis intercept position.
int GetStartLayer() const
Get start layer.
void GetTransverseInterpolationWeights(const float x, const LayerFitResultMap::const_iterator &firstLayerIter, const LayerFitResultMap::const_iterator &secondLayerIter, double &firstWeight, double &secondWeight) const
Get interpolation weights for layers surrounding a specified transverse position. ...
pandora::StatusCode GetTransverseSurroundingLayers(const float x, const int minLayer, const int maxLayer, LayerFitResultMap::const_iterator &firstLayerIter, LayerFitResultMap::const_iterator &secondLayerIter) const
Get iterators for layers surrounding a specified transverse position.
const pandora::Cluster * m_pCluster
The address of the cluster.
double GetEndLayerWeight() const
Get the end layer weight.
TransverseDirection
TransverseDirection enum.
void FindSlidingFitSegments()
Find sliding fit segments; sections with tramsverse direction.
pandora::StatusCode GetExtrapolatedPositionAtX(const float x, pandora::CartesianVector &position) const
Get extrapolated position (beyond span) for a given input x coordinate.
pandora::CartesianVector EigenValues
void GetLocalDirection(const pandora::CartesianVector &direction, float &dTdL) const
Get local sliding fit gradient for a given global direction.
float GetMaxLayerRms() const
Get rms at maximum layer.
pandora::CartesianVector m_axisDirection
The axis direction vector.
void GetLongitudinalInterpolationWeights(const float rL, const LayerFitResultMap::const_iterator &firstLayerIter, const LayerFitResultMap::const_iterator &secondLayerIter, double &firstWeight, double &secondWeight) const
Get interpolation weights for layers surrounding a specified longitudinal position.
float GetLayerFitHalfWindowLength() const
Get the layer fit half window length.
Header file for the principal curve analysis helper class.
pandora::StatusCode LongitudinalInterpolation(const float rL, LayerInterpolation &layerInterpolation) const
Get the pair of layers surrounding a specified longitudinal position.
pandora::CartesianVector GetGlobalMinLayerDirection() const
Get global direction corresponding to the fit result in minimum fit layer.
pandora::StatusCode GetLongitudinalSurroundingLayers(const float rL, LayerFitResultMap::const_iterator &firstLayerIter, LayerFitResultMap::const_iterator &secondLayerIter) const
Get iterators for layers surrounding the specified longitudinal position.
std::map< int, LayerFitContribution > LayerFitContributionMap
float GetCosScatteringAngle(const float rL) const
Get scattering angle for a given longitudinal coordinate.
Header file for the geometry helper class.
unsigned int m_layerFitHalfWindow
The layer fit half window.
TwoDSlidingFitResult(const T *const pT, const unsigned int layerFitHalfWindow, const float layerPitch)
Constructor using internal definition of primary axis.
int GetMaxLayer() const
Get the maximum occupied layer in the sliding fit.
LayerFitResultMap::const_iterator GetEndLayerIter() const
Get the end layer iterator.
int GetMinLayer() const
Get the minimum occupied layer in the sliding fit.
Header file for the cluster helper class.
float GetFitRms(const float rL) const
Get fit rms for a given longitudinal coordinate.
pandora::StatusCode GetGlobalFitPosition(const float rL, pandora::CartesianVector &position) const
Get global fit position for a given longitudinal coordinate.
double GetStartLayerWeight() const
Get the start layer weight.
Header file for the lar two dimensional sliding fit result class.
pandora::StatusCode TransverseInterpolation(const float x, const FitSegment &fitSegment, LayerInterpolation &layerInterpolation) const
Get the surrounding pair of layers for a specified transverse position and fit segment.
pandora::StatusCode GetExtrapolatedPosition(const float rL, pandora::CartesianVector &position) const
Get extrapolated position (beyond span) for a given input coordinate.
std::map< int, LayerFitResult > LayerFitResultMap
void CalculateAxes(const pandora::CartesianPointVector &coordinateVector, const float layerPitch)
Calculate the longitudinal and transverse axes.
const FitSegment & GetFitSegment(const float rL) const
Get fit segment for a given longitudinal coordinate.
pandora::CartesianVector GetGlobalMinLayerPosition() const
Get global position corresponding to the fit result in minimum fit layer.
pandora::StatusCode GetExtrapolatedDirection(const float rL, pandora::CartesianVector &direction) const
Get extrapolated direction (beyond span) for a given input coordinate.
std::vector< LayerInterpolation > LayerInterpolationList
void GetGlobalDirection(const float dTdL, pandora::CartesianVector &direction) const
Get global direction coordinates for given sliding linear fit gradient.
const LayerFitResultMap & GetLayerFitResultMap() const
Get the layer fit result map.
float GetMinLayerRms() const
Get rms at minimum layer.
static void RunPca(const T &t, pandora::CartesianVector ¢roid, EigenValues &outputEigenValues, EigenVectors &outputEigenVectors)
Run principal component analysis using input calo hits (TPC_VIEW_U,V,W or TPC_3D; all treated as 3D p...
const pandora::Cluster * GetCluster() const
Get the address of the cluster, if originally provided.
pandora::StatusCode GetGlobalFitPositionAtX(const float x, pandora::CartesianVector &position) const
Get global fit position for a given input x coordinate.
pandora::StatusCode GetGlobalFitDirection(const float rL, pandora::CartesianVector &direction) const
Get global fit direction for a given longitudinal coordinate.
std::vector< pandora::CartesianVector > EigenVectors
LayerInterpolation class.
pandora::StatusCode GetGlobalFitProjection(const pandora::CartesianVector &inputPosition, pandora::CartesianVector &projectedPosition) const
Get projected position on global fit for a given position vector.
void PerformSlidingLinearFit()
Perform the sliding linear fit.
void GetGlobalPosition(const float rL, const float rT, pandora::CartesianVector &position) const
Get global coordinates for given sliding linear fit coordinates.
FitSegmentList m_fitSegmentList
The fit segment list.
pandora::CartesianVector GetGlobalMaxLayerDirection() const
Get global direction corresponding to the fit result in maximum fit layer.
float GetL(const int layer) const
Get longitudinal coordinate for a given sliding linear fit layer number.
LayerFitContributionMap m_layerFitContributionMap
The layer fit contribution map.
pandora::StatusCode GetGlobalFitDirectionAtX(const float x, pandora::CartesianVector &direction) const
Get global fit direction for a given input x coordinate.
pandora::StatusCode GetTransverseProjection(const float x, const FitSegment &fitSegment, pandora::CartesianVector &position) const
Get projected position for a given input x coordinate and fit segment.
static void GetCoordinateVector(const pandora::Cluster *const pCluster, pandora::CartesianPointVector &coordinateVector)
Get vector of hit coordinates from an input cluster.
LayerFitResultMap::const_iterator GetStartLayerIter() const
Get the start layer iterator.
float m_layerPitch
The layer pitch, units cm.
pandora::StatusCode GetGlobalFitPositionListAtX(const float x, pandora::CartesianPointVector &positionList) const
Get a list of projected positions for a given input x coordinate.
const LayerFitContributionMap & GetLayerFitContributionMap() const
Get the layer fit contribution map.
LayerFitResultMap m_layerFitResultMap
The layer fit result map.
int GetEndLayer() const
Get end layer.
void GetLocalPosition(const pandora::CartesianVector &position, float &rL, float &rT) const
Get local sliding fit coordinates for a given global position.
pandora::CartesianVector m_orthoDirection
The orthogonal direction vector.
pandora::CartesianVector GetGlobalMaxLayerPosition() const
Get global position corresponding to the fit result in maximum fit layer.
int GetLayer(const float rL) const
Get layer number for given sliding linear fit longitudinal coordinate.