#include <AlphaT.h>
|
static double | getAlphaT (const std::vector< double > &et, const std::vector< double > &px, const std::vector< double > &py) |
|
Definition at line 18 of file AlphaT.h.
double AlphaT::getAlphaT |
( |
const std::vector< double > & |
et, |
|
|
const std::vector< double > & |
px, |
|
|
const std::vector< double > & |
py |
|
) |
| |
|
static |
Definition at line 9 of file AlphaT.cc.
References mps_fire::i, dqmiolumiharvest::j, metsig::jet, and mathSSE::sqrt().
13 const double sum_et = accumulate(et.begin(), et.end(), 0.);
14 const double sum_px = accumulate(px.begin(), px.end(), 0.);
15 const double sum_py = accumulate(py.begin(), py.end(), 0.);
18 double min_delta_sum_et = -1.;
19 for (
unsigned i = 0;
i < unsigned(1 << (et.size() - 1));
i++) {
20 double delta_sum_et = 0.;
21 std::vector<bool>
jet;
22 for (
unsigned j = 0;
j < et.size();
j++) {
23 delta_sum_et += et[
j] * (1 - 2 * (int(
i >>
j) & 1));
25 if ((fabs(delta_sum_et) < min_delta_sum_et || min_delta_sum_et < 0.)) {
26 min_delta_sum_et = fabs(delta_sum_et);
29 if (min_delta_sum_et < 0.) {
34 return (0.5 * (sum_et - min_delta_sum_et) /
sqrt(sum_et * sum_et - (sum_px * sum_px + sum_py * sum_py)));