Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
ShowerAsymmetryFeatureTool.cc
Go to the documentation of this file.
1
13
14using namespace pandora;
15
16namespace lar_content
17{
18
22
23//------------------------------------------------------------------------------------------------------------------------------------------
24
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}
54
55//------------------------------------------------------------------------------------------------------------------------------------------
56
58 const CartesianVector &vertexPosition, const VertexSelectionBaseAlgorithm::ShowerCluster &showerCluster) const
59{
60 for (const Cluster *const pCluster : showerCluster.GetClusters())
61 {
63 return true;
64 }
65
66 return false;
67}
68
69//------------------------------------------------------------------------------------------------------------------------------------------
70//------------------------------------------------------------------------------------------------------------------------------------------
71
73{
75 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "VertexClusterDistance", m_vertexClusterDistance));
76
78}
79
80} // namespace lar_content
Grouping of header files for many classes of use in particle flow algorithms.
Header file for the cluster helper class.
Header file for the geometry helper class.
Header file for the shower asymmetry feature tool class.
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
Definition StatusCodes.h:31
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
virtual float CalculateAsymmetry(const bool useEnergyMetrics, const pandora::CartesianVector &vertexPosition2D, const pandora::ClusterVector &asymmetryClusters, const pandora::CartesianVector &localWeightedDirectionSum) const
Calculate the asymmetry feature.
static float GetClosestDistance(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2)
Get closest distance between clusters in a pair of cluster lists.
float m_vertexClusterDistance
The distance around the vertex to look for shower clusters.
float GetAsymmetryForView(const pandora::CartesianVector &vertexPosition2D, const VertexSelectionBaseAlgorithm::SlidingFitDataList &, const VertexSelectionBaseAlgorithm::ShowerClusterList &showerClusterList) const override
Get the shower asymmetry feature for a given view.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle) override
Read the algorithm settings.
bool ShouldUseShowerCluster(const pandora::CartesianVector &vertexPosition, const VertexSelectionBaseAlgorithm::ShowerCluster &showerCluster) const
Get whether we should use a given shower cluster for asymmetry calculation.
void GetLocalPosition(const pandora::CartesianVector &position, float &rL, float &rT) const
Get local sliding fit coordinates for a given global position.
pandora::StatusCode GetGlobalFitDirection(const float rL, pandora::CartesianVector &direction) const
Get global fit direction for a given longitudinal coordinate.
const pandora::ClusterList & GetClusters() const
Get the cluster list.
CartesianVector class.
Cluster class.
Definition Cluster.h:31
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
Definition XmlHelper.h:136
std::vector< const Cluster * > ClusterVector
StatusCode
The StatusCode enum.