Belle II Software development
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 <Math/Vector4D.h>
12#include <vector>
13
14namespace Belle2 {
26 public:
27
31 explicit SphericityEigenvalues(const std::vector<ROOT::Math::PxPyPzEVector>& momenta)
32 {
33 m_momenta.clear();
34 m_momenta = momenta;
35 }
36
41
42
47 void setMomenta(const std::vector<ROOT::Math::PxPyPzEVector>& momenta)
48 {
49 m_momenta.clear();
50 m_momenta = momenta;
51 }
52
53
58
59
63 double getEigenvalue(short i) const
64 {
65 return (i < 0 || i > 3) ? 0. : m_lambda[i];
66 }
67
71 ROOT::Math::XYZVector getEigenvector(short i) const
72 {
73 ROOT::Math::XYZVector nullVector(0., 0., 0.);
74 return (i < 0 || i > 3) ? nullVector : m_eVector[i];
75 }
76
77 private:
78
79 double m_lambda[3] = {0.};
80 ROOT::Math::XYZVector m_eVector[3];
81 std::vector<ROOT::Math::PxPyPzEVector> m_momenta;
82 };
83
85} // Belle2 namespace
Class to calculate the Sphericity tensor eigenvalues and eigenvectors starting from an array of 3-mom...
void setMomenta(const std::vector< ROOT::Math::PxPyPzEVector > &momenta)
Sets the list of momenta to be used in the calculation overwriting the previous values.
std::vector< ROOT::Math::PxPyPzEVector > m_momenta
The particles' momenta.
void calculateEigenvalues()
Calculates eigenvalues and eigenvectors.
SphericityEigenvalues(const std::vector< ROOT::Math::PxPyPzEVector > &momenta)
Constructor with an array of 4-momenta.
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.