8 #ifndef LAR_DL_LATER_TIER_HIERARCHY_TOOL_H 9 #define LAR_DL_LATER_TIER_HIERARCHY_TOOL_H 1 11 #include "Pandora/PandoraInternal.h" 76 pandora::StatusCode
Run(
const pandora::Algorithm *
const pAlgorithm,
const pandora::ParticleFlowObject *
const pNeutrinoPfo,
78 std::vector<DLLaterTierNetworkParams> &networkParamVector,
float &laterTierScore);
88 float m_trackScoreMin = -1.f;
89 float m_trackScoreMax = 1.f;
90 float m_nSpacepointsMin = 0.f;
91 float m_nSpacepointsMax = 2000.f;
92 float m_separation3DMin = -50.f;
93 float m_separation3DMax = 700.f;
94 float m_nuVertexSepMin = -100.f;
95 float m_nuVertexSepMax = 750.f;
96 float m_parentEndRegionNHitsMin = -10.f;
97 float m_parentEndRegionNHitsMax = 80.f;
98 float m_parentEndRegionNParticlesMin = -1.f;
99 float m_parentEndRegionNParticlesMax = 5.f;
100 float m_parentEndRegionRToWallMin = -10.f;
101 float m_parentEndRegionRToWallMax = 400.f;
102 float m_vertexSepMin = -50.f;
103 float m_vertexSepMax = 700.f;
104 float m_doesChildConnectMin = -1.f;
105 float m_doesChildConnectMax = 1.f;
106 float m_overshootDCAMin = -700.f;
107 float m_overshootDCAMax = 700.f;
108 float m_overshootLMin = -100.f;
109 float m_overshootLMax = 700.f;
110 float m_childCPDCAMin = -5.f;
111 float m_childCPDCAMax = 50.f;
112 float m_childCPExtrapDistanceMin = -500.f;
113 float m_childCPExtrapDistanceMax = 500.f;
114 float m_childCPLRatioMin = -1.f;
115 float m_childCPLRatioMax = 1.f;
116 float m_parentCPNHitsMin = -10.f;
117 float m_parentCPNHitsMax = 100.f;
118 float m_parentCPNHitRatioMin = -5.f;
119 float m_parentCPNHitRatioMax = 30.f;
120 float m_parentCPEigenvalueRatioMin = -5.f;
121 float m_parentCPEigenvalueRatioMax = 50.f;
122 float m_parentCPOpeningAngleMin = -10.f;
123 float m_parentCPOpeningAngleMax = 180.f;
126 pandora::StatusCode
ReadSettings(
const pandora::TiXmlHandle xmlHandle);
152 const HierarchyPfo &childHierarchyPfo,
const pandora::ParticleFlowObject *
const pNeutrinoPfo,
const bool useUpstreamForParent,
164 void SetCommonParams(
const std::pair<float, float> &trackScoreParams,
const std::pair<float, float> &nSpacepointsParams,
177 void SetVertexParams(
const pandora::CartesianVector &nuVertex,
const pandora::CartesianVector &parentStartPos,
178 const pandora::CartesianVector &parentEndPos,
const pandora::CartesianVector &childStartPos,
190 void SetEndRegionParams(
const pandora::Algorithm *
const pAlgorithm,
const pandora::ParticleFlowObject *
const pParentPfo,
224 const pandora::CartesianVector &parentPosition,
const ExtremalPoint &childStart)
const;
235 bool DoesConnect(
const pandora::CartesianVector &boundary1,
const pandora::CartesianVector &boundary2,
const pandora::CartesianVector &testPoint)
const;
335 #endif // #ifndef LAR_DL_LATER_TIER_HIERARCHY_TOOL_H float m_parentNuVertexSep
the separation between the neutrino vertex and assumed parent start point
float m_parentCPEigenvalueRatio
the ratio of the second eigenvalues of the downstream and upstream 3D hit groups (set if the child co...
pandora::StatusCode CalculateNetworkVariables(const pandora::Algorithm *const pAlgorithm, const HierarchyPfo &parentHierarchyPfo, const HierarchyPfo &childHierarchyPfo, const pandora::ParticleFlowObject *const pNeutrinoPfo, const bool useUpstreamForParent, const bool useUpstreamForChild, DLLaterTierNetworkParams &laterTierNetworkParams) const
Function to calculate the DLLaterTierNetworkParams.
void SetConnectionParams(const HierarchyPfo &parentHierarchyPfo, const pandora::CartesianVector &parentStartPos, const ExtremalPoint &childStart, DLLaterTierNetworkParams &laterTierNetworkParams) const
Set the child connection DLLaterTierNetworkParams (m_doesChildConnect, m_connectionPoint, m_connectionDirection, m_childCPDCA, m_childCPExtrapDistance, m_childCPLRatio)
float m_overshootEndL
the extension distance of the child to the DCA point (set if the child doesn't connect) ...
pandora::FloatVector ClassifyTrackShowerEdge(const DLLaterTierNetworkParams &edgeParams, const DLLaterTierNetworkParams &otherEdgeParams)
Apply the track-shower orientation edge network - determine whether an edge is signal (with correct o...
void SetParentConnectionPointVars(const HierarchyPfo &parentHierarchyPfo, DLLaterTierNetworkParams &laterTierNetworkParams) const
Set the parent connection point DLLaterTierNetworkParams (m_parentCPNUpstreamHits, m_parentCPNDownstreamHits, m_parentCPNHitRatio, m_parentCPEigenvalueRatio, m_parentCPOpeningAngle)
float m_overshootStartL
the extension distance of the child to the DCA point (set if the child doesn't connect) ...
float m_childCPDCA
the DCA of the child to the connection point (set if the child connects)
float m_parentEndRegionNHits
the number of 3D hits 'close to' the parent POI
float m_parentEndRegionNParticles
the number of different particles 'close to' the parent POI
pandora::StatusCode Run(const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pNeutrinoPfo, const HierarchyPfo &parentHierarchyPfo, const HierarchyPfo &childHierarchyPfo, std::vector< DLLaterTierNetworkParams > &networkParamVector, float &laterTierScore)
Header file for the HierarchyPfo class.
float m_parentCPNHitRatio
the ratio of the number of downstream hits and upstream 3D hits (set if the child connects) ...
float m_overshootStartDCA
the DCA of the child to the parent startpoint (set if the child doesn't connect)
float m_separation3D
the smallest 3D distance between the parent and child 3D hits
float m_vertexSeparation
the separation between the parent and child POIs
LArDLHelper::TorchModel m_trackShowerBranchModel
the track-shower edge model
torch::jit::script::Module TorchModel
std::string m_trackShowerBranchModelName
the name of the track-shower edge model file
DLBaseHierarchyTool to calculate variables related to the initial shower region.
float m_overshootEndDCA
the DCA of the child to the parent endpoint (set if the child doesn't connect)
pandora::CartesianVector m_connectionPoint
the connection point of the child on the parent
bool m_normalise
whether to normalise the network parameters
bool IsShowerVertexUpstream(const HierarchyPfo &parentHierarchyPfo, const HierarchyPfo &childHierarchyPfo) const
Whether the shower POI is the endpoint closest to the neutrino vertex.
float m_parentCPNUpstreamHits
the number of 3D parent hits upstream of the connection point (set if the child connects) ...
float m_connectionBuffer
the 'is child connected?' threshold
NormalisationLimits m_normLimits
struct of the normalisation limits
void AddOrientationParamsToInput(int &insertIndex, LArDLHelper::TorchInput &modelInput) const
Add the orientation dependent later tier network parameters to the model input tensor.
DLLaterTierHierarchyTool()
Default constructor.
void AddCommonParamsToInput(int &insertIndex, LArDLHelper::TorchInput &modelInput) const
Add the orientation independent later tier network parameters to the model input tensor.
void NormaliseNetworkParams(DLLaterTierNetworkParams &laterTierNetworkParams) const
Shift and normalise the later tier network parameters.
float m_parentCPOpeningAngle
the opening angle between the first eigenvectors of the downstream and upstream 3D hit groups (set if...
LArDLHelper::TorchModel m_trackShowerClassifierModel
the track-shower classification model
std::string m_trackTrackBranchModelName
the name of the track-track edge model file
void SetEndRegionParams(const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pParentPfo, const pandora::CartesianVector &parentEndPos, DLLaterTierNetworkParams &laterTierNetworkParams) const
Set the parent endpoint region DLLaterTierNetworkParams (m_parentEndRegionNHits, m_parentEndRegionNPa...
float m_searchRegion
the dimensions of the box used to obtain the up/downstream 3D hit groups
Header file for the lar deep learning helper helper class.
float m_parentCPNDownstreamHits
the number of 3D parent hits downstream of the connection point (set if the child connects) ...
void SetOvershootParams(const ExtremalPoint &parentStart, const ExtremalPoint &parentEnd, const ExtremalPoint &childStart, DLLaterTierNetworkParams &laterTierNetworkParams) const
Set the overshoot DLLaterTierNetworkParams (m_overshootStartDCA, m_overshootStartL, m_overshootEndDCA, m_overshootEndL)
DLLaterTierHierarchyTool to apply the later-tier hierarchy DL networks.
float ClassifyTrackTrack(const DLLaterTierNetworkParams &edgeParamsUpUp, const DLLaterTierNetworkParams &edgeParamsUpDown, const DLLaterTierNetworkParams &edgeParamsDownUp, const DLLaterTierNetworkParams &edgeParamsDownDown)
Apply the track-track parent-child classification network.
float m_parentEndRegionRToWall
the smallest parent POI to detector boundary separation
pandora::FloatVector ClassifyTrackTrackEdge(const DLLaterTierNetworkParams &edgeParams, const DLLaterTierNetworkParams &otherEdgeParams1, const DLLaterTierNetworkParams &otherEdgeParams2, const DLLaterTierNetworkParams &otherEdgeParams3)
Apply the track-track orientation edge network - determine whether an edge is signal (with correct or...
float m_parentTrackScore
the track/shower score of the parent pfo
void SetVertexParams(const pandora::CartesianVector &nuVertex, const pandora::CartesianVector &parentStartPos, const pandora::CartesianVector &parentEndPos, const pandora::CartesianVector &childStartPos, DLLaterTierNetworkParams &laterTierNetworkParams) const
Set the vertex related DLLaterTierNetworkParams (m_parentNuVertexSep, m_childNuVertexSep, m_vertexSeparation)
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
float m_childTrackScore
the track/shower score of the child pfo
void SetCommonParams(const std::pair< float, float > &trackScoreParams, const std::pair< float, float > &nSpacepointsParams, const float separation3D, DLLaterTierNetworkParams &laterTierNetworkParams) const
Set the orientation independent DLLaterTierNetworkParams (m_parentTrackScore, m_childTrackScore, m_parentNSpacepoints, m_childNSpacepoints, m_separation3D)
float m_doesChildConnect
whether the backwards trace of the child's path connects to the parent
float m_trajectoryStepSize
the size of the steps taken to trace the parent trajectory
std::pair< pandora::CartesianVector, bool > ExtrapolateChildToParent(const pandora::CartesianVector &parentPosition, const ExtremalPoint &childStart) const
Project the (parentPos - childStartPos) vector onto the child direction axis to obtain an extrapolati...
bool m_trainingMode
whether to run the tool in training mode
LArDLHelper::TorchModel m_trackTrackClassifierModel
the track-track classification model
bool DoesConnect(const pandora::CartesianVector &boundary1, const pandora::CartesianVector &boundary2, const pandora::CartesianVector &testPoint) const
Return whether an input position connects to a line defined by two endpoints.
void SetEndRegionRToWall(const pandora::CartesianVector &parentEndPos, DLLaterTierNetworkParams &laterTierNetworkParams) const
Set the m_parentEndRegionRToWall DLLaterTierNetworkParam.
float m_childCPLRatio
the ratio of the parent length at the connection point and the full parent length (set if the child c...
std::string m_trackShowerClassifierModelName
the name of the track-shower classification model file
LArDLHelper::TorchModel m_trackTrackBranchModel
the track-track edge model
float m_childCPExtrapDistance
the extension distance of the child to the DCA point (set if the child connects)
float m_childNSpacepoints
the number of 3D hits in the child pfo
float m_parentIsPOIClosestToNu
whether the parent POI is that closest to the neutrino vertex
pandora::CartesianVector m_connectionDirection
the parent's direction at the connection point
std::string m_trackTrackClassifierModelName
the name of the track-track classification model file
float ClassifyTrackShower(const DLLaterTierNetworkParams &edgeParamsUp, const DLLaterTierNetworkParams &edgeParamsDown)
Apply the track-shower parent-child classification network.
float m_parentNSpacepoints
the number of 3D hits in the parent pfo
float m_childIsPOIClosestToNu
whether the child POI is that closest to the neutrino vertex
float m_childNuVertexSep
the separation between the neutrino vertex and assumed child start point