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

DLLaterTierHierarchyTool to apply the later-tier hierarchy DL networks. More...

#include "DLLaterTierHierarchyTool.h"

Inheritance diagram for lar_dl_content::DLLaterTierHierarchyTool:
lar_dl_content::DLBaseHierarchyTool

Classes

struct  DLLaterTierNetworkParams
 
struct  NormalisationLimits
 

Public Member Functions

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)
 
 DLLaterTierHierarchyTool ()
 Default constructor. 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)
 
bool IsShowerVertexUpstream (const HierarchyPfo &parentHierarchyPfo, const HierarchyPfo &childHierarchyPfo) const
 Whether the shower POI is the endpoint closest to the neutrino vertex. More...
 
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. More...
 
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) More...
 
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) More...
 
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_parentEndRegionNParticles, m_parentEndRegionRToWall) More...
 
void SetEndRegionRToWall (const pandora::CartesianVector &parentEndPos, DLLaterTierNetworkParams &laterTierNetworkParams) const
 Set the m_parentEndRegionRToWall DLLaterTierNetworkParam. More...
 
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) More...
 
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 extrapolation position. More...
 
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. More...
 
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) More...
 
void SetParentConnectionPointVars (const HierarchyPfo &parentHierarchyPfo, DLLaterTierNetworkParams &laterTierNetworkParams) const
 Set the parent connection point DLLaterTierNetworkParams (m_parentCPNUpstreamHits, m_parentCPNDownstreamHits, m_parentCPNHitRatio, m_parentCPEigenvalueRatio, m_parentCPOpeningAngle) More...
 
void NormaliseNetworkParams (DLLaterTierNetworkParams &laterTierNetworkParams) const
 Shift and normalise the later tier network parameters. More...
 
float ClassifyTrackTrack (const DLLaterTierNetworkParams &edgeParamsUpUp, const DLLaterTierNetworkParams &edgeParamsUpDown, const DLLaterTierNetworkParams &edgeParamsDownUp, const DLLaterTierNetworkParams &edgeParamsDownDown)
 Apply the track-track parent-child classification network. More...
 
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 orientation), signal (with the wrong orientation) or background. More...
 
float ClassifyTrackShower (const DLLaterTierNetworkParams &edgeParamsUp, const DLLaterTierNetworkParams &edgeParamsDown)
 Apply the track-shower parent-child classification network. More...
 
pandora::FloatVector ClassifyTrackShowerEdge (const DLLaterTierNetworkParams &edgeParams, const DLLaterTierNetworkParams &otherEdgeParams)
 Apply the track-shower orientation edge network - determine whether an edge is signal (with correct orientation), signal (with the wrong orientation) or background. More...
 

Private Attributes

std::string m_trackTrackBranchModelName
 the name of the track-track edge model file More...
 
std::string m_trackTrackClassifierModelName
 the name of the track-track classification model file More...
 
std::string m_trackShowerBranchModelName
 the name of the track-shower edge model file More...
 
std::string m_trackShowerClassifierModelName
 the name of the track-shower classification model file More...
 
LArDLHelper::TorchModel m_trackTrackBranchModel
 the track-track edge model More...
 
LArDLHelper::TorchModel m_trackTrackClassifierModel
 the track-track classification model More...
 
LArDLHelper::TorchModel m_trackShowerBranchModel
 the track-shower edge model More...
 
LArDLHelper::TorchModel m_trackShowerClassifierModel
 the track-shower classification model More...
 
bool m_trainingMode
 whether to run the tool in training mode More...
 
float m_trajectoryStepSize
 the size of the steps taken to trace the parent trajectory More...
 
float m_connectionBuffer
 the 'is child connected?' threshold More...
 
float m_searchRegion
 the dimensions of the box used to obtain the up/downstream 3D hit groups More...
 
bool m_normalise
 whether to normalise the network parameters More...
 
NormalisationLimits m_normLimits
 struct of the normalisation limits More...
 

Detailed Description

DLLaterTierHierarchyTool to apply the later-tier hierarchy DL networks.

Definition at line 23 of file DLLaterTierHierarchyTool.h.

Constructor & Destructor Documentation

lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierHierarchyTool ( )

Default constructor.

Definition at line 59 of file DLLaterTierHierarchyTool.cc.

59  :
61  m_trainingMode(false),
64  m_searchRegion(10.f),
65  m_normalise(true)
66 {
67 }
bool m_normalise
whether to normalise the network parameters
DLBaseHierarchyTool()
Default constructor.
float m_connectionBuffer
the &#39;is child connected?&#39; threshold
TFile f
Definition: plotHisto.C:6
float m_searchRegion
the dimensions of the box used to obtain the up/downstream 3D hit groups
float m_trajectoryStepSize
the size of the steps taken to trace the parent trajectory
bool m_trainingMode
whether to run the tool in training mode

Member Function Documentation

StatusCode lar_dl_content::DLLaterTierHierarchyTool::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
private

Function to calculate the DLLaterTierNetworkParams.

Parameters
pAlgorithma pointer to the pandora algorithm
parentHierarchyPfothe HierarchyPfo object of the parent pfo
childHierarchyPfothe HierarchyPfo object of the child pfo
pNeutrinoPfoa pointer to the neutrino pfo
useUpstreamForParentwhether the parent POI is that closest to the nu vertex
useUpstreamForChildwhether the child POI is that closest to the nu vertex
laterTierNetworkParamsthe later tier network parameters to fill
Returns
a StatusCode to signify whether the network variables could be correctly calculated

Definition at line 175 of file DLLaterTierHierarchyTool.cc.

References lar_dl_content::HierarchyPfo::GetDownstreamPoint(), lar_dl_content::HierarchyPfo::GetPfo(), lar_dl_content::HierarchyPfo::GetUpstreamPoint(), lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_childIsPOIClosestToNu, m_normalise, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentIsPOIClosestToNu, NormaliseNetworkParams(), SetConnectionParams(), SetEndRegionParams(), SetOvershootParams(), SetParentConnectionPointVars(), and SetVertexParams().

Referenced by Run().

178 {
179  // Pick out neutrino vertex
180  if (pNeutrinoPfo->GetVertexList().empty())
181  return STATUS_CODE_NOT_INITIALIZED;
182 
183  const Vertex *const pNeutrinoVertex(LArPfoHelper::GetVertex(pNeutrinoPfo));
184  const CartesianVector nuVertex(
185  pNeutrinoVertex->GetPosition().GetX(), pNeutrinoVertex->GetPosition().GetY(), pNeutrinoVertex->GetPosition().GetZ());
186 
187  // Pick out the correct pfo vertex/direction
188  // Parent POI is a postulate endpoint
189  // Child POI is a postulate startpoint
190  const ExtremalPoint &parentStart(useUpstreamForParent ? parentHierarchyPfo.GetDownstreamPoint() : parentHierarchyPfo.GetUpstreamPoint());
191  const ExtremalPoint &parentEnd(useUpstreamForParent ? parentHierarchyPfo.GetUpstreamPoint() : parentHierarchyPfo.GetDownstreamPoint());
192  const ExtremalPoint &childStart(useUpstreamForChild ? childHierarchyPfo.GetUpstreamPoint() : childHierarchyPfo.GetDownstreamPoint());
193 
194  // Check that we could actually calculate pfo vertex/direction, return if not
195  if (!parentStart.IsSet())
196  {
197  return STATUS_CODE_NOT_INITIALIZED;
198  }
199  if (!parentEnd.IsSet())
200  {
201  return STATUS_CODE_NOT_INITIALIZED;
202  }
203  if (!childStart.IsSet())
204  {
205  return STATUS_CODE_NOT_INITIALIZED;
206  }
207 
208  // Set laterTierNetworkParams
209  laterTierNetworkParams.m_parentIsPOIClosestToNu = useUpstreamForParent ? 1.f : 0.f;
210  laterTierNetworkParams.m_childIsPOIClosestToNu = useUpstreamForChild ? 1.f : 0.f;
211  this->SetVertexParams(nuVertex, parentStart.GetPosition(), parentEnd.GetPosition(), childStart.GetPosition(), laterTierNetworkParams);
212  this->SetEndRegionParams(pAlgorithm, parentHierarchyPfo.GetPfo(), parentEnd.GetPosition(), laterTierNetworkParams);
213  this->SetConnectionParams(parentHierarchyPfo, parentStart.GetPosition(), childStart, laterTierNetworkParams);
214  this->SetOvershootParams(parentStart, parentEnd, childStart, laterTierNetworkParams);
215  this->SetParentConnectionPointVars(parentHierarchyPfo, laterTierNetworkParams);
216 
217  // Normalise
218  if (m_normalise)
219  this->NormaliseNetworkParams(laterTierNetworkParams);
220 
221  return STATUS_CODE_SUCCESS;
222 }
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)
void SetParentConnectionPointVars(const HierarchyPfo &parentHierarchyPfo, DLLaterTierNetworkParams &laterTierNetworkParams) const
Set the parent connection point DLLaterTierNetworkParams (m_parentCPNUpstreamHits, m_parentCPNDownstreamHits, m_parentCPNHitRatio, m_parentCPEigenvalueRatio, m_parentCPOpeningAngle)
bool m_normalise
whether to normalise the network parameters
void NormaliseNetworkParams(DLLaterTierNetworkParams &laterTierNetworkParams) const
Shift and normalise the later tier network parameters.
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...
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)
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)
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
float lar_dl_content::DLLaterTierHierarchyTool::ClassifyTrackShower ( const DLLaterTierNetworkParams edgeParamsUp,
const DLLaterTierNetworkParams edgeParamsDown 
)
private

