23 indices_matched.clear();
41 vector<array<float,4>> jets;
42 for (
unsigned int i=0;
i<eta.size(); ++
i) {
43 jets.push_back({pt[
i],eta[
i],phi[
i], (float)
i});
46 for (
auto jet : jets) {
47 pt_truth .push_back(jet[0]);
48 eta_truth .push_back(jet[1]);
49 phi_truth .push_back(jet[2]);
50 index_truth .push_back((
int)jet[3]);
54 vector<array<float,4>> jets;
55 for (
unsigned int i=0;
i<eta.size(); ++
i) {
56 jets.push_back({pt[
i],eta[
i],phi[
i], (float)
i});
59 for (
auto jet : jets) {
60 pt_reco .push_back(jet[0]);
61 eta_reco .push_back(jet[1]);
62 phi_reco .push_back(jet[2]);
63 index_reco .push_back((
int)jet[3]);
69 indices_matched.clear();
71 vector<bool> is_matched (eta_reco.size(),
false);
86 for (
unsigned int T=0;
T<eta_truth.size();++
T) {
89 bool found_match {
false };
90 for (
unsigned int R=0;
R<eta_reco.size();++
R) {
91 if (pt_reco[
R]<min_pT_reco)
continue;
93 if (is_matched[
R])
continue;
94 float dphi = fabs(phi_truth[
T]-phi_reco[R]);
95 while (dphi>M_PI) dphi = fabs(dphi - 2*M_PI);
96 const float deta = eta_truth[
T]-eta_reco[
R];
97 const float R2_comp = deta*deta + dphi*
dphi;
100 is_matched[
R] =
true;
101 indices_matched.push_back({index_truth[
T],index_reco[
R]});
107 if (!found_match) indices_miss.push_back(index_truth[
T]);
109 for (
unsigned int R=0;R<eta_reco.size();++
R) {
111 if (pt_reco[R]<min_pT_reco)
continue;
112 if (!is_matched[R]) {
113 indices_fake.push_back(index_reco[R]);
117 return {
static_cast<unsigned int>(indices_matched.size()),
118 static_cast<unsigned int>(indices_miss.size()),
119 static_cast<unsigned int>(indices_fake.size())};