Belle II Software  release-06-01-15
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 <TVector3.h>
11 #include <vector>
12 
13 
14 namespace Belle2 {
29  public:
30 
35  {
36  m_axis.SetXYZ(0., 0., 0.);
37  };
38 
44  HarmonicMoments(const std::vector<TVector3>& momenta, const TVector3& axis)
45  {
46  m_momenta.clear();
47  m_momenta = momenta;
48  m_axis = axis;
49  };
50 
55 
60  void setMomenta(const std::vector<TVector3>& momenta)
61  {
62  m_momenta.clear();
63  m_momenta = momenta;
64  return;
65  };
66 
71  void setAxis(TVector3 axis)
72  {
73  m_axis = axis;
74  return;
75  };
76 
80  void calculateBasicMoments();
81 
86  void calculateAllMoments();
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<TVector3> m_momenta;
105  TVector3 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.
void setMomenta(const std::vector< TVector3 > &momenta)
Sets the list of momenta, overwriting whatever list has been set before.
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(const std::vector< TVector3 > &momenta, const TVector3 &axis)
Constructor.
void setAxis(TVector3 axis)
Sets the reference axis.
HarmonicMoments()
Default constructor.
TVector3 m_axis
The reference axis.
std::vector< TVector3 > m_momenta
The list of particles.
Abstract base class for different kinds of events.