Class to calculate the Harmonic moments up to order 8 with respect to a given axis.
More...
#include <HarmonicMoments.h>
|
| HarmonicMoments () |
| Default constructor.
|
|
| HarmonicMoments (const std::vector< ROOT::Math::PxPyPzEVector > &momenta, const ROOT::Math::XYZVector &axis) |
| Constructor.
|
|
| ~HarmonicMoments () |
| Default destructor.
|
|
void | setMomenta (const std::vector< ROOT::Math::PxPyPzEVector > &momenta) |
| Sets the list of momenta, overwriting whatever list has been set before.
|
|
void | setAxis (ROOT::Math::XYZVector axis) |
| Sets the reference axis.
|
|
void | calculateBasicMoments () |
| Calculates the moments up to order 4.
|
|
void | calculateAllMoments () |
| Calculates the moments up to order 8.
|
|
double | getMoment (short i, double sqrts) const |
| Returns the moment of order i.
|
|
|
double | m_moment [9] = {0.} |
| The harmonic moments.
|
|
std::vector< ROOT::Math::PxPyPzEVector > | m_momenta |
| The list of particles.
|
|
ROOT::Math::XYZVector | m_axis |
| The reference axis.
|
|
Class to calculate the Harmonic moments up to order 8 with respect to a given axis.
Since the most common user case is the calculation of the moments up to order 4, and the calculation of the momenta 5-8 takes much longer, two methods have been implemented. HarmonicMoments::calculateBasicMoments will calculate the moments up to 4, while HarmonicMoments::calculateAllMoments will perform the calculation up to order 8. The two options have been implemented in two separate methods instead of using an if condition simply to minimize the computing time.
Definition at line 29 of file HarmonicMoments.h.
◆ HarmonicMoments() [1/2]
Default constructor.
Definition at line 35 of file HarmonicMoments.h.
36 {
37 m_axis.SetXYZ(0., 0., 0.);
38 };
◆ HarmonicMoments() [2/2]
HarmonicMoments |
( |
const std::vector< ROOT::Math::PxPyPzEVector > & | momenta, |
|
|
const ROOT::Math::XYZVector & | axis ) |
|
inline |
Constructor.
- Parameters
-
momenta | A vector of XYZVectors containing the 3-momenta to be used to the moments' calculation |
axis | The reference axis |
Definition at line 45 of file HarmonicMoments.h.
46 {
47 m_momenta.clear();
48 m_momenta = momenta;
49 m_axis = axis;
50 };
◆ ~HarmonicMoments()
◆ calculateAllMoments()
void calculateAllMoments |
( |
| ) |
|
Calculates the moments up to order 8.
The execution time of this function is significantly longer than calculateBasicMoments().
Definition at line 42 of file HarmonicMoments.cc.
43{
44
46
47 double pMag = p.R();
48 double cTheta = p.Vect().Dot(
m_axis) / pMag;
49
50
51
52
53
54 double cTheta2 = cTheta * cTheta;
55 double cTheta3 = cTheta2 * cTheta;
56 double cTheta4 = cTheta2 * cTheta2;
57 double cTheta5 = cTheta4 * cTheta;
58 double cTheta6 = cTheta3 * cTheta3;
59 double cTheta7 = cTheta6 * cTheta;
60 double cTheta8 = cTheta4 * cTheta4;
61
64 m_moment[2] += pMag * 0.5 * (3.*cTheta2 - 1);
65 m_moment[3] += pMag * 0.5 * (5.*cTheta3 - 3.*cTheta);
66 m_moment[4] += pMag * 0.125 * (35.*cTheta4 - 30.*cTheta2 + 3.);
67 m_moment[5] += pMag * 0.125 * (63.*cTheta5 - 70 * cTheta3 + 15.*cTheta);
68 m_moment[6] += pMag * 0.0625 * (231.*cTheta6 - 315 * cTheta4 + 105 * cTheta2 - 5.);
69 m_moment[7] += pMag * 0.0625 * (429.*cTheta7 - 693.*cTheta5 + 315.*cTheta3 - 35.*cTheta);
70 m_moment[8] += pMag * 0.0078125 * (6435.*cTheta8 - 12012.*cTheta6 + 6930.*cTheta4 - 1260.*cTheta2 + 35.);
71 }
72 return;
73}
double m_moment[9]
The harmonic moments.
std::vector< ROOT::Math::PxPyPzEVector > m_momenta
The list of particles.
ROOT::Math::XYZVector m_axis
The reference axis.
◆ calculateBasicMoments()
void calculateBasicMoments |
( |
| ) |
|
Calculates the moments up to order 4.
Definition at line 16 of file HarmonicMoments.cc.
17{
18
20
21 double pMag = p.R();
22 double cTheta = p.Vect().Dot(
m_axis) / pMag;
23
24
25
26
27
28 double cTheta2 = cTheta * cTheta;
29 double cTheta3 = cTheta2 * cTheta;
30 double cTheta4 = cTheta2 * cTheta2;
31
34 m_moment[2] += pMag * 0.5 * (3.*cTheta2 - 1);
35 m_moment[3] += pMag * 0.5 * (5.*cTheta3 - 3.*cTheta);
36 m_moment[4] += pMag * 0.125 * (35.*cTheta4 - 30.*cTheta2 + 3.);
37 }
38 return;
39}
◆ getMoment()
double getMoment |
( |
short | i, |
|
|
double | sqrts ) const |
|
inline |
Returns the moment of order i.
- Parameters
-
i | the order (0-8) |
sqrts | the center of mass energy |
- Returns
- the harmonic moment, not normalized to sqrt(s)
Definition at line 95 of file HarmonicMoments.h.
96 {
97 if (i < 0 || i > 8)
98 return NAN;
99 else
100 return m_moment[i] / sqrts;
101 }
◆ setAxis()
void setAxis |
( |
ROOT::Math::XYZVector | axis | ) |
|
|
inline |
Sets the reference axis.
- Parameters
-
Definition at line 72 of file HarmonicMoments.h.
73 {
74 m_axis = axis;
75 return;
76 };
◆ setMomenta()
void setMomenta |
( |
const std::vector< ROOT::Math::PxPyPzEVector > & | momenta | ) |
|
|
inline |
Sets the list of momenta, overwriting whatever list has been set before.
- Parameters
-
momenta | A vector of PxPyPzEVectors containing the 4-momenta to be used for the moments' calculation |
Definition at line 61 of file HarmonicMoments.h.
62 {
63 m_momenta.clear();
64 m_momenta = momenta;
65 return;
66 };
◆ m_axis
ROOT::Math::XYZVector m_axis |
|
private |
◆ m_moment
double m_moment[9] = {0.} |
|
private |
◆ m_momenta
std::vector<ROOT::Math::PxPyPzEVector> m_momenta |
|
private |
The documentation for this class was generated from the following files: