LArSoft
v07_13_02
Liquid Argon Software toolkit - http://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... | |
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 29 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 224 of file VertexSelectionBaseAlgorithm.h.
typedef KDTreeNodeInfoT<const pandora::CaloHit*, 2> lar_content::VertexSelectionBaseAlgorithm::HitKDNode2D |
Definition at line 220 of file VertexSelectionBaseAlgorithm.h.
typedef std::vector<HitKDNode2D> lar_content::VertexSelectionBaseAlgorithm::HitKDNode2DList |
Definition at line 221 of file VertexSelectionBaseAlgorithm.h.
typedef KDTreeLinkerAlgo<const pandora::CaloHit*, 2> lar_content::VertexSelectionBaseAlgorithm::HitKDTree2D |
Definition at line 222 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 227 of file VertexSelectionBaseAlgorithm.h.
typedef std::vector<ShowerCluster> lar_content::VertexSelectionBaseAlgorithm::ShowerClusterList |
Definition at line 218 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 226 of file VertexSelectionBaseAlgorithm.h.
typedef std::vector<SlidingFitData> lar_content::VertexSelectionBaseAlgorithm::SlidingFitDataList |
Definition at line 172 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 225 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 230 of file VertexSelectionBaseAlgorithm.h.
typedef std::vector<VertexScore> lar_content::VertexSelectionBaseAlgorithm::VertexScoreList |
Definition at line 79 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 268 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 119 of file VertexSelectionBaseAlgorithm.cc.
References lar_content::LArGeometryHelper::GetWireZPitch(), min, and lar_content::LArClusterHelper::SortByNHits().
Referenced by lar_content::EnergyKickVertexSelectionAlgorithm::GetVertexScoreList(), and lar_content::SvmVertexSelectionAlgorithm::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, max, 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 394 of file VertexSelectionBaseAlgorithm.h.
References lar_content::VertexSelectionBaseAlgorithm::BeamConstants::GetDecayConstant(), lar_content::VertexSelectionBaseAlgorithm::BeamConstants::GetMinZCoordinate(), and max.
Referenced by lar_content::EnergyKickVertexSelectionAlgorithm::GetVertexScoreList(), and lar_content::SvmVertexSelectionAlgorithm::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::SvmVertexSelectionAlgorithm::GetVertexScoreList().
|
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::SvmVertexSelectionAlgorithm, lar_content::EnergyKickVertexSelectionAlgorithm, and lar_content::HitAngleVertexSelectionAlgorithm.
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 184 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 402 of file VertexSelectionBaseAlgorithm.h.
References m_beamMode.
Referenced by lar_content::EnergyKickVertexSelectionAlgorithm::GetVertexScoreList().
|
private |
Whether the vertex lies in a registered gap.
pVertex | the address of the vertex |
hitType | the relevant hit type |
Definition at line 230 of file VertexSelectionBaseAlgorithm.cc.
References lar_content::LArGeometryHelper::IsInGap3D(), m_gapTolerance, and m_useDetectorGaps.
Referenced by FilterVertexList().
|
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 217 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 349 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::SvmVertexSelectionAlgorithm::ReadSettings().
|
private |
Definition at line 140 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 240 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 287 of file VertexSelectionBaseAlgorithm.cc.
Referenced by FilterVertexList().
|
private |
Whether to run in beam mode, assuming neutrinos travel in positive z-direction.
Definition at line 374 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 386 of file VertexSelectionBaseAlgorithm.h.
Referenced by IsVertexInGap(), and ReadSettings().
|
private |
The list of calo hit list names.
Definition at line 369 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 388 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 380 of file VertexSelectionBaseAlgorithm.h.
Referenced by IsVertexOnHit(), and ReadSettings().
|
private |
Max number of top-scoring vertex candidate to select for output.
Definition at line 378 of file VertexSelectionBaseAlgorithm.h.
Referenced by ReadSettings(), and SelectTopScoreVertices().
|
private |
Ignore other top-scoring candidates located in close proximity to original.
Definition at line 382 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 383 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 389 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 375 of file VertexSelectionBaseAlgorithm.h.
Referenced by GetBeamConstants(), and ReadSettings().
|
private |
The name under which to save the output vertex list.
Definition at line 370 of file VertexSelectionBaseAlgorithm.h.
Referenced by ReadSettings(), and Run().
|
private |
Whether to replace the current vertex list with the output list.
Definition at line 372 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 377 of file VertexSelectionBaseAlgorithm.h.
Referenced by ReadSettings(), and SelectTopScoreVertices().
|
private |
Whether to account for registered detector gaps in vertex selection.
Definition at line 385 of file VertexSelectionBaseAlgorithm.h.
Referenced by IsVertexInGap(), and ReadSettings().