Apply the track-shower parent-child classification network.

Parameters
edgeParamsUpthe DLLaterTierNetworkParams for the parent upstream POI
edgeParamsDownthe DLLaterTierNetworkParams for the parent upstream POI
Returns
the network score (how likely to be signal)

Definition at line 550 of file DLLaterTierHierarchyTool.cc.

References ClassifyTrackShowerEdge(), lar_dl_content::LArDLHelper::Forward(), lar_dl_content::LArDLHelper::InitialiseInput(), and m_trackShowerClassifierModel.

Referenced by Run().

551 {
552  // Invoke branch model for each edge
553  const FloatVector outputUp(this->ClassifyTrackShowerEdge(edgeParamsUp, edgeParamsDown));
554  const FloatVector outputDown(this->ClassifyTrackShowerEdge(edgeParamsDown, edgeParamsUp));
555 
556  // Invoke classifier model for final output
558  LArDLHelper::InitialiseInput({1, 6}, input);
559 
560  int insertIndex(0);
561 
562  for (const FloatVector &edgeOutput : {outputUp, outputDown})
563  {
564  for (int i = 0; i < 3; ++i)
565  {
566  input[0][insertIndex] = edgeOutput.at(i);
567  ++insertIndex;
568  }
569  }
570 
573  const torch::TensorAccessor<float, 2> outputAccessor = output.accessor<float, 2>();
574 
575  return outputAccessor[0][0];
576 }
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...
LArDLHelper::TorchModel m_trackShowerClassifierModel
the track-shower classification model
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
FloatVector lar_dl_content::DLLaterTierHierarchyTool::ClassifyTrackShowerEdge ( const DLLaterTierNetworkParams edgeParams,
const DLLaterTierNetworkParams otherEdgeParams 
)
private

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

Parameters
edgeParamsthe DLLaterTierNetworkParams of the edge to classify
otherEdgeParamsthe DLLaterTierNetworkParams of another edge
Returns
the float vector of (signal, wrong orientation, background) scores

Definition at line 580 of file DLLaterTierHierarchyTool.cc.

References lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::AddCommonParamsToInput(), lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::AddOrientationParamsToInput(), lar_dl_content::LArDLHelper::Forward(), lar_dl_content::LArDLHelper::InitialiseInput(), and m_trackShowerBranchModel.

Referenced by ClassifyTrackShower().

581 {
583  LArDLHelper::InitialiseInput({1, 47}, input);
584 
585  int insertIndex(0);
586  edgeParams.AddCommonParamsToInput(insertIndex, input);
587  edgeParams.AddOrientationParamsToInput(insertIndex, input);
588  otherEdgeParams.AddOrientationParamsToInput(insertIndex, input);
589 
592 
593  const torch::TensorAccessor<float, 2> outputAccessor(output.accessor<float, 2>());
594 
595  return {outputAccessor[0][0], outputAccessor[0][1], outputAccessor[0][2]};
596 }
LArDLHelper::TorchModel m_trackShowerBranchModel
the track-shower edge model
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
float lar_dl_content::DLLaterTierHierarchyTool::ClassifyTrackTrack ( const DLLaterTierNetworkParams edgeParamsUpUp,
const DLLaterTierNetworkParams edgeParamsUpDown,
const DLLaterTierNetworkParams edgeParamsDownUp,
const DLLaterTierNetworkParams edgeParamsDownDown 
)
private

Apply the track-track parent-child classification network.

Parameters
edgeParamsUpUpthe DLLaterTierNetworkParams for the parent upstream POI and child upstream POI
edgeParamsUpDownthe DLLaterTierNetworkParams for the parent upstream POI and child downstream POI
edgeParamsDownUpthe DLLaterTierNetworkParams for the parent downstream POI and child upstream POI
edgeParamsDownDownthe DLLaterTierNetworkParams for the parent downstream POI and child downstream POI
Returns
the network score (how likely to be signal)

Definition at line 494 of file DLLaterTierHierarchyTool.cc.

References ClassifyTrackTrackEdge(), lar_dl_content::LArDLHelper::Forward(), lar_dl_content::LArDLHelper::InitialiseInput(), and m_trackTrackClassifierModel.

Referenced by Run().

496 {
497  // Invoke branch model for each edge
498  const FloatVector outputUpUp(this->ClassifyTrackTrackEdge(edgeParamsUpUp, edgeParamsUpDown, edgeParamsDownUp, edgeParamsDownDown));
499  const FloatVector outputUpDown(this->ClassifyTrackTrackEdge(edgeParamsUpDown, edgeParamsDownUp, edgeParamsDownDown, edgeParamsUpUp));
500  const FloatVector outputDownUp(this->ClassifyTrackTrackEdge(edgeParamsDownUp, edgeParamsDownDown, edgeParamsUpUp, edgeParamsUpDown));
501  const FloatVector outputDownDown(this->ClassifyTrackTrackEdge(edgeParamsDownDown, edgeParamsUpUp, edgeParamsUpDown, edgeParamsDownUp));
502 
503  // Invoke classifier model for final output
505  LArDLHelper::InitialiseInput({1, 12}, input);
506 
507  int insertIndex(0);
508 
509  for (const FloatVector &edgeOutput : {outputUpUp, outputUpDown, outputDownUp, outputDownDown})
510  {
511  for (int i = 0; i < 3; ++i)
512  {
513  input[0][insertIndex] = edgeOutput.at(i);
514  ++insertIndex;
515  }
516  }
517 
520  const torch::TensorAccessor<float, 2> outputAccessor = output.accessor<float, 2>();
521 
522  return outputAccessor[0][0];
523 }
static void Forward(TorchModel &model, const TorchInputVector &input, TorchOutput &output)
Run a deep learning model.
Definition: LArDLHelper.cc:41
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...
LArDLHelper::TorchModel m_trackTrackClassifierModel
the track-track classification model
static void InitialiseInput(const at::IntArrayRef dimensions, TorchInput &tensor)
Create a torch input tensor.
Definition: LArDLHelper.cc:34
FloatVector lar_dl_content::DLLaterTierHierarchyTool::ClassifyTrackTrackEdge ( const DLLaterTierNetworkParams edgeParams,
const DLLaterTierNetworkParams otherEdgeParams1,
const DLLaterTierNetworkParams otherEdgeParams2,
const DLLaterTierNetworkParams otherEdgeParams3 
)
private

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

Parameters
edgeParamsthe DLLaterTierNetworkParams of the edge to classify
otherEdgeParams1the DLLaterTierNetworkParams of another edge
otherEdgeParams2the DLLaterTierNetworkParams of another another edge
otherEdgeParams3the DLLaterTierNetworkParams of another another another edge
Returns
the float vector of (signal, wrong orientation, background) scores

Definition at line 527 of file DLLaterTierHierarchyTool.cc.

References lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::AddCommonParamsToInput(), lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::AddOrientationParamsToInput(), lar_dl_content::LArDLHelper::Forward(), lar_dl_content::LArDLHelper::InitialiseInput(), and m_trackTrackBranchModel.

Referenced by ClassifyTrackTrack().

529 {
531  LArDLHelper::InitialiseInput({1, 89}, input);
532 
533  int insertIndex(0);
534  edgeParams.AddCommonParamsToInput(insertIndex, input);
535  edgeParams.AddOrientationParamsToInput(insertIndex, input);
536  otherEdgeParams1.AddOrientationParamsToInput(insertIndex, input);
537  otherEdgeParams2.AddOrientationParamsToInput(insertIndex, input);
538  otherEdgeParams3.AddOrientationParamsToInput(insertIndex, input);
539 
542 
543  const torch::TensorAccessor<float, 2> outputAccessor(output.accessor<float, 2>());
544 
545  return {outputAccessor[0][0], outputAccessor[0][1], outputAccessor[0][2]};
546 }
static void Forward(TorchModel &model, const TorchInputVector &input, TorchOutput &output)
Run a deep learning model.
Definition: LArDLHelper.cc:41
LArDLHelper::TorchModel m_trackTrackBranchModel
the track-track edge model
static void InitialiseInput(const at::IntArrayRef dimensions, TorchInput &tensor)
Create a torch input tensor.
Definition: LArDLHelper.cc:34
bool lar_dl_content::DLLaterTierHierarchyTool::DoesConnect ( const pandora::CartesianVector &  boundary1,
const pandora::CartesianVector &  boundary2,
const pandora::CartesianVector &  testPoint 
) const
private

Return whether an input position connects to a line defined by two endpoints.

Parameters
boundary1one end position
boundary2the other end position
testPointthe input position
Returns
whether the input position connects to the line defined by the two input endpoints

Definition at line 353 of file DLLaterTierHierarchyTool.cc.

References f, and m_connectionBuffer.

