LArSoft  v10_06_00
Liquid Argon Software toolkit - https://larsoft.org/
lar_dl_content::DLPrimaryHierarchyTool Class Reference

DLPrimaryHierarchyTool to apply the primary hierarchy DL networks. More...

#include "DLPrimaryHierarchyTool.h"

Inheritance diagram for lar_dl_content::DLPrimaryHierarchyTool:
lar_dl_content::DLBaseHierarchyTool

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...
 

Detailed Description

DLPrimaryHierarchyTool to apply the primary hierarchy DL networks.

Definition at line 22 of file DLPrimaryHierarchyTool.h.

Constructor & Destructor Documentation

lar_dl_content::DLPrimaryHierarchyTool::DLPrimaryHierarchyTool ( )

Default constructor.

Definition at line 52 of file DLPrimaryHierarchyTool.cc.

52  :
54  m_trainingMode(false),
56  m_normalise(true)
57 {
58 }
float m_extrapolationStepSize
the step size used to trace back a child particle&#39;s path
bool m_trainingMode
whether to run the tool in training mode
DLBaseHierarchyTool()
Default constructor.
TFile f
Definition: plotHisto.C:6
bool m_normalise
whether to normalise the network parameters

Member Function Documentation

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)

Parameters
parentPointthe extremal point of the parent
childPointthe extremal point of the child
parentConnectionDistancethe DCA to the parent vertex
childConnectionDistancethe 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().

208 {
209  // Loop things
210  float smallestT(std::numeric_limits<float>::max());
211  bool isGettingCloser(true);
212  bool found(false);
213  CartesianVector connectionPoint(std::numeric_limits<float>::lowest(), std::numeric_limits<float>::lowest(), std::numeric_limits<float>::lowest());
214 
215  // start the seed
216  CartesianVector extrapolatedPoint(childPoint.GetPosition());
217 
218  while (isGettingCloser)
219  {
220  isGettingCloser = false;
221  extrapolatedPoint = extrapolatedPoint + (childPoint.GetDirection() * ((-1.f) * m_extrapolationStepSize));
222 
223  if (!LArGeometryHelper::IsInDetector(m_detectorBoundaries, extrapolatedPoint))
224  break;
225 
226  const float parentT(
227  (parentPoint.GetDirection() * (-1.f)).GetCrossProduct((extrapolatedPoint - parentPoint.GetPosition())).GetMagnitudeSquared());
228 
229  if (parentT < smallestT)
230  {
231  smallestT = parentT;
232  connectionPoint = extrapolatedPoint;
233  isGettingCloser = true;
234  found = true;
235  }
236  }
237 
238  // Distance from parent end to connection point - need to turn parent direction around
239  parentConnectionDistance = found ? (parentPoint.GetDirection() * (-1.f)).GetDotProduct(connectionPoint - parentPoint.GetPosition())
240  : std::numeric_limits<float>::lowest();
241  // Distance from child start to connection point
242  childConnectionDistance = found ? (childPoint.GetPosition() - connectionPoint).GetMagnitude() : std::numeric_limits<float>::lowest();
243 }
float m_extrapolationStepSize
the step size used to trace back a child particle&#39;s path
STL namespace.
LArGeometryHelper::DetectorBoundaries m_detectorBoundaries
the detector boundaries
StatusCode lar_dl_content::DLPrimaryHierarchyTool::CalculateNetworkVariables ( const pandora::Algorithm *const  pAlgorithm,
const HierarchyPfo hierarchyPfo,
const pandora::ParticleFlowObject *const  pNeutrinoPfo,
const HierarchyPfoVector trackPfos,
const bool  useUpstream,
DLPrimaryNetworkParams primaryNetworkParams 
) const
private

Function to calculate the DLPrimaryNetworkParams.

Parameters
pAlgorithma pointer to the pandora algorithm
hierarchyPfothe input hierarchy pfo object
pNeutrinoPfoa pointer to the neutrino pfo
trackPfosthe HierachyPfoVector of track-like particles
useUpstreamwhether the POI is the endpoint closest to the nu vertex
primaryNetworkParamsthe primary network parameters to fill
Returns
a StatusCode to signify whether the network variables could be correctly calculated

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().

