9#include <analysis/ContinuumSuppression/FoxWolfram.h>
12using namespace ROOT::Math;
24 for (
auto iter1 = begin; iter1 != end; iter1++) {
25 const XYZVector pVec1 = (*iter1);
26 double pMag1 = pVec1.R();
29 for (
auto iter2 = iter1; iter2 != end; iter2++) {
30 const XYZVector pVec2 = (*iter2);
31 double magProd = pMag1 * pVec2.R();
32 double cTheta = pVec1.Dot(pVec2) / magProd;
37 if (iter1 != iter2) magProd *= 2;
43 double cTheta2 = cTheta * cTheta;
44 double cTheta3 = cTheta2 * cTheta;
45 double cTheta4 = cTheta2 * cTheta2;
48 m_moment[2] += magProd * 0.5 * (3.*cTheta2 - 1);
49 m_moment[3] += magProd * 0.5 * (5.*cTheta3 - 3.*cTheta);
50 m_moment[4] += magProd * 0.125 * (35.*cTheta4 - 30.*cTheta2 + 3.);
68 for (
auto iter1 = begin; iter1 != end; iter1++) {
69 const XYZVector pVec1 = (*iter1);
70 double pMag1 = pVec1.R();
73 for (
auto iter2 = iter1; iter2 != end; iter2++) {
74 const XYZVector pVec2 = (*iter2);
75 double magProd = pMag1 * pVec2.R();
76 double cTheta = pVec1.Dot(pVec2) / magProd;
81 if (iter1 != iter2) magProd *= 2;
87 double cTheta2 = cTheta * cTheta;
88 double cTheta3 = cTheta2 * cTheta;
89 double cTheta4 = cTheta2 * cTheta2;
90 double cTheta5 = cTheta4 * cTheta;
91 double cTheta6 = cTheta3 * cTheta3;
92 double cTheta7 = cTheta6 * cTheta;
93 double cTheta8 = cTheta4 * cTheta4;
97 m_moment[2] += magProd * 0.5 * (3.*cTheta2 - 1);
98 m_moment[3] += magProd * 0.5 * (5.*cTheta3 - 3.*cTheta);
99 m_moment[4] += magProd * 0.125 * (35.*cTheta4 - 30.*cTheta2 + 3.);
100 m_moment[5] += magProd * 0.125 * (63.*cTheta5 - 70 * cTheta3 + 15.*cTheta);
101 m_moment[6] += magProd * 0.0625 * (231.*cTheta6 - 315 * cTheta4 + 105 * cTheta2 - 5.);
102 m_moment[7] += magProd * 0.0625 * (429.*cTheta7 - 693.*cTheta5 + 315.*cTheta3 - 35.*cTheta);
103 m_moment[8] += magProd * 0.0078125 * (6435.*cTheta8 - 12012.*cTheta6 + 6930.*cTheta4 - 1260.*cTheta2 + 35.);
double m_moment[9]
The moments.
std::vector< ROOT::Math::XYZVector > m_momenta
The particle's momenta.
void calculateAllMoments()
Method to perform the calculation of the moments up to order 8.
void calculateBasicMoments()
Method to perform the calculation of the moments up to order 4, which are the most relevant ones.
Abstract base class for different kinds of events.