Referenced by SetConnectionParams().

354 {
355  const CartesianVector displacement(boundary2 - boundary1);
356  const double segmentLength(displacement.GetMagnitude());
357  const CartesianVector unitVector(displacement * (1.f / segmentLength));
358  const double l(unitVector.GetDotProduct(testPoint - boundary1));
359 
360  if ((l < 0.f) || (l > segmentLength))
361  return false;
362 
363  const double t(unitVector.GetCrossProduct(testPoint - boundary1).GetMagnitudeSquared());
364 
366  return false;
367 
368  return true;
369 }
float m_connectionBuffer
the &#39;is child connected?&#39; threshold
TFile f
Definition: plotHisto.C:6
std::pair< CartesianVector, bool > lar_dl_content::DLLaterTierHierarchyTool::ExtrapolateChildToParent ( const pandora::CartesianVector &  parentPosition,
const ExtremalPoint childStart 
) const
private

Project the (parentPos - childStartPos) vector onto the child direction axis to obtain an extrapolation position.

Parameters
parentPositionthe parent position
childStartthe assumed child pfo startpoint
Returns
the (extrapolated position, whether the extrpolation was backwards wrt the child direction) pair

Definition at line 342 of file DLLaterTierHierarchyTool.cc.

References f, lar_dl_content::ExtremalPoint::GetDirection(), and lar_dl_content::ExtremalPoint::GetPosition().

Referenced by SetConnectionParams(), and SetOvershootParams().

343 {
344  const double extrapDistance((parentPos - childStart.GetPosition()).GetDotProduct(childStart.GetDirection()));
345  const bool backwardsExtrap(extrapDistance < 0.f);
346  const CartesianVector extrapPoint(childStart.GetPosition() + (childStart.GetDirection() * extrapDistance));
347 
348  return std::pair<CartesianVector, bool>({extrapPoint, backwardsExtrap});
349 }
TFile f
Definition: plotHisto.C:6
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 SetEndRegionParams(), and lar_dl_content::DLPrimaryHierarchyTool::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
bool lar_dl_content::DLLaterTierHierarchyTool::IsShowerVertexUpstream ( const HierarchyPfo parentHierarchyPfo,
const HierarchyPfo childHierarchyPfo 
) const
private

Whether the shower POI is the endpoint closest to the neutrino vertex.

Parameters
parentHierarchyPfothe HierarchyPfo object of the parent pfo
childHierarchyPfothe HierarchyPfo object of the child pfo
Returns
whether the shower POI is in the upstream position

Definition at line 128 of file DLLaterTierHierarchyTool.cc.

References lar_dl_content::HierarchyPfo::GetDownstreamPoint(), lar_dl_content::HierarchyPfo::GetPfo(), lar_dl_content::ExtremalPoint::GetPosition(), lar_dl_content::HierarchyPfo::GetUpstreamPoint(), and lar_dl_content::ExtremalPoint::IsSet().

Referenced by Run().

129 {
130  const bool isUpstreamSet(childHierarchyPfo.GetUpstreamPoint().IsSet());
131  const bool isDownstreamSet(childHierarchyPfo.GetDownstreamPoint().IsSet());
132 
133  if (isUpstreamSet && !isDownstreamSet)
134  return true;
135 
136  if (!isUpstreamSet && isDownstreamSet)
137  return false;
138 
139  // By design, showers should have at least one set
140  if (!isUpstreamSet && !isDownstreamSet)
141  throw StatusCodeException(STATUS_CODE_FAILURE);
142 
143  CartesianPointVector parentPositions3D;
144  LArPfoHelper::GetCoordinateVector(parentHierarchyPfo.GetPfo(), TPC_3D, parentPositions3D);
145 
146  float upstreamSepSq(std::numeric_limits<float>::max());
147  float downstreamSepSq(std::numeric_limits<float>::max());
148 
149  for (const CartesianVector &parentPosition3D : parentPositions3D)
150  {
151  const float thisUpstreamSepSq((parentPosition3D - childHierarchyPfo.GetUpstreamPoint().GetPosition()).GetMagnitudeSquared());
152  const float thisDownstreamSepSq((parentPosition3D - childHierarchyPfo.GetDownstreamPoint().GetPosition()).GetMagnitudeSquared());
153 
154  upstreamSepSq = std::min(upstreamSepSq, thisUpstreamSepSq);
155  downstreamSepSq = std::min(downstreamSepSq, thisDownstreamSepSq);
156  }
157 
158  return (upstreamSepSq < downstreamSepSq);
159 }
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 lar_dl_content::DLPrimaryHierarchyTool::NormaliseNetworkParams(), and 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::DLLaterTierHierarchyTool::NormaliseNetworkParams ( DLLaterTierNetworkParams laterTierNetworkParams) const
private

Shift and normalise the later tier network parameters.

Parameters
laterTierNetworkParamthe input later tier network parameters

Definition at line 460 of file DLLaterTierHierarchyTool.cc.

References lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_childCPDCA, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_childCPDCAMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_childCPDCAMin, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_childCPExtrapDistance, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_childCPExtrapDistanceMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_childCPExtrapDistanceMin, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_childCPLRatio, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_childCPLRatioMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_childCPLRatioMin, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_childNSpacepoints, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_childNuVertexSep, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_childTrackScore, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_doesChildConnect, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_doesChildConnectMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_doesChildConnectMin, m_normLimits, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_nSpacepointsMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_nSpacepointsMin, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_nuVertexSepMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_nuVertexSepMin, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_overshootDCAMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_overshootDCAMin, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_overshootEndDCA, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_overshootEndL, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_overshootLMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_overshootLMin, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_overshootStartDCA, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_overshootStartL, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentCPEigenvalueRatio, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentCPEigenvalueRatioMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentCPEigenvalueRatioMin, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentCPNDownstreamHits, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentCPNHitRatio, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentCPNHitRatioMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentCPNHitRatioMin, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentCPNHitsMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentCPNHitsMin, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentCPNUpstreamHits, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentCPOpeningAngle, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentCPOpeningAngleMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentCPOpeningAngleMin, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentEndRegionNHits, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentEndRegionNHitsMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentEndRegionNHitsMin, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentEndRegionNParticles, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentEndRegionNParticlesMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentEndRegionNParticlesMin, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentEndRegionRToWall, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentEndRegionRToWallMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentEndRegionRToWallMin, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentNSpacepoints, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentNuVertexSep, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentTrackScore, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_separation3D, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_separation3DMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_separation3DMin, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_trackScoreMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_trackScoreMin, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_vertexSeparation, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_vertexSepMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_vertexSepMin, and lar_dl_content::DLBaseHierarchyTool::NormaliseNetworkParam().

Referenced by CalculateNetworkVariables().

