Public Member Functions | Private Member Functions | Private Attributes | List of all members
lar_content::ShowerAsymmetryFeatureTool Class Reference

ShowerAsymmetryFeatureTool class. More...

#include <ShowerAsymmetryFeatureTool.h>

Inheritance diagram for lar_content::ShowerAsymmetryFeatureTool:
lar_content::AsymmetryFeatureBaseTool lar_content::MvaFeatureTool< Ts >

Public Member Functions

 ShowerAsymmetryFeatureTool ()
 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...
 

Private Member Functions

pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle) override
 
float GetAsymmetryForView (const pandora::CartesianVector &vertexPosition2D, const VertexSelectionBaseAlgorithm::SlidingFitDataList &, const VertexSelectionBaseAlgorithm::ShowerClusterList &showerClusterList) const override
 Get the shower asymmetry feature for a given view. More...
 
bool ShouldUseShowerCluster (const pandora::CartesianVector &vertexPosition, const VertexSelectionBaseAlgorithm::ShowerCluster &showerCluster) const
 Get whether we should use a given shower cluster for asymmetry calculation. More...
 

Private Attributes

float m_vertexClusterDistance
 The distance around the vertex to look for shower clusters. More...
 

Additional Inherited Members

- Public Types inherited from lar_content::MvaFeatureTool< Ts >
typedef std::vector< MvaFeatureTool< Ts... > * > FeatureToolVector
 
- 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...
 
- 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

ShowerAsymmetryFeatureTool class.

Definition at line 21 of file ShowerAsymmetryFeatureTool.h.

Constructor & Destructor Documentation

lar_content::ShowerAsymmetryFeatureTool::ShowerAsymmetryFeatureTool ( )

Default constructor.

Definition at line 19 of file ShowerAsymmetryFeatureTool.cc.

20 {
21 }
float m_vertexClusterDistance
The distance around the vertex to look for shower clusters.

Member Function Documentation

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

Get the shower asymmetry feature for a given view.

Parameters
vertexPosition2Dthe projected vertex position
showerClusterListthe list of shower clusters in this view
Returns
the shower asymmetry feature

Implements lar_content::AsymmetryFeatureBaseTool.

Definition at line 25 of file ShowerAsymmetryFeatureTool.cc.

27 {
28  float showerAsymmetry(1.f);
29 
30  for (const VertexSelectionBaseAlgorithm::ShowerCluster &showerCluster : showerClusterList)
31  {
32  if (this->ShouldUseShowerCluster(vertexPosition2D, showerCluster))
33  {
34  const TwoDSlidingFitResult &showerFit = showerCluster.GetFit();
35 
36  float rL(0.f), rT(0.f);
37  showerFit.GetLocalPosition(vertexPosition2D, rL, rT);
38 
39  CartesianVector showerDirection(0.f, 0.f, 0.f);
40  if (STATUS_CODE_SUCCESS != showerFit.GetGlobalFitDirection(rL, showerDirection))
41  continue;
42 
43  ClusterVector asymmetryClusters;
44  std::copy(showerCluster.GetClusters().begin(), showerCluster.GetClusters().end(), std::back_inserter(asymmetryClusters));
45 
46  showerAsymmetry = this->CalculateAsymmetry(true, vertexPosition2D, asymmetryClusters, showerDirection);
47 
48  break;
49  }
50  }
51 
52  return showerAsymmetry;
53 }
virtual float CalculateAsymmetry(const bool useEnergyMetrics, const pandora::CartesianVector &vertexPosition2D, const pandora::ClusterVector &asymmetryClusters, const pandora::CartesianVector &localWeightedDirectionSum) const
Calculate the asymmetry feature.
T copy(T const &v)
std::vector< art::Ptr< recob::Cluster > > ClusterVector
bool ShouldUseShowerCluster(const pandora::CartesianVector &vertexPosition, const VertexSelectionBaseAlgorithm::ShowerCluster &showerCluster) const
Get whether we should use a given shower cluster for asymmetry calculation.
StatusCode lar_content::ShowerAsymmetryFeatureTool::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
overrideprivate

Definition at line 72 of file ShowerAsymmetryFeatureTool.cc.

73 {
74  PANDORA_RETURN_RESULT_IF_AND_IF(
75  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "VertexClusterDistance", m_vertexClusterDistance));
76 
78 }
float m_vertexClusterDistance
The distance around the vertex to look for shower clusters.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
bool lar_content::ShowerAsymmetryFeatureTool::ShouldUseShowerCluster ( const pandora::CartesianVector &  vertexPosition,
const VertexSelectionBaseAlgorithm::ShowerCluster showerCluster 
) const
private

Get whether we should use a given shower cluster for asymmetry calculation.

Parameters
vertexPositionthe projected vertex position
showerClusterthe shower cluster
Returns
whether the shower cluster should be considered

Definition at line 57 of file ShowerAsymmetryFeatureTool.cc.

59 {
60  for (const Cluster *const pCluster : showerCluster.GetClusters())
61  {
62  if (LArClusterHelper::GetClosestDistance(vertexPosition, pCluster) < m_vertexClusterDistance)
63  return true;
64  }
65 
66  return false;
67 }
float m_vertexClusterDistance
The distance around the vertex to look for shower clusters.
static float GetClosestDistance(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2)
Get closest distance between clusters in a pair of cluster lists.

Member Data Documentation

float lar_content::ShowerAsymmetryFeatureTool::m_vertexClusterDistance
private

The distance around the vertex to look for shower clusters.

Definition at line 53 of file ShowerAsymmetryFeatureTool.h.


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