103 {
104  // Pick out neutrino vertex
105  if (pNeutrinoPfo->GetVertexList().empty())
106  return STATUS_CODE_NOT_INITIALIZED;
107 
108  const Vertex *const pNeutrinoVertex(LArPfoHelper::GetVertex(pNeutrinoPfo));
109  const CartesianVector nuVertex(
110  pNeutrinoVertex->GetPosition().GetX(), pNeutrinoVertex->GetPosition().GetY(), pNeutrinoVertex->GetPosition().GetZ());
111 
112  // Pick out the correct extremal point
113  const ExtremalPoint &particlePoint(useUpstream ? hierarchyPfo.GetUpstreamPoint() : hierarchyPfo.GetDownstreamPoint());
114 
115  // Check that we could actually calculate pfo vertex/direction, return if not
116  if (!particlePoint.IsSet())
117  {
118  return STATUS_CODE_NOT_INITIALIZED;
119  }
120 
121  // Set primaryNetworkParams
122  primaryNetworkParams.m_isPOIClosestToNu = useUpstream ? 1.f : 0.f;
123  primaryNetworkParams.m_nSpacepoints = LArPfoHelper::GetNumberOfThreeDHits(hierarchyPfo.GetPfo());
124  primaryNetworkParams.m_nuSeparation = (particlePoint.GetPosition() - nuVertex).GetMagnitude();
125  this->SetVertexRegionParams(pAlgorithm, hierarchyPfo.GetPfo(), particlePoint.GetPosition(), primaryNetworkParams);
126  this->SetConnectionParams(particlePoint, nuVertex, primaryNetworkParams);
127  this->SetContextParams(hierarchyPfo.GetPfo(), particlePoint, nuVertex, trackPfos, primaryNetworkParams);
128 
129  // Normalise
130  if (m_normalise)
131  this->NormaliseNetworkParams(primaryNetworkParams);
132 
133  return STATUS_CODE_SUCCESS;
134 }
void NormaliseNetworkParams(DLPrimaryNetworkParams &primaryNetworkParams) const
Shift and normalise the primary network parameters.
void SetConnectionParams(const ExtremalPoint &particlePoint, const pandora::CartesianVector &nuVertex, DLPrimaryNetworkParams &primaryNetworkParams) const
Set the connection region DLPrimaryNetworkParams params (m_dca, m_connectionExtrapDistance) ...
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_childConnectionDis...
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) ...
bool m_normalise
whether to normalise the network parameters
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
float lar_dl_content::DLPrimaryHierarchyTool::ClassifyShower ( const DLPrimaryNetworkParams primaryNetworkParams)
private

Apply the primary shower classification network.

Parameters
primaryNetworkParamsthe primary network parameters associated with the shower endpoint
Returns
the network score

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().

317 {
319  LArDLHelper::InitialiseInput({1, 9}, input);
320 
321  // Fill our torch vector
322  int insertIndex(0);
323  primaryNetworkParams.AddCommonParamsToInput(insertIndex, input);
324  primaryNetworkParams.AddOrientationParamsToInput(insertIndex, input);
325 
328  auto outputAccessor = output.accessor<float, 2>();
329 
330  return outputAccessor[0][0];
331 }
static void Forward(TorchModel &model, const TorchInputVector &input, TorchOutput &output)
Run a deep learning model.
Definition: LArDLHelper.cc:41
LArDLHelper::TorchModel m_primaryShowerClassifierModel
the primary shower classification model
static void InitialiseInput(const at::IntArrayRef dimensions, TorchInput &tensor)
Create a torch input tensor.
Definition: LArDLHelper.cc:34
float lar_dl_content::DLPrimaryHierarchyTool::ClassifyTrack ( const DLPrimaryNetworkParams edgeParamsUp,
const DLPrimaryNetworkParams edgeParamsDown 
)
private

Apply the primary track classification network.

Parameters
edgeParamsUpthe primary network parameters associated with the upstream endpoint
edgeParamsDownthe primary network parameters associated with the downstream endpoint
Returns
the network score

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().

