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

DLBaseHierarchyTool to calculate variables related to the initial shower region. More...

#include "DLBaseHierarchyTool.h"

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

Public Member Functions

 DLBaseHierarchyTool ()
 Default constructor. More...
 

Protected Member Functions

pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 
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...
 

Detailed Description

DLBaseHierarchyTool to calculate variables related to the initial shower region.

Definition at line 27 of file DLBaseHierarchyTool.h.

Constructor & Destructor Documentation

lar_dl_content::DLBaseHierarchyTool::DLBaseHierarchyTool ( )

Default constructor.

Definition at line 27 of file DLBaseHierarchyTool.cc.

References m_areBoundariesSet.

27  :
29  m_pfoListNames({"TrackParticles3D", "ShowerParticles3D"}),
30  m_areBoundariesSet(false)
31 {
32 }
TFile f
Definition: plotHisto.C:6
float m_vertexRegionRadiusSq
the radius (squared) in which to search for particle hits
pandora::StringVector m_pfoListNames
the input pfo list name vector
bool m_areBoundariesSet
whether the detector boundaries have been set

Member Function Documentation

std::pair< float, float > lar_dl_content::DLBaseHierarchyTool::GetParticleInfoAboutPfoPosition ( const pandora::Algorithm *const  pAlgorithm,
const pandora::ParticleFlowObject *const  pPfo,
const pandora::CartesianVector &  pointOfInterest 
) const
protected

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 m_pfoListNames, and m_vertexRegionRadiusSq.

Referenced by lar_dl_content::DLLaterTierHierarchyTool::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
void lar_dl_content::DLBaseHierarchyTool::NormaliseNetworkParam ( const float  minLimit,
const float  maxLimit,
float &  networkParam 
) const
protected

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 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 }
StatusCode lar_dl_content::DLBaseHierarchyTool::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
protected

Definition at line 111 of file DLBaseHierarchyTool.cc.

References m_pfoListNames, and m_vertexRegionRadiusSq.

Referenced by lar_dl_content::DLPrimaryHierarchyTool::ReadSettings(), and lar_dl_content::DLLaterTierHierarchyTool::ReadSettings().

112 {
113  StatusCode statCode(XmlHelper::ReadValue(xmlHandle, "VertexRegionRadius", m_vertexRegionRadiusSq));
114 
115  if (statCode == STATUS_CODE_SUCCESS)
116  {
118  }
119  else if (statCode != STATUS_CODE_NOT_FOUND)
120  {
121  return statCode;
122  }
123 
124  PANDORA_RETURN_RESULT_IF_AND_IF(
125  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "PfoListNames", m_pfoListNames));
126 
127  return STATUS_CODE_SUCCESS;
128 }
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::SetDetectorBoundaries ( )
protected

Set the detector boundaries.

Definition at line 36 of file DLBaseHierarchyTool.cc.

References m_areBoundariesSet, and m_detectorBoundaries.

Referenced by lar_dl_content::DLLaterTierHierarchyTool::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

Member Data Documentation

bool lar_dl_content::DLBaseHierarchyTool::m_areBoundariesSet
protected

whether the detector boundaries have been set

Definition at line 68 of file DLBaseHierarchyTool.h.

Referenced by DLBaseHierarchyTool(), and SetDetectorBoundaries().

LArGeometryHelper::DetectorBoundaries lar_dl_content::DLBaseHierarchyTool::m_detectorBoundaries
protected
pandora::StringVector lar_dl_content::DLBaseHierarchyTool::m_pfoListNames
protected

the input pfo list name vector

Definition at line 66 of file DLBaseHierarchyTool.h.

Referenced by GetParticleInfoAboutPfoPosition(), ReadSettings(), and lar_dl_content::DLPrimaryHierarchyTool::ReadSettings().

float lar_dl_content::DLBaseHierarchyTool::m_vertexRegionRadiusSq
protected

the radius (squared) in which to search for particle hits

Definition at line 65 of file DLBaseHierarchyTool.h.

Referenced by GetParticleInfoAboutPfoPosition(), and ReadSettings().


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