23const auto z_mass = 91.2;
26RVec<RVec<size_t>> reco_zz_to_4l(rvec_f
pt, rvec_f eta, rvec_f phi, rvec_f mass, rvec_i charge)
29 idx[0].reserve(2); idx[1].reserve(2);
34 size_t best_i1 = 0;
size_t best_i2 = 0;
35 for (
size_t i = 0; i < idx_cmb[0].size(); i++) {
36 const auto i1 = idx_cmb[0][i];
37 const auto i2 = idx_cmb[1][i];
38 if (charge[i1] != charge[i2]) {
41 const auto this_mass = (p1 + p2).M();
42 if (std::abs(z_mass - this_mass) < std::abs(z_mass - best_mass)) {
43 best_mass = this_mass;
49 idx[0].emplace_back(best_i1);
50 idx[0].emplace_back(best_i2);
53 for (
size_t i = 0; i < 4; i++) {
54 if (i != best_i1 && i != best_i2) {
55 idx[1].emplace_back(i);
67 for (
size_t i = 0; i < 2; i++) {
68 const auto i1 = idx[i][0];
const auto i2 = idx[i][1];
71 z_masses[i] = (p1 + p2).M();
73 if (std::abs(z_masses[0] - z_mass) < std::abs(z_masses[1] - z_mass)) {
81float compute_higgs_mass_4l(
const RVec<
RVec<size_t>> &idx, rvec_f
pt, rvec_f eta, rvec_f phi, rvec_f mass)
83 const auto i1 = idx[0][0];
const auto i2 = idx[0][1];
84 const auto i3 = idx[1][0];
const auto i4 = idx[1][1];
89 return (p1 + p2 + p3 + p4).M();
93RVec<float> compute_z_masses_2el2mu(rvec_f el_pt, rvec_f el_eta, rvec_f el_phi, rvec_f el_mass, rvec_f mu_pt,
94 rvec_f mu_eta, rvec_f mu_phi, rvec_f mu_mass)
100 auto mu_z = (p1 + p2).M();
101 auto el_z = (p3 + p4).M();
103 if (std::abs(mu_z - z_mass) < std::abs(el_z - z_mass)) {
114float compute_higgs_mass_2el2mu(rvec_f el_pt, rvec_f el_eta, rvec_f el_phi, rvec_f el_mass, rvec_f mu_pt, rvec_f mu_eta,
115 rvec_f mu_phi, rvec_f mu_mass)
121 return (p1 + p2 + p3 + p4).M();
126 for (
size_t i = 0; i < 2; i++) {
127 const auto i1 = idx[i][0];
128 const auto i2 = idx[i][1];
129 const auto dr =
DeltaR(eta[i1], eta[i2], phi[i1], phi[i2]);
137bool pt_cuts(rvec_f mu_pt, rvec_f el_pt)
140 if (mu_pt_sorted[0] > 20 && mu_pt_sorted[1] > 10) {
144 if (el_pt_sorted[0] > 20 && el_pt_sorted[1] > 10) {
150bool dr_cuts(rvec_f mu_eta, rvec_f mu_phi, rvec_f el_eta, rvec_f el_phi)
152 auto mu_dr =
DeltaR(mu_eta[0], mu_eta[1], mu_phi[0], mu_phi[1]);
153 auto el_dr =
DeltaR(el_eta[0], el_eta[1], el_phi[0], el_phi[1]);
154 if (mu_dr < 0.02 || el_dr < 0.02) {
Vector1::Scalar DeltaR(const Vector1 &v1, const Vector2 &v2)
Find difference in pseudorapidity (Eta) and Phi betwen two generic vectors The only requirements on t...
RInterface<::ROOT::Detail::RDF::RNodeBase, void > RNode
RVec< T > Reverse(const RVec< T > &v)
Return copy of reversed vector.
RVec< RVec< std::size_t > > Combinations(const std::size_t size1, const std::size_t size2)
Return the indices that represent all combinations of the elements of two RVecs.
void Sort(Index n, const Element *a, Index *index, Bool_t down=kTRUE)