813 if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
814 std::cout <<
"----> Running Algorithm Tool: " << this->GetInstanceName() <<
", " << this->GetType() << std::endl;
817 CaloHitList threeDCaloHitList;
821 if (!threeDCaloHitList.empty())
823 CartesianPointVector pointVectorStart, pointVectorEnd;
824 this->
Divide3DCaloHitList(pAlgorithm, threeDCaloHitList, pointVectorStart, pointVectorEnd);
827 if ((pointVectorStart.size() > 1) && (pointVectorEnd.size() > 1))
832 CartesianVector centroidStart(0.f, 0.f, 0.f), centroidEnd(0.f, 0.f, 0.f);
839 const float openingAngle(this->
OpeningAngle(eigenVecsStart.at(0), eigenVecsStart.at(1), eigenValuesStart));
840 const float closingAngle(this->
OpeningAngle(eigenVecsEnd.at(0), eigenVecsEnd.at(1), eigenValuesEnd));
841 diffAngle = std::fabs(openingAngle - closingAngle);
843 catch (
const StatusCodeException &)
853 featureVector.push_back(diffAngle);
pandora::CartesianVector EigenValues
MvaTypes::MvaFeature MvaFeature
float OpeningAngle(const pandora::CartesianVector &principal, const pandora::CartesianVector &secondary, const pandora::CartesianVector &eigenValues) const
Use the results of principal component analysis to calculate an opening angle.
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...
std::vector< pandora::CartesianVector > EigenVectors
float m_defaultValue
Default value to return, in case calculation not feasible.
void Divide3DCaloHitList(const pandora::Algorithm *const pAlgorithm, const pandora::CaloHitList &threeDCaloHitList, pandora::CartesianPointVector &pointVectorStart, pandora::CartesianPointVector &pointVectorEnd)
Obtain positions at the vertex and non-vertex end of a list of three dimensional calo hits...
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.
BEGIN_PROLOG could also be cout