266 {
267  // Invoke branch model for each edge
268  const FloatVector outputUp(this->ClassifyTrackEdge(edgeParamsUp, edgeParamsDown));
269  const FloatVector outputDown(this->ClassifyTrackEdge(edgeParamsDown, edgeParamsUp));
270 
271  // Invoke classifier model for final output
273  LArDLHelper::InitialiseInput({1, 6}, input);
274 
275  int insertIndex(0);
276 
277  for (const FloatVector &edgeOutput : {outputUp, outputDown})
278  {
279  for (int i = 0; i < 3; ++i)
280  {
281  input[0][insertIndex] = edgeOutput.at(i);
282  ++insertIndex;
283  }
284  }
285 
288  torch::TensorAccessor<float, 2> outputAccessor = output.accessor<float, 2>();
289 
290  return outputAccessor[0][0];
291 }
pandora::FloatVector ClassifyTrackEdge(const DLPrimaryNetworkParams &edgeParams, const DLPrimaryNetworkParams &otherEdgeParams)
Apply the primary track orientation edge network - determine whether an edge is signal (with correct ...
static void Forward(TorchModel &model, const TorchInputVector &input, TorchOutput &output)
Run a deep learning model.
Definition: LArDLHelper.cc:41
static void InitialiseInput(const at::IntArrayRef dimensions, TorchInput &tensor)
Create a torch input tensor.
Definition: LArDLHelper.cc:34
LArDLHelper::TorchModel m_primaryTrackClassifierModel
the primary track classification model
FloatVector lar_dl_content::DLPrimaryHierarchyTool::ClassifyTrackEdge ( const DLPrimaryNetworkParams edgeParams,
const DLPrimaryNetworkParams otherEdgeParams 
)
private

Apply the primary track orientation edge network - determine whether an edge is signal (with correct orientation), signal (with the wrong orientation) or background.

Parameters
edgeParamsthe primary network parameters associated with the edge to classify
otherEdgeParamsthe primary network parameters associated with the other edge
Returns
the float vector of (signal, wrong orientation, background) scores

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().

296 {
298  LArDLHelper::InitialiseInput({1, 17}, input);
299 
300  // Fill our torch vector
301  int insertIndex(0);
302  edgeParams.AddCommonParamsToInput(insertIndex, input);
303  edgeParams.AddOrientationParamsToInput(insertIndex, input);
304  otherEdgeParams.AddOrientationParamsToInput(insertIndex, input);
305 
308 
309  torch::TensorAccessor<float, 2> outputAccessor(output.accessor<float, 2>());
310 
311  return {outputAccessor[0][0], outputAccessor[0][1], outputAccessor[0][2]};
312 }
static void Forward(TorchModel &model, const TorchInputVector &input, TorchOutput &output)
Run a deep learning model.
Definition: LArDLHelper.cc:41
static void InitialiseInput(const at::IntArrayRef dimensions, TorchInput &tensor)
Create a torch input tensor.
Definition: LArDLHelper.cc:34
LArDLHelper::TorchModel m_primaryTrackBranchModel
the primary track edge model
std::pair< float, float > lar_dl_content::DLBaseHierarchyTool::GetParticleInfoAboutPfoPosition ( const pandora::Algorithm *const  pAlgorithm,
const pandora::ParticleFlowObject *const  pPfo,
const pandora::CartesianVector &  pointOfInterest 
) const
protectedinherited

Return the number of 3D hits and the number of corresponding pfos of a given pfo about a point.

Parameters
pAlgorithma pointer to the pandora algorithm calling the tool
pPfoa pointer to the pfo
pointOfInterestthe input position
Returns
std::pair of the number of 3D hits and the number of corresponding pfos

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().

49 {
50  int hitCount(0);
51  int particleCount(0);
52 
53  for (const std::string &pfoListName : m_pfoListNames)
54  {
55  const PfoList *pPfoList(nullptr);
56  if (PandoraContentApi::GetList(*pAlgorithm, pfoListName, pPfoList) != STATUS_CODE_SUCCESS)
57  continue;
58 
59  for (const ParticleFlowObject *const pOtherPfo : *pPfoList)
60  {
61  if (pPfo == pOtherPfo)
62  continue;
63 
64  bool isClose(false);
65 
66  CartesianPointVector otherPfoPositions3D;
67  LArPfoHelper::GetCoordinateVector(pOtherPfo, TPC_3D, otherPfoPositions3D);
68 
69  for (const CartesianVector &otherPfoPosition : otherPfoPositions3D)
70  {
71  const double sepSq((otherPfoPosition - pointOfInterest).GetMagnitudeSquared());
72 
73  if (sepSq < m_vertexRegionRadiusSq)
74  {
75  isClose = true;
76  ++hitCount;
77  }
78  }
79 
80  if (isClose)
81  ++particleCount;
82  }
83  }
84 
85  return std::pair<float, float>({hitCount, particleCount});
86 }
float m_vertexRegionRadiusSq
the radius (squared) in which to search for particle hits
pandora::StringVector m_pfoListNames
the input pfo list name vector
void lar_dl_content::DLBaseHierarchyTool::NormaliseNetworkParam ( const float  minLimit,
const float  maxLimit,
float &  networkParam 
) const
protectedinherited

Shift and normalise a network parameter with respect to an input range.

Parameters
minLimitthe minimum allowed value of the variable
maxLimitthe maximum allowed value of the variable
networkParamthe input network parameter value

Definition at line 90 of file DLBaseHierarchyTool.cc.

Referenced by NormaliseNetworkParams(), and lar_dl_content::DLLaterTierHierarchyTool::NormaliseNetworkParams().

91 {
92  const float interval(std::fabs(maxLimit - minLimit));
93 
94  if (interval < std::numeric_limits<float>::epsilon())
95  {
96  networkParam = minLimit;
97  return;
98  }
99 
100  if (networkParam < minLimit)
101  networkParam = minLimit;
102 
103  if (networkParam > maxLimit)
104  networkParam = maxLimit;
105 
106  networkParam /= interval;
107 }
void lar_dl_content::DLPrimaryHierarchyTool::NormaliseNetworkParams ( DLPrimaryNetworkParams primaryNetworkParams) const
private

Shift and normalise the primary network parameters.

Parameters
primaryNetworkParamthe 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().

248 {
249  this->NormaliseNetworkParam(m_normLimits.m_nSpacepointsMin, m_normLimits.m_nSpacepointsMax, primaryNetworkParams.m_nSpacepoints);
250  this->NormaliseNetworkParam(m_normLimits.m_nuSeparationMin, m_normLimits.m_nuSeparationMax, primaryNetworkParams.m_nuSeparation);
251  this->NormaliseNetworkParam(m_normLimits.m_vertexRegionNHitsMin, m_normLimits.m_vertexRegionNHitsMax, primaryNetworkParams.m_vertexRegionNHits);
252  this->NormaliseNetworkParam(
253  m_normLimits.m_vertexRegionNParticlesMin, m_normLimits.m_vertexRegionNParticlesMax, primaryNetworkParams.m_vertexRegionNParticles);
254  this->NormaliseNetworkParam(m_normLimits.m_dcaMin, m_normLimits.m_dcaMax, primaryNetworkParams.m_dca);
256  primaryNetworkParams.m_connectionExtrapDistance);
258  primaryNetworkParams.m_parentConnectionDistance);
260  primaryNetworkParams.m_childConnectionDistance);
261 }
NormalisationLimits m_normLimits
struct of the normalisation limits
float m_vertexRegionNParticlesMax
the m_vertexRegionNParticles maximum range boundary
float m_parentConnectionDistanceMax
the m_parentConnectionDistance maximum range boundary
float m_childConnectionDistanceMin
the m_childConnectionDistance minimum range boundary
float m_connectionExtrapDistanceMin
the m_connectionExtrapDistance minimum range boundary
float m_parentConnectionDistanceMin
the m_parentConnectionDistance minimum range boundary
float m_vertexRegionNHitsMax
the m_vertexRegionNHits maximum range boundary
float m_vertexRegionNParticlesMin
the m_vertexRegionNParticles minimum range boundary
float m_childConnectionDistanceMax
the m_childConnectionDistance maximum range boundary
float m_vertexRegionNHitsMin
the m_vertexRegionNHits minimum range boundary
float m_nSpacepointsMin
the m_nSpacepoints minimum range boundary
void NormaliseNetworkParam(const float minLimit, const float maxLimit, float &networkParam) const
Shift and normalise a network parameter with respect to an input range.
float m_nSpacepointsMax
the m_nSpacepoints maximum range boundary
float m_nuSeparationMin
the m_nuSeparation minimum range boundary
float m_nuSeparationMax
the m_nuSeparation maximum range boundary
float m_connectionExtrapDistanceMax
the m_connectionExtrapDistance maximum range boundary
StatusCode lar_dl_content::DLPrimaryHierarchyTool::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
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().

