66#include <analysis/ContinuumSuppression/Thrust.h>
69using namespace ROOT::Math;
75 XYZVector thrust_axis, trial_axis, base_axis;
76 auto end = momenta.end();
77 auto begin = momenta.begin();
80 double sum_magnitude_mom = 0.;
87 for (
auto const& momentum : momenta)
88 sum_magnitude_mom += momentum.R();
95 for (
auto const& mom : momenta) {
97 trial_axis = (mom.Z() >= 0.) ? XYZVector(mom) : XYZVector(-mom);
100 trial_axis = trial_axis.Unit();
109 base_axis = trial_axis;
110 trial_axis = XYZVector();
113 for (
auto const& momentum : momenta)
114 trial_axis += (momentum.Dot(base_axis) >= 0.) ? \
115 XYZVector(momentum) : XYZVector(-momentum);
121 for (itr = begin; itr != end; itr++)
122 if ((*itr).Dot(trial_axis) * (*itr).Dot(base_axis) < 0.)
break;
133 double trial_mag(trial_axis.R());
142 double trial_thrust(0.);
143 for (
auto const& momentum : momenta)
144 trial_thrust += std::fabs(momentum.Dot(trial_axis));
146 trial_thrust /= (sum_magnitude_mom * trial_mag);
152 if (trial_thrust > thrust) {
153 thrust = trial_thrust;
154 thrust_axis = trial_axis / trial_mag;
167 thrust_axis *= thrust;
static ROOT::Math::XYZVector calculateThrust(const std::vector< ROOT::Math::XYZVector > &momenta)
calculates the thrust axis
Abstract base class for different kinds of events.