Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
lar_content::HitAngleVertexSelectionAlgorithm Class Reference

HitAngleVertexSelectionAlgorithm class. More...

#include "HitAngleVertexSelectionAlgorithm.h"

Inheritance diagram for lar_content::HitAngleVertexSelectionAlgorithm:
Collaboration diagram for lar_content::HitAngleVertexSelectionAlgorithm:

Public Types

typedef std::vector< VertexScoreVertexScoreList
 
typedef std::vector< SlidingFitDataSlidingFitDataList
 
typedef std::vector< ShowerClusterShowerClusterList
 
typedef KDTreeNodeInfoT< const pandora::CaloHit *, 2 > HitKDNode2D
 
typedef std::vector< HitKDNode2DHitKDNode2DList
 
typedef KDTreeLinkerAlgo< const pandora::CaloHit *, 2 > HitKDTree2D
 
typedef std::map< pandora::HitType, const pandora::ClusterList & > ClusterListMap
 Map array of cluster lists for passing to tools.
 
typedef std::map< pandora::HitType, const SlidingFitDataListSlidingFitDataListMap
 Map of sliding fit data lists for passing to tools.
 
typedef std::map< pandora::HitType, const ShowerClusterListShowerClusterListMap
 Map of shower cluster lists for passing to tools.
 
typedef std::map< pandora::HitType, const std::reference_wrapper< HitKDTree2D > > KDTreeMap
 Map array of hit kd trees for passing to tools.
 
typedef MvaFeatureTool< const VertexSelectionBaseAlgorithm *const, const pandora::Vertex *const, const SlidingFitDataListMap &, const ClusterListMap &, const KDTreeMap &, const ShowerClusterListMap &, const float, float & > VertexFeatureTool
 The base type for the vertex feature tools.
 

Public Member Functions

 HitAngleVertexSelectionAlgorithm ()
 Default constructor.
 
const std::string & GetType () const
 Get the type.
 
const std::string & GetInstanceName () const
 Get the instance name.
 
const PandoraGetPandora () const
 Get the associated pandora instance.
 

Protected Member Functions

virtual void FilterVertexList (const pandora::VertexList *const pInputVertexList, HitKDTree2D &kdTreeU, HitKDTree2D &kdTreeV, HitKDTree2D &kdTreeW, pandora::VertexVector &filteredVertices) const
 Filter the input list of vertices to obtain a reduced number of vertex candidates.
 
virtual void GetBeamConstants (const pandora::VertexVector &vertexVector, BeamConstants &beamConstants) const
 Get the beam score constants for a provided list of candidate vertices.
 
void GetClusterLists (const pandora::StringVector &inputClusterListNames, pandora::ClusterList &clusterListU, pandora::ClusterList &clusterListV, pandora::ClusterList &clusterListW) const
 Get the cluster lists.
 
void CalculateClusterSlidingFits (const pandora::ClusterList &inputClusterList, const unsigned int minClusterCaloHits, const unsigned int slidingFitWindow, SlidingFitDataList &slidingFitDataList) const
 Calculate the cluster sliding fits.
 
float GetBeamDeweightingScore (const BeamConstants &beamConstants, const pandora::Vertex *const pVertex) const
 Get the beam deweighting score for a vertex.
 
bool IsBeamModeOn () const
 Whether algorithm is running in beam mode, assuming neutrinos travel in positive z-direction.
 
float GetVertexEnergy (const pandora::Vertex *const pVertex, const KDTreeMap &kdTreeMap) const
 Calculate the energy of a vertex candidate by summing values from all three planes.
 
float VertexHitEnergy (const pandora::Vertex *const pVertex, const pandora::HitType hitType, HitKDTree2D &kdTree) const
 Finds the energy of the nearest hit to the vertex candidate in this view.
 
virtual StatusCode Initialize ()
 Perform any operations that must occur after reading settings, but before running the process.
 
virtual StatusCode Reset ()
 Perform any operations when pandora is reset, typically at the end of each event.
 
