Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
lar_content::RPhiFeatureTool Class Referenceabstract

RPhiFeatureTool class. More...

#include "RPhiFeatureTool.h"

Inheritance diagram for lar_content::RPhiFeatureTool:
Collaboration diagram for lar_content::RPhiFeatureTool:

Classes

class  KernelEstimate
 Kernel estimate class. More...
 

Public Types

typedef std::vector< MvaFeatureTool< Ts... > * > FeatureToolVector
 
typedef std::map< std::string, MvaFeatureTool< Ts... > * > FeatureToolMap
 

Public Member Functions

 RPhiFeatureTool ()
 Default constructor.
 
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.
 
virtual void Run (MvaTypes::MvaFeatureVector &featureVector, Ts... args)=0
 Run the algorithm tool.
 
virtual void Run (MvaTypes::MvaFeatureMap &featureMap, pandora::StringVector &featureOrder, const std::string &featureToolName, Ts...)
 
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 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

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

Private Attributes

bool m_fastScoreCheck
 Whether to use the fast histogram based score to selectively avoid calling full or midway scores.
 
bool m_fastScoreOnly
 Whether to use the fast histogram based score only.
 
bool m_fullScore
 Whether to use the full kernel density estimation score, as opposed to the midway score.
 
float m_kernelEstimateSigma
 The Gaussian width to use for kernel estimation.
 
float m_kappa
 Hit-deweighting offset, of form: weight = 1 / sqrt(distance + kappa), units cm.
 
float m_maxHitVertexDisplacement1D
 Max hit-vertex displacement in any one dimension for contribution to kernel estimation.
 
float m_minFastScoreFraction
 Fast score must be at least this fraction of best fast score to calculate full score.
 
unsigned int m_fastHistogramNPhiBins
 Number of bins to use for fast score histograms.
 
float m_fastHistogramPhiMin
 Min value for fast score histograms.
 
float m_fastHistogramPhiMax
 Max value for fast score histograms.
 
bool m_enableFolding
 Whether to enable folding of -pi -> +pi phi distribution into 0 -> +pi region only.
 

Detailed Description

RPhiFeatureTool class.

Definition at line 21 of file RPhiFeatureTool.h.

Member Typedef Documentation

◆ FeatureToolMap

template<typename... Ts>
typedef std::map<std::string, MvaFeatureTool<Ts...> *> lar_content::MvaFeatureTool< Ts >::FeatureToolMap
inherited

Definition at line 37 of file LArMvaHelper.h.

◆ FeatureToolVector

template<typename... Ts>
typedef std::vector<MvaFeatureTool<Ts...> *> lar_content::MvaFeatureTool< Ts >::FeatureToolVector
inherited

Definition at line 36 of file LArMvaHelper.h.

Constructor & Destructor Documentation

◆ RPhiFeatureTool()

lar_content::RPhiFeatureTool::RPhiFeatureTool ( )

Default constructor.

Definition at line 21 of file RPhiFeatureTool.cc.

Member Function Documentation

◆ AcceptVertexLocation()

bool lar_content::RPhiFeatureTool::AcceptVertexLocation ( const pandora::Vertex *const  pVertex,
const pandora::VertexList selectedVertexList 
) const
private

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

◆ atan2Fast()

float lar_content::RPhiFeatureTool::atan2Fast ( const float  y,
const float  x 
) const
private

Fast estimate of std::atan2 function. Rather coarse (max |error| > 0.01) but should suffice for this use-case.

Parameters
ythe y coordinate
xthe x coordinate
Returns
estimate of std::atan2

Definition at line 198 of file RPhiFeatureTool.cc.

Here is the caller graph for this function:

◆ FillKernelEstimate()

void lar_content::RPhiFeatureTool::FillKernelEstimate ( const pandora::Vertex *const  pVertex,
const pandora::HitType  hitType,
VertexSelectionBaseAlgorithm::HitKDTree2D kdTree,
KernelEstimate kernelEstimate 
) const
private

Use hits in clusters (in the provided kd tree) to fill a provided kernel estimate with hit-vertex relationship information.

Parameters
pVertexthe address of the vertex
hitTypethe relevant hit type
kdTreethe relevant kd tree
kernelEstimateto receive the populated kernel estimate

Definition at line 166 of file RPhiFeatureTool.cc.

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

◆ GetFastScore()

float lar_content::RPhiFeatureTool::GetFastScore ( const KernelEstimate kernelEstimateU,
const KernelEstimate kernelEstimateV,
const KernelEstimate kernelEstimateW 
) const
private

Get the score for a trio of kernel estimations, using fast histogram approach.

Parameters
kernelEstimateUthe kernel estimate for the u view
kernelEstimateVthe kernel estimate for the v view
kernelEstimateWthe kernel estimate for the w view
Returns
the fast score

Definition at line 82 of file RPhiFeatureTool.cc.

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

◆ GetFullScore()

float lar_content::RPhiFeatureTool::GetFullScore ( const KernelEstimate kernelEstimateU,
const KernelEstimate kernelEstimateV,
const KernelEstimate kernelEstimateW 
) const
private

