Belle II Software light-2406-ragdoll
SphericityEigenvalues.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <Math/Vector3D.h>
11#include <vector>
12
13namespace Belle2 {
25 public:
26
30 explicit SphericityEigenvalues(const std::vector<ROOT::Math::XYZVector>& momenta)
31 {
32 m_momenta.clear();
33 m_momenta = momenta;
34 }
35
40
41
46 void setMomenta(const std::vector<ROOT::Math::XYZVector>& momenta)
47 {
48 m_momenta.clear();
49 m_momenta = momenta;
50 }
51
52
57
58
62 double getEigenvalue(short i) const
63 {
64 return (i < 0 || i > 3) ? 0. : m_lambda[i];
65 }
66
70 ROOT::Math::XYZVector getEigenvector(short i) const
71 {
72 ROOT::Math::XYZVector nullVector(0., 0., 0.);
73 return (i < 0 || i > 3) ? nullVector : m_eVector[i];
74 }
75
76 private:
77
78 double m_lambda[3] = {0.};
79 ROOT::Math::XYZVector m_eVector[3];
80 std::vector<ROOT::Math::XYZVector> m_momenta;
81 };
82
84} // Belle2 namespace
Class to calculate the Sphericity tensor eigenvalues and eigenvectors starting from an array of 3-mom...
std::vector< ROOT::Math::XYZVector > m_momenta
The particles' momenta.
SphericityEigenvalues(const std::vector< ROOT::Math::XYZVector > &momenta)
Constructor with an array of 3-momenta.
void calculateEigenvalues()
Calculates eigenvalues and eigenvectors.
void setMomenta(const std::vector< ROOT::Math::XYZVector > &momenta)
Sets the list of momenta to be used in the calculation overwriting the previous values.
ROOT::Math::XYZVector getEigenvector(short i) const
Returns the i-th Eigenvector.
~SphericityEigenvalues()
Default destructor.
double getEigenvalue(short i) const
Returns the i-th Eigenvalue.
ROOT::Math::XYZVector m_eVector[3]
The eigenvectors.
double m_lambda[3]
The eigenvalues.
Abstract base class for different kinds of events.
Definition: ClusterUtils.h:24