Belle II Software  release-05-02-19
HarmonicMoments.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Umberto Tamponi (tamponi@to.infn.it) *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 #include <TVector3.h>
13 #include <vector>
14 
15 
16 namespace Belle2 {
30  class HarmonicMoments {
31  public:
32 
37  {
38  m_axis.SetXYZ(0., 0., 0.);
39  };
40 
46  HarmonicMoments(const std::vector<TVector3>& momenta, const TVector3& axis)
47  {
48  m_momenta.clear();
49  m_momenta = momenta;
50  m_axis = axis;
51  };
52 
56  ~HarmonicMoments() {};
57 
62  void setMomenta(const std::vector<TVector3>& momenta)
63  {
64  m_momenta.clear();
65  m_momenta = momenta;
66  return;
67  };
68 
73  void setAxis(TVector3 axis)
74  {
75  m_axis = axis;
76  return;
77  };
78 
82  void calculateBasicMoments();
83 
88  void calculateAllMoments();
89 
96  double getMoment(short i, double sqrts) const
97  {
98  if (i < 0 || i > 8)
99  return NAN;
100  else
101  return m_moment[i] / sqrts;
102  }
103 
104  private:
105  double m_moment[9] = {0.};
106  std::vector<TVector3> m_momenta;
107  TVector3 m_axis;
108  };
109 
111 } // Belle2 namespace
Belle2::HarmonicMoments::m_moment
double m_moment[9]
The harmonic moments.
Definition: HarmonicMoments.h:113
Belle2::HarmonicMoments::setAxis
void setAxis(TVector3 axis)
Sets the reference axis.
Definition: HarmonicMoments.h:81
Belle2::HarmonicMoments::m_axis
TVector3 m_axis
The reference axis.
Definition: HarmonicMoments.h:115
Belle2::HarmonicMoments::calculateAllMoments
void calculateAllMoments()
Calculates the moments up to order 8.
Definition: HarmonicMoments.cc:44
Belle2::HarmonicMoments::getMoment
double getMoment(short i, double sqrts) const
Returns the moment of order i.
Definition: HarmonicMoments.h:104
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::HarmonicMoments::HarmonicMoments
HarmonicMoments()
Default constructor.
Definition: HarmonicMoments.h:44
Belle2::HarmonicMoments::calculateBasicMoments
void calculateBasicMoments()
Calculates the moments up to order 4.
Definition: HarmonicMoments.cc:18
Belle2::HarmonicMoments::~HarmonicMoments
~HarmonicMoments()
Default destructor.
Definition: HarmonicMoments.h:64
Belle2::HarmonicMoments::m_momenta
std::vector< TVector3 > m_momenta
The list of particles.
Definition: HarmonicMoments.h:114
Belle2::HarmonicMoments::setMomenta
void setMomenta(const std::vector< TVector3 > &momenta)
Sets the list of momenta, overwriting whatever list has been set before.
Definition: HarmonicMoments.h:70