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 <Math/Vector4D.h>
12#include <vector>
13
14
15namespace Belle2 {
30 public:
31
36 {
37 m_axis.SetXYZ(0., 0., 0.);
38 };
39
45 HarmonicMoments(const std::vector<ROOT::Math::PxPyPzEVector>& momenta, const ROOT::Math::XYZVector& axis)
46 {
47 m_momenta.clear();
48 m_momenta = momenta;
49 m_axis = axis;
50 };
51
56
61 void setMomenta(const std::vector<ROOT::Math::PxPyPzEVector>& momenta)
62 {
63 m_momenta.clear();
64 m_momenta = momenta;
65 return;
66 };
67
72 void setAxis(ROOT::Math::XYZVector axis)
73 {
74 m_axis = axis;
75 return;
76 };
77
82
88
95 double getMoment(short i, double sqrts) const
96 {
97 if (i < 0 || i > 8)
98 return NAN;
99 else
100 return m_moment[i] / sqrts;
101 }
102
103 private:
104 double m_moment[9] = {0.};
105 std::vector<ROOT::Math::PxPyPzEVector> m_momenta;
106 ROOT::Math::XYZVector m_axis;
107 };
108
110} // 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.
void setMomenta(const std::vector< ROOT::Math::PxPyPzEVector > &momenta)
Sets the list of momenta, overwriting whatever list has been set before.
HarmonicMoments(const std::vector< ROOT::Math::PxPyPzEVector > &momenta, const ROOT::Math::XYZVector &axis)
Constructor.
std::vector< ROOT::Math::PxPyPzEVector > 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.
void calculateBasicMoments()
Calculates the moments up to order 4.
HarmonicMoments()
Default constructor.
void setAxis(ROOT::Math::XYZVector axis)
Sets the reference axis.
Abstract base class for different kinds of events.