![]() |
LArSoft
v10_06_00
Liquid Argon Software toolkit - https://larsoft.org/
|
DLPrimaryHierarchyTool to apply the primary hierarchy DL networks. More...
#include "DLPrimaryHierarchyTool.h"
Classes | |
| struct | DLPrimaryNetworkParams |
| struct | NormalisationLimits |
Public Member Functions | |
| pandora::StatusCode | Run (const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pNeutrinoPfo, const HierarchyPfoVector &trackPfos, const HierarchyPfo &hierarchyPfo, std::vector< DLPrimaryNetworkParams > &networkParamVector, float &primaryScore) |
| DLPrimaryHierarchyTool () | |
| Default constructor. More... | |
| void | CalculateConnectionDistances (const ExtremalPoint &parentPoint, const ExtremalPoint &childPoint, float &parentConnectionDistance, float &childConnectionDistance) const |
| Calculate the variables describing the extension of a child particle to a given parent (m_parentConnectionDistance, m_childConnectionDistance) More... | |
Protected Member Functions | |
| void | SetDetectorBoundaries () |
| Set the detector boundaries. More... | |
| 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. More... | |
| void | NormaliseNetworkParam (const float minLimit, const float maxLimit, float &networkParam) const |
| Shift and normalise a network parameter with respect to an input range. More... | |
Protected Attributes | |
| float | m_vertexRegionRadiusSq |
| the radius (squared) in which to search for particle hits More... | |
| pandora::StringVector | m_pfoListNames |
| the input pfo list name vector More... | |
| LArGeometryHelper::DetectorBoundaries | m_detectorBoundaries |
| the detector boundaries More... | |
| bool | m_areBoundariesSet |
| whether the detector boundaries have been set More... | |
Private Member Functions | |
| pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
| pandora::StatusCode | CalculateNetworkVariables (const pandora::Algorithm *const pAlgorithm, const HierarchyPfo &hierarchyPfo, const pandora::ParticleFlowObject *const pNeutrinoPfo, const HierarchyPfoVector &trackPfos, const bool useUpstream, DLPrimaryNetworkParams &primaryNetworkParams) const |
| Function to calculate the DLPrimaryNetworkParams. More... | |
| void | SetVertexRegionParams (const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pPfo, const pandora::CartesianVector &particleVertex, DLPrimaryNetworkParams &primaryNetworkParams) const |
| Set the vertex region DLPrimaryNetworkParams params (m_vertexRegionNHits, m_vertexRegionNParticles) More... | |
| void | SetConnectionParams (const ExtremalPoint &particlePoint, const pandora::CartesianVector &nuVertex, DLPrimaryNetworkParams &primaryNetworkParams) const |
| Set the connection region DLPrimaryNetworkParams params (m_dca, m_connectionExtrapDistance) More... | |
| void | SetContextParams (const pandora::ParticleFlowObject *const pPfo, const ExtremalPoint &particlePoint, const pandora::CartesianVector &nuVertex, const HierarchyPfoVector &trackPfos, DLPrimaryNetworkParams &primaryNetworkParams) const |
| Set the event context DLPrimaryNetworkParams params (m_parentConnectionDistance, m_childConnectionDistance) More... | |
| void | NormaliseNetworkParams (DLPrimaryNetworkParams &primaryNetworkParams) const |
| Shift and normalise the primary network parameters. More... | |
| float | ClassifyTrack (const DLPrimaryNetworkParams &edgeParamsUp, const DLPrimaryNetworkParams &edgeParamsDown) |
| Apply the primary track classification network. More... | |
| pandora::FloatVector | ClassifyTrackEdge (const DLPrimaryNetworkParams &edgeParams, const DLPrimaryNetworkParams &otherEdgeParams) |
| Apply the primary track orientation edge network - determine whether an edge is signal (with correct orientation), signal (with the wrong orientation) or background. More... | |
| float | ClassifyShower (const DLPrimaryNetworkParams &primaryNetworkParams) |
| Apply the primary shower classification network. More... | |
Private Attributes | |
| bool | m_trainingMode |
| whether to run the tool in training mode More... | |
| std::string | m_primaryTrackBranchModelName |
| the name of the primary track edge model file More... | |
| std::string | m_primaryTrackClassifierModelName |
| the name of the primary track classification model file More... | |
| std::string | m_primaryShowerClassifierModelName |
| the name of the primary shower classification model file More... | |
| LArDLHelper::TorchModel | m_primaryTrackBranchModel |
| the primary track edge model More... | |
| LArDLHelper::TorchModel | m_primaryTrackClassifierModel |
| the primary track classification model More... | |
| LArDLHelper::TorchModel | m_primaryShowerClassifierModel |
| the primary shower classification model More... | |
| float | m_extrapolationStepSize |
| the step size used to trace back a child particle's path More... | |
| bool | m_normalise |
| whether to normalise the network parameters More... | |
| NormalisationLimits | m_normLimits |
| struct of the normalisation limits More... | |
DLPrimaryHierarchyTool to apply the primary hierarchy DL networks.
Definition at line 22 of file DLPrimaryHierarchyTool.h.
| lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryHierarchyTool | ( | ) |
Default constructor.
Definition at line 52 of file DLPrimaryHierarchyTool.cc.
| void lar_dl_content::DLPrimaryHierarchyTool::CalculateConnectionDistances | ( | const ExtremalPoint & | parentPoint, |
| const ExtremalPoint & | childPoint, | ||
| float & | parentConnectionDistance, | ||
| float & | childConnectionDistance | ||
| ) | const |
Calculate the variables describing the extension of a child particle to a given parent (m_parentConnectionDistance, m_childConnectionDistance)
| parentPoint | the extremal point of the parent |
| childPoint | the extremal point of the child |
| parentConnectionDistance | the DCA to the parent vertex |
| childConnectionDistance | the extension of the child to the DCA point |
Definition at line 206 of file DLPrimaryHierarchyTool.cc.
References lar_dl_content::ExtremalPoint::GetDirection(), lar_dl_content::ExtremalPoint::GetPosition(), lar_dl_content::DLBaseHierarchyTool::m_detectorBoundaries, and m_extrapolationStepSize.
Referenced by lar_dl_content::DLNeutrinoHierarchyAlgorithm::BuildPandoraHierarchy(), and SetContextParams().
|
private |
Function to calculate the DLPrimaryNetworkParams.
| pAlgorithm | a pointer to the pandora algorithm |
| hierarchyPfo | the input hierarchy pfo object |
| pNeutrinoPfo | a pointer to the neutrino pfo |
| trackPfos | the HierachyPfoVector of track-like particles |
| useUpstream | whether the POI is the endpoint closest to the nu vertex |
| primaryNetworkParams | the primary network parameters to fill |
Definition at line 100 of file DLPrimaryHierarchyTool.cc.
References lar_dl_content::HierarchyPfo::GetDownstreamPoint(), lar_dl_content::HierarchyPfo::GetPfo(), lar_dl_content::HierarchyPfo::GetUpstreamPoint(), lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::m_isPOIClosestToNu, m_normalise, lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::m_nSpacepoints, lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::m_nuSeparation, NormaliseNetworkParams(), SetConnectionParams(), SetContextParams(), and SetVertexRegionParams().
Referenced by Run().
|
private |
Apply the primary shower classification network.
| primaryNetworkParams | the primary network parameters associated with the shower endpoint |
Definition at line 316 of file DLPrimaryHierarchyTool.cc.
References lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::AddCommonParamsToInput(), lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::AddOrientationParamsToInput(), lar_dl_content::LArDLHelper::Forward(), lar_dl_content::LArDLHelper::InitialiseInput(), and m_primaryShowerClassifierModel.
Referenced by Run().
|
private |
Apply the primary track classification network.
| edgeParamsUp | the primary network parameters associated with the upstream endpoint |
| edgeParamsDown | the primary network parameters associated with the downstream endpoint |
Definition at line 265 of file DLPrimaryHierarchyTool.cc.
References ClassifyTrackEdge(), lar_dl_content::LArDLHelper::Forward(), lar_dl_content::LArDLHelper::InitialiseInput(), and m_primaryTrackClassifierModel.
Referenced by Run().
|
private |
Apply the primary track orientation edge network - determine whether an edge is signal (with correct orientation), signal (with the wrong orientation) or background.
| edgeParams | the primary network parameters associated with the edge to classify |
| otherEdgeParams | the primary network parameters associated with the other edge |
Definition at line 295 of file DLPrimaryHierarchyTool.cc.
References lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::AddCommonParamsToInput(), lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::AddOrientationParamsToInput(), lar_dl_content::LArDLHelper::Forward(), lar_dl_content::LArDLHelper::InitialiseInput(), and m_primaryTrackBranchModel.
Referenced by ClassifyTrack().
|
protectedinherited |
Return the number of 3D hits and the number of corresponding pfos of a given pfo about a point.
| pAlgorithm | a pointer to the pandora algorithm calling the tool |
| pPfo | a pointer to the pfo |
| pointOfInterest | the input position |
Definition at line 47 of file DLBaseHierarchyTool.cc.
References lar_dl_content::DLBaseHierarchyTool::m_pfoListNames, and lar_dl_content::DLBaseHierarchyTool::m_vertexRegionRadiusSq.
Referenced by lar_dl_content::DLLaterTierHierarchyTool::SetEndRegionParams(), and SetVertexRegionParams().
|
protectedinherited |
Shift and normalise a network parameter with respect to an input range.
| minLimit | the minimum allowed value of the variable |
| maxLimit | the maximum allowed value of the variable |
| networkParam | the input network parameter value |
Definition at line 90 of file DLBaseHierarchyTool.cc.
Referenced by NormaliseNetworkParams(), and lar_dl_content::DLLaterTierHierarchyTool::NormaliseNetworkParams().
|
private |
Shift and normalise the primary network parameters.
| primaryNetworkParam | the input primary network parameters |
Definition at line 247 of file DLPrimaryHierarchyTool.cc.
References lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::m_childConnectionDistance, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_childConnectionDistanceMax, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_childConnectionDistanceMin, lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::m_connectionExtrapDistance, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_connectionExtrapDistanceMax, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_connectionExtrapDistanceMin, lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::m_dca, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_dcaMax, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_dcaMin, m_normLimits, lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::m_nSpacepoints, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_nSpacepointsMax, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_nSpacepointsMin, lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::m_nuSeparation, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_nuSeparationMax, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_nuSeparationMin, lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::m_parentConnectionDistance, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_parentConnectionDistanceMax, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_parentConnectionDistanceMin, lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::m_vertexRegionNHits, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_vertexRegionNHitsMax, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_vertexRegionNHitsMin, lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::m_vertexRegionNParticles, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_vertexRegionNParticlesMax, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_vertexRegionNParticlesMin, and lar_dl_content::DLBaseHierarchyTool::NormaliseNetworkParam().
Referenced by CalculateNetworkVariables().
|
private |
Definition at line 335 of file DLPrimaryHierarchyTool.cc.
References lar_dl_content::LArDLHelper::LoadModel(), lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_childConnectionDistanceMax, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_childConnectionDistanceMin, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_connectionExtrapDistanceMax, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_connectionExtrapDistanceMin, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_dcaMax, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_dcaMin, m_extrapolationStepSize, m_normalise, m_normLimits, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_nSpacepointsMax, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_nSpacepointsMin, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_nuSeparationMax, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_nuSeparationMin, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_parentConnectionDistanceMax, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_parentConnectionDistanceMin, lar_dl_content::DLBaseHierarchyTool::m_pfoListNames, m_primaryShowerClassifierModel, m_primaryShowerClassifierModelName, m_primaryTrackBranchModel, m_primaryTrackBranchModelName, m_primaryTrackClassifierModel, m_primaryTrackClassifierModelName, m_trainingMode, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_vertexRegionNHitsMax, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_vertexRegionNHitsMin, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_vertexRegionNParticlesMax, lar_dl_content::DLPrimaryHierarchyTool::NormalisationLimits::m_vertexRegionNParticlesMin, and lar_dl_content::DLBaseHierarchyTool::ReadSettings().
| StatusCode lar_dl_content::DLPrimaryHierarchyTool::Run | ( | const pandora::Algorithm *const | pAlgorithm, |
| const pandora::ParticleFlowObject *const | pNeutrinoPfo, | ||
| const HierarchyPfoVector & | trackPfos, | ||
| const HierarchyPfo & | hierarchyPfo, | ||
| std::vector< DLPrimaryNetworkParams > & | networkParamVector, | ||
| float & | primaryScore | ||
| ) |
Definition at line 62 of file DLPrimaryHierarchyTool.cc.
References CalculateNetworkVariables(), ClassifyShower(), ClassifyTrack(), lar_dl_content::HierarchyPfo::GetPfo(), m_trainingMode, and lar_dl_content::DLBaseHierarchyTool::SetDetectorBoundaries().
Referenced by lar_dl_content::DLNeutrinoHierarchyAlgorithm::BuildPandoraHierarchy(), and lar_dl_content::DLNeutrinoHierarchyAlgorithm::GetPrimaryScore().
|
private |
Set the connection region DLPrimaryNetworkParams params (m_dca, m_connectionExtrapDistance)
| particlePoint | the extremal point of the particle |
| nuVertex | the neutrino vertex |
| primaryNetworkParams | the primary network parameters |
Definition at line 149 of file DLPrimaryHierarchyTool.cc.
References lar_dl_content::ExtremalPoint::GetDirection(), lar_dl_content::ExtremalPoint::GetPosition(), lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::m_connectionExtrapDistance, and lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::m_dca.
Referenced by CalculateNetworkVariables().
|
private |
Set the event context DLPrimaryNetworkParams params (m_parentConnectionDistance, m_childConnectionDistance)
| pPfo | a pointer to the input pfo |
| particlePoint | the extremal point of the particle |
| nuVertex | the neutrino vertex |
| trackPfos | the HierachyPfoVector of track-like particles |
| primaryNetworkParams | the primary network parameters |
Definition at line 162 of file DLPrimaryHierarchyTool.cc.
References CalculateConnectionDistances(), f, lar_dl_content::ExtremalPoint::GetPosition(), lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::m_childConnectionDistance, and lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::m_parentConnectionDistance.
Referenced by CalculateNetworkVariables().
|
protectedinherited |
Set the detector boundaries.
Definition at line 36 of file DLBaseHierarchyTool.cc.
References lar_dl_content::DLBaseHierarchyTool::m_areBoundariesSet, and lar_dl_content::DLBaseHierarchyTool::m_detectorBoundaries.
Referenced by lar_dl_content::DLLaterTierHierarchyTool::Run(), and Run().
|
private |
Set the vertex region DLPrimaryNetworkParams params (m_vertexRegionNHits, m_vertexRegionNParticles)
| pAlgorithm | a pointer to the pandora algorithm |
| pPfo | a pointer to the input pfo |
| particleVertex | the position of the pfo vertex |
| primaryNetworkParams | the primary network parameters |
Definition at line 138 of file DLPrimaryHierarchyTool.cc.
References lar_dl_content::DLBaseHierarchyTool::GetParticleInfoAboutPfoPosition(), lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::m_vertexRegionNHits, and lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryNetworkParams::m_vertexRegionNParticles.
Referenced by CalculateNetworkVariables().
|
protectedinherited |
whether the detector boundaries have been set
Definition at line 68 of file DLBaseHierarchyTool.h.
Referenced by lar_dl_content::DLBaseHierarchyTool::DLBaseHierarchyTool(), and lar_dl_content::DLBaseHierarchyTool::SetDetectorBoundaries().
|
protectedinherited |
the detector boundaries
Definition at line 67 of file DLBaseHierarchyTool.h.
Referenced by CalculateConnectionDistances(), lar_dl_content::DLBaseHierarchyTool::SetDetectorBoundaries(), and lar_dl_content::DLLaterTierHierarchyTool::SetEndRegionRToWall().
|
private |
the step size used to trace back a child particle's path
Definition at line 198 of file DLPrimaryHierarchyTool.h.
Referenced by CalculateConnectionDistances(), and ReadSettings().
|
private |
whether to normalise the network parameters
Definition at line 200 of file DLPrimaryHierarchyTool.h.
Referenced by CalculateNetworkVariables(), and ReadSettings().
|
private |
struct of the normalisation limits
Definition at line 201 of file DLPrimaryHierarchyTool.h.
Referenced by NormaliseNetworkParams(), and ReadSettings().
|
protectedinherited |
the input pfo list name vector
Definition at line 66 of file DLBaseHierarchyTool.h.
Referenced by lar_dl_content::DLBaseHierarchyTool::GetParticleInfoAboutPfoPosition(), lar_dl_content::DLBaseHierarchyTool::ReadSettings(), and ReadSettings().
|
private |
the primary shower classification model
Definition at line 196 of file DLPrimaryHierarchyTool.h.
Referenced by ClassifyShower(), and ReadSettings().
|
private |
the name of the primary shower classification model file
Definition at line 193 of file DLPrimaryHierarchyTool.h.
Referenced by ReadSettings().
|
private |
the primary track edge model
Definition at line 194 of file DLPrimaryHierarchyTool.h.
Referenced by ClassifyTrackEdge(), and ReadSettings().
|
private |
the name of the primary track edge model file
Definition at line 191 of file DLPrimaryHierarchyTool.h.
Referenced by ReadSettings().
|
private |
the primary track classification model
Definition at line 195 of file DLPrimaryHierarchyTool.h.
Referenced by ClassifyTrack(), and ReadSettings().
|
private |
the name of the primary track classification model file
Definition at line 192 of file DLPrimaryHierarchyTool.h.
Referenced by ReadSettings().
|
private |
whether to run the tool in training mode
Definition at line 190 of file DLPrimaryHierarchyTool.h.
Referenced by ReadSettings(), and Run().
|
protectedinherited |
the radius (squared) in which to search for particle hits
Definition at line 65 of file DLBaseHierarchyTool.h.
Referenced by lar_dl_content::DLBaseHierarchyTool::GetParticleInfoAboutPfoPosition(), and lar_dl_content::DLBaseHierarchyTool::ReadSettings().