336 {
337  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "TrainingMode", m_trainingMode));
338  PANDORA_RETURN_RESULT_IF_AND_IF(
339  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "PfoListNames", m_pfoListNames));
340  PANDORA_RETURN_RESULT_IF_AND_IF(
341  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ExtrapolationStepSize", m_extrapolationStepSize));
342  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "Normalise", m_normalise));
343  PANDORA_RETURN_RESULT_IF_AND_IF(
344  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "NSpacepointsMin", m_normLimits.m_nSpacepointsMin));
345  PANDORA_RETURN_RESULT_IF_AND_IF(
346  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "NSpacepointsMax", m_normLimits.m_nSpacepointsMax));
347  PANDORA_RETURN_RESULT_IF_AND_IF(
348  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "NuSeparationMin", m_normLimits.m_nuSeparationMin));
349  PANDORA_RETURN_RESULT_IF_AND_IF(
350  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "NuSeparationMax", m_normLimits.m_nuSeparationMax));
351  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
352  XmlHelper::ReadValue(xmlHandle, "VertexRegionNHitsMin", m_normLimits.m_vertexRegionNHitsMin));
353  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
354  XmlHelper::ReadValue(xmlHandle, "VertexRegionNHitsMax", m_normLimits.m_vertexRegionNHitsMax));
355  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
356  XmlHelper::ReadValue(xmlHandle, "VertexRegionNParticlesMin", m_normLimits.m_vertexRegionNParticlesMin));
357  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
358  XmlHelper::ReadValue(xmlHandle, "VertexRegionNParticlesMax", m_normLimits.m_vertexRegionNParticlesMax));
359  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "DCAMin", m_normLimits.m_dcaMin));
360  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "DCAMax", m_normLimits.m_dcaMax));
361  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
362  XmlHelper::ReadValue(xmlHandle, "ConnectionExtrapDistanceMin", m_normLimits.m_connectionExtrapDistanceMin));
363  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
364  XmlHelper::ReadValue(xmlHandle, "ConnectionExtrapDistanceMax", m_normLimits.m_connectionExtrapDistanceMax));
365  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
366  XmlHelper::ReadValue(xmlHandle, "ParentConnectionDistanceMin", m_normLimits.m_parentConnectionDistanceMin));
367  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
368  XmlHelper::ReadValue(xmlHandle, "ParentConnectionDistanceMax", m_normLimits.m_parentConnectionDistanceMax));
369  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
370  XmlHelper::ReadValue(xmlHandle, "ChildConnectionDistanceMin", m_normLimits.m_childConnectionDistanceMin));
371  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
372  XmlHelper::ReadValue(xmlHandle, "ChildConnectionDistanceMax", m_normLimits.m_childConnectionDistanceMax));
373 
374  if (!m_trainingMode)
375  {
376  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "PrimaryTrackBranchModelName", m_primaryTrackBranchModelName));
377  m_primaryTrackBranchModelName = LArFileHelper::FindFileInPath(m_primaryTrackBranchModelName, "FW_SEARCH_PATH");
378  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, LArDLHelper::LoadModel(m_primaryTrackBranchModelName, m_primaryTrackBranchModel));
379 
380  PANDORA_RETURN_RESULT_IF(
381  STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "PrimaryTrackClassifierModelName", m_primaryTrackClassifierModelName));
382  m_primaryTrackClassifierModelName = LArFileHelper::FindFileInPath(m_primaryTrackClassifierModelName, "FW_SEARCH_PATH");
383  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, LArDLHelper::LoadModel(m_primaryTrackClassifierModelName, m_primaryTrackClassifierModel));
384 
385  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=,
386  XmlHelper::ReadValue(xmlHandle, "PrimaryShowerClassifierModelName", m_primaryShowerClassifierModelName));
387  m_primaryShowerClassifierModelName = LArFileHelper::FindFileInPath(m_primaryShowerClassifierModelName, "FW_SEARCH_PATH");
388  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, LArDLHelper::LoadModel(m_primaryShowerClassifierModelName, m_primaryShowerClassifierModel));
389  }
390 
391  return DLBaseHierarchyTool::ReadSettings(xmlHandle);
392 }
NormalisationLimits m_normLimits
struct of the normalisation limits
std::string m_primaryTrackBranchModelName
the name of the primary track edge model file
float m_vertexRegionNParticlesMax
the m_vertexRegionNParticles maximum range boundary
std::string m_primaryShowerClassifierModelName
the name of the primary shower classification model file
float m_parentConnectionDistanceMax
the m_parentConnectionDistance maximum range boundary
float m_extrapolationStepSize
the step size used to trace back a child particle&#39;s path
float m_childConnectionDistanceMin
the m_childConnectionDistance minimum range boundary
float m_connectionExtrapDistanceMin
the m_connectionExtrapDistance minimum range boundary
float m_parentConnectionDistanceMin
the m_parentConnectionDistance minimum range boundary
float m_vertexRegionNHitsMax
the m_vertexRegionNHits maximum range boundary
std::string m_primaryTrackClassifierModelName
the name of the primary track classification model file
bool m_trainingMode
whether to run the tool in training mode
float m_vertexRegionNParticlesMin
the m_vertexRegionNParticles minimum range boundary
float m_childConnectionDistanceMax
the m_childConnectionDistance maximum range boundary
float m_vertexRegionNHitsMin
the m_vertexRegionNHits minimum range boundary
float m_nSpacepointsMin
the m_nSpacepoints minimum range boundary
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
pandora::StringVector m_pfoListNames
the input pfo list name vector
float m_nSpacepointsMax
the m_nSpacepoints maximum range boundary
static pandora::StatusCode LoadModel(const std::string &filename, TorchModel &model)
Loads a deep learning model.
Definition: LArDLHelper.cc:16
float m_nuSeparationMin
the m_nuSeparation minimum range boundary
bool m_normalise
whether to normalise the network parameters
LArDLHelper::TorchModel m_primaryShowerClassifierModel
the primary shower classification model
LArDLHelper::TorchModel m_primaryTrackClassifierModel
the primary track classification model
float m_nuSeparationMax
the m_nuSeparation maximum range boundary
LArDLHelper::TorchModel m_primaryTrackBranchModel
the primary track edge model
float m_connectionExtrapDistanceMax
the m_connectionExtrapDistance maximum range boundary
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().

64 {
65  networkParamVector.clear();
66  primaryScore = std::numeric_limits<float>::lowest();
67 
68  this->SetDetectorBoundaries();
69 
70  const bool isTrack(hierarchyPfo.GetPfo()->GetParticleId() == 13);
71  std::vector<bool> orientationVector(isTrack ? std::vector<bool>({true, false}) : std::vector<bool>({true}));
72 
73  for (const bool useUpstream : orientationVector)
74  {
75  // Set network params
76  DLPrimaryNetworkParams primaryNetworkParams;
77 
78  const StatusCode statusCode(this->CalculateNetworkVariables(pAlgorithm, hierarchyPfo, pNeutrinoPfo, trackPfos, useUpstream, primaryNetworkParams));
79 
80  if (statusCode != STATUS_CODE_SUCCESS)
81  return statusCode;
82 
83  networkParamVector.emplace_back(primaryNetworkParams);
84  }
85 
86  // Now run the model!
87  if (!m_trainingMode)
88  {
89  if (isTrack)
90  primaryScore = this->ClassifyTrack(networkParamVector.at(0), networkParamVector.at(1));
91  else
92  primaryScore = this->ClassifyShower(networkParamVector.at(0));
93  }
94 
95  return STATUS_CODE_SUCCESS;
96 }
float ClassifyTrack(const DLPrimaryNetworkParams &edgeParamsUp, const DLPrimaryNetworkParams &edgeParamsDown)
Apply the primary track classification network.
bool m_trainingMode
whether to run the tool in training mode
float ClassifyShower(const DLPrimaryNetworkParams &primaryNetworkParams)
Apply the primary shower classification network.
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.
void SetDetectorBoundaries()
Set the detector boundaries.
void lar_dl_content::DLPrimaryHierarchyTool::SetConnectionParams ( const ExtremalPoint particlePoint,
const pandora::CartesianVector &  nuVertex,
DLPrimaryNetworkParams primaryNetworkParams 
) const
private