461 {
462  this->NormaliseNetworkParam(m_normLimits.m_trackScoreMin, m_normLimits.m_trackScoreMax, laterTierNetworkParams.m_parentTrackScore);
463  this->NormaliseNetworkParam(m_normLimits.m_trackScoreMin, m_normLimits.m_trackScoreMax, laterTierNetworkParams.m_childTrackScore);
464  this->NormaliseNetworkParam(m_normLimits.m_nSpacepointsMin, m_normLimits.m_nSpacepointsMax, laterTierNetworkParams.m_parentNSpacepoints);
465  this->NormaliseNetworkParam(m_normLimits.m_nSpacepointsMin, m_normLimits.m_nSpacepointsMax, laterTierNetworkParams.m_childNSpacepoints);
466  this->NormaliseNetworkParam(m_normLimits.m_separation3DMin, m_normLimits.m_separation3DMax, laterTierNetworkParams.m_separation3D);
467  this->NormaliseNetworkParam(m_normLimits.m_nuVertexSepMin, m_normLimits.m_nuVertexSepMax, laterTierNetworkParams.m_parentNuVertexSep);
468  this->NormaliseNetworkParam(m_normLimits.m_nuVertexSepMin, m_normLimits.m_nuVertexSepMax, laterTierNetworkParams.m_childNuVertexSep);
469  this->NormaliseNetworkParam(m_normLimits.m_parentEndRegionNHitsMin, m_normLimits.m_parentEndRegionNHitsMax, laterTierNetworkParams.m_parentEndRegionNHits);
471  laterTierNetworkParams.m_parentEndRegionNParticles);
472  this->NormaliseNetworkParam(
473  m_normLimits.m_parentEndRegionRToWallMin, m_normLimits.m_parentEndRegionRToWallMax, laterTierNetworkParams.m_parentEndRegionRToWall);
474  this->NormaliseNetworkParam(m_normLimits.m_vertexSepMin, m_normLimits.m_vertexSepMax, laterTierNetworkParams.m_vertexSeparation);
475  this->NormaliseNetworkParam(m_normLimits.m_doesChildConnectMin, m_normLimits.m_doesChildConnectMax, laterTierNetworkParams.m_doesChildConnect);
476  this->NormaliseNetworkParam(m_normLimits.m_overshootDCAMin, m_normLimits.m_overshootDCAMax, laterTierNetworkParams.m_overshootStartDCA);
477  this->NormaliseNetworkParam(m_normLimits.m_overshootLMin, m_normLimits.m_overshootLMax, laterTierNetworkParams.m_overshootStartL);
478  this->NormaliseNetworkParam(m_normLimits.m_overshootDCAMin, m_normLimits.m_overshootDCAMax, laterTierNetworkParams.m_overshootEndDCA);
479  this->NormaliseNetworkParam(m_normLimits.m_overshootLMin, m_normLimits.m_overshootLMax, laterTierNetworkParams.m_overshootEndL);
480  this->NormaliseNetworkParam(m_normLimits.m_childCPDCAMin, m_normLimits.m_childCPDCAMax, laterTierNetworkParams.m_childCPDCA);
481  this->NormaliseNetworkParam(
482  m_normLimits.m_childCPExtrapDistanceMin, m_normLimits.m_childCPExtrapDistanceMax, laterTierNetworkParams.m_childCPExtrapDistance);
483  this->NormaliseNetworkParam(m_normLimits.m_childCPLRatioMin, m_normLimits.m_childCPLRatioMax, laterTierNetworkParams.m_childCPLRatio);
484  this->NormaliseNetworkParam(m_normLimits.m_parentCPNHitsMin, m_normLimits.m_parentCPNHitsMax, laterTierNetworkParams.m_parentCPNUpstreamHits);
485  this->NormaliseNetworkParam(m_normLimits.m_parentCPNHitsMin, m_normLimits.m_parentCPNHitsMax, laterTierNetworkParams.m_parentCPNDownstreamHits);
486  this->NormaliseNetworkParam(m_normLimits.m_parentCPNHitRatioMin, m_normLimits.m_parentCPNHitRatioMax, laterTierNetworkParams.m_parentCPNHitRatio);
488  laterTierNetworkParams.m_parentCPEigenvalueRatio);
489  this->NormaliseNetworkParam(m_normLimits.m_parentCPOpeningAngleMin, m_normLimits.m_parentCPOpeningAngleMax, laterTierNetworkParams.m_parentCPOpeningAngle);
490 }
float m_doesChildConnectMin
the m_doesChildConnect minimum range boundary
float m_childCPExtrapDistanceMax
the m_childCPExtrapDistance maximum range boundary
float m_childCPLRatioMin
the m_childCPLRatio minimum range boundary
float m_trackScoreMin
the m_parent(child)TrackScore minimum range boundary
float m_parentCPNHitRatioMax
the m_parentCPNHitRatio maximum range boundary
float m_childCPExtrapDistanceMin
the m_childCPExtrapDistance minimum range boundary
float m_separation3DMin
the m_separation3D minimum range boundary
float m_parentCPEigenvalueRatioMin
the m_parentCPEigenvalueRatio minimum range boundary
float m_parentCPOpeningAngleMax
the m_parentCPOpeningAngle maximum range boundary
float m_nuVertexSepMax
the m_parent(child)NuVertexSep maximum range boundary
float m_parentCPNHitsMax
the m_parentCPNUp(Down)streamHits maximum range boundary
float m_parentCPOpeningAngleMin
the m_parentCPOpeningAngle minimum range boundary
float m_childCPDCAMin
the m_childCPDCA minimum range boundary
float m_parentCPEigenvalueRatioMax
the m_parentCPEigenvalueRatio maximum range boundary
NormalisationLimits m_normLimits
struct of the normalisation limits
float m_overshootDCAMin
the m_overshootStart(End)DCA minimum range boundary
float m_overshootLMin
the m_overshootStart(End)L 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_doesChildConnectMax
the m_doesChildConnect maximum range boundary
float m_overshootLMax
the m_overshootStart(End)L maximum range boundary
float m_trackScoreMax
the m_parent(child)TrackScore maximum range boundary
float m_nSpacepointsMin
the m_parent(child)NSpacepoints minimum range boundary
float m_vertexSepMax
the m_vertexSeparation maximum range boundary
float m_parentCPNHitRatioMin
the m_parentCPNHitRatio minimum range boundary
float m_nSpacepointsMax
the m_parent(child)NSpacepoints maximum range boundary
float m_parentEndRegionNHitsMin
the m_parentEndRegionNHits minimum range boundary
float m_separation3DMax
the m_separation3D maximum range boundary
float m_parentCPNHitsMin
the m_parentCPNUp(Down)streamHits minimum range boundary
float m_parentEndRegionRToWallMax
the m_parentEndRegionRToWall maximum range boundary
float m_parentEndRegionNParticlesMin
the m_parentEndRegionNParticles minimum range boundary
float m_parentEndRegionNHitsMax
the m_parentEndRegionNHits maximum range boundary
float m_parentEndRegionNParticlesMax
the m_parentEndRegionNParticles maximum range boundary
float m_childCPLRatioMax
the m_childCPLRatio maximum range boundary
float m_childCPDCAMax
the m_childCPDCA maximum range boundary
float m_overshootDCAMax
the m_overshootStart(End)DCA maximum range boundary
float m_nuVertexSepMin
the m_parent(child)NuVertexSep minimum range boundary
float m_parentEndRegionRToWallMin
the m_parentEndRegionRToWall minimum range boundary
float m_vertexSepMin
the m_vertexSeparation minimum range boundary
StatusCode lar_dl_content::DLLaterTierHierarchyTool::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 600 of file DLLaterTierHierarchyTool.cc.

References lar_dl_content::LArDLHelper::LoadModel(), lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_childCPDCAMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_childCPDCAMin, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_childCPExtrapDistanceMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_childCPExtrapDistanceMin, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_childCPLRatioMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_childCPLRatioMin, m_connectionBuffer, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_doesChildConnectMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_doesChildConnectMin, m_normalise, m_normLimits, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_nSpacepointsMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_nSpacepointsMin, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_nuVertexSepMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_nuVertexSepMin, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_overshootDCAMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_overshootDCAMin, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_overshootLMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_overshootLMin, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentCPEigenvalueRatioMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentCPEigenvalueRatioMin, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentCPNHitRatioMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentCPNHitRatioMin, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentCPNHitsMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentCPNHitsMin, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentCPOpeningAngleMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentCPOpeningAngleMin, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentEndRegionNHitsMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentEndRegionNHitsMin, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentEndRegionNParticlesMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentEndRegionNParticlesMin, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentEndRegionRToWallMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_parentEndRegionRToWallMin, m_searchRegion, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_separation3DMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_separation3DMin, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_trackScoreMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_trackScoreMin, m_trackShowerBranchModel, m_trackShowerBranchModelName, m_trackShowerClassifierModel, m_trackShowerClassifierModelName, m_trackTrackBranchModel, m_trackTrackBranchModelName, m_trackTrackClassifierModel, m_trackTrackClassifierModelName, m_trainingMode, m_trajectoryStepSize, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_vertexSepMax, lar_dl_content::DLLaterTierHierarchyTool::NormalisationLimits::m_vertexSepMin, and lar_dl_content::DLBaseHierarchyTool::ReadSettings().