StatusCode RegisterDetails (const Pandora *const pPandora, const std::string &type, const std::string &instanceName)
 Register i) the pandora instance that will run the process and ii) the process type.
 

Protected Attributes

const Pandoram_pPandora
 The pandora object that will run the process.
 
std::string m_type
 The process type.
 
std::string m_instanceName
 The process instance name.
 

Private Member Functions

void GetVertexScoreList (const pandora::VertexVector &vertexVector, const BeamConstants &beamConstants, HitKDTree2D &kdTreeU, HitKDTree2D &kdTreeV, HitKDTree2D &kdTreeW, VertexScoreList &vertexScoreList) const
 Get the vertex score list for a provided list of candidate vertices.
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 Read the algorithm settings.
 
pandora::StatusCode Run ()
 Run the algorithm.
 
void InitializeKDTrees (HitKDTree2D &kdTreeU, HitKDTree2D &kdTreeV, HitKDTree2D &kdTreeW) const
 Initialize kd trees with details of hits in algorithm-configured cluster lists.
 
bool IsVertexOnHit (const pandora::Vertex *const pVertex, const pandora::HitType hitType, HitKDTree2D &kdTree) const
 Whether the vertex lies on a hit in the specified view.
 
bool IsVertexInGap (const pandora::Vertex *const pVertex, const pandora::HitType hitType) const
 Whether the vertex lies in a registered gap.
 
void SelectTopScoreVertices (VertexScoreList &vertexScoreList, pandora::VertexList &selectedVertexList) const
 From the top-scoring candidate vertices, select a subset for further investigation.
 
bool AcceptVertexLocation (const pandora::Vertex *const pVertex, const pandora::VertexList &selectedVertexList) const
 Whether to accept a candidate vertex, based on its spatial position in relation to other selected candidates.
 

Static Private Member Functions

static bool SortByVertexZPosition (const pandora::Vertex *const pLhs, const pandora::Vertex *const pRhs)
 Sort vertices by increasing z position.
 

Private Attributes

VertexFeatureTool::FeatureToolVector m_featureToolVector
 The feature tool map.
 
pandora::StringVector m_inputCaloHitListNames
 The list of calo hit list names.
 
std::string m_outputVertexListName
 The name under which to save the output vertex list.
 
bool m_replaceCurrentVertexList
 Whether to replace the current vertex list with the output list.
 
bool m_beamMode
 Whether to run in beam mode, assuming neutrinos travel in positive z-direction.
 
float m_nDecayLengthsInZSpan
 The number of score decay lengths to use over the course of the vertex z-span.
 
bool m_selectSingleVertex
 Whether to make a final decision and select just one vertex candidate.
 
unsigned int m_maxTopScoreSelections
 Max number of top-scoring vertex candidate to select for output.
 
float m_maxOnHitDisplacement
 Max hit-vertex displacement for declaring vertex to lie on a hit in each view.
 
float m_minCandidateDisplacement
 Ignore other top-scoring candidates located in close proximity to original.
 
float m_minCandidateScoreFraction
 Ignore other top-scoring candidates with score less than a fraction of original.
 
bool m_useDetectorGaps
 Whether to account for registered detector gaps in vertex selection.
 
float m_gapTolerance
 The tolerance to use when querying whether a sampling point is in a gap, units cm.
 
bool m_isEmptyViewAcceptable
 Whether views entirely empty of hits are classed as 'acceptable' for candidate filtration.
 
unsigned int m_minVertexAcceptableViews
 The minimum number of views in which a candidate must sit on/near a hit or in a gap (or view can be empty)
 

Detailed Description

Member Typedef Documentation

◆ ClusterListMap

Map array of cluster lists for passing to tools.

Definition at line 227 of file VertexSelectionBaseAlgorithm.h.

◆ HitKDNode2D

◆ HitKDNode2DList

◆ HitKDTree2D

◆ KDTreeMap

typedef std::map<pandora::HitType, const std::reference_wrapper<HitKDTree2D> > lar_content::VertexSelectionBaseAlgorithm::KDTreeMap
inherited

Map array of hit kd trees for passing to tools.

