525 if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
526 std::cout <<
"----> Running Algorithm Tool: " << this->GetInstanceName() <<
", " << this->GetType() <<
std::endl;
529 CaloHitList threeDCaloHitList;
533 if (!threeDCaloHitList.empty())
535 CartesianPointVector pointVectorStart, pointVectorEnd;
536 this->
Divide3DCaloHitList(pAlgorithm, threeDCaloHitList, pointVectorStart, pointVectorEnd);
539 if ((pointVectorStart.size() > 1) && (pointVectorEnd.size() > 1))
544 CartesianVector centroidStart(0.
f, 0.
f, 0.
f), centroidEnd(0.
f, 0.
f, 0.
f);
551 const float openingAngle(this->
OpeningAngle(eigenVecsStart.at(0), eigenVecsStart.at(1), eigenValuesStart));
552 const float closingAngle(this->
OpeningAngle(eigenVecsEnd.at(0), eigenVecsEnd.at(1), eigenValuesEnd));
553 diffAngle = std::fabs(openingAngle - closingAngle);
555 catch (
const StatusCodeException &)
565 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.
QTextStream & endl(QTextStream &s)