Belle II Software development
FoxWolfram.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#include <Math/Vector3D.h>
10#include <vector>
11
12
13namespace Belle2 {
28 class FoxWolfram {
29 public:
30
35
36
40 explicit FoxWolfram(const std::vector<ROOT::Math::XYZVector>& momenta)
41 {
42 m_momenta.clear();
43 m_momenta = momenta;
44 };
45
46
51
52
59
60
67
68
73 void setMomenta(const std::vector<ROOT::Math::XYZVector>& momenta)
74 {
75 m_momenta.clear();
76 m_momenta = momenta;
77 return;
78 };
79
83 double getH(int i) const { return (i < 0 || i > 8) ? NAN : m_moment[i]; }
84
89 double getR(int i) const { return (i < 0 || i > 8 || m_moment[0] == 0) ? NAN : m_moment[i] / m_moment[0]; }
90
91
92 private:
93 double m_moment[9] = {0.};
94 std::vector<ROOT::Math::XYZVector> m_momenta;
95 };
96
98} // Belle2 namespace
Class to calculate the Fox-Wolfram moments up to order 8.
Definition: FoxWolfram.h:28
double m_moment[9]
The moments.
Definition: FoxWolfram.h:93
std::vector< ROOT::Math::XYZVector > m_momenta
The particle's momenta.
Definition: FoxWolfram.h:94
~FoxWolfram()
Default destructor.
Definition: FoxWolfram.h:50
double getR(int i) const
Returns the i-th moment normalized to the 0th-order moment.
Definition: FoxWolfram.h:89
void calculateAllMoments()
Method to perform the calculation of the moments up to order 8.
Definition: FoxWolfram.cc:58
void calculateBasicMoments()
Method to perform the calculation of the moments up to order 4, which are the most relevant ones.
Definition: FoxWolfram.cc:14
FoxWolfram(const std::vector< ROOT::Math::XYZVector > &momenta)
Constructor with an array of 3-momenta.
Definition: FoxWolfram.h:40
void setMomenta(const std::vector< ROOT::Math::XYZVector > &momenta)
Sets the list of momenta used for the FW moment calculation, overwriting whatever list has been set b...
Definition: FoxWolfram.h:73
double getH(int i) const
Returns the i-th moment.
Definition: FoxWolfram.h:83
FoxWolfram()
Default constructor.
Abstract base class for different kinds of events.