Belle II Software  release-06-01-15
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 <TVector3.h>
11 
12 namespace Belle2 {
24  public:
25 
29  explicit SphericityEigenvalues(const std::vector<TVector3>& momenta)
30  {
31  m_momenta.clear();
32  m_momenta = momenta;
33  }
34 
39 
40 
45  void setMomenta(const std::vector<TVector3>& momenta)
46  {
47  m_momenta.clear();
48  m_momenta = momenta;
49  return;
50  }
51 
52 
56  void calculateEigenvalues();
57 
58 
62  double getEigenvalue(short i) const
63  {
64  return (i < 0 || i > 3) ? 0. : m_lambda[i];
65  }
66 
70  TVector3 getEigenvector(short i) const
71  {
72  TVector3 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  TVector3 m_eVector[3];
80  std::vector<TVector3> m_momenta;
81  };
82 
84 } // Belle2 namespace
Class to calculate the Sphericity tensor eigenvalues and eigenvectors starting from an array of 3-mom...
void setMomenta(const std::vector< TVector3 > &momenta)
Sets the list of momenta to be used in the calculation overwriting the previous values.
TVector3 getEigenvector(short i) const
Returns the i-th Eigenvector.
void calculateEigenvalues()
Calculates eigenvalues and eigenvectors.
TVector3 m_eVector[3]
The eigenvectors.
~SphericityEigenvalues()
Default destructor.
double getEigenvalue(short i) const
Returns the i-th Eigenvalue.
SphericityEigenvalues(const std::vector< TVector3 > &momenta)
Constructor with an array of 3-momenta.
std::vector< TVector3 > m_momenta
The particles' momenta.
double m_lambda[3]
The eigenvalues.
Abstract base class for different kinds of events.