601 {
602  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "TrainingMode", m_trainingMode));
603  PANDORA_RETURN_RESULT_IF_AND_IF(
604  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "TrajectoryStepSize", m_trajectoryStepSize));
605  PANDORA_RETURN_RESULT_IF_AND_IF(
606  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ConnectionBuffer", m_connectionBuffer));
607  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "SearchRegion", m_searchRegion));
608  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "Normalise", m_normalise));
609 
610  PANDORA_RETURN_RESULT_IF_AND_IF(
611  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "TrackScoreMin", m_normLimits.m_trackScoreMin));
612  PANDORA_RETURN_RESULT_IF_AND_IF(
613  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "TrackScoreMax", m_normLimits.m_trackScoreMax));
614  PANDORA_RETURN_RESULT_IF_AND_IF(
615  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "NSpacepointsMin", m_normLimits.m_nSpacepointsMin));
616  PANDORA_RETURN_RESULT_IF_AND_IF(
617  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "NSpacepointsMax", m_normLimits.m_nSpacepointsMax));
618  PANDORA_RETURN_RESULT_IF_AND_IF(
619  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "Separation3DMin", m_normLimits.m_separation3DMin));
620  PANDORA_RETURN_RESULT_IF_AND_IF(
621  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "Separation3DMax", m_normLimits.m_separation3DMax));
622  PANDORA_RETURN_RESULT_IF_AND_IF(
623  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "NuVertexSepMin", m_normLimits.m_nuVertexSepMin));
624  PANDORA_RETURN_RESULT_IF_AND_IF(
625  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "NuVertexSepMax", m_normLimits.m_nuVertexSepMax));
626  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
627  XmlHelper::ReadValue(xmlHandle, "ParentEndRegionNHitsMin", m_normLimits.m_parentEndRegionNHitsMin));
628  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
629  XmlHelper::ReadValue(xmlHandle, "ParentEndRegionNHitsMax", m_normLimits.m_parentEndRegionNHitsMax));
630  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
631  XmlHelper::ReadValue(xmlHandle, "ParentEndRegionNParticlesMin", m_normLimits.m_parentEndRegionNParticlesMin));
632  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
633  XmlHelper::ReadValue(xmlHandle, "ParentEndRegionNParticlesMax", m_normLimits.m_parentEndRegionNParticlesMax));
634  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
635  XmlHelper::ReadValue(xmlHandle, "ParentEndRegionRToWallMin", m_normLimits.m_parentEndRegionRToWallMin));
636  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
637  XmlHelper::ReadValue(xmlHandle, "ParentEndRegionRToWallMax", m_normLimits.m_parentEndRegionRToWallMax));
638  PANDORA_RETURN_RESULT_IF_AND_IF(
639  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "VertexSepMin", m_normLimits.m_vertexSepMin));
640  PANDORA_RETURN_RESULT_IF_AND_IF(
641  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "VertexSepMax", m_normLimits.m_vertexSepMax));
642  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
643  XmlHelper::ReadValue(xmlHandle, "DoesChildConnectMin", m_normLimits.m_doesChildConnectMin));
644  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
645  XmlHelper::ReadValue(xmlHandle, "DoesChildConnectMax", m_normLimits.m_doesChildConnectMax));
646  PANDORA_RETURN_RESULT_IF_AND_IF(
647  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "OvershootDCAMin", m_normLimits.m_overshootDCAMin));
648  PANDORA_RETURN_RESULT_IF_AND_IF(
649  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "OvershootDCAMax", m_normLimits.m_overshootDCAMax));
650  PANDORA_RETURN_RESULT_IF_AND_IF(
651  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "OvershootLMin", m_normLimits.m_overshootLMin));
652  PANDORA_RETURN_RESULT_IF_AND_IF(
653  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "OvershootLMax", m_normLimits.m_overshootLMax));
654  PANDORA_RETURN_RESULT_IF_AND_IF(
655  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ChildCPDCAMin", m_normLimits.m_childCPDCAMin));
656  PANDORA_RETURN_RESULT_IF_AND_IF(
657  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ChildCPDCAMax", m_normLimits.m_childCPDCAMax));
658  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
659  XmlHelper::ReadValue(xmlHandle, "ChildCPExtrapDistanceMin", m_normLimits.m_childCPExtrapDistanceMin));
660  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
661  XmlHelper::ReadValue(xmlHandle, "ChildCPExtrapDistanceMax", m_normLimits.m_childCPExtrapDistanceMax));
662  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
663  XmlHelper::ReadValue(xmlHandle, "ChildCPLRatioMin", m_normLimits.m_childCPLRatioMin));
664  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
665  XmlHelper::ReadValue(xmlHandle, "ChildCPLRatioMax", m_normLimits.m_childCPLRatioMax));
666  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
667  XmlHelper::ReadValue(xmlHandle, "ParentCPNHitsMin", m_normLimits.m_parentCPNHitsMin));
668  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
669  XmlHelper::ReadValue(xmlHandle, "ParentCPNHitsMax", m_normLimits.m_parentCPNHitsMax));
670  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
671  XmlHelper::ReadValue(xmlHandle, "ParentCPNHitRatioMin", m_normLimits.m_parentCPNHitRatioMin));
672  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
673  XmlHelper::ReadValue(xmlHandle, "ParentCPNHitRatioMax", m_normLimits.m_parentCPNHitRatioMax));
674  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
675  XmlHelper::ReadValue(xmlHandle, "ParentCPEigenvalueRatioMin", m_normLimits.m_parentCPEigenvalueRatioMin));
676  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
677  XmlHelper::ReadValue(xmlHandle, "ParentCPEigenvalueRatioMax", m_normLimits.m_parentCPEigenvalueRatioMax));
678  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
679  XmlHelper::ReadValue(xmlHandle, "ParentCPOpeningAngleMin", m_normLimits.m_parentCPOpeningAngleMin));
680  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
681  XmlHelper::ReadValue(xmlHandle, "ParentCPOpeningAngleMax", m_normLimits.m_parentCPOpeningAngleMax));
682 
683  if (!m_trainingMode)
684  {
685  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "TrackTrackBranchModelName", m_trackTrackBranchModelName));
686  m_trackTrackBranchModelName = LArFileHelper::FindFileInPath(m_trackTrackBranchModelName, "FW_SEARCH_PATH");
687  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, LArDLHelper::LoadModel(m_trackTrackBranchModelName, m_trackTrackBranchModel));
688 
689  PANDORA_RETURN_RESULT_IF(
690  STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "TrackTrackClassifierModelName", m_trackTrackClassifierModelName));
691  m_trackTrackClassifierModelName = LArFileHelper::FindFileInPath(m_trackTrackClassifierModelName, "FW_SEARCH_PATH");
692  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, LArDLHelper::LoadModel(m_trackTrackClassifierModelName, m_trackTrackClassifierModel));
693 
694  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "TrackShowerBranchModelName", m_trackShowerBranchModelName));
695  m_trackShowerBranchModelName = LArFileHelper::FindFileInPath(m_trackShowerBranchModelName, "FW_SEARCH_PATH");
696  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, LArDLHelper::LoadModel(m_trackShowerBranchModelName, m_trackShowerBranchModel));
697 
698  PANDORA_RETURN_RESULT_IF(
699  STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "TrackShowerClassifierModelName", m_trackShowerClassifierModelName));
700  m_trackShowerClassifierModelName = LArFileHelper::FindFileInPath(m_trackShowerClassifierModelName, "FW_SEARCH_PATH");
701  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, LArDLHelper::LoadModel(m_trackShowerClassifierModelName, m_trackShowerClassifierModel));
702  }
703 
704  return DLBaseHierarchyTool::ReadSettings(xmlHandle);
705 }
float m_doesChildConnectMin
the m_doesChildConnect minimum range boundary
float m_childCPExtrapDistanceMax
the m_childCPExtrapDistance maximum range boundary
float m_childCPLRatioMin
the m_childCPLRatio minimum range boundary
float m_trackScoreMin
the m_parent(child)TrackScore minimum range boundary
float m_parentCPNHitRatioMax
the m_parentCPNHitRatio maximum range boundary
float m_childCPExtrapDistanceMin
the m_childCPExtrapDistance minimum range boundary
float m_separation3DMin
the m_separation3D minimum range boundary
float m_parentCPEigenvalueRatioMin
the m_parentCPEigenvalueRatio minimum range boundary
LArDLHelper::TorchModel m_trackShowerBranchModel
the track-shower edge model
float m_parentCPOpeningAngleMax
the m_parentCPOpeningAngle maximum range boundary
std::string m_trackShowerBranchModelName
the name of the track-shower edge model file
float m_nuVertexSepMax
the m_parent(child)NuVertexSep maximum range boundary
float m_parentCPNHitsMax
the m_parentCPNUp(Down)streamHits maximum range boundary
bool m_normalise
whether to normalise the network parameters
float m_parentCPOpeningAngleMin
the m_parentCPOpeningAngle minimum range boundary
float m_childCPDCAMin
the m_childCPDCA minimum range boundary
float m_connectionBuffer
the &#39;is child connected?&#39; threshold
float m_parentCPEigenvalueRatioMax
the m_parentCPEigenvalueRatio maximum range boundary
NormalisationLimits m_normLimits
struct of the normalisation limits
float m_overshootDCAMin
the m_overshootStart(End)DCA minimum range boundary
LArDLHelper::TorchModel m_trackShowerClassifierModel
the track-shower classification model
std::string m_trackTrackBranchModelName
the name of the track-track edge model file
float m_overshootLMin
the m_overshootStart(End)L minimum range boundary
float m_doesChildConnectMax
the m_doesChildConnect maximum range boundary
float m_overshootLMax
the m_overshootStart(End)L maximum range boundary
float m_trackScoreMax
the m_parent(child)TrackScore maximum range boundary
float m_searchRegion
the dimensions of the box used to obtain the up/downstream 3D hit groups
float m_nSpacepointsMin
the m_parent(child)NSpacepoints minimum range boundary
float m_vertexSepMax
the m_vertexSeparation maximum range boundary
float m_parentCPNHitRatioMin
the m_parentCPNHitRatio minimum range boundary
float m_nSpacepointsMax
the m_parent(child)NSpacepoints maximum range boundary
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
float m_parentEndRegionNHitsMin
the m_parentEndRegionNHits minimum range boundary
float m_separation3DMax
the m_separation3D maximum range boundary
float m_parentCPNHitsMin
the m_parentCPNUp(Down)streamHits minimum range boundary
float m_parentEndRegionRToWallMax
the m_parentEndRegionRToWall maximum range boundary
static pandora::StatusCode LoadModel(const std::string &filename, TorchModel &model)
Loads a deep learning model.
Definition: LArDLHelper.cc:16
float m_trajectoryStepSize
the size of the steps taken to trace the parent trajectory
float m_parentEndRegionNParticlesMin
the m_parentEndRegionNParticles minimum range boundary
float m_parentEndRegionNHitsMax
the m_parentEndRegionNHits maximum range boundary
bool m_trainingMode
whether to run the tool in training mode
LArDLHelper::TorchModel m_trackTrackClassifierModel
the track-track classification model
std::string m_trackShowerClassifierModelName
the name of the track-shower classification model file
LArDLHelper::TorchModel m_trackTrackBranchModel
the track-track edge model
float m_parentEndRegionNParticlesMax
the m_parentEndRegionNParticles maximum range boundary
float m_childCPLRatioMax
the m_childCPLRatio maximum range boundary
float m_childCPDCAMax
the m_childCPDCA maximum range boundary
float m_overshootDCAMax
the m_overshootStart(End)DCA maximum range boundary
std::string m_trackTrackClassifierModelName
the name of the track-track classification model file
float m_nuVertexSepMin
the m_parent(child)NuVertexSep minimum range boundary
float m_parentEndRegionRToWallMin
the m_parentEndRegionRToWall minimum range boundary
float m_vertexSepMin
the m_vertexSeparation minimum range boundary
StatusCode lar_dl_content::DLLaterTierHierarchyTool::Run ( const pandora::Algorithm *const  pAlgorithm,
const pandora::ParticleFlowObject *const  pNeutrinoPfo,
const HierarchyPfo parentHierarchyPfo,
const HierarchyPfo childHierarchyPfo,
std::vector< DLLaterTierNetworkParams > &  networkParamVector,
float &  laterTierScore 
)