Definition at line 230 of file VertexSelectionBaseAlgorithm.h.

◆ ShowerClusterList

◆ ShowerClusterListMap

Map of shower cluster lists for passing to tools.

Definition at line 229 of file VertexSelectionBaseAlgorithm.h.

◆ SlidingFitDataList

◆ SlidingFitDataListMap

Map of sliding fit data lists for passing to tools.

Definition at line 228 of file VertexSelectionBaseAlgorithm.h.

◆ VertexFeatureTool

The base type for the vertex feature tools.

Definition at line 234 of file VertexSelectionBaseAlgorithm.h.

◆ VertexScoreList

Constructor & Destructor Documentation

◆ HitAngleVertexSelectionAlgorithm()

lar_content::HitAngleVertexSelectionAlgorithm::HitAngleVertexSelectionAlgorithm ( )

Default constructor.

Definition at line 21 of file HitAngleVertexSelectionAlgorithm.cc.

Member Function Documentation

◆ AcceptVertexLocation()

bool lar_content::VertexSelectionBaseAlgorithm::AcceptVertexLocation ( const pandora::Vertex *const  pVertex,
const pandora::VertexList selectedVertexList 
) const
privateinherited

Whether to accept a candidate vertex, based on its spatial position in relation to other selected candidates.

Parameters
pVertexthe address of the vertex
selectedVertexListthe selected vertex list
Returns
boolean

Definition at line 314 of file VertexSelectionBaseAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CalculateClusterSlidingFits()

void lar_content::VertexSelectionBaseAlgorithm::CalculateClusterSlidingFits ( const pandora::ClusterList inputClusterList,
const unsigned int  minClusterCaloHits,
const unsigned int  slidingFitWindow,
SlidingFitDataList slidingFitDataList 
) const
protectedinherited

Calculate the cluster sliding fits.

Parameters
inputClusterListthe input cluster list
minClusterCaloHitsthe minimum number of cluster calo hits
slidingFitWindowthe sliding fit window
slidingFitDataListthe list of sliding fits to fill

Definition at line 120 of file VertexSelectionBaseAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FilterVertexList()

void lar_content::VertexSelectionBaseAlgorithm::FilterVertexList ( const pandora::VertexList *const  pInputVertexList,
HitKDTree2D kdTreeU,
HitKDTree2D kdTreeV,
HitKDTree2D kdTreeW,
pandora::VertexVector filteredVertices 
) const
protectedvirtualinherited

Filter the input list of vertices to obtain a reduced number of vertex candidates.

Parameters
pInputVertexListthe address of the input vertex list
kdTreeUthe kd tree for u hits
kdTreeVthe kd tree for v hits
kdTreeWthe kd tree for w hits
filteredVerticesto receive the filtered vertex list

Definition at line 40 of file VertexSelectionBaseAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBeamConstants()

void lar_content::VertexSelectionBaseAlgorithm::GetBeamConstants ( const pandora::VertexVector vertexVector,
BeamConstants beamConstants 
) const
protectedvirtualinherited

Get the beam score constants for a provided list of candidate vertices.

Parameters
vertexVectorthe vertex vector
beamConstantsto receive the beam constants

Definition at line 65 of file VertexSelectionBaseAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBeamDeweightingScore()

float lar_content::VertexSelectionBaseAlgorithm::GetBeamDeweightingScore ( const BeamConstants beamConstants,
const pandora::Vertex *const  pVertex 
) const
inlineprotectedinherited

Get the beam deweighting score for a vertex.

Parameters
beamConstantsthe beam constants
pVertexaddress of the vertex
Returns
the score

Definition at line 419 of file VertexSelectionBaseAlgorithm.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetClusterLists()

void lar_content::VertexSelectionBaseAlgorithm::GetClusterLists ( const pandora::StringVector inputClusterListNames,
pandora::ClusterList clusterListU,
pandora::ClusterList clusterListV,
pandora::ClusterList clusterListW 
) const
protectedinherited

Get the cluster lists.

