LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
RPhiFeatureTool class. More...
#include "RPhiFeatureTool.h"
Classes | |
class | KernelEstimate |
Kernel estimate class. More... | |
Public Types | |
typedef std::vector< MvaFeatureTool< Ts... > * > | FeatureToolVector |
Public Member Functions | |
RPhiFeatureTool () | |
Default constructor. More... | |
void | Run (LArMvaHelper::MvaFeatureVector &featureVector, const VertexSelectionBaseAlgorithm *const pAlgorithm, const pandora::Vertex *const pVertex, const VertexSelectionBaseAlgorithm::SlidingFitDataListMap &, const VertexSelectionBaseAlgorithm::ClusterListMap &, const VertexSelectionBaseAlgorithm::KDTreeMap &kdTreeMap, const VertexSelectionBaseAlgorithm::ShowerClusterListMap &, const float beamDeweightingScore, float &bestFastScore) |
Run the tool. More... | |
virtual void | Run (MvaTypes::MvaFeatureVector &featureVector, Ts...args)=0 |
Run the algorithm tool. More... | |
Private Member Functions | |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
float | GetFastScore (const KernelEstimate &kernelEstimateU, const KernelEstimate &kernelEstimateV, const KernelEstimate &kernelEstimateW) const |
Get the score for a trio of kernel estimations, using fast histogram approach. More... | |
float | GetMidwayScore (const KernelEstimate &kernelEstimateU, const KernelEstimate &kernelEstimateV, const KernelEstimate &kernelEstimateW) const |
Get the score for a trio of kernel estimations, using kernel density estimation but with reduced (binned) sampling. More... | |
float | GetFullScore (const KernelEstimate &kernelEstimateU, const KernelEstimate &kernelEstimateV, const KernelEstimate &kernelEstimateW) const |
Get the score for a trio of kernel estimations, using kernel density estimation and full hit-by-hit sampling. More... | |
void | FillKernelEstimate (const pandora::Vertex *const pVertex, const pandora::HitType hitType, VertexSelectionBaseAlgorithm::HitKDTree2D &kdTree, KernelEstimate &kernelEstimate) const |
Use hits in clusters (in the provided kd tree) to fill a provided kernel estimate with hit-vertex relationship information. 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... | |
float | atan2Fast (const float y, const float x) const |
Fast estimate of std::atan2 function. Rather coarse (max |error| > 0.01) but should suffice for this use-case. More... | |
Private Attributes | |
bool | m_fastScoreCheck |
Whether to use the fast histogram based score to selectively avoid calling full or midway scores. More... | |
bool | m_fastScoreOnly |
Whether to use the fast histogram based score only. More... | |
bool | m_fullScore |
Whether to use the full kernel density estimation score, as opposed to the midway score. More... | |
float | m_kernelEstimateSigma |
The Gaussian width to use for kernel estimation. More... | |
float | m_kappa |
Hit-deweighting offset, of form: weight = 1 / sqrt(distance + kappa), units cm. More... | |
float | m_maxHitVertexDisplacement1D |
Max hit-vertex displacement in any one dimension for contribution to kernel estimation. More... | |
float | m_minFastScoreFraction |
Fast score must be at least this fraction of best fast score to calculate full score. More... | |
unsigned int | m_fastHistogramNPhiBins |
Number of bins to use for fast score histograms. More... | |
float | m_fastHistogramPhiMin |
Min value for fast score histograms. More... | |
float | m_fastHistogramPhiMax |
Max value for fast score histograms. More... | |
bool | m_enableFolding |
Whether to enable folding of -pi -> +pi phi distribution into 0 -> +pi region only. More... | |
RPhiFeatureTool class.
Definition at line 21 of file RPhiFeatureTool.h.
|
inherited |
Definition at line 30 of file LArMvaHelper.h.
lar_content::RPhiFeatureTool::RPhiFeatureTool | ( | ) |
Default constructor.
Definition at line 21 of file RPhiFeatureTool.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 |
|
private |
Fast estimate of std::atan2 function. Rather coarse (max |error| > 0.01) but should suffice for this use-case.
y | the y coordinate |
x | the x coordinate |
Definition at line 201 of file RPhiFeatureTool.cc.
Referenced by FillKernelEstimate().
|
private |
Use hits in clusters (in the provided kd tree) to fill a provided kernel estimate with hit-vertex relationship information.
pVertex | the address of the vertex |
hitType | the relevant hit type |
kdTree | the relevant kd tree |
kernelEstimate | to receive the populated kernel estimate |
Definition at line 169 of file RPhiFeatureTool.cc.
References lar_content::RPhiFeatureTool::KernelEstimate::AddContribution(), atan2Fast(), lar_content::build_2d_kd_search_region(), f, m_enableFolding, m_kappa, m_maxHitVertexDisplacement1D, lar_content::LArGeometryHelper::ProjectPosition(), lar_content::KDTreeLinkerAlgo< DATA, DIM >::search(), and weight.
Referenced by Run().
|
private |
Get the score for a trio of kernel estimations, using fast histogram approach.
kernelEstimateU | the kernel estimate for the u view |
kernelEstimateV | the kernel estimate for the v view |
kernelEstimateW | the kernel estimate for the w view |
Definition at line 82 of file RPhiFeatureTool.cc.
References f, lar_content::RPhiFeatureTool::KernelEstimate::GetContributionList(), m_fastHistogramNPhiBins, m_fastHistogramPhiMax, and m_fastHistogramPhiMin.
Referenced by Run().
|
private |
Get the score for a trio of kernel estimations, using kernel density estimation and full hit-by-hit sampling.
kernelEstimateU | the kernel estimate for the u view |
kernelEstimateV | the kernel estimate for the v view |
kernelEstimateW | the kernel estimate for the w view |
Definition at line 150 of file RPhiFeatureTool.cc.
References f, lar_content::RPhiFeatureTool::KernelEstimate::GetContributionList(), and lar_content::RPhiFeatureTool::KernelEstimate::Sample().
Referenced by Run().
|
private |
Get the score for a trio of kernel estimations, using kernel density estimation but with reduced (binned) sampling.
kernelEstimateU | the kernel estimate for the u view |
kernelEstimateV | the kernel estimate for the v view |
kernelEstimateW | the kernel estimate for the w view |
Definition at line 119 of file RPhiFeatureTool.cc.
References f, lar_content::RPhiFeatureTool::KernelEstimate::GetContributionList(), m_fastHistogramNPhiBins, m_fastHistogramPhiMax, m_fastHistogramPhiMin, and lar_content::RPhiFeatureTool::KernelEstimate::Sample().
Referenced by Run().
|
private |
Definition at line 246 of file RPhiFeatureTool.cc.
References m_enableFolding, m_fastHistogramNPhiBins, m_fastHistogramPhiMax, m_fastHistogramPhiMin, m_fastScoreCheck, m_fastScoreOnly, m_fullScore, m_kappa, m_kernelEstimateSigma, m_maxHitVertexDisplacement1D, and m_minFastScoreFraction.
void lar_content::RPhiFeatureTool::Run | ( | LArMvaHelper::MvaFeatureVector & | featureVector, |
const VertexSelectionBaseAlgorithm *const | pAlgorithm, | ||
const pandora::Vertex *const | pVertex, | ||
const VertexSelectionBaseAlgorithm::SlidingFitDataListMap & | , | ||
const VertexSelectionBaseAlgorithm::ClusterListMap & | , | ||
const VertexSelectionBaseAlgorithm::KDTreeMap & | kdTreeMap, | ||
const VertexSelectionBaseAlgorithm::ShowerClusterListMap & | , | ||
const float | beamDeweightingScore, | ||
float & | bestFastScore | ||
) |
Run the tool.
pAlgorithm | address of the calling algorithm |
pVertex | address of the vertex |
kdTreeMap | map of the hit kd trees |
beamDeweightingScore | the beam deweighting score for this vertex |
bestFastScore | the best fast score |
Definition at line 38 of file RPhiFeatureTool.cc.
References FillKernelEstimate(), GetFastScore(), GetFullScore(), GetMidwayScore(), m_fastScoreCheck, m_fastScoreOnly, m_fullScore, m_kernelEstimateSigma, and m_minFastScoreFraction.
|
pure virtualinherited |
Run the algorithm tool.
featureVector | the vector of features to append |
args | arguments to pass to the tool |
|
private |
Whether to enable folding of -pi -> +pi phi distribution into 0 -> +pi region only.
Definition at line 177 of file RPhiFeatureTool.h.
Referenced by FillKernelEstimate(), and ReadSettings().
|
private |
Number of bins to use for fast score histograms.
Definition at line 173 of file RPhiFeatureTool.h.
Referenced by GetFastScore(), GetMidwayScore(), and ReadSettings().
|
private |
Max value for fast score histograms.
Definition at line 175 of file RPhiFeatureTool.h.
Referenced by GetFastScore(), GetMidwayScore(), and ReadSettings().
|
private |
Min value for fast score histograms.
Definition at line 174 of file RPhiFeatureTool.h.
Referenced by GetFastScore(), GetMidwayScore(), and ReadSettings().
|
private |
Whether to use the fast histogram based score to selectively avoid calling full or midway scores.
Definition at line 164 of file RPhiFeatureTool.h.
Referenced by ReadSettings(), and Run().
|
private |
Whether to use the fast histogram based score only.
Definition at line 165 of file RPhiFeatureTool.h.
Referenced by ReadSettings(), and Run().
|
private |
Whether to use the full kernel density estimation score, as opposed to the midway score.
Definition at line 166 of file RPhiFeatureTool.h.
Referenced by ReadSettings(), and Run().
|
private |
Hit-deweighting offset, of form: weight = 1 / sqrt(distance + kappa), units cm.
Definition at line 169 of file RPhiFeatureTool.h.
Referenced by FillKernelEstimate(), and ReadSettings().
|
private |
The Gaussian width to use for kernel estimation.
Definition at line 168 of file RPhiFeatureTool.h.
Referenced by ReadSettings(), and Run().
|
private |
Max hit-vertex displacement in any one dimension for contribution to kernel estimation.
Definition at line 170 of file RPhiFeatureTool.h.
Referenced by FillKernelEstimate(), and ReadSettings().
|
private |
Fast score must be at least this fraction of best fast score to calculate full score.
Definition at line 172 of file RPhiFeatureTool.h.
Referenced by ReadSettings(), and Run().