Set the connection region DLPrimaryNetworkParams params (m_dca, m_connectionExtrapDistance)

Parameters
particlePointthe extremal point of the particle
nuVertexthe neutrino vertex
primaryNetworkParamsthe 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().

151 {
152  // Extrapolate particle to nuVertex
153  const float extrapDistance((nuVertex - particlePoint.GetPosition()).GetDotProduct(particlePoint.GetDirection()));
154  const CartesianVector extrapolationPoint(particlePoint.GetPosition() + (particlePoint.GetDirection() * extrapDistance));
155 
156  primaryNetworkParams.m_dca = (nuVertex - extrapolationPoint).GetMagnitude();
157  primaryNetworkParams.m_connectionExtrapDistance = (extrapDistance * (-1.f)); // backwards extrap. should be +ve
158 }
void lar_dl_content::DLPrimaryHierarchyTool::SetContextParams ( const pandora::ParticleFlowObject *const  pPfo,
const ExtremalPoint particlePoint,
const pandora::CartesianVector &  nuVertex,
const HierarchyPfoVector trackPfos,
DLPrimaryNetworkParams primaryNetworkParams 
) const
private

Set the event context DLPrimaryNetworkParams params (m_parentConnectionDistance, m_childConnectionDistance)

Parameters
pPfoa pointer to the input pfo
particlePointthe extremal point of the particle
nuVertexthe neutrino vertex
trackPfosthe HierachyPfoVector of track-like particles
primaryNetworkParamsthe 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().