Get the score for a trio of kernel estimations, using kernel density estimation and full hit-by-hit sampling.

Parameters
kernelEstimateUthe kernel estimate for the u view
kernelEstimateVthe kernel estimate for the v view
kernelEstimateWthe kernel estimate for the w view
Returns
the full score

Definition at line 148 of file RPhiFeatureTool.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.

◆ GetMidwayScore()

float lar_content::RPhiFeatureTool::GetMidwayScore ( const KernelEstimate kernelEstimateU,
const KernelEstimate kernelEstimateV,
const KernelEstimate kernelEstimateW 
) const
private

Get the score for a trio of kernel estimations, using kernel density estimation but with reduced (binned) sampling.

Parameters
kernelEstimateUthe kernel estimate for the u view
kernelEstimateVthe kernel estimate for the v view
kernelEstimateWthe kernel estimate for the w view
Returns
the midway score

Definition at line 118 of file RPhiFeatureTool.cc.

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

◆ 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.

◆ 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:

◆ ReadSettings()

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

Read the algorithm settings.

Parameters
xmlHandlethe relevant xml handle

Implements pandora::Process.

Definition at line 243 of file RPhiFeatureTool.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() [1/3]

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.

Parameters
pAlgorithmaddress of the calling algorithm
pVertexaddress of the vertex
kdTreeMapmap of the hit kd trees
beamDeweightingScorethe beam deweighting score for this vertex
bestFastScorethe best fast score
Returns
the r/phi feature

Definition at line 38 of file RPhiFeatureTool.cc.

Here is the call graph for this function:

◆ Run() [2/3]

template<typename... Ts>
virtual void lar_content::MvaFeatureTool< Ts >::Run ( MvaTypes::MvaFeatureMap featureMap,
pandora::StringVector featureOrder,
const std::string &  featureToolName,
Ts...   
)
inlinevirtualinherited

Definition at line 51 of file LArMvaHelper.h.

◆ Run() [3/3]

template<typename... Ts>
virtual void lar_content::MvaFeatureTool< Ts >::Run ( MvaTypes::MvaFeatureVector featureVector,
Ts...  args 
)
pure virtualinherited

Run the algorithm tool.

Parameters
featureVectorthe vector of features to append
argsarguments to pass to the tool

Member Data Documentation

◆ m_enableFolding

bool lar_content::RPhiFeatureTool::m_enableFolding
private

Whether to enable folding of -pi -> +pi phi distribution into 0 -> +pi region only.

Definition at line 178 of file RPhiFeatureTool.h.

◆ m_fastHistogramNPhiBins

unsigned int lar_content::RPhiFeatureTool::m_fastHistogramNPhiBins
private

Number of bins to use for fast score histograms.

Definition at line 174 of file RPhiFeatureTool.h.

◆ m_fastHistogramPhiMax

float lar_content::RPhiFeatureTool::m_fastHistogramPhiMax
private

Max value for fast score histograms.

Definition at line 176 of file RPhiFeatureTool.h.

◆ m_fastHistogramPhiMin

float lar_content::RPhiFeatureTool::m_fastHistogramPhiMin
private

Min value for fast score histograms.

Definition at line 175 of file RPhiFeatureTool.h.

◆ m_fastScoreCheck

bool lar_content::RPhiFeatureTool::m_fastScoreCheck
private

Whether to use the fast histogram based score to selectively avoid calling full or midway scores.

Definition at line 165 of file RPhiFeatureTool.h.

◆ m_fastScoreOnly

bool lar_content::RPhiFeatureTool::m_fastScoreOnly
private

Whether to use the fast histogram based score only.

Definition at line 166 of file RPhiFeatureTool.h.

◆ m_fullScore

bool lar_content::RPhiFeatureTool::m_fullScore
private

Whether to use the full kernel density estimation score, as opposed to the midway score.

Definition at line 167 of file RPhiFeatureTool.h.

◆ m_instanceName

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

The process instance name.

Definition at line 89 of file Process.h.

◆ m_kappa

float lar_content::RPhiFeatureTool::m_kappa
private

Hit-deweighting offset, of form: weight = 1 / sqrt(distance + kappa), units cm.

Definition at line 170 of file RPhiFeatureTool.h.

◆ m_kernelEstimateSigma

float lar_content::RPhiFeatureTool::m_kernelEstimateSigma
private

The Gaussian width to use for kernel estimation.

Definition at line 169 of file RPhiFeatureTool.h.

◆ m_maxHitVertexDisplacement1D

float lar_content::RPhiFeatureTool::m_maxHitVertexDisplacement1D
private

Max hit-vertex displacement in any one dimension for contribution to kernel estimation.

Definition at line 171 of file RPhiFeatureTool.h.

◆ m_minFastScoreFraction

float lar_content::RPhiFeatureTool::m_minFastScoreFraction
private

Fast score must be at least this fraction of best fast score to calculate full score.

Definition at line 173 of file RPhiFeatureTool.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_type

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

The process type.

Definition at line 88 of file Process.h.


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