21#include <analysis/ContinuumSuppression/KsfwMoments.h>
33 inline double legendre(
const double z,
const int i)
38 case 2:
return 1.5 * z * z - 0.5;
39 case 3:
return z * (2.5 * z * z - 1.5);
40 case 4:
return (4.375 * z * z * z * z - 3.75 * z * z + 0.375);
49 std::vector<std::pair<ROOT::Math::XYZVector, int>> p3_cms_q_sigA,
50 std::vector<std::pair<ROOT::Math::XYZVector, int>> p3_cms_q_sigB,
51 std::vector<std::pair<ROOT::Math::XYZVector, int>> p3_cms_q_roe,
52 const ROOT::Math::PxPyPzEVector& p_cms_missA,
53 const ROOT::Math::PxPyPzEVector& p_cms_missB,
63 m_mm2[0] = p_cms_missA.E() > 0
65 : -p_cms_missA.E() * p_cms_missA.E() - p_cms_missA.P2();
66 m_mm2[1] = p_cms_missB.E() > 0
68 : -p_cms_missB.E() * p_cms_missB.E() - p_cms_missB.P2();
73 std::vector<std::pair<ROOT::Math::XYZVector, int>>::iterator pqi, pqj;
76 for (
int i = 0; i < 3; i++) {
77 for (
int k = 0; k < 5; k++) {
83 for (pqi = p3_cms_q_sigA.begin(); pqi != p3_cms_q_sigA.end(); ++pqi) {
84 const double pi_mag((pqi->first).R());
85 for (pqj = p3_cms_q_roe.begin(); pqj != p3_cms_q_roe.end(); ++pqj) {
86 const double pj_mag((pqj->first).R());
87 const double ij_cos((pqi->first).Dot(pqj->first) / pi_mag / pj_mag);
88 const int c_or_n(0 == (pqj->second) ? 1 : 0);
89 for (
int k = 0; k < 5; k++) {
90 m_Hso[0][c_or_n][k] += (k % 2)
91 ? (pqi->second) * (pqj->second) * pj_mag *
legendre(ij_cos, k)
95 const double p_miss_mag(p_cms_missA.P());
96 const double i_miss_cos((pqi->first).Dot(p_cms_missA.Vect()) / pi_mag / p_miss_mag);
97 for (
int k = 0; k < 5; k++) {
98 m_Hso[0][2][k] += (k % 2) ? 0 : p_miss_mag *
legendre(i_miss_cos, k);
103 for (pqi = p3_cms_q_sigB.begin(); pqi != p3_cms_q_sigB.end(); ++pqi) {
104 const double pi_mag((pqi->first).R());
105 for (pqj = p3_cms_q_roe.begin(); pqj != p3_cms_q_roe.end(); ++pqj) {
106 const double pj_mag((pqj->first).R());
107 const double ij_cos((pqi->first).Dot(pqj->first) / pi_mag / pj_mag);
108 const int c_or_n(0 == (pqj->second) ? 1 : 0);
109 for (
int k = 0; k < 5; k++) {
110 m_Hso[1][c_or_n][k] += (k % 2)
111 ? (pqi->second) * (pqj->second) * pj_mag *
legendre(ij_cos, k)
115 const double p_miss_mag(p_cms_missB.P());
116 const double i_miss_cos((pqi->first).Dot(p_cms_missB.Vect()) / pi_mag / p_miss_mag);
117 for (
int k = 0; k < 5; k++) {
118 m_Hso[1][2][k] += (k % 2) ? 0 : p_miss_mag *
legendre(i_miss_cos, k);
123 std::vector<std::pair<ROOT::Math::XYZVector, int>> p3_cms_q_roeA(p3_cms_q_roe), p3_cms_q_roeB(p3_cms_q_roe);
124 p3_cms_q_roeA.emplace_back(p_cms_missA.Vect(), 0);
125 p3_cms_q_roeB.emplace_back(p_cms_missB.Vect(), 0);
128 for (
int k = 0; k < 5; k++) {
131 for (pqi = p3_cms_q_roeA.begin(); pqi != p3_cms_q_roeA.end(); ++pqi) {
132 const double pi_mag((pqi->first).R());
133 for (pqj = p3_cms_q_roeA.begin(); pqj != pqi; ++pqj) {
134 const double pj_mag((pqj->first).R());
135 const double ij_cos((pqi->first).Dot(pqj->first) / pi_mag / pj_mag);
136 for (
int k = 0; k < 5; k++) {
137 m_Hoo[0][k] += (k % 2)
138 ? (pqi->second) * (pqj->second) * pi_mag * pj_mag *
legendre(ij_cos, k)
139 : pi_mag * pj_mag *
legendre(ij_cos, k);
143 for (pqi = p3_cms_q_roeB.begin(); pqi != p3_cms_q_roeB.end(); ++pqi) {
144 const double pi_mag((pqi->first).R());
145 for (pqj = p3_cms_q_roeB.begin(); pqj != pqi; ++pqj) {
146 const double pj_mag((pqj->first).R());
147 const double ij_cos((pqi->first).Dot(pqj->first) / pi_mag / pj_mag);
148 for (
int k = 0; k < 5; k++) {
149 m_Hoo[1][k] += (k % 2)
150 ? (pqi->second) * (pqj->second) * pi_mag * pj_mag *
legendre(ij_cos, k)
151 : pi_mag * pj_mag *
legendre(ij_cos, k);
157 for (
int k = 0; k < 5; k++) {
158 for (
int j = 0; j < ((k % 2) ? 1 : 3); j++) {
159 m_Hso[0][j][k] /= Hso0_max;
160 m_Hso[1][j][k] /= Hso0_max;
162 m_Hoo[0][k] /= (Hso0_max * Hso0_max);
163 m_Hoo[1][k] /= (Hso0_max * Hso0_max);
double et(int uf=-1) const
Returns calculated transverse energy.
double m_et[2]
Transverse energy.
int m_uf
Flag that specifiies we are using the final state for signal.
double m_Hso[2][3][5]
KSFW moments.
KsfwMoments()
Initialize KSFW moments, et, and mm2 to 0.
double m_mm2[2]
Missing mass squared.
double m_Hoo[2][5]
KSFW moments.
double legendre(const double z, const int i)
Legendre polynomials.
Abstract base class for different kinds of events.