164 {
165  // What is our nuVertex separation
166  const float nuVertexSepSq((particlePoint.GetPosition() - nuVertex).GetMagnitudeSquared());
167 
168  bool found(false);
169  float parentConnectionDistance(std::numeric_limits<float>::max());
170  float childConnectionDistance(std::numeric_limits<float>::max());
171 
172  // Look at potential parents
173  for (const HierarchyPfo &hierarchyTrackPfo : trackPfos)
174  {
175  if (hierarchyTrackPfo == pPfo)
176  continue;
177 
178  // Upstream position should be closer to nu vertex
179  const float thisNuVertexSepSq((hierarchyTrackPfo.GetDownstreamPoint().GetPosition() - nuVertex).GetMagnitudeSquared());
180 
181  if (thisNuVertexSepSq > nuVertexSepSq)
182  continue;
183 
184  float thisParentConnectionDistance(std::numeric_limits<float>::lowest());
185  float thisChildConnectionDistance(std::numeric_limits<float>::lowest());
186 
187  this->CalculateConnectionDistances(hierarchyTrackPfo.GetDownstreamPoint(), particlePoint, thisParentConnectionDistance, thisChildConnectionDistance);
188 
189  if ((thisChildConnectionDistance > 0.f) && (std::fabs(thisParentConnectionDistance) < std::fabs(parentConnectionDistance)))
190  {
191  found = true;
192  parentConnectionDistance = thisParentConnectionDistance;
193  childConnectionDistance = thisChildConnectionDistance;
194  }
195  }
196 
197  if (found)
198  {
199  primaryNetworkParams.m_parentConnectionDistance = parentConnectionDistance;
200  primaryNetworkParams.m_childConnectionDistance = childConnectionDistance;
201  }
202 }
TFile f
Definition: plotHisto.C:6
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_parentConne...
void lar_dl_content::DLBaseHierarchyTool::SetDetectorBoundaries ( )
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().

