#include <AlphaT.h>
List of all members.
Public Member Functions |
template<class T > |
| AlphaT (std::vector< T const * > const &p4, bool use_et=true) |
template<class T > |
| AlphaT (std::vector< T > const &p4, bool use_et=true) |
double | value (void) const |
double | value (std::vector< bool > &jet_sign) const |
Private Member Functions |
double | value_ (std::vector< bool > *jet_sign) const |
Private Attributes |
std::vector< double > | et_ |
std::vector< double > | px_ |
std::vector< double > | py_ |
Detailed Description
Definition at line 9 of file AlphaT.h.
Constructor & Destructor Documentation
template<class T >
AlphaT::AlphaT |
( |
std::vector< T const * > const & |
p4, |
|
|
bool |
use_et = true |
|
) |
| |
Definition at line 33 of file AlphaT.h.
References et_, reco::tau::disc::Pt(), px_, and py_.
{
std::transform( p4.begin(), p4.end(), back_inserter(et_), ( use_et ? std::mem_fun(&T::Et) : std::mem_fun(&T::Pt) ) );
std::transform( p4.begin(), p4.end(), back_inserter(px_), std::mem_fun(&T::Px) );
std::transform( p4.begin(), p4.end(), back_inserter(py_), std::mem_fun(&T::Py) );
}
template<class T >
AlphaT::AlphaT |
( |
std::vector< T > const & |
p4, |
|
|
bool |
use_et = true |
|
) |
| |
Definition at line 41 of file AlphaT.h.
References et_, reco::tau::disc::Pt(), px_, and py_.
{
std::transform( p4.begin(), p4.end(), back_inserter(et_), std::mem_fun_ref( use_et ? &T::Et : &T::Pt ) );
std::transform( p4.begin(), p4.end(), back_inserter(px_), std::mem_fun_ref(&T::Px) );
std::transform( p4.begin(), p4.end(), back_inserter(py_), std::mem_fun_ref(&T::Py) );
}
Member Function Documentation
double AlphaT::value |
( |
void |
| ) |
const [inline] |
double AlphaT::value |
( |
std::vector< bool > & |
jet_sign | ) |
const [inline] |
double AlphaT::value_ |
( |
std::vector< bool > * |
jet_sign | ) |
const [private] |
Definition at line 3 of file AlphaT.cc.
References abs, et_, i, j, max(), px_, py_, and mathSSE::sqrt().
Referenced by value().
{
if (jet_sign) {
jet_sign->clear();
jet_sign->resize(et_.size());
}
if (et_.size() == 0)
return 0.;
if (et_.size() > (unsigned int) std::numeric_limits<unsigned int>::digits)
return std::numeric_limits<double>::max();
const double sum_et = std::accumulate( et_.begin(), et_.end(), 0. );
const double sum_px = std::accumulate( px_.begin(), px_.end(), 0. );
const double sum_py = std::accumulate( py_.begin(), py_.end(), 0. );
double min_delta_sum_et = sum_et;
for (unsigned int i = 0; i < (1U << (et_.size() - 1)); i++) {
double delta_sum_et = 0.;
for (unsigned int j = 0; j < et_.size(); ++j) {
if (i & (1U << j))
delta_sum_et -= et_[j];
else
delta_sum_et += et_[j];
}
delta_sum_et = std::abs(delta_sum_et);
if (delta_sum_et < min_delta_sum_et) {
min_delta_sum_et = delta_sum_et;
if (jet_sign) {
for (unsigned int j = 0; j < et_.size(); ++j)
(*jet_sign)[j] = ((i & (1U << j)) == 0);
}
}
}
return (0.5 * (sum_et - min_delta_sum_et) / sqrt( sum_et*sum_et - (sum_px*sum_px+sum_py*sum_py) ));
}
Member Data Documentation