LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
VertexSelectionBaseAlgorithm class. More...
#include "VertexSelectionBaseAlgorithm.h"
Classes | |
class | BeamConstants |
Beam constants class. More... | |
class | ShowerCluster |
Shower cluster class. More... | |
class | SlidingFitData |
Sliding fit data class. More... | |
class | VertexScore |
VertexScore class. More... | |
Public Types | |
typedef std::vector< VertexScore > | VertexScoreList |
typedef std::vector< SlidingFitData > | SlidingFitDataList |
typedef std::vector< ShowerCluster > | ShowerClusterList |
typedef KDTreeNodeInfoT< const pandora::CaloHit *, 2 > | HitKDNode2D |
typedef std::vector< HitKDNode2D > | HitKDNode2DList |
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. More... | |
typedef std::map< pandora::HitType, const SlidingFitDataList > | SlidingFitDataListMap |
Map of sliding fit data lists for passing to tools. More... | |
typedef std::map< pandora::HitType, const ShowerClusterList > | ShowerClusterListMap |
Map of shower cluster lists for passing to tools. More... | |
typedef std::map< pandora::HitType, const std::reference_wrapper< HitKDTree2D > > | KDTreeMap |
Map array of hit kd trees for passing to tools. More... | |
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. More... | |
Public Member Functions | |
VertexSelectionBaseAlgorithm () | |
Default constructor. More... | |
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. More... | |
virtual void | GetBeamConstants (const pandora::VertexVector &vertexVector, BeamConstants &beamConstants) const |
Get the beam score constants for a provided list of candidate vertices. More... | |
virtual void | GetVertexScoreList (const pandora::VertexVector &vertexVector, const BeamConstants &beamConstants, HitKDTree2D &kdTreeU, HitKDTree2D &kdTreeV, HitKDTree2D &kdTreeW, VertexScoreList &vertexScoreList) const =0 |
Get the vertex score list for a provided list of candidate vertices. More... | |
void | GetClusterLists (const pandora::StringVector &inputClusterListNames, pandora::ClusterList &clusterListU, pandora::ClusterList &clusterListV, pandora::ClusterList &clusterListW) const |
Get the cluster lists. More... | |
void | CalculateClusterSlidingFits (const pandora::ClusterList &inputClusterList, const unsigned int minClusterCaloHits, const unsigned int slidingFitWindow, SlidingFitDataList &slidingFitDataList) const |
Calculate the cluster sliding fits. More... | |
float | GetBeamDeweightingScore (const BeamConstants &beamConstants, const pandora::Vertex *const pVertex) const |
Get the beam deweighting score for a vertex. More... | |
bool | IsBeamModeOn () const |
Whether algorithm is running in beam mode, assuming neutrinos travel in positive z-direction. More... | |
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. More... | |
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. More... | |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
Private Member Functions | |
pandora::StatusCode | Run () |
void | InitializeKDTrees (HitKDTree2D &kdTreeU, HitKDTree2D &kdTreeV, HitKDTree2D &kdTreeW) const |
Initialize kd trees with details of hits in algorithm-configured cluster lists. More... | |
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. More... | |
bool | IsVertexInGap (const pandora::Vertex *const pVertex, const pandora::HitType hitType) const |
Whether the vertex lies in a registered gap. More... | |
void | SelectTopScoreVertices (VertexScoreList &vertexScoreList, pandora::VertexList &selectedVertexList) const |
From the top-scoring candidate vertices, select a subset for further investigation. More... | |
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. More... | |
Static Private Member Functions | |
static bool | SortByVertexZPosition (const pandora::Vertex *const pLhs, const pandora::Vertex *const pRhs) |
Sort vertices by increasing z position. More... | |
Private Attributes | |
pandora::StringVector | m_inputCaloHitListNames |
The list of calo hit list names. More... | |
std::string | m_outputVertexListName |
The name under which to save the output vertex list. More... | |
bool | m_replaceCurrentVertexList |
Whether to replace the current vertex list with the output list. More... | |
bool | m_beamMode |
Whether to run in beam mode, assuming neutrinos travel in positive z-direction. More... | |
float | m_nDecayLengthsInZSpan |
The number of score decay lengths to use over the course of the vertex z-span. More... | |
bool | m_selectSingleVertex |
Whether to make a final decision and select just one vertex candidate. More... | |
unsigned int | m_maxTopScoreSelections |
Max number of top-scoring vertex candidate to select for output. More... | |
float | m_maxOnHitDisplacement |
Max hit-vertex displacement for declaring vertex to lie on a hit in each view. More... | |
float | m_minCandidateDisplacement |
Ignore other top-scoring candidates located in close proximity to original. More... | |
float | m_minCandidateScoreFraction |
Ignore other top-scoring candidates with score less than a fraction of original. More... | |
bool | m_useDetectorGaps |
Whether to account for registered detector gaps in vertex selection. More... | |
float | m_gapTolerance |
The tolerance to use when querying whether a sampling point is in a gap, units cm. More... | |
bool | m_isEmptyViewAcceptable |
Whether views entirely empty of hits are classed as 'acceptable' for candidate filtration. More... | |
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) More... | |
VertexSelectionBaseAlgorithm class.
Definition at line 32 of file VertexSelectionBaseAlgorithm.h.
typedef std::map<pandora::HitType, const pandora::ClusterList &> lar_content::VertexSelectionBaseAlgorithm::ClusterListMap |
Map array of cluster lists for passing to tools.
Definition at line 227 of file VertexSelectionBaseAlgorithm.h.
typedef KDTreeNodeInfoT<const pandora::CaloHit *, 2> lar_content::VertexSelectionBaseAlgorithm::HitKDNode2D |
Definition at line 223 of file VertexSelectionBaseAlgorithm.h.
typedef std::vector<HitKDNode2D> lar_content::VertexSelectionBaseAlgorithm::HitKDNode2DList |
Definition at line 224 of file VertexSelectionBaseAlgorithm.h.
typedef KDTreeLinkerAlgo<const pandora::CaloHit *, 2> lar_content::VertexSelectionBaseAlgorithm::HitKDTree2D |
Definition at line 225 of file VertexSelectionBaseAlgorithm.h.
typedef std::map<pandora::HitType, const std::reference_wrapper<HitKDTree2D> > lar_content::VertexSelectionBaseAlgorithm::KDTreeMap |
Map array of hit kd trees for passing to tools.
Definition at line 230 of file VertexSelectionBaseAlgorithm.h.
typedef std::vector<ShowerCluster> lar_content::VertexSelectionBaseAlgorithm::ShowerClusterList |
Definition at line 221 of file VertexSelectionBaseAlgorithm.h.
typedef std::map<pandora::HitType, const ShowerClusterList> lar_content::VertexSelectionBaseAlgorithm::ShowerClusterListMap |
Map of shower cluster lists for passing to tools.
Definition at line 229 of file VertexSelectionBaseAlgorithm.h.
typedef std::vector<SlidingFitData> lar_content::VertexSelectionBaseAlgorithm::SlidingFitDataList |
Definition at line 175 of file VertexSelectionBaseAlgorithm.h.
typedef std::map<pandora::HitType, const SlidingFitDataList> lar_content::VertexSelectionBaseAlgorithm::SlidingFitDataListMap |
Map of sliding fit data lists for passing to tools.
Definition at line 228 of file VertexSelectionBaseAlgorithm.h.
typedef MvaFeatureTool<const VertexSelectionBaseAlgorithm *const, const pandora::Vertex *const, const SlidingFitDataListMap &, const ClusterListMap &, const KDTreeMap &, const ShowerClusterListMap &, const float, float &> lar_content::VertexSelectionBaseAlgorithm::VertexFeatureTool |
The base type for the vertex feature tools.
Definition at line 234 of file VertexSelectionBaseAlgorithm.h.
typedef std::vector<VertexScore> lar_content::VertexSelectionBaseAlgorithm::VertexScoreList |
Definition at line 82 of file VertexSelectionBaseAlgorithm.h.
lar_content::VertexSelectionBaseAlgorithm::VertexSelectionBaseAlgorithm | ( | ) |
Default constructor.
Definition at line 22 of file VertexSelectionBaseAlgorithm.cc.
|
private |
Whether to accept a candidate vertex, based on its spatial position in relation to other selected candidates.
pVertex | the address of the vertex |
selectedVertexList | the selected vertex list |
Definition at line 314 of file VertexSelectionBaseAlgorithm.cc.
References m_minCandidateDisplacement.
Referenced by SelectTopScoreVertices().
|
protected |
Calculate the cluster sliding fits.
inputClusterList | the input cluster list |
minClusterCaloHits | the minimum number of cluster calo hits |
slidingFitWindow | the sliding fit window |
slidingFitDataList | the list of sliding fits to fill |
Definition at line 120 of file VertexSelectionBaseAlgorithm.cc.
References lar_content::LArGeometryHelper::GetWireZPitch(), and lar_content::LArClusterHelper::SortByNHits().
Referenced by lar_content::EnergyKickVertexSelectionAlgorithm::GetVertexScoreList(), and lar_content::MvaVertexSelectionAlgorithm< T >::GetVertexScoreList().
|
protectedvirtual |
Filter the input list of vertices to obtain a reduced number of vertex candidates.
pInputVertexList | the address of the input vertex list |
kdTreeU | the kd tree for u hits |
kdTreeV | the kd tree for v hits |
kdTreeW | the kd tree for w hits |
filteredVertices | to receive the filtered vertex list |
Definition at line 40 of file VertexSelectionBaseAlgorithm.cc.
References lar_content::KDTreeLinkerAlgo< DATA, DIM >::empty(), IsVertexInGap(), IsVertexOnHit(), m_isEmptyViewAcceptable, m_minVertexAcceptableViews, and SortByVertexZPosition().
Referenced by Run().
|
protectedvirtual |
Get the beam score constants for a provided list of candidate vertices.
vertexVector | the vertex vector |
beamConstants | to receive the beam constants |
Definition at line 65 of file VertexSelectionBaseAlgorithm.cc.
References f, m_beamMode, m_nDecayLengthsInZSpan, and lar_content::VertexSelectionBaseAlgorithm::BeamConstants::SetConstants().
Referenced by Run().
|
inlineprotected |
Get the beam deweighting score for a vertex.
beamConstants | the beam constants |
pVertex | address of the vertex |
Definition at line 419 of file VertexSelectionBaseAlgorithm.h.
References lar_content::VertexSelectionBaseAlgorithm::BeamConstants::GetDecayConstant(), and lar_content::VertexSelectionBaseAlgorithm::BeamConstants::GetMinZCoordinate().
Referenced by lar_content::EnergyKickVertexSelectionAlgorithm::GetVertexScoreList(), and lar_content::TrainedVertexSelectionAlgorithm::PopulateVertexFeatureInfoMap().
|
protected |
Get the cluster lists.
inputClusterListNames | the input cluster list names |
clusterListU | the U-view cluster list to populate |
clusterListV | the V-view cluster list to populate |
clusterListW | the W-view cluster list to populate |
Definition at line 91 of file VertexSelectionBaseAlgorithm.cc.
References lar_content::LArClusterHelper::GetClusterHitType().
Referenced by lar_content::EnergyKickVertexSelectionAlgorithm::GetVertexScoreList(), and lar_content::MvaVertexSelectionAlgorithm< T >::GetVertexScoreList().
|
protected |
Calculate the energy of a vertex candidate by summing values from all three planes.
pVertex | the address of the vertex |
kdTreeMap | the map of 2D hit kd trees |
Definition at line 243 of file VertexSelectionBaseAlgorithm.cc.
References f, IsVertexInGap(), and VertexHitEnergy().
Referenced by lar_content::TrainedVertexSelectionAlgorithm::PopulateVertexFeatureInfoMap().
|
protectedpure virtual |
Get the vertex score list for a provided list of candidate vertices.
vertexVector | the vertex vector |
beamConstants | the beam constants |
kdTreeU | the kd tree for u hits |
kdTreeV | the kd tree for v hits |
kdTreeW | the kd tree for w hits |
vertexScoreList | to receive the vertex score list |
Implemented in lar_content::TrainedVertexSelectionAlgorithm, lar_content::MvaVertexSelectionAlgorithm< T >, lar_content::EnergyKickVertexSelectionAlgorithm, lar_content::HitAngleVertexSelectionAlgorithm, and lar_content::CheatingVertexSelectionAlgorithm.
Referenced by Run().
|
private |
Initialize kd trees with details of hits in algorithm-configured cluster lists.
kdTreeU | the kd tree for u hits |
kdTreeV | the kd tree for v hits |
kdTreeW | the kd tree for w hits |
Definition at line 186 of file VertexSelectionBaseAlgorithm.cc.
References lar_content::KDTreeLinkerAlgo< DATA, DIM >::build(), lar_content::KDTreeLinkerAlgo< DATA, DIM >::empty(), lar_content::fill_and_bound_2d_kd_tree(), and m_inputCaloHitListNames.
Referenced by Run().
|
inlineprotected |
Whether algorithm is running in beam mode, assuming neutrinos travel in positive z-direction.
Definition at line 427 of file VertexSelectionBaseAlgorithm.h.
References m_beamMode.
Referenced by lar_content::TrainedVertexSelectionAlgorithm::AddEventFeaturesToVector(), lar_content::TrainedVertexSelectionAlgorithm::AddVertexFeaturesToVector(), lar_content::EnergyKickVertexSelectionAlgorithm::GetVertexScoreList(), and lar_content::TrainedVertexSelectionAlgorithm::PopulateVertexFeatureInfoMap().
|
private |
Whether the vertex lies in a registered gap.
pVertex | the address of the vertex |
hitType | the relevant hit type |
Definition at line 233 of file VertexSelectionBaseAlgorithm.cc.
References lar_content::LArGeometryHelper::IsInGap3D(), m_gapTolerance, and m_useDetectorGaps.
Referenced by FilterVertexList(), and GetVertexEnergy().
|
private |
Whether the vertex lies on a hit in the specified view.
pVertex | the address of the vertex |
hitType | the relevant hit type |
kdTree | the relevant kd tree |
Definition at line 220 of file VertexSelectionBaseAlgorithm.cc.
References lar_content::build_2d_kd_search_region(), m_maxOnHitDisplacement, lar_content::LArGeometryHelper::ProjectPosition(), and lar_content::KDTreeLinkerAlgo< DATA, DIM >::search().
Referenced by FilterVertexList().
|
protected |
Definition at line 393 of file VertexSelectionBaseAlgorithm.cc.
References m_beamMode, m_gapTolerance, m_inputCaloHitListNames, m_isEmptyViewAcceptable, m_maxOnHitDisplacement, m_maxTopScoreSelections, m_minCandidateDisplacement, m_minCandidateScoreFraction, m_minVertexAcceptableViews, m_nDecayLengthsInZSpan, m_outputVertexListName, m_replaceCurrentVertexList, m_selectSingleVertex, and m_useDetectorGaps.
Referenced by lar_content::EnergyKickVertexSelectionAlgorithm::ReadSettings(), and lar_content::TrainedVertexSelectionAlgorithm::ReadSettings().
|
private |
Definition at line 142 of file VertexSelectionBaseAlgorithm.cc.
References FilterVertexList(), GetBeamConstants(), GetVertexScoreList(), InitializeKDTrees(), m_outputVertexListName, m_replaceCurrentVertexList, and SelectTopScoreVertices().
|
private |
From the top-scoring candidate vertices, select a subset for further investigation.
vertexScoreList | the vertex score list |
selectedVertexList | to receive the selected vertex list |
Definition at line 286 of file VertexSelectionBaseAlgorithm.cc.
References AcceptVertexLocation(), f, m_maxTopScoreSelections, m_minCandidateScoreFraction, and m_selectSingleVertex.
Referenced by Run().
|
staticprivate |
Sort vertices by increasing z position.
pLhs | address of the lhs vertex |
pRhs | address of the rhs vertex |
Definition at line 333 of file VertexSelectionBaseAlgorithm.cc.
Referenced by FilterVertexList().
|
protected |
Finds the energy of the nearest hit to the vertex candidate in this view.
pVertex | the address of the vertex |
hitType | the relevant hit type |
kdTree | the kd tree of 2D hits |
Definition at line 261 of file VertexSelectionBaseAlgorithm.cc.
References lar_content::build_2d_kd_search_region(), energy, m_maxOnHitDisplacement, lar_content::LArGeometryHelper::ProjectPosition(), and lar_content::KDTreeLinkerAlgo< DATA, DIM >::search().
Referenced by GetVertexEnergy().
|
private |
Whether to run in beam mode, assuming neutrinos travel in positive z-direction.
Definition at line 399 of file VertexSelectionBaseAlgorithm.h.
Referenced by GetBeamConstants(), IsBeamModeOn(), and ReadSettings().
|
private |
The tolerance to use when querying whether a sampling point is in a gap, units cm.
Definition at line 411 of file VertexSelectionBaseAlgorithm.h.
Referenced by IsVertexInGap(), and ReadSettings().
|
private |
The list of calo hit list names.
Definition at line 394 of file VertexSelectionBaseAlgorithm.h.
Referenced by InitializeKDTrees(), and ReadSettings().
|
private |
Whether views entirely empty of hits are classed as 'acceptable' for candidate filtration.
Definition at line 413 of file VertexSelectionBaseAlgorithm.h.
Referenced by FilterVertexList(), and ReadSettings().
|
private |
Max hit-vertex displacement for declaring vertex to lie on a hit in each view.
Definition at line 405 of file VertexSelectionBaseAlgorithm.h.
Referenced by IsVertexOnHit(), ReadSettings(), and VertexHitEnergy().
|
private |
Max number of top-scoring vertex candidate to select for output.
Definition at line 403 of file VertexSelectionBaseAlgorithm.h.
Referenced by ReadSettings(), and SelectTopScoreVertices().
|
private |
Ignore other top-scoring candidates located in close proximity to original.
Definition at line 407 of file VertexSelectionBaseAlgorithm.h.
Referenced by AcceptVertexLocation(), and ReadSettings().
|
private |
Ignore other top-scoring candidates with score less than a fraction of original.
Definition at line 408 of file VertexSelectionBaseAlgorithm.h.
Referenced by ReadSettings(), and SelectTopScoreVertices().
|
private |
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.
Referenced by FilterVertexList(), and ReadSettings().
|
private |
The number of score decay lengths to use over the course of the vertex z-span.
Definition at line 400 of file VertexSelectionBaseAlgorithm.h.
Referenced by GetBeamConstants(), and ReadSettings().
|
private |
The name under which to save the output vertex list.
Definition at line 395 of file VertexSelectionBaseAlgorithm.h.
Referenced by ReadSettings(), and Run().
|
private |
Whether to replace the current vertex list with the output list.
Definition at line 397 of file VertexSelectionBaseAlgorithm.h.
Referenced by ReadSettings(), and Run().
|
private |
Whether to make a final decision and select just one vertex candidate.
Definition at line 402 of file VertexSelectionBaseAlgorithm.h.
Referenced by ReadSettings(), and SelectTopScoreVertices().
|
private |
Whether to account for registered detector gaps in vertex selection.
Definition at line 410 of file VertexSelectionBaseAlgorithm.h.
Referenced by IsVertexInGap(), and ReadSettings().