37 {
39  return;
40 
41  m_detectorBoundaries = LArGeometryHelper::GetDetectorBoundaries(this->GetPandora());
42  m_areBoundariesSet = true;
43 }
bool m_areBoundariesSet
whether the detector boundaries have been set
LArGeometryHelper::DetectorBoundaries m_detectorBoundaries
the detector boundaries
void lar_dl_content::DLPrimaryHierarchyTool::SetVertexRegionParams ( const pandora::Algorithm *const  pAlgorithm,
const pandora::ParticleFlowObject *const  pPfo,
const pandora::CartesianVector &  particleVertex,
DLPrimaryNetworkParams primaryNetworkParams 
) const
private

Set the vertex region DLPrimaryNetworkParams params (m_vertexRegionNHits, m_vertexRegionNParticles)

Parameters
pAlgorithma pointer to the pandora algorithm
pPfoa pointer to the input pfo
particleVertexthe position of the pfo vertex
primaryNetworkParamsthe 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().

140 {
141  std::pair<float, float> vertexRegionParams(this->GetParticleInfoAboutPfoPosition(pAlgorithm, pPfo, particleVertex));
142 
143  primaryNetworkParams.m_vertexRegionNHits = vertexRegionParams.first;
144  primaryNetworkParams.m_vertexRegionNParticles = vertexRegionParams.second;
145 }
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...

Member Data Documentation

bool lar_dl_content::DLBaseHierarchyTool::m_areBoundariesSet
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().

LArGeometryHelper::DetectorBoundaries lar_dl_content::DLBaseHierarchyTool::m_detectorBoundaries
protectedinherited
float lar_dl_content::DLPrimaryHierarchyTool::m_extrapolationStepSize
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().

bool lar_dl_content::DLPrimaryHierarchyTool::m_normalise
private

whether to normalise the network parameters

Definition at line 200 of file DLPrimaryHierarchyTool.h.

Referenced by CalculateNetworkVariables(), and ReadSettings().

NormalisationLimits lar_dl_content::DLPrimaryHierarchyTool::m_normLimits
private

struct of the normalisation limits

Definition at line 201 of file DLPrimaryHierarchyTool.h.

Referenced by NormaliseNetworkParams(), and ReadSettings().

pandora::StringVector lar_dl_content::DLBaseHierarchyTool::m_pfoListNames
protectedinherited
LArDLHelper::TorchModel lar_dl_content::DLPrimaryHierarchyTool::m_primaryShowerClassifierModel
private

the primary shower classification model

Definition at line 196 of file DLPrimaryHierarchyTool.h.

Referenced by ClassifyShower(), and ReadSettings().

std::string lar_dl_content::DLPrimaryHierarchyTool::m_primaryShowerClassifierModelName
private

the name of the primary shower classification model file

Definition at line 193 of file DLPrimaryHierarchyTool.h.

Referenced by ReadSettings().

LArDLHelper::TorchModel lar_dl_content::DLPrimaryHierarchyTool::m_primaryTrackBranchModel
private

the primary track edge model

Definition at line 194 of file DLPrimaryHierarchyTool.h.

Referenced by ClassifyTrackEdge(), and ReadSettings().

std::string lar_dl_content::DLPrimaryHierarchyTool::m_primaryTrackBranchModelName
private

the name of the primary track edge model file

Definition at line 191 of file DLPrimaryHierarchyTool.h.

Referenced by ReadSettings().

LArDLHelper::TorchModel lar_dl_content::DLPrimaryHierarchyTool::m_primaryTrackClassifierModel
private

the primary track classification model

Definition at line 195 of file DLPrimaryHierarchyTool.h.

Referenced by ClassifyTrack(), and ReadSettings().

std::string lar_dl_content::DLPrimaryHierarchyTool::m_primaryTrackClassifierModelName
private

the name of the primary track classification model file

Definition at line 192 of file DLPrimaryHierarchyTool.h.

Referenced by ReadSettings().

bool lar_dl_content::DLPrimaryHierarchyTool::m_trainingMode
private

whether to run the tool in training mode

Definition at line 190 of file DLPrimaryHierarchyTool.h.

Referenced by ReadSettings(), and Run().

float lar_dl_content::DLBaseHierarchyTool::m_vertexRegionRadiusSq
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().


The documentation for this class was generated from the following files: