All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
lar_content::GlobalAsymmetryFeatureTool Class Reference

GlobalAsymmetryFeatureTool class. More...

#include <GlobalAsymmetryFeatureTool.h>

Inheritance diagram for lar_content::GlobalAsymmetryFeatureTool:
lar_content::AsymmetryFeatureBaseTool lar_content::MvaFeatureTool< Ts > lar_content::EnergyDepositionAsymmetryFeatureTool

Public Member Functions

 GlobalAsymmetryFeatureTool ()
 Default constructor. More...
 
- Public Member Functions inherited from lar_content::AsymmetryFeatureBaseTool
 AsymmetryFeatureBaseTool ()
 Default constructor. More...
 
void Run (LArMvaHelper::MvaFeatureVector &featureVector, const VertexSelectionBaseAlgorithm *const pAlgorithm, const pandora::Vertex *const pVertex, const VertexSelectionBaseAlgorithm::SlidingFitDataListMap &slidingFitDataListMap, const VertexSelectionBaseAlgorithm::ClusterListMap &, const VertexSelectionBaseAlgorithm::KDTreeMap &, const VertexSelectionBaseAlgorithm::ShowerClusterListMap &showerClusterListMap, const float, float &)
 Run the tool. More...
 
- Public Member Functions inherited from lar_content::MvaFeatureTool< Ts >
 MvaFeatureTool ()=default
 Default constructor. More...
 
virtual void Run (MvaTypes::MvaFeatureVector &featureVector, Ts...args)=0
 Run the algorithm tool. More...
 
virtual void Run (MvaTypes::MvaFeatureMap &featureMap, pandora::StringVector &featureOrder, const std::string &featureToolName, Ts...args)
 

Protected Member Functions

pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle) override
 
- Protected Member Functions inherited from lar_content::AsymmetryFeatureBaseTool
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 
void IncrementAsymmetryParameters (const float weight, const pandora::CartesianVector &clusterDirection, pandora::CartesianVector &localWeightedDirectionSum) const
 Increment the asymmetry parameters. More...
 
virtual float CalculateAsymmetry (const bool useEnergyMetrics, const pandora::CartesianVector &vertexPosition2D, const pandora::ClusterVector &asymmetryClusters, const pandora::CartesianVector &localWeightedDirectionSum) const
 Calculate the asymmetry feature. More...
 

Private Member Functions

float GetAsymmetryForView (const pandora::CartesianVector &vertexPosition2D, const VertexSelectionBaseAlgorithm::SlidingFitDataList &slidingFitDataList, const VertexSelectionBaseAlgorithm::ShowerClusterList &) const override
 Get the global asymmetry feature for a given view. More...
 

Additional Inherited Members

- Public Types inherited from lar_content::MvaFeatureTool< Ts >
typedef std::vector
< MvaFeatureTool< Ts...> * > 
FeatureToolVector
 
typedef std::map< std::string,
MvaFeatureTool< Ts...> * > 
FeatureToolMap
 
- Protected Attributes inherited from lar_content::AsymmetryFeatureBaseTool
float m_maxAsymmetryDistance
 The max distance between cluster (any hit) and vertex to calculate asymmetry score. More...
 

Detailed Description

GlobalAsymmetryFeatureTool class.

Definition at line 19 of file GlobalAsymmetryFeatureTool.h.

Constructor & Destructor Documentation

lar_content::GlobalAsymmetryFeatureTool::GlobalAsymmetryFeatureTool ( )

Default constructor.

Definition at line 19 of file GlobalAsymmetryFeatureTool.cc.

20 {
21 }

Member Function Documentation

float lar_content::GlobalAsymmetryFeatureTool::GetAsymmetryForView ( const pandora::CartesianVector &  vertexPosition2D,
const VertexSelectionBaseAlgorithm::SlidingFitDataList slidingFitDataList,
const VertexSelectionBaseAlgorithm::ShowerClusterList  
) const
overrideprivatevirtual

Get the global asymmetry feature for a given view.

Parameters
vertexPosition2Dthe vertex position projected into this view
slidingFitDataListthe list of sliding fit data objects for this view
Returns
the global asymmetry feature

Implements lar_content::AsymmetryFeatureBaseTool.

Definition at line 25 of file GlobalAsymmetryFeatureTool.cc.

27 {
28  bool useEnergy(true);
29  CartesianVector energyWeightedDirectionSum(0.f, 0.f, 0.f), hitWeightedDirectionSum(0.f, 0.f, 0.f);
30  ClusterVector asymmetryClusters;
31 
32  for (const VertexSelectionBaseAlgorithm::SlidingFitData &slidingFitData : slidingFitDataList)
33  {
34  const Cluster *const pCluster(slidingFitData.GetCluster());
35 
36  asymmetryClusters.push_back(pCluster);
37 
38  if (pCluster->GetElectromagneticEnergy() < std::numeric_limits<float>::epsilon())
39  useEnergy = false;
40 
41  const CartesianVector vertexToMinLayer(slidingFitData.GetMinLayerPosition() - vertexPosition2D);
42  const CartesianVector vertexToMaxLayer(slidingFitData.GetMaxLayerPosition() - vertexPosition2D);
43 
44  const bool minLayerClosest(vertexToMinLayer.GetMagnitudeSquared() < vertexToMaxLayer.GetMagnitudeSquared());
45  const CartesianVector &clusterDirection((minLayerClosest) ? slidingFitData.GetMinLayerDirection() : slidingFitData.GetMaxLayerDirection());
46 
47  if ((LArClusterHelper::GetClosestDistance(vertexPosition2D, pCluster) < m_maxAsymmetryDistance))
48  {
49  this->IncrementAsymmetryParameters(pCluster->GetElectromagneticEnergy(), clusterDirection, energyWeightedDirectionSum);
50  this->IncrementAsymmetryParameters(static_cast<float>(pCluster->GetNCaloHits()), clusterDirection, hitWeightedDirectionSum);
51  }
52  }
53 
54  const CartesianVector &localWeightedDirectionSum(useEnergy ? energyWeightedDirectionSum : hitWeightedDirectionSum);
55 
56  if (localWeightedDirectionSum.GetMagnitudeSquared() < std::numeric_limits<float>::epsilon())
57  return 0.f;
58 
59  return this->CalculateAsymmetry(useEnergy, vertexPosition2D, asymmetryClusters, localWeightedDirectionSum);
60 }
virtual float CalculateAsymmetry(const bool useEnergyMetrics, const pandora::CartesianVector &vertexPosition2D, const pandora::ClusterVector &asymmetryClusters, const pandora::CartesianVector &localWeightedDirectionSum) const
Calculate the asymmetry feature.
float m_maxAsymmetryDistance
The max distance between cluster (any hit) and vertex to calculate asymmetry score.
void IncrementAsymmetryParameters(const float weight, const pandora::CartesianVector &clusterDirection, pandora::CartesianVector &localWeightedDirectionSum) const
Increment the asymmetry parameters.
std::vector< art::Ptr< recob::Cluster > > ClusterVector
static float GetClosestDistance(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2)
Get closest distance between clusters in a pair of cluster lists.
StatusCode lar_content::GlobalAsymmetryFeatureTool::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
overrideprotected

Definition at line 62 of file GlobalAsymmetryFeatureTool.cc.

63 {
65 }
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)

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