22const auto z_mass = 91.2;
28 idx[0].reserve(2); idx[1].reserve(2);
33 size_t best_i1 = 0;
size_t best_i2 = 0;
34 for (
size_t i = 0; i < idx_cmb[0].size(); i++) {
35 const auto i1 = idx_cmb[0][i];
36 const auto i2 = idx_cmb[1][i];
37 if (charge[i1] != charge[i2]) {
40 const auto this_mass = (p1 + p2).M();
41 if (std::abs(z_mass - this_mass) < std::abs(z_mass - best_mass)) {
42 best_mass = this_mass;
48 idx[0].emplace_back(best_i1);
49 idx[0].emplace_back(best_i2);
52 for (
size_t i = 0; i < 4; i++) {
53 if (i != best_i1 && i != best_i2) {
54 idx[1].emplace_back(i);
66 for (
size_t i = 0; i < 2; i++) {
67 const auto i1 = idx[i][0];
const auto i2 = idx[i][1];
70 z_masses[i] = (p1 + p2).M();
72 if (std::abs(z_masses[0] - z_mass) < std::abs(z_masses[1] - z_mass)) {
82 const auto i1 = idx[0][0];
const auto i2 = idx[0][1];
83 const auto i3 = idx[1][0];
const auto i4 = idx[1][1];
88 return (p1 + p2 + p3 + p4).M();
99 auto mu_z = (p1 + p2).M();
100 auto el_z = (p3 + p4).M();
102 if (std::abs(mu_z - z_mass) < std::abs(el_z - z_mass)) {
120 return (p1 + p2 + p3 + p4).M();
125 for (
size_t i = 0; i < 2; i++) {
126 const auto i1 = idx[i][0];
127 const auto i2 = idx[i][1];
128 const auto dr =
DeltaR(eta[i1], eta[i2], phi[i1], phi[i2]);
139 if (mu_pt_sorted[0] > 20 && mu_pt_sorted[1] > 10) {
143 if (el_pt_sorted[0] > 20 && el_pt_sorted[1] > 10) {
151 auto mu_dr =
DeltaR(mu_eta[0], mu_eta[1], mu_phi[0], mu_phi[1]);
152 auto el_dr =
DeltaR(el_eta[0], el_eta[1], el_phi[0], el_phi[1]);
153 if (mu_dr < 0.02 || el_dr < 0.02) {
Class describing a generic LorentzVector in the 4D space-time, using the specified coordinate system ...
A "std::vector"-like collection of values implementing handy operation to analyse them.
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.
Vector1::Scalar DeltaR(const Vector1 &v1, const Vector2 &v2)
Find difference in pseudorapidity (Eta) and Phi between two generic vectors The only requirements on ...
RInterface<::ROOT::Detail::RDF::RNodeBase, void > RNode
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
void Sort(Index n, const Element *a, Index *index, Bool_t down=kTRUE)
Sort the n elements of the array a of generic templated type Element.