9 #include "Pandora/AlgorithmHeaders.h" 30 TwoDShowerFitFeatureTool::TwoDShowerFitFeatureTool() :
31 m_slidingShowerFitWindow(3),
32 m_slidingLinearFitWindow(10000)
39 const pandora::Cluster *
const pCluster)
41 if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
42 std::cout <<
"----> Running Algorithm Tool: " << this->GetInstanceName() <<
", " << this->GetType() << std::endl;
49 if (straightLineLength > std::numeric_limits<float>::epsilon())
52 catch (
const StatusCodeException &)
56 featureVector.push_back(ratio);
64 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
67 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
70 return STATUS_CODE_SUCCESS;
78 m_slidingLinearFitWindowLarge(10000)
85 const pandora::Cluster *
const pCluster)
87 if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
88 std::cout <<
"----> Running Algorithm Tool: " << this->GetInstanceName() <<
", " << this->GetType() << std::endl;
90 float dTdLWidth(-1.
f), straightLineLengthLarge(-1.
f), diffWithStraightLineMean(-1.
f), diffWithStraightLineSigma(-1.
f), maxFitGapLength(-1.
f), rmsSlidingLinearFit(-1.
f);
91 this->
CalculateVariablesSlidingLinearFit(pCluster, straightLineLengthLarge, diffWithStraightLineMean, diffWithStraightLineSigma, dTdLWidth, maxFitGapLength, rmsSlidingLinearFit);
93 if (straightLineLengthLarge > std::numeric_limits<float>::epsilon())
95 diffWithStraightLineMean /= straightLineLengthLarge;
96 diffWithStraightLineSigma /= straightLineLengthLarge;
97 dTdLWidth /= straightLineLengthLarge;
98 maxFitGapLength /= straightLineLengthLarge;
99 rmsSlidingLinearFit /= straightLineLengthLarge;
102 featureVector.push_back(straightLineLengthLarge);
103 featureVector.push_back(diffWithStraightLineMean);
104 featureVector.push_back(diffWithStraightLineSigma);
105 featureVector.push_back(dTdLWidth);
106 featureVector.push_back(maxFitGapLength);
107 featureVector.push_back(rmsSlidingLinearFit);
113 float &diffWithStraightLineMean,
float &diffWithStraightLineSigma,
float &dTdLWidth,
float &maxFitGapLength,
float &rmsSlidingLinearFit)
const 121 throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
124 rmsSlidingLinearFit = 0.f;
126 FloatVector diffWithStraightLineVector;
134 rmsSlidingLinearFit += layerFitResult.
GetRms();
136 CartesianVector thisFitPosition(0.
f, 0.
f, 0.
f);
142 throw StatusCodeException(STATUS_CODE_FAILURE);
144 diffWithStraightLineVector.push_back(static_cast<float>(std::fabs(layerFitResult.
GetFitT() - iterLarge->second.GetFitT())));
146 const float thisGapLength((thisFitPosition - previousFitPosition).GetMagnitude());
147 const float minZ(
std::min(thisFitPosition.GetZ(), previousFitPosition.GetZ()));
148 const float maxZ(
std::max(thisFitPosition.GetZ(), previousFitPosition.GetZ()));
150 if ((maxZ - minZ) > std::numeric_limits<float>::epsilon())
153 const float correctedGapLength(thisGapLength * (1.
f - gapZ / (maxZ - minZ)));
155 if (correctedGapLength > maxFitGapLength)
156 maxFitGapLength = correctedGapLength;
161 previousFitPosition = thisFitPosition;
164 if (diffWithStraightLineVector.empty())
165 throw StatusCodeException(STATUS_CODE_FAILURE);
167 diffWithStraightLineMean = 0.f;
168 diffWithStraightLineSigma = 0.f;
170 for (
const float diffWithStraightLine : diffWithStraightLineVector)
171 diffWithStraightLineMean += diffWithStraightLine;
173 diffWithStraightLineMean /=
static_cast<float>(diffWithStraightLineVector.size());
175 for (
const float diffWithStraightLine : diffWithStraightLineVector)
176 diffWithStraightLineSigma += (diffWithStraightLine - diffWithStraightLineMean) * (diffWithStraightLine - diffWithStraightLineMean);
178 if (diffWithStraightLineSigma < 0.
f)
179 throw StatusCodeException(STATUS_CODE_FAILURE);
181 diffWithStraightLineSigma = std::sqrt(diffWithStraightLineSigma / static_cast<float>(diffWithStraightLineVector.size()));
182 dTdLWidth = dTdLMax - dTdLMin;
184 catch (
const StatusCodeException &)
186 straightLineLengthLarge = -1.f;
187 diffWithStraightLineMean = -1.f;
188 diffWithStraightLineSigma = -1.f;
190 maxFitGapLength = -1.f;
191 rmsSlidingLinearFit = -1.f;
199 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
202 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
205 return STATUS_CODE_SUCCESS;
219 const pandora::Cluster *
const pCluster)
221 if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
222 std::cout <<
"----> Running Algorithm Tool: " << this->GetInstanceName() <<
", " << this->GetType() << std::endl;
224 float straightLineLength(-1.
f), ratio(-1.
f);
229 if (straightLineLength > std::numeric_limits<float>::epsilon())
232 catch (
const StatusCodeException &)
236 featureVector.push_back(ratio);
244 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
247 return STATUS_CODE_SUCCESS;
255 m_slidingLinearFitWindowLarge(10000)
262 const pandora::ParticleFlowObject *
const pInputPfo)
264 if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
265 std::cout <<
"----> Running Algorithm Tool: " << this->GetInstanceName() <<
", " << this->GetType() << std::endl;
267 ClusterList clusterList;
269 float diffWithStraightLineMean(0.
f), maxFitGapLength(0.
f), rmsSlidingLinearFit(0.
f);
271 unsigned int nClustersUsed(0);
273 for (
const Cluster *
const pCluster : clusterList)
275 float straightLineLengthLargeCluster(-1.
f), diffWithStraightLineMeanCluster(-1.
f), maxFitGapLengthCluster(-1.
f), rmsSlidingLinearFitCluster(-1.
f);
277 this->
CalculateVariablesSlidingLinearFit(pCluster, straightLineLengthLargeCluster, diffWithStraightLineMeanCluster, maxFitGapLengthCluster, rmsSlidingLinearFitCluster);
279 if (straightLineLengthLargeCluster > std::numeric_limits<float>::epsilon())
281 diffWithStraightLineMeanCluster /= straightLineLengthLargeCluster;
282 maxFitGapLengthCluster /= straightLineLengthLargeCluster;
283 rmsSlidingLinearFitCluster /= straightLineLengthLargeCluster;
285 diffWithStraightLineMean += diffWithStraightLineMeanCluster;
286 maxFitGapLength += maxFitGapLengthCluster;
287 rmsSlidingLinearFit += rmsSlidingLinearFitCluster;
293 if (nClustersUsed > 0)
295 const float nClusters(static_cast<float>(nClustersUsed));
297 diff = diffWithStraightLineMean / nClusters;
298 gap = maxFitGapLength / nClusters;
299 rms = rmsSlidingLinearFit / nClusters;
302 featureVector.push_back(length);
303 featureVector.push_back(diff);
304 featureVector.push_back(gap);
305 featureVector.push_back(rms);
311 float &diffWithStraightLineMean,
float &maxFitGapLength,
float &rmsSlidingLinearFit)
const 319 throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
322 rmsSlidingLinearFit = 0.f;
324 FloatVector diffWithStraightLineVector;
332 rmsSlidingLinearFit += layerFitResult.
GetRms();
334 CartesianVector thisFitPosition(0.
f, 0.
f, 0.
f);
340 throw StatusCodeException(STATUS_CODE_FAILURE);
342 diffWithStraightLineVector.push_back(static_cast<float>(std::fabs(layerFitResult.
GetFitT() - iterLarge->second.GetFitT())));
344 const float thisGapLength((thisFitPosition - previousFitPosition).GetMagnitude());
345 const float minZ(
std::min(thisFitPosition.GetZ(), previousFitPosition.GetZ()));
346 const float maxZ(
std::max(thisFitPosition.GetZ(), previousFitPosition.GetZ()));
348 if ((maxZ - minZ) > std::numeric_limits<float>::epsilon())
351 const float correctedGapLength(thisGapLength * (1.
f - gapZ / (maxZ - minZ)));
353 if (correctedGapLength > maxFitGapLength)
354 maxFitGapLength = correctedGapLength;
358 maxFitGapLength = 0.f;
363 previousFitPosition = thisFitPosition;
366 if (diffWithStraightLineVector.empty())
367 throw StatusCodeException(STATUS_CODE_FAILURE);
369 diffWithStraightLineMean = 0.f;
371 for (
const float diffWithStraightLine : diffWithStraightLineVector)
372 diffWithStraightLineMean += diffWithStraightLine;
374 diffWithStraightLineMean /=
static_cast<float>(diffWithStraightLineVector.size());
377 catch (
const StatusCodeException &)
379 straightLineLengthLarge = -1.f;
380 diffWithStraightLineMean = -1.f;
381 maxFitGapLength = -1.f;
382 rmsSlidingLinearFit = -1.f;
390 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
393 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
396 return STATUS_CODE_SUCCESS;
409 const pandora::ParticleFlowObject *
const pInputPfo)
411 if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
412 std::cout <<
"----> Running Algorithm Tool: " << this->GetInstanceName() <<
", " << this->GetType() << std::endl;
416 (void) PandoraContentApi::GetCurrentList(*pAlgorithm, pVertexList);
418 if ((!pVertexList->empty()) && (pVertexList->size() == 1) && (VERTEX_3D == pVertexList->front()->GetVertexType()))
422 vertexDistance = (pVertexList->front()->GetPosition() -
LArPfoHelper::GetVertex(pInputPfo)->GetPosition()).GetMagnitude();
424 catch (
const StatusCodeException &) {}
427 featureVector.push_back(vertexDistance);
435 return STATUS_CODE_SUCCESS;
448 const pandora::ParticleFlowObject *
const pInputPfo)
450 if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
451 std::cout <<
"----> Running Algorithm Tool: " << this->GetInstanceName() <<
", " << this->GetType() << std::endl;
454 ClusterList threeDClusterList;
457 CaloHitList threeDCaloHitList;
461 if (!threeDCaloHitList.empty())
463 CartesianPointVector pointVectorStart, pointVectorEnd;
464 this->Divide3DCaloHitList(pAlgorithm, threeDCaloHitList, pointVectorStart, pointVectorEnd);
467 if ((pointVectorStart.size() > 1) && (pointVectorEnd.size() > 1))
472 CartesianVector centroidStart(0.
f, 0.
f, 0.
f), centroidEnd(0.
f, 0.
f, 0.
f);
479 const float openingAngle(this->OpeningAngle(eigenVecsStart.at(0), eigenVecsStart.at(1), eigenValuesStart));
480 const float closingAngle(this->OpeningAngle(eigenVecsEnd.at(0), eigenVecsEnd.at(1), eigenValuesEnd));
481 diffAngle = std::fabs(openingAngle-closingAngle);
483 catch (
const StatusCodeException &){}
487 featureVector.push_back(diffAngle);
495 (void) PandoraContentApi::GetCurrentList(*pAlgorithm, pVertexList);
497 if ((!pVertexList->empty()) && (pVertexList->size() == 1) && (VERTEX_3D == pVertexList->front()->GetVertexType()))
499 const CartesianVector nuVertex(pVertexList->front()->GetPosition());
500 CaloHitVector threeDCaloHitVector(threeDCaloHitList.begin(), threeDCaloHitList.end());
504 CaloHitList orderedCaloHitList(threeDCaloHitVector.begin(),threeDCaloHitVector.end());
505 const unsigned int nhits(orderedCaloHitList.size());
507 for (
const CaloHit *
const pCaloHit : orderedCaloHitList)
509 CartesianPointVector &targetVector((pointVectorStart.size() < (nhits / 2)) ? pointVectorStart : pointVectorEnd);
510 targetVector.push_back(pCaloHit->GetPositionVector());
518 const CartesianVector &eigenValues)
const 520 const float principalMagnitude(principal.GetMagnitude());
521 const float secondaryMagnitude(secondary.GetMagnitude());
523 if (std::fabs(principalMagnitude) < std::numeric_limits<float>::epsilon())
525 std::cout <<
"PcaShowerParticleBuildingAlgorithm::OpeningAngle - The principal eigenvector is 0." << std::endl;
526 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
528 else if (std::fabs(secondaryMagnitude) < std::numeric_limits<float>::epsilon())
533 const float cosTheta(principal.GetDotProduct(secondary) / (principalMagnitude * secondaryMagnitude));
537 std::cout <<
"PcaShowerParticleBuildingAlgorithm::OpeningAngle - cos(theta) reportedly greater than 1." << std::endl;
538 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
541 const float sinTheta(std::sqrt(1.
f - cosTheta * cosTheta));
543 if (std::fabs(eigenValues.GetX()) < std::numeric_limits<float>::epsilon())
545 std::cout <<
"PcaShowerParticleBuildingAlgorithm::OpeningAngle - principal eigenvalue less than or equal to 0." << std::endl;
546 throw StatusCodeException( STATUS_CODE_INVALID_PARAMETER );
548 else if (std::fabs(eigenValues.GetY()) < std::numeric_limits<float>::epsilon())
553 return std::atan(std::sqrt(eigenValues.GetY()) * sinTheta / std::sqrt(eigenValues.GetX()));
559 return STATUS_CODE_SUCCESS;
572 const pandora::ParticleFlowObject *
const pInputPfo)
574 if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
575 std::cout <<
"----> Running Algorithm Tool: " << this->GetInstanceName() <<
", " << this->GetType() << std::endl;
579 ClusterList threeDClusterList;
582 CaloHitList threeDCaloHitList;
586 if ((!threeDClusterList.empty()) && (!threeDCaloHitList.empty()))
589 CartesianVector centroid(0.
f, 0.
f, 0.
f);
595 const float principalEigenvalue(eigenValues.GetX()), secondaryEigenvalue(eigenValues.GetY()), tertiaryEigenvalue(eigenValues.GetZ());
596 if (principalEigenvalue > std::numeric_limits<float>::epsilon())
598 pca1 = secondaryEigenvalue/principalEigenvalue;
599 pca2 = tertiaryEigenvalue/principalEigenvalue;
602 catch (
const StatusCodeException &){}
605 featureVector.push_back(pca1);
606 featureVector.push_back(pca2);
613 return STATUS_CODE_SUCCESS;
620 m_endChargeFraction(0.1
f)
627 const pandora::ParticleFlowObject *
const pInputPfo)
629 if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
630 std::cout <<
"----> Running Algorithm Tool: " << this->GetInstanceName() <<
", " << this->GetType() << std::endl;
632 float totalCharge(-1.
f), chargeSigma(-1.
f), chargeMean(-1.
f), endCharge(-1.
f);
635 ClusterList pClusterList;
637 if ((!pClusterList.empty()) && (pClusterList.size() == 1))
639 const Cluster *
const pCluster(pClusterList.front());
643 if (chargeMean > std::numeric_limits<float>::epsilon())
644 charge1 = chargeSigma / chargeMean;
646 if (totalCharge > std::numeric_limits<float>::epsilon())
647 charge2 = endCharge / totalCharge;
649 featureVector.push_back(charge1);
650 featureVector.push_back(charge2);
656 float &chargeSigma,
float &chargeMean,
float &endCharge)
659 CaloHitList orderedCaloHitList;
662 const int totalHits(pCluster->GetNCaloHits());
663 FloatVector chargeVector;
668 for (
const CaloHit *
const pCaloHit : orderedCaloHitList)
671 const float pCaloHitCharge(pCaloHit->GetInputEnergy());
673 if (pCaloHitCharge < 0)
675 std::cout <<
"Found a hit with negative charge! " << std::endl;
679 totalCharge += pCaloHitCharge;
680 chargeVector.push_back(pCaloHitCharge);
684 endCharge += pCaloHitCharge;
689 if (!chargeVector.empty())
694 for (
const float charge : chargeVector)
695 chargeMean += charge;
697 chargeMean /=
static_cast<float>(chargeVector.size());
699 for (
const float charge : chargeVector)
700 chargeSigma += (charge - chargeMean) * (charge - chargeMean);
702 chargeSigma = std::sqrt(chargeSigma / static_cast<float>(chargeVector.size()));
712 (void) PandoraContentApi::GetCurrentList(*pAlgorithm, pVertexList);
714 if ((!pVertexList->empty()) && (pVertexList->size() == 1) && (VERTEX_3D == pVertexList->front()->GetVertexType()))
716 const Vertex *
const pVertex(pVertexList->front());
721 CaloHitList clusterCaloHitList;
722 pCluster->GetOrderedCaloHitList().FillCaloHitList(clusterCaloHitList);
723 CaloHitVector clusterCaloHitVector(clusterCaloHitList.begin(), clusterCaloHitList.end());
726 std::sort(clusterCaloHitVector.begin(), clusterCaloHitVector.end(),
VertexComparator(vertexPosition2D));
727 caloHitList.insert(caloHitList.end(), clusterCaloHitVector.begin(), clusterCaloHitVector.end());
736 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
739 return STATUS_CODE_SUCCESS;
746 m_neutrinoVertex(vertexPosition2D)
754 float distanceL((left->GetPositionVector()-
m_neutrinoVertex).GetMagnitudeSquared());
755 float distanceR((right->GetPositionVector()-
m_neutrinoVertex).GetMagnitudeSquared());
756 return distanceL < distanceR;
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
void OrderCaloHitsByDistanceToVertex(const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster, pandora::CaloHitList &caloHitList)
Function to order the calo hit list by distance to neutrino vertex.
Header file for the lar two dimensional sliding shower fit result class.
Header file for the pfo helper class.
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo)
Header file for the cut based cluster characterisation algorithm class.
MvaTypes::MvaFeatureVector MvaFeatureVector
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
static void GetClusters(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::ClusterList &clusterList)
Get a list of clusters of a particular hit type from a list of pfos.
static void GetTwoDClusterList(const pandora::ParticleFlowObject *const pPfo, pandora::ClusterList &clusterList)
Get the list of 2D clusters from an input pfo.
pandora::CartesianVector EigenValues
static float GetThreeDLengthSquared(const pandora::ParticleFlowObject *const pPfo)
Calculate length of Pfo using 3D clusters.
static float CalculateGapDeltaZ(const pandora::Pandora &pandora, const float minZ, const float maxZ, const pandora::HitType hitType)
Calculate the total distance within a given 2D region that is composed of detector gaps...
static const pandora::Vertex * GetVertex(const pandora::ParticleFlowObject *const pPfo)
Get the pfo vertex.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
static float GetVertexDistance(const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster)
Get the distance between the interaction vertex (if present in the current vertex list) and a provide...
static pandora::CartesianVector ProjectPosition(const pandora::Pandora &pandora, const pandora::CartesianVector &position3D, const pandora::HitType view)
Project 3D position into a given 2D view.
unsigned int m_slidingShowerFitWindow
The sliding shower fit window.
Header file for the principal curve analysis helper class.
ThreeDOpeningAngleFeatureTool()
Default constructor.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
TwoDLinearFitFeatureTool()
Default constructor.
ThreeDLinearFitFeatureTool()
Default constructor.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
void CalculateVariablesSlidingLinearFit(const pandora::Cluster *const pCluster, float &straightLineLengthLarge, float &diffWithStraigthLineMean, float &maxFitGapLength, float &rmsSlidingLinearFit) const
Calculation of several variables related to sliding linear fit.
static float GetWireZPitch(const pandora::Pandora &pandora, const float maxWirePitchDiscrepancy=0.01)
Return the wire pitch.
void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster)
void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo)
unsigned int m_slidingLinearFitWindow
The sliding linear fit window.
Header file for the geometry helper class.
ThreeDPCAFeatureTool()
Default constructor.
void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo)
unsigned int m_slidingLinearFitWindow
The sliding linear fit window.
bool operator()(const pandora::CaloHit *const left, const pandora::CaloHit *const right) const
operator <
double GetFitT() const
Get the fitted t coordinate.
InitializedDouble class used to define mva features.
Header file for the lar monte carlo particle helper helper class.
unsigned int m_slidingLinearFitWindowLarge
The sliding linear fit window - should be large, providing a simple linear fit.
Header file for the cluster helper class.
float OpeningAngle(const pandora::CartesianVector &principal, const pandora::CartesianVector &secondary, const pandora::CartesianVector &eigenValues) const
void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo)
TwoDVertexDistanceFeatureTool()
Default constructor.
void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo)
Header file for the lar two dimensional sliding fit result class.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
pandora::CartesianVector m_neutrinoVertex
unsigned int m_slidingLinearFitWindow
The sliding linear fit window.
pandora::CartesianVector GetGlobalMinLayerPosition() const
Get global position corresponding to the fit result in minimum fit layer.
double GetGradient() const
Get the fitted gradient dt/dz.
static void GetThreeDClusterList(const pandora::ParticleFlowObject *const pPfo, pandora::ClusterList &clusterList)
Get the list of 3D clusters from an input pfo.
const LayerFitResultMap & GetLayerFitResultMap() const
Get the layer fit result map.
Header file for the vertex helper class.
VertexComparator class for comparison of two points wrt neutrino vertex position. ...
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
double GetRms() const
Get the rms of the fit residuals.
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...
VertexComparator(const pandora::CartesianVector vertexPosition2D)
Constructor.
Header file for the shower growing algorithm class.
std::vector< pandora::CartesianVector > EigenVectors
void GetGlobalPosition(const float rL, const float rT, pandora::CartesianVector &position) const
Get global coordinates for given sliding linear fit coordinates.
unsigned int m_slidingLinearFitWindowLarge
The sliding linear fit window - should be large, providing a simple linear fit.
void CalculateChargeVariables(const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster, float &totalCharge, float &chargeSigma, float &chargeMean, float &endCharge)
Calculation of the charge variables.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
ThreeDVertexDistanceFeatureTool()
Default constructor.
float m_endChargeFraction
Fraction of hits that will be considered to calculate end charge (default 10%)
double GetL() const
Get the l coordinate.
static float GetShowerFitWidth(const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster, const unsigned int showerFitWindow)
Get a measure of the width of a cluster, using a sliding shower fit result.
void Divide3DCaloHitList(const pandora::Algorithm *const pAlgorithm, pandora::CaloHitList &threeDCaloHitList, pandora::CartesianPointVector &pointVectorStart, pandora::CartesianPointVector &pointVectorEnd)
ThreeDChargeFeatureTool()
Default constructor.
void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster)
unsigned int m_slidingLinearFitWindow
The sliding linear fit window.
void CalculateVariablesSlidingLinearFit(const pandora::Cluster *const pCluster, float &straightLineLengthLarge, float &diffWithStraigthLineMean, float &diffWithStraightLineSigma, float &dTdLWidth, float &maxFitGapLength, float &rmsSlidingLinearFit) const
Calculation of several variables related to sliding linear fit.
static void GetCaloHits(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::CaloHitList &caloHitList)
Get a list of calo hits of a particular hit type from a list of pfos.
std::list< Vertex > VertexList
pandora::CartesianVector GetGlobalMaxLayerPosition() const
Get global position corresponding to the fit result in maximum fit layer.
TwoDSlidingFitResult class.
int GetLayer(const float rL) const
Get layer number for given sliding linear fit longitudinal coordinate.
void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster)
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)