Definition at line 71 of file DLLaterTierHierarchyTool.cc.

References CalculateNetworkVariables(), ClassifyTrackShower(), ClassifyTrackTrack(), lar_dl_content::HierarchyPfo::GetPfo(), IsShowerVertexUpstream(), m_trainingMode, SetCommonParams(), and lar_dl_content::DLBaseHierarchyTool::SetDetectorBoundaries().

Referenced by lar_dl_content::DLNeutrinoHierarchyAlgorithm::BuildPandoraHierarchy(), and lar_dl_content::DLNeutrinoHierarchyAlgorithm::GetLaterTierScore().

74 {
75  networkParamVector.clear();
76  laterTierScore = std::numeric_limits<float>::lowest();
77 
78  this->SetDetectorBoundaries();
79 
80  // Get the common params i.e. independent of postulated orientation
81  const std::pair<float, float> trackScoreParams(
82  {LArPfoHelper::GetTrackScore(parentHierarchyPfo.GetPfo()), LArPfoHelper::GetTrackScore(childHierarchyPfo.GetPfo())});
83  const std::pair<float, float> nSpacepointsParams(
84  {LArPfoHelper::GetNumberOfThreeDHits(parentHierarchyPfo.GetPfo()), LArPfoHelper::GetNumberOfThreeDHits(childHierarchyPfo.GetPfo())});
85  const float separation3D(LArPfoHelper::GetThreeDSeparation(parentHierarchyPfo.GetPfo(), childHierarchyPfo.GetPfo()));
86 
87  const bool isChildTrack(childHierarchyPfo.GetPfo()->GetParticleId() == 13);
88  std::vector<bool> childOrientationVector(
89  isChildTrack ? std::vector<bool>({true, false}) : std::vector<bool>({this->IsShowerVertexUpstream(parentHierarchyPfo, childHierarchyPfo)}));
90 
91  // Set network params
92  for (const bool &useUpstreamForParent : {true, false})
93  {
94  for (const bool &useUpstreamForChild : childOrientationVector)
95  {
96  DLLaterTierNetworkParams edgeParams;
97 
98  // Set common params
99  this->SetCommonParams(trackScoreParams, nSpacepointsParams, separation3D, edgeParams);
100 
101  // Get orientation dependent params
102  const StatusCode statusCode(this->CalculateNetworkVariables(
103  pAlgorithm, parentHierarchyPfo, childHierarchyPfo, pNeutrinoPfo, useUpstreamForParent, useUpstreamForChild, edgeParams));
104 
105  if (statusCode != STATUS_CODE_SUCCESS)
106  return statusCode;
107 
108  // Add these to our output vector
109  networkParamVector.emplace_back(edgeParams);
110  }
111  }
112 
113  // Now run the model!
114  if (!m_trainingMode)
115  {
116  if (isChildTrack)
117  laterTierScore =
118  this->ClassifyTrackTrack(networkParamVector.at(0), networkParamVector.at(1), networkParamVector.at(2), networkParamVector.at(3));
119  else
120  laterTierScore = this->ClassifyTrackShower(networkParamVector.at(0), networkParamVector.at(1));
121  }
122 
123  return STATUS_CODE_SUCCESS;
124 }
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.
bool IsShowerVertexUpstream(const HierarchyPfo &parentHierarchyPfo, const HierarchyPfo &childHierarchyPfo) const
Whether the shower POI is the endpoint closest to the neutrino vertex.
float ClassifyTrackTrack(const DLLaterTierNetworkParams &edgeParamsUpUp, const DLLaterTierNetworkParams &edgeParamsUpDown, const DLLaterTierNetworkParams &edgeParamsDownUp, const DLLaterTierNetworkParams &edgeParamsDownDown)
Apply the track-track parent-child classification network.
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)
bool m_trainingMode
whether to run the tool in training mode
float ClassifyTrackShower(const DLLaterTierNetworkParams &edgeParamsUp, const DLLaterTierNetworkParams &edgeParamsDown)
Apply the track-shower parent-child classification network.
void SetDetectorBoundaries()
Set the detector boundaries.
void lar_dl_content::DLLaterTierHierarchyTool::SetCommonParams ( const std::pair< float, float > &  trackScoreParams,
const std::pair< float, float > &  nSpacepointsParams,
const float  separation3D,
DLLaterTierNetworkParams laterTierNetworkParams 
) const
private

Set the orientation independent DLLaterTierNetworkParams (m_parentTrackScore, m_childTrackScore, m_parentNSpacepoints, m_childNSpacepoints, m_separation3D)

Parameters
trackScoreParamsthe track score (parent, child) pair
nSpacepointsParamsthe number of 3D hit (parent, child) pair
separation3Dthe smallest 3D distance between the parent and child 3D hits
laterTierNetworkParamsthe later tier network parameters to fill

Definition at line 163 of file DLLaterTierHierarchyTool.cc.

References lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_childNSpacepoints, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_childTrackScore, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentNSpacepoints, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentTrackScore, and lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_separation3D.

Referenced by Run().

165 {
166  laterTierNetworkParams.m_parentTrackScore = trackScoreParams.first;
167  laterTierNetworkParams.m_childTrackScore = trackScoreParams.second;
168  laterTierNetworkParams.m_parentNSpacepoints = nSpacepointsParams.first;
169  laterTierNetworkParams.m_childNSpacepoints = nSpacepointsParams.second;
170  laterTierNetworkParams.m_separation3D = separation3D;
171 }
void lar_dl_content::DLLaterTierHierarchyTool::SetConnectionParams ( const HierarchyPfo parentHierarchyPfo,
const pandora::CartesianVector &  parentStartPos,
const ExtremalPoint childStart,
DLLaterTierNetworkParams laterTierNetworkParams 
) const
private

Set the child connection DLLaterTierNetworkParams (m_doesChildConnect, m_connectionPoint, m_connectionDirection, m_childCPDCA, m_childCPExtrapDistance, m_childCPLRatio)

Parameters
parentHierarchyPfothe HierarchyPfo object of the parent pfo
parentStartPosthe assumed parent pfo start position
childStartthe assumed child startpoint
laterTierNetworkParamsthe later tier network parameters to fill

Definition at line 269 of file DLLaterTierHierarchyTool.cc.

References DoesConnect(), ExtrapolateChildToParent(), f, lar_dl_content::ExtremalPoint::GetPosition(), lar_dl_content::HierarchyPfo::GetSlidingFitResult(), lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_childCPDCA, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_childCPExtrapDistance, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_childCPLRatio, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_connectionDirection, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_connectionPoint, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_doesChildConnect, and m_trajectoryStepSize.

Referenced by CalculateNetworkVariables().