Parameters
inputClusterListNamesthe input cluster list names
clusterListUthe U-view cluster list to populate
clusterListVthe V-view cluster list to populate
clusterListWthe W-view cluster list to populate

Definition at line 91 of file VertexSelectionBaseAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetInstanceName()

const std::string & pandora::Process::GetInstanceName ( ) const
inlineinherited

Get the instance name.

Returns
The instance name

Definition at line 109 of file Process.h.

◆ GetPandora()

const Pandora & pandora::Process::GetPandora ( ) const
inlineinherited

Get the associated pandora instance.

Returns
the associated pandora instance

Definition at line 116 of file Process.h.

◆ GetType()

const std::string & pandora::Process::GetType ( ) const
inlineinherited

Get the type.

Returns
The type

Definition at line 102 of file Process.h.

◆ GetVertexEnergy()

float lar_content::VertexSelectionBaseAlgorithm::GetVertexEnergy ( const pandora::Vertex *const  pVertex,
const KDTreeMap kdTreeMap 
) const
protectedinherited

Calculate the energy of a vertex candidate by summing values from all three planes.

Parameters
pVertexthe address of the vertex
kdTreeMapthe map of 2D hit kd trees
Returns
the summed vertex energy

Definition at line 243 of file VertexSelectionBaseAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetVertexScoreList()

void lar_content::HitAngleVertexSelectionAlgorithm::GetVertexScoreList ( const pandora::VertexVector vertexVector,
const BeamConstants beamConstants,
HitKDTree2D kdTreeU,
HitKDTree2D kdTreeV,
HitKDTree2D kdTreeW,
VertexScoreList vertexScoreList 
) const
privatevirtual

Get the vertex score list for a provided list of candidate vertices.

Parameters
vertexVectorthe vertex vector
beamConstantsthe beam constants
kdTreeUthe kd tree for u hits
kdTreeVthe kd tree for v hits
kdTreeWthe kd tree for w hits
vertexScoreListto receive the vertex score list

Implements lar_content::VertexSelectionBaseAlgorithm.

Definition at line 27 of file HitAngleVertexSelectionAlgorithm.cc.

Here is the call graph for this function:

◆ Initialize()

StatusCode pandora::Process::Initialize ( )
inlineprotectedvirtualinherited

Perform any operations that must occur after reading settings, but before running the process.

Reimplemented in lar_content::BdtBeamParticleIdTool, lar_content::BeamParticleIdTool, lar_content::CosmicRayTaggingTool, lar_content::EventReadingAlgorithm, lar_content::EventWritingAlgorithm, lar_content::LArPseudoLayerPlugin, lar_content::LArRotationalTransformationPlugin, EventReadingAlgorithm, and EventWritingAlgorithm.

Definition at line 126 of file Process.h.

Here is the caller graph for this function:

◆ InitializeKDTrees()

void lar_content::VertexSelectionBaseAlgorithm::InitializeKDTrees ( HitKDTree2D kdTreeU,
HitKDTree2D kdTreeV,
HitKDTree2D kdTreeW 
) const
privateinherited

Initialize kd trees with details of hits in algorithm-configured cluster lists.

Parameters
kdTreeUthe kd tree for u hits
kdTreeVthe kd tree for v hits
kdTreeWthe kd tree for w hits

Definition at line 186 of file VertexSelectionBaseAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsBeamModeOn()

bool lar_content::VertexSelectionBaseAlgorithm::IsBeamModeOn ( ) const
inlineprotectedinherited

Whether algorithm is running in beam mode, assuming neutrinos travel in positive z-direction.

Returns
boolean

Definition at line 427 of file VertexSelectionBaseAlgorithm.h.

Here is the caller graph for this function:

◆ IsVertexInGap()

bool lar_content::VertexSelectionBaseAlgorithm::IsVertexInGap ( const pandora::Vertex *const  pVertex,
const pandora::HitType  hitType 
) const
privateinherited

Whether the vertex lies in a registered gap.

Parameters
pVertexthe address of the vertex
hitTypethe relevant hit type
Returns
boolean

Definition at line 233 of file VertexSelectionBaseAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsVertexOnHit()

bool lar_content::VertexSelectionBaseAlgorithm::IsVertexOnHit ( const pandora::Vertex *const  pVertex,
const pandora::HitType  hitType,
HitKDTree2D kdTree 
) const
privateinherited

Whether the vertex lies on a hit in the specified view.

Parameters
pVertexthe address of the vertex
hitTypethe relevant hit type
kdTreethe relevant kd tree
Returns
boolean

Definition at line 220 of file VertexSelectionBaseAlgorithm.cc.

Here is the call graph for this function:

◆ ReadSettings()

StatusCode lar_content::HitAngleVertexSelectionAlgorithm::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
privatevirtual

Read the algorithm settings.

Parameters
xmlHandlethe relevant xml handle

Implements pandora::Process.

Definition at line 49 of file HitAngleVertexSelectionAlgorithm.cc.

Here is the call graph for this function:

◆ RegisterDetails()

StatusCode pandora::Process::RegisterDetails ( const Pandora *const  pPandora,
const std::string &  type,
const std::string &  instanceName 
)
inlineprotectedinherited

Register i) the pandora instance that will run the process and ii) the process type.

Parameters
pPandoraaddress of the pandora object that will run the process
typethe process type
instanceNamethe process instance name

Definition at line 146 of file Process.h.

Here is the caller graph for this function:

◆ Reset()

StatusCode pandora::Process::Reset ( )
inlineprotectedvirtualinherited

Perform any operations when pandora is reset, typically at the end of each event.

Reimplemented in lar_content::MasterAlgorithm, lar_content::PostProcessingAlgorithm, and lar_content::PreProcessingAlgorithm.

Definition at line 133 of file Process.h.

Here is the caller graph for this function:

◆ Run()

StatusCode lar_content::VertexSelectionBaseAlgorithm::Run ( )
privatevirtualinherited

Run the algorithm.

Implements pandora::Algorithm.

Definition at line 142 of file VertexSelectionBaseAlgorithm.cc.

Here is the call graph for this function:

◆ SelectTopScoreVertices()

void lar_content::VertexSelectionBaseAlgorithm::SelectTopScoreVertices ( VertexScoreList vertexScoreList,
pandora::VertexList selectedVertexList 
) const
privateinherited

From the top-scoring candidate vertices, select a subset for further investigation.

Parameters
vertexScoreListthe vertex score list
selectedVertexListto receive the selected vertex list

Definition at line 286 of file VertexSelectionBaseAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SortByVertexZPosition()

bool lar_content::VertexSelectionBaseAlgorithm::SortByVertexZPosition ( const pandora::Vertex *const  pLhs,
const pandora::Vertex *const  pRhs 
)
staticprivateinherited

Sort vertices by increasing z position.

Parameters
pLhsaddress of the lhs vertex
pRhsaddress of the rhs vertex
Returns
whether lhs should precedes rhs

Definition at line 333 of file VertexSelectionBaseAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ VertexHitEnergy()

float lar_content::VertexSelectionBaseAlgorithm::VertexHitEnergy ( const pandora::Vertex *const  pVertex,
const pandora::HitType  hitType,
HitKDTree2D kdTree 
) const
protectedinherited

Finds the energy of the nearest hit to the vertex candidate in this view.

Parameters
pVertexthe address of the vertex
hitTypethe relevant hit type
kdTreethe kd tree of 2D hits
Returns
the energy of the nearest hit

Definition at line 261 of file VertexSelectionBaseAlgorithm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_beamMode

bool lar_content::VertexSelectionBaseAlgorithm::m_beamMode
privateinherited

Whether to run in beam mode, assuming neutrinos travel in positive z-direction.

Definition at line 399 of file VertexSelectionBaseAlgorithm.h.

◆ m_featureToolVector

VertexFeatureTool::FeatureToolVector lar_content::HitAngleVertexSelectionAlgorithm::m_featureToolVector
private

The feature tool map.

Definition at line 33 of file HitAngleVertexSelectionAlgorithm.h.

◆ m_gapTolerance

float lar_content::VertexSelectionBaseAlgorithm::m_gapTolerance
privateinherited

The tolerance to use when querying whether a sampling point is in a gap, units cm.

Definition at line 411 of file VertexSelectionBaseAlgorithm.h.

◆ m_inputCaloHitListNames

pandora::StringVector lar_content::VertexSelectionBaseAlgorithm::m_inputCaloHitListNames
privateinherited

The list of calo hit list names.

Definition at line 394 of file VertexSelectionBaseAlgorithm.h.

◆ m_instanceName

std::string pandora::Process::m_instanceName
protectedinherited

The process instance name.

Definition at line 89 of file Process.h.

◆ m_isEmptyViewAcceptable

bool lar_content::VertexSelectionBaseAlgorithm::m_isEmptyViewAcceptable
privateinherited

Whether views entirely empty of hits are classed as 'acceptable' for candidate filtration.

Definition at line 413 of file VertexSelectionBaseAlgorithm.h.

◆ m_maxOnHitDisplacement

float lar_content::VertexSelectionBaseAlgorithm::m_maxOnHitDisplacement
privateinherited

Max hit-vertex displacement for declaring vertex to lie on a hit in each view.

Definition at line 405 of file VertexSelectionBaseAlgorithm.h.

◆ m_maxTopScoreSelections

unsigned int lar_content::VertexSelectionBaseAlgorithm::m_maxTopScoreSelections
privateinherited

Max number of top-scoring vertex candidate to select for output.

Definition at line 403 of file VertexSelectionBaseAlgorithm.h.

◆ m_minCandidateDisplacement

float lar_content::VertexSelectionBaseAlgorithm::m_minCandidateDisplacement
privateinherited

Ignore other top-scoring candidates located in close proximity to original.

Definition at line 407 of file VertexSelectionBaseAlgorithm.h.

◆ m_minCandidateScoreFraction

float lar_content::VertexSelectionBaseAlgorithm::m_minCandidateScoreFraction
privateinherited

Ignore other top-scoring candidates with score less than a fraction of original.

Definition at line 408 of file VertexSelectionBaseAlgorithm.h.

◆ m_minVertexAcceptableViews

unsigned int lar_content::VertexSelectionBaseAlgorithm::m_minVertexAcceptableViews
privateinherited

The minimum number of views in which a candidate must sit on/near a hit or in a gap (or view can be empty)

Definition at line 414 of file VertexSelectionBaseAlgorithm.h.

◆ m_nDecayLengthsInZSpan

float lar_content::VertexSelectionBaseAlgorithm::m_nDecayLengthsInZSpan
privateinherited

The number of score decay lengths to use over the course of the vertex z-span.

Definition at line 400 of file VertexSelectionBaseAlgorithm.h.

◆ m_outputVertexListName

std::string lar_content::VertexSelectionBaseAlgorithm::m_outputVertexListName
privateinherited

The name under which to save the output vertex list.

Definition at line 395 of file VertexSelectionBaseAlgorithm.h.

◆ m_pPandora

const Pandora* pandora::Process::m_pPandora
protectedinherited

The pandora object that will run the process.

Definition at line 87 of file Process.h.

◆ m_replaceCurrentVertexList

bool lar_content::VertexSelectionBaseAlgorithm::m_replaceCurrentVertexList
privateinherited

Whether to replace the current vertex list with the output list.

Definition at line 397 of file VertexSelectionBaseAlgorithm.h.

◆ m_selectSingleVertex

bool lar_content::VertexSelectionBaseAlgorithm::m_selectSingleVertex
privateinherited

Whether to make a final decision and select just one vertex candidate.

Definition at line 402 of file VertexSelectionBaseAlgorithm.h.

◆ m_type

std::string pandora::Process::m_type
protectedinherited

The process type.

Definition at line 88 of file Process.h.

◆ m_useDetectorGaps

bool lar_content::VertexSelectionBaseAlgorithm::m_useDetectorGaps
privateinherited

Whether to account for registered detector gaps in vertex selection.

Definition at line 410 of file VertexSelectionBaseAlgorithm.h.


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