AsymmetryFeatureBaseTool.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArVertex/AsymmetryFeatureBaseTool.h
3  *
4  * @brief Header file for the global asymmetry feature tool class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_ASYMMETRY_FEATURE_BASE_TOOL_H
9 #define LAR_ASYMMETRY_FEATURE_BASE_TOOL_H 1
10 
12 
13 namespace lar_content
14 {
15 
16 /**
17  * @brief AsymmetryFeatureBaseTool class
18  */
20 {
21 public:
22  /**
23  * @brief Default constructor
24  */
26 
27  /**
28  * @brief Run the tool
29  *
30  * @param pAlgorithm address of the calling algorithm
31  * @param pVertex address of the vertex
32  * @param slidingFitDataListMap map of the sliding fit data lists
33  * @param showerClusterListMap map of the shower cluster lists
34  *
35  * @return the asymmetry feature
36  */
37  void Run(LArMvaHelper::MvaFeatureVector &featureVector, const VertexSelectionBaseAlgorithm *const pAlgorithm,
38  const pandora::Vertex *const pVertex, const VertexSelectionBaseAlgorithm::SlidingFitDataListMap &slidingFitDataListMap,
40  const VertexSelectionBaseAlgorithm::ShowerClusterListMap &showerClusterListMap, const float, float &);
41 
42 protected:
43  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
44 
45  /**
46  * @brief Get the asymmetry feature for a given view
47  *
48  * @param vertexPosition2D the vertex position projected into this view
49  * @param slidingFitDataList the list of sliding fit data objects for this view
50  * @param showerClusterList the list of shower cluster objects for this view
51  *
52  * @return the asymmetry feature
53  */
54  virtual float GetAsymmetryForView(const pandora::CartesianVector &vertexPosition2D,
55  const VertexSelectionBaseAlgorithm::SlidingFitDataList &slidingFitDataList,
56  const VertexSelectionBaseAlgorithm::ShowerClusterList &showerClusterList) const = 0;
57 
58  /**
59  * @brief Increment the asymmetry parameters
60  *
61  * @param weight the weight to assign to this vector
62  * @param clusterDirection the direction of the cluster
63  * @param localWeightedDirectionSum the current energy-weighted local cluster direction vector
64  */
66  const float weight, const pandora::CartesianVector &clusterDirection, pandora::CartesianVector &localWeightedDirectionSum) const;
67 
68  /**
69  * @brief Calculate the asymmetry feature
70  *
71  * @param useEnergyMetrics whether to use energy-based metrics instead of hit-counting-based metrics
72  * @param vertexPosition2D the vertex position in this view
73  * @param asymmetryCluster the vector of cluster objects to be used in the asymmetry calculation
74  * @param localWeightedDirectionSum the local event axis
75  *
76  * @return the asymmetry feature
77  */
78  virtual float CalculateAsymmetry(const bool useEnergyMetrics, const pandora::CartesianVector &vertexPosition2D,
79  const pandora::ClusterVector &asymmetryClusters, const pandora::CartesianVector &localWeightedDirectionSum) const;
80 
81  float m_maxAsymmetryDistance; ///< The max distance between cluster (any hit) and vertex to calculate asymmetry score
82 };
83 
84 } // namespace lar_content
85 
86 #endif // #ifndef LAR_ASYMMETRY_FEATURE_BASE_TOOL_H
MvaTypes::MvaFeatureVector MvaFeatureVector
Definition: LArMvaHelper.h:58
virtual float CalculateAsymmetry(const bool useEnergyMetrics, const pandora::CartesianVector &vertexPosition2D, const pandora::ClusterVector &asymmetryClusters, const pandora::CartesianVector &localWeightedDirectionSum) const
Calculate the asymmetry feature.
virtual float GetAsymmetryForView(const pandora::CartesianVector &vertexPosition2D, const VertexSelectionBaseAlgorithm::SlidingFitDataList &slidingFitDataList, const VertexSelectionBaseAlgorithm::ShowerClusterList &showerClusterList) const =0
Get the asymmetry feature for a given view.
float m_maxAsymmetryDistance
The max distance between cluster (any hit) and vertex to calculate asymmetry score.
weight
Definition: test.py:257
std::map< pandora::HitType, const ShowerClusterList > ShowerClusterListMap
Map of shower cluster lists for passing to tools.
std::map< pandora::HitType, const pandora::ClusterList & > ClusterListMap
Map array of cluster lists for passing to tools.
Header file for the vertex selection base algorithm class.
AsymmetryFeatureBaseTool class.
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.
std::map< pandora::HitType, const SlidingFitDataList > SlidingFitDataListMap
Map of sliding fit data lists for passing to tools.
void IncrementAsymmetryParameters(const float weight, const pandora::CartesianVector &clusterDirection, pandora::CartesianVector &localWeightedDirectionSum) const
Increment the asymmetry parameters.
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
std::map< pandora::HitType, const std::reference_wrapper< HitKDTree2D > > KDTreeMap
Map array of hit kd trees for passing to tools.
std::vector< art::Ptr< recob::Cluster > > ClusterVector
MvaFeatureTool class template.
Definition: LArMvaHelper.h:27
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)