Belle II Software development
HarmonicMoments.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
9#pragma once
10#include <Math/Vector3D.h>
11#include <vector>
12
13
14namespace Belle2 {
29 public:
30
35 {
36 m_axis.SetXYZ(0., 0., 0.);
37 };
38
44 HarmonicMoments(const std::vector<ROOT::Math::XYZVector>& momenta, const ROOT::Math::XYZVector& axis)
45 {
46 m_momenta.clear();
47 m_momenta = momenta;
48 m_axis = axis;
49 };
50
55
60 void setMomenta(const std::vector<ROOT::Math::XYZVector>& momenta)
61 {
62 m_momenta.clear();
63 m_momenta = momenta;
64 return;
65 };
66
71 void setAxis(ROOT::Math::XYZVector axis)
72 {
73 m_axis = axis;
74 return;
75 };
76
81
87
94 double getMoment(short i, double sqrts) const
95 {
96 if (i < 0 || i > 8)
97 return NAN;
98 else
99 return m_moment[i] / sqrts;
100 }
101
102 private:
103 double m_moment[9] = {0.};
104 std::vector<ROOT::Math::XYZVector> m_momenta;
105 ROOT::Math::XYZVector m_axis;
106 };
107
109} // Belle2 namespace
Class to calculate the Harmonic moments up to order 8 with respect to a given axis.
double m_moment[9]
The harmonic moments.
std::vector< ROOT::Math::XYZVector > m_momenta
The list of particles.
ROOT::Math::XYZVector m_axis
The reference axis.
void calculateAllMoments()
Calculates the moments up to order 8.
~HarmonicMoments()
Default destructor.
double getMoment(short i, double sqrts) const
Returns the moment of order i.
HarmonicMoments(const std::vector< ROOT::Math::XYZVector > &momenta, const ROOT::Math::XYZVector &axis)
Constructor.
void calculateBasicMoments()
Calculates the moments up to order 4.
void setMomenta(const std::vector< ROOT::Math::XYZVector > &momenta)
Sets the list of momenta, overwriting whatever list has been set before.
HarmonicMoments()
Default constructor.
void setAxis(ROOT::Math::XYZVector axis)
Sets the reference axis.
Abstract base class for different kinds of events.