14 const std::vector<double>&
px,
15 const std::vector<double>&
py,
22 const double ht = accumulate(
et.begin(),
et.end(), 0.);
25 double apcjetmetmin(0.);
27 std::vector<double> apcjetvector;
28 std::vector<double> apcjetmetvector;
29 for (
size_t j = 0;
j <
et.size();
j++) {
30 apcjetvector.push_back(0.);
31 apcjetmetvector.push_back(0.);
32 double jet_phi_j = atan2(
py[
j],
px[
j]);
33 for (
size_t i = 0;
i <
et.size();
i++) {
34 double jet_phi_i = atan2(
py[
i],
px[
i]);
35 double dphi_jet = fabs(
deltaPhi(jet_phi_i, jet_phi_j));
36 double met_phi = atan2(mety, metx);
37 double dphimet = fabs(
deltaPhi(jet_phi_i, met_phi));
39 apcjetvector.back() +=
et[
i] *
cos(dphi_jet / 2.0);
40 apcjetmetvector.back() +=
et[
i] *
cos(dphi_jet / 2.0) *
sin(dphimet / 2.0);
43 if (!apcjetvector.empty() && !apcjetmetvector.empty()) {
44 apcjetmetmin = *min_element(apcjetmetvector.begin(), apcjetmetvector.end());
48 return apcjetmetmin / ht;
Sin< T >::type sin(const T &t)
Cos< T >::type cos(const T &t)
TAKEN FROM http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/ElectroWeakAnalysis/Utilities/src/PdfWeig...
static double getApcJetMetMin(const std::vector< double > &et, const std::vector< double > &px, const std::vector< double > &py, const double metx, const double mety)