271 {
272  // Get fit of parent
273  const ThreeDSlidingFitResult &slidingFitResult(parentHierarchyPfo.GetSlidingFitResult());
274 
275  // Now walk along track, starting from parentStartPos
276  // I want this to be interpreted as l = 0 so have to alter pandora def
277  const bool startFromMin((parentStartPos - slidingFitResult.GetGlobalMinLayerPosition()).GetMagnitudeSquared() <
278  (parentStartPos - slidingFitResult.GetGlobalMaxLayerPosition()).GetMagnitudeSquared());
279  const float minL(slidingFitResult.GetLongitudinalDisplacement(slidingFitResult.GetGlobalMinLayerPosition()));
280  const float maxL(slidingFitResult.GetLongitudinalDisplacement(slidingFitResult.GetGlobalMaxLayerPosition()));
281 
282  if (std::fabs(minL - maxL) < std::numeric_limits<float>::epsilon())
283  return;
284 
285  const int nSteps(std::floor(std::fabs(maxL - minL) / m_trajectoryStepSize));
286 
287  // Keep track of these in loop
288  float slidingL(startFromMin ? minL : 0.f);
289  float trackLength(0.f);
290  float minDCA(std::numeric_limits<float>::max());
291  float lengthAtConnection(0.f);
292 
293  laterTierNetworkParams.m_doesChildConnect = 0.f;
294 
295  for (int i = 0; i < nSteps; i++)
296  {
297  float firstL(slidingL), secondL(slidingL + m_trajectoryStepSize);
298  float firstEvalL(startFromMin ? firstL : (maxL - firstL));
299  float secondEvalL(startFromMin ? secondL : (maxL - secondL));
300  CartesianVector firstPosition(0.f, 0.f, 0.f);
301  CartesianVector secondPosition(0.f, 0.f, 0.f);
302 
303  if ((slidingFitResult.GetGlobalFitPosition(firstEvalL, firstPosition) != STATUS_CODE_SUCCESS) ||
304  (slidingFitResult.GetGlobalFitPosition(secondEvalL, secondPosition) != STATUS_CODE_SUCCESS))
305  {
306  slidingL += m_trajectoryStepSize;
307  continue;
308  }
309 
310  // Get trajectory position
311  const CartesianVector midPoint((secondPosition + firstPosition) * 0.5f);
312 
313  // Extrap child vertex to parent position
314  const std::pair<CartesianVector, bool> extrap(this->ExtrapolateChildToParent(midPoint, childStart));
315  const float thisDCA((midPoint - extrap.first).GetMagnitude());
316 
317  if (thisDCA < minDCA)
318  {
319  if (this->DoesConnect(firstPosition, secondPosition, extrap.first))
320  {
321  minDCA = thisDCA;
322  laterTierNetworkParams.m_doesChildConnect = 1.f;
323  laterTierNetworkParams.m_connectionPoint = midPoint;
324  laterTierNetworkParams.m_connectionDirection = (secondPosition - firstPosition).GetUnitVector();
325  laterTierNetworkParams.m_childCPDCA = thisDCA;
326  laterTierNetworkParams.m_childCPExtrapDistance =
327  (extrap.first - childStart.GetPosition()).GetMagnitude() * (extrap.second ? 1.f : (-1.f));
328  lengthAtConnection = trackLength + (midPoint - firstPosition).GetMagnitude();
329  }
330  }
331 
332  slidingL += m_trajectoryStepSize;
333  trackLength += (secondPosition - firstPosition).GetMagnitude();
334  }
335 
336  if (std::fabs(laterTierNetworkParams.m_doesChildConnect - 1.f) < std::numeric_limits<float>::epsilon())
337  laterTierNetworkParams.m_childCPLRatio = lengthAtConnection / trackLength;
338 }
TFile f
Definition: plotHisto.C:6
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 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 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 Run(), and lar_dl_content::DLPrimaryHierarchyTool::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::DLLaterTierHierarchyTool::SetEndRegionParams ( const pandora::Algorithm *const  pAlgorithm,
const pandora::ParticleFlowObject *const  pParentPfo,
const pandora::CartesianVector &  parentEndPos,
DLLaterTierNetworkParams laterTierNetworkParams 
) const
private

Set the parent endpoint region DLLaterTierNetworkParams (m_parentEndRegionNHits, m_parentEndRegionNParticles, m_parentEndRegionRToWall)

Parameters
pAlgorithma pointer to the pandora algorithm
pParentPfoa pointer to the parent pfo
parentEndPosthe assumed parent pfo end position
laterTierNetworkParamsthe later tier network parameters to fill

Definition at line 236 of file DLLaterTierHierarchyTool.cc.

References lar_dl_content::DLBaseHierarchyTool::GetParticleInfoAboutPfoPosition(), lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentEndRegionNHits, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentEndRegionNParticles, and SetEndRegionRToWall().

Referenced by CalculateNetworkVariables().

238 {
239  std::pair<float, float> endRegionParams(this->GetParticleInfoAboutPfoPosition(pAlgorithm, pParentPfo, parentEndPos));
240 
241  laterTierNetworkParams.m_parentEndRegionNHits = endRegionParams.first;
242  laterTierNetworkParams.m_parentEndRegionNParticles = endRegionParams.second;
243 
244  this->SetEndRegionRToWall(parentEndPos, laterTierNetworkParams);
245 }
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 SetEndRegionRToWall(const pandora::CartesianVector &parentEndPos, DLLaterTierNetworkParams &laterTierNetworkParams) const
Set the m_parentEndRegionRToWall DLLaterTierNetworkParam.
void lar_dl_content::DLLaterTierHierarchyTool::SetEndRegionRToWall ( const pandora::CartesianVector &  parentEndPos,
DLLaterTierNetworkParams laterTierNetworkParams 
) const
private

Set the m_parentEndRegionRToWall DLLaterTierNetworkParam.

Parameters
parentEndPosthe assumed parent pfo end position
laterTierNetworkParamsthe later tier network parameters to fill

Definition at line 249 of file DLLaterTierHierarchyTool.cc.

References lar_dl_content::DLBaseHierarchyTool::m_detectorBoundaries, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentEndRegionRToWall, lar_content::LArGeometryHelper::DetectorBoundaries::m_xBoundaries, lar_content::LArGeometryHelper::DetectorBoundaries::m_yBoundaries, and lar_content::LArGeometryHelper::DetectorBoundaries::m_zBoundaries.

Referenced by SetEndRegionParams().

250 {
251  float closestDistance(std::numeric_limits<float>::max());
252 
253  for (int iAxis : {0, 1, 2})
254  {
255  const float parentCoord(iAxis == 0 ? parentEndPos.GetX() : iAxis == 1 ? parentEndPos.GetY() : parentEndPos.GetZ());
256  const std::pair<float, float> &boundary(iAxis == 0 ? m_detectorBoundaries.m_xBoundaries
257  : iAxis == 1 ? m_detectorBoundaries.m_yBoundaries
259  const float dimensionMin(std::min((parentCoord - boundary.first), (boundary.second - parentCoord)));
260 
261  closestDistance = std::min(closestDistance, dimensionMin);
262  }
263 
264  laterTierNetworkParams.m_parentEndRegionRToWall = closestDistance;
265 }
std::pair< float, float > m_yBoundaries
{low, high} y boundaries of the detector
std::pair< float, float > m_xBoundaries
{low, high} x boundaries of the detector
std::pair< float, float > m_zBoundaries
{low, high} z boundaries of the detector
LArGeometryHelper::DetectorBoundaries m_detectorBoundaries
the detector boundaries
void lar_dl_content::DLLaterTierHierarchyTool::SetOvershootParams ( const ExtremalPoint parentStart,
const ExtremalPoint parentEnd,
const ExtremalPoint childStart,
DLLaterTierNetworkParams laterTierNetworkParams 
) const
private

Set the overshoot DLLaterTierNetworkParams (m_overshootStartDCA, m_overshootStartL, m_overshootEndDCA, m_overshootEndL)

Parameters
parentStartthe assumed parent pfo startpoint
parentEndthe assumed parent pfo endpoint
childStartthe assumed child pfo startpoint
laterTierNetworkParamsthe later tier network parameters to fill

Definition at line 373 of file DLLaterTierHierarchyTool.cc.

References ExtrapolateChildToParent(), lar_dl_content::ExtremalPoint::GetDirection(), lar_dl_content::ExtremalPoint::GetPosition(), lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_doesChildConnect, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_overshootEndDCA, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_overshootEndL, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_overshootStartDCA, and lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_overshootStartL.

Referenced by CalculateNetworkVariables().

375 {
376  if (std::fabs(laterTierNetworkParams.m_doesChildConnect - 1.f) < std::numeric_limits<float>::epsilon())
377  return;
378 
379  // Let's start at the very beginning, a very good place to start
380  const std::pair<CartesianVector, bool> extrapStart(this->ExtrapolateChildToParent(parentStart.GetPosition(), childStart));
381  laterTierNetworkParams.m_overshootStartDCA =
382  (extrapStart.first - parentStart.GetPosition()).GetMagnitude() * (extrapStart.second ? 1.f : (-1.f));
383  laterTierNetworkParams.m_overshootStartL =
384  std::fabs((childStart.GetPosition() - parentStart.GetPosition()).GetDotProduct(parentStart.GetDirection()));
385 
386  // Now end
387  const std::pair<CartesianVector, bool> extrapEnd(this->ExtrapolateChildToParent(parentEnd.GetPosition(), childStart));
388  laterTierNetworkParams.m_overshootEndDCA = (extrapEnd.first - parentEnd.GetPosition()).GetMagnitude() * (extrapEnd.second ? 1.f : (-1.f));
389  laterTierNetworkParams.m_overshootEndL =
390  std::fabs((childStart.GetPosition() - parentEnd.GetPosition()).GetDotProduct(parentEnd.GetDirection()));
391 }
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...
void lar_dl_content::DLLaterTierHierarchyTool::SetParentConnectionPointVars ( const HierarchyPfo parentHierarchyPfo,
DLLaterTierNetworkParams laterTierNetworkParams 
) const
private

Set the parent connection point DLLaterTierNetworkParams (m_parentCPNUpstreamHits, m_parentCPNDownstreamHits, m_parentCPNHitRatio, m_parentCPEigenvalueRatio, m_parentCPOpeningAngle)

Parameters
parentHierarchyPfothe HierarchyPfo object of the parent pfo
laterTierNetworkParamsthe later tier network parameters to fill

Definition at line 395 of file DLLaterTierHierarchyTool.cc.

References f, lar_dl_content::HierarchyPfo::GetPfo(), lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_connectionDirection, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_connectionPoint, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_doesChildConnect, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentCPEigenvalueRatio, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentCPNDownstreamHits, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentCPNHitRatio, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentCPNUpstreamHits, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentCPOpeningAngle, and m_searchRegion.

Referenced by CalculateNetworkVariables().

396 {
397  if (std::fabs(laterTierNetworkParams.m_doesChildConnect - 1.f) > std::numeric_limits<float>::epsilon())
398  return;
399 
400  // Use direction to current direction to split spacepoints into two groups
401  CartesianPointVector parentPositions3D;
402  LArPfoHelper::GetCoordinateVector(parentHierarchyPfo.GetPfo(), TPC_3D, parentPositions3D);
403 
404  CartesianPointVector upstreamGroup, downstreamGroup;
405 
406  for (const CartesianVector &parentPosition : parentPositions3D)
407  {
408  const CartesianVector displacement(parentPosition - laterTierNetworkParams.m_connectionPoint);
409 
410  // Do box as quicker than circle with mag.
411  if ((std::fabs(displacement.GetX()) > m_searchRegion) || (std::fabs(displacement.GetY()) > m_searchRegion) ||
412  (std::fabs(displacement.GetZ()) > m_searchRegion))
413  {
414  continue;
415  }
416 
417  // Assign to group
418  const float thisL(laterTierNetworkParams.m_connectionDirection.GetDotProduct(displacement));
419  CartesianPointVector &group(thisL > 0.f ? downstreamGroup : upstreamGroup);
420  group.emplace_back(parentPosition);
421  }
422 
423  laterTierNetworkParams.m_parentCPNUpstreamHits = upstreamGroup.size();
424  laterTierNetworkParams.m_parentCPNDownstreamHits = downstreamGroup.size();
425 
426  if (upstreamGroup.empty() || downstreamGroup.empty())
427  return;
428 
429  laterTierNetworkParams.m_parentCPNHitRatio = laterTierNetworkParams.m_parentCPNDownstreamHits / laterTierNetworkParams.m_parentCPNUpstreamHits;
430 
431  // Now PCA magic
432  try
433  {
434  CartesianVector centroidUp(0.f, 0.f, 0.f);
435  CartesianVector centroidDown(0.f, 0.f, 0.f);
436  LArPcaHelper::EigenVectors eigenVecsUp, eigenVecsDown;
437  LArPcaHelper::EigenValues eigenValuesUp(0.f, 0.f, 0.f);
438  LArPcaHelper::EigenValues eigenValuesDown(0.f, 0.f, 0.f);
439 
440  LArPcaHelper::RunPca(upstreamGroup, centroidUp, eigenValuesUp, eigenVecsUp);
441  LArPcaHelper::RunPca(downstreamGroup, centroidDown, eigenValuesDown, eigenVecsDown);
442 
443  // Get opening angle from first eigenvectors (this is the longitudinal one) - straight would be around 180
444  laterTierNetworkParams.m_parentCPOpeningAngle = eigenVecsUp.at(0).GetOpeningAngle(eigenVecsDown.at(0)) * (180.f / 3.14);
445 
446  // Get average transverse eigenvalues, get ratio
447  const float avTransEVaUp((eigenValuesUp.GetY() + eigenValuesUp.GetZ()) * 0.5f);
448  const float avTransEVaDown((eigenValuesDown.GetY() + eigenValuesDown.GetZ()) * 0.5f);
449 
450  laterTierNetworkParams.m_parentCPEigenvalueRatio = avTransEVaUp < std::numeric_limits<double>::epsilon() ? 0.f : avTransEVaDown / avTransEVaUp;
451  }
452  catch (...)
453  {
454  return;
455  }
456 }
pandora::CartesianVector EigenValues
Definition: LArPcaHelper.h:24
TFile f
Definition: plotHisto.C:6
float m_searchRegion
the dimensions of the box used to obtain the up/downstream 3D hit groups
std::vector< pandora::CartesianVector > EigenVectors
Definition: LArPcaHelper.h:25
void lar_dl_content::DLLaterTierHierarchyTool::SetVertexParams ( const pandora::CartesianVector &  nuVertex,
const pandora::CartesianVector &  parentStartPos,
const pandora::CartesianVector &  parentEndPos,
const pandora::CartesianVector &  childStartPos,
DLLaterTierNetworkParams laterTierNetworkParams 
) const
private

Set the vertex related DLLaterTierNetworkParams (m_parentNuVertexSep, m_childNuVertexSep, m_vertexSeparation)

Parameters
nuVertexthe neutrino vertex position
parentStartPosthe assumed parent pfo start position
parentEndPosthe assumed parent pfo end position
childStartPosthe assumed child pfo start position
laterTierNetworkParamsthe later tier network parameters to fill

Definition at line 226 of file DLLaterTierHierarchyTool.cc.

References lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_childNuVertexSep, lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_parentNuVertexSep, and lar_dl_content::DLLaterTierHierarchyTool::DLLaterTierNetworkParams::m_vertexSeparation.

Referenced by CalculateNetworkVariables().

228 {
229  laterTierNetworkParams.m_parentNuVertexSep = (parentStartPos - nuVertex).GetMagnitude();
230  laterTierNetworkParams.m_childNuVertexSep = (childStartPos - nuVertex).GetMagnitude();
231  laterTierNetworkParams.m_vertexSeparation = (parentEndPos - childStartPos).GetMagnitude();
232 }

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

float lar_dl_content::DLLaterTierHierarchyTool::m_connectionBuffer
private

the 'is child connected?' threshold

Definition at line 326 of file DLLaterTierHierarchyTool.h.

Referenced by DoesConnect(), and ReadSettings().

LArGeometryHelper::DetectorBoundaries lar_dl_content::DLBaseHierarchyTool::m_detectorBoundaries
protectedinherited
bool lar_dl_content::DLLaterTierHierarchyTool::m_normalise
private

whether to normalise the network parameters

Definition at line 329 of file DLLaterTierHierarchyTool.h.

Referenced by CalculateNetworkVariables(), and ReadSettings().

NormalisationLimits lar_dl_content::DLLaterTierHierarchyTool::m_normLimits
private

struct of the normalisation limits

Definition at line 330 of file DLLaterTierHierarchyTool.h.

Referenced by NormaliseNetworkParams(), and ReadSettings().

pandora::StringVector lar_dl_content::DLBaseHierarchyTool::m_pfoListNames
protectedinherited
float lar_dl_content::DLLaterTierHierarchyTool::m_searchRegion
private

the dimensions of the box used to obtain the up/downstream 3D hit groups

Definition at line 327 of file DLLaterTierHierarchyTool.h.

Referenced by ReadSettings(), and SetParentConnectionPointVars().

LArDLHelper::TorchModel lar_dl_content::DLLaterTierHierarchyTool::m_trackShowerBranchModel
private

the track-shower edge model

Definition at line 321 of file DLLaterTierHierarchyTool.h.

Referenced by ClassifyTrackShowerEdge(), and ReadSettings().

std::string lar_dl_content::DLLaterTierHierarchyTool::m_trackShowerBranchModelName
private

the name of the track-shower edge model file

Definition at line 317 of file DLLaterTierHierarchyTool.h.

Referenced by ReadSettings().

LArDLHelper::TorchModel lar_dl_content::DLLaterTierHierarchyTool::m_trackShowerClassifierModel
private

the track-shower classification model

Definition at line 322 of file DLLaterTierHierarchyTool.h.

Referenced by ClassifyTrackShower(), and ReadSettings().

std::string lar_dl_content::DLLaterTierHierarchyTool::m_trackShowerClassifierModelName
private

the name of the track-shower classification model file

Definition at line 318 of file DLLaterTierHierarchyTool.h.

Referenced by ReadSettings().

LArDLHelper::TorchModel lar_dl_content::DLLaterTierHierarchyTool::m_trackTrackBranchModel
private

the track-track edge model

Definition at line 319 of file DLLaterTierHierarchyTool.h.

Referenced by ClassifyTrackTrackEdge(), and ReadSettings().

std::string lar_dl_content::DLLaterTierHierarchyTool::m_trackTrackBranchModelName
private

the name of the track-track edge model file

Definition at line 315 of file DLLaterTierHierarchyTool.h.

Referenced by ReadSettings().

LArDLHelper::TorchModel lar_dl_content::DLLaterTierHierarchyTool::m_trackTrackClassifierModel
private

the track-track classification model

Definition at line 320 of file DLLaterTierHierarchyTool.h.

Referenced by ClassifyTrackTrack(), and ReadSettings().

std::string lar_dl_content::DLLaterTierHierarchyTool::m_trackTrackClassifierModelName
private

the name of the track-track classification model file

Definition at line 316 of file DLLaterTierHierarchyTool.h.

Referenced by ReadSettings().

bool lar_dl_content::DLLaterTierHierarchyTool::m_trainingMode
private

whether to run the tool in training mode

Definition at line 324 of file DLLaterTierHierarchyTool.h.

Referenced by ReadSettings(), and Run().

float lar_dl_content::DLLaterTierHierarchyTool::m_trajectoryStepSize
private

the size of the steps taken to trace the parent trajectory

Definition at line 325 of file DLLaterTierHierarchyTool.h.

Referenced by ReadSettings(), and SetConnectionParams().

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: