14 const std::vector<double>& px,
15 const std::vector<double>& py,
22 const double ht = accumulate(et.begin(), et.end(), 0.);
25 double firstjet_phi = atan2(py[0], px[0]);
27 double apcjet(0.), apcmet(0.), apcjetmet(0.);
28 double apcjetmetmin(0.);
30 for (
size_t i = 0;
i < et.size();
i++) {
31 double jet_phi = atan2(py[
i], px[i]);
32 double met_phi = atan2(mety, metx);
34 double dphisignaljet = fabs(
deltaPhi(jet_phi, firstjet_phi));
35 double dphimet = fabs(
deltaPhi(jet_phi, met_phi));
37 apcjet += et[
i] *
cos(dphisignaljet / 2.0);
38 apcmet += et[
i] *
sin(dphimet / 2.0);
39 apcjetmet += et[
i] *
cos(dphisignaljet / 2.0) *
sin(dphimet / 2.0);
42 std::vector<double> apcjetvector;
43 std::vector<double> apcjetmetvector;
44 for (
size_t j = 0;
j < et.size();
j++) {
45 apcjetvector.push_back(0.);
46 apcjetmetvector.push_back(0.);
47 double jet_phi_j = atan2(py[
j], px[j]);
48 for (
size_t i = 0;
i < et.size();
i++) {
49 double jet_phi_i = atan2(py[
i], px[i]);
50 double dphi_jet = fabs(
deltaPhi(jet_phi_i, jet_phi_j));
51 double met_phi = atan2(mety, metx);
52 double dphimet = fabs(
deltaPhi(jet_phi_i, met_phi));
54 apcjetvector.back() += et[
i] *
cos(dphi_jet / 2.0);
55 apcjetmetvector.back() += et[
i] *
cos(dphi_jet / 2.0) *
sin(dphimet / 2.0);
58 if (!apcjetvector.empty() && !apcjetmetvector.empty()) {
59 apcjetmetmin = *min_element(apcjetmetvector.begin(), apcjetmetvector.end());
63 return apcjetmetmin / ht;
Sin< T >::type sin(const T &t)
Cos< T >::type cos(const T &t)
static double getApcJetMetMin(const std::vector< double > &et, const std::vector< double > &px, const std::vector< double > &py, const double metx, const double mety)