9 #include "Pandora/AlgorithmHeaders.h" 10 #include "Pandora/StatusCodes.h" 18 #include <torch/script.h> 19 #include <torch/torch.h> 27 DLBaseHierarchyTool::DLBaseHierarchyTool() :
28 m_vertexRegionRadiusSq(25.
f),
29 m_pfoListNames({
"TrackParticles3D",
"ShowerParticles3D"}),
48 const Algorithm *
const pAlgorithm,
const ParticleFlowObject *
const pPfo,
const CartesianVector &pointOfInterest)
const 55 const PfoList *pPfoList(
nullptr);
56 if (PandoraContentApi::GetList(*pAlgorithm, pfoListName, pPfoList) != STATUS_CODE_SUCCESS)
59 for (
const ParticleFlowObject *
const pOtherPfo : *pPfoList)
61 if (pPfo == pOtherPfo)
66 CartesianPointVector otherPfoPositions3D;
67 LArPfoHelper::GetCoordinateVector(pOtherPfo, TPC_3D, otherPfoPositions3D);
69 for (
const CartesianVector &otherPfoPosition : otherPfoPositions3D)
71 const double sepSq((otherPfoPosition - pointOfInterest).GetMagnitudeSquared());
85 return std::pair<float, float>({hitCount, particleCount});
92 const float interval(std::fabs(maxLimit - minLimit));
94 if (interval < std::numeric_limits<float>::epsilon())
96 networkParam = minLimit;
100 if (networkParam < minLimit)
101 networkParam = minLimit;
103 if (networkParam > maxLimit)
104 networkParam = maxLimit;
106 networkParam /= interval;
115 if (statCode == STATUS_CODE_SUCCESS)
119 else if (statCode != STATUS_CODE_NOT_FOUND)
124 PANDORA_RETURN_RESULT_IF_AND_IF(
125 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
"PfoListNames",
m_pfoListNames));
127 return STATUS_CODE_SUCCESS;
Header file for the pfo helper class.
float m_vertexRegionRadiusSq
the radius (squared) in which to search for particle hits
Header file for the geometry helper class.
std::pair< float, float > GetParticleInfoAboutPfoPosition(const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pPfo, const pandora::CartesianVector &pointOfInterest) const
Return the number of 3D hits and the number of corresponding pfos of a given pfo about a point...
void NormaliseNetworkParam(const float minLimit, const float maxLimit, float &networkParam) const
Shift and normalise a network parameter with respect to an input range.
Header file for the lar deep learning helper helper class.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
pandora::StringVector m_pfoListNames
the input pfo list name vector
bool m_areBoundariesSet
whether the detector boundaries have been set
LArGeometryHelper::DetectorBoundaries m_detectorBoundaries
the detector boundaries
void SetDetectorBoundaries()
Set the detector boundaries.