#include <AlphaT.h>
|
static double | getAlphaT (const std::vector< double > &et, const std::vector< double > &px, const std::vector< double > &py) |
|
Definition at line 19 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 i, j, metsig::jet, and mathSSE::sqrt().
14 const double sum_et = accumulate( et.begin(), et.end(), 0. );
15 const double sum_px = accumulate( px.begin(), px.end(), 0. );
16 const double sum_py = accumulate( py.begin(), py.end(), 0. );
19 double min_delta_sum_et = -1.;
20 for (
unsigned i=0;
i < unsigned(1<<(et.size()-1));
i++ ) {
21 double delta_sum_et = 0.;
22 std::vector<bool>
jet;
23 for (
unsigned j=0;
j < et.size();
j++ ) {
24 delta_sum_et += et[
j] * ( 1 - 2 * (int(
i>>
j)&1) );
26 if ( ( fabs(delta_sum_et) < min_delta_sum_et || min_delta_sum_et < 0. ) ) {
27 min_delta_sum_et = fabs(delta_sum_et);
30 if ( min_delta_sum_et < 0. ) {
return 0.; }
33 return ( 0.5 * ( sum_et - min_delta_sum_et ) /
sqrt( sum_et*sum_et - (sum_px*sum_px+sum_py*sum_py) ) );