Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tutorials/dataframe/df002_dataModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

getPt_code ='''
using namespace ROOT::VecOps;
RVec<double> getPt(const RVec<FourVector> &tracks)
ROOT::RVecD getPt(const RVec<FourVector> &tracks)
{
auto pt = [](const FourVector &v) { return v.pt(); };
return Map(tracks, pt);
Expand All @@ -86,7 +86,7 @@

getPtWeights_code ='''
using namespace ROOT::VecOps;
RVec<double> getPtWeights(const RVec<FourVector> &tracks)
ROOT::RVecD getPtWeights(const RVec<FourVector> &tracks)
{
auto ptWeight = [](const FourVector &v) { return 1. / v.Pt(); };
return Map(tracks, ptWeight);
Expand Down
5 changes: 2 additions & 3 deletions tutorials/dataframe/df016_vecOps.C
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
/// \date February 2018
/// \author Danilo Piparo (CERN)

using ROOT::RDataFrame;
using namespace ROOT::VecOps;
using namespace ROOT;

int df016_vecOps()
{
// We re-create a set of points in a square.
// This is a technical detail, just to create a dataset to play with!
auto unifGen = [](double) { return gRandom->Uniform(-1.0, 1.0); };
auto vGen = [&](int len) {
RVec<double> v(len);
RVecD v(len);
std::transform(v.begin(), v.end(), v.begin(), unifGen);
return v;
};
Expand Down
2 changes: 1 addition & 1 deletion tutorials/dataframe/df016_vecOps.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import ROOT

df = ROOT.RDataFrame(1024)
coordDefineCode = '''ROOT::VecOps::RVec<double> {0}(len);
coordDefineCode = '''ROOT::RVecD {0}(len);
std::transform({0}.begin(), {0}.end(), {0}.begin(), [](double){{return gRandom->Uniform(-1.0, 1.0);}});
return {0};'''
d = df.Define("len", "gRandom->Uniform(0, 16)")\
Expand Down
21 changes: 11 additions & 10 deletions tutorials/dataframe/df017_vecOpsHEP.C
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@

auto filename = gROOT->GetTutorialDir() + "/dataframe/df017_vecOpsHEP.root";
auto treename = "myDataset";
using doubles = ROOT::VecOps::RVec<double>;
using RDF = ROOT::RDataFrame;

using namespace ROOT;


void WithTTreeReader()
{
Expand All @@ -41,9 +42,9 @@ void WithTTreeReader()

void WithRDataFrame()
{
RDF f(treename, filename.Data());
auto CalcPt = [](doubles &px, doubles &py, doubles &E) {
doubles v;
RDataFrame f(treename, filename.Data());
auto CalcPt = [](RVecD &px, RVecD &py, RVecD &E) {
RVecD v;
for (auto i=0U;i < px.size(); ++i) {
if (E[i] > 100) {
v.emplace_back(sqrt(px[i]*px[i] + py[i]*py[i]));
Expand All @@ -52,23 +53,23 @@ void WithRDataFrame()
return v;
};
f.Define("pt", CalcPt, {"px", "py", "E"})
.Histo1D<doubles>({"pt", "pt", 16, 0, 4}, "pt")->DrawCopy();
.Histo1D<RVecD>({"pt", "pt", 16, 0, 4}, "pt")->DrawCopy();
}

void WithRDataFrameVecOps()
{
RDF f(treename, filename.Data());
auto CalcPt = [](doubles &px, doubles &py, doubles &E) {
RDataFrame f(treename, filename.Data());
auto CalcPt = [](RVecD &px, RVecD &py, RVecD &E) {
auto pt = sqrt(px*px + py*py);
return pt[E>100];
};
f.Define("good_pt", CalcPt, {"px", "py", "E"})
.Histo1D<doubles>({"pt", "pt", 16, 0, 4}, "good_pt")->DrawCopy();
.Histo1D<RVecD>({"pt", "pt", 16, 0, 4}, "good_pt")->DrawCopy();
}

void WithRDataFrameVecOpsJit()
{
RDF f(treename, filename.Data());
RDataFrame f(treename, filename.Data());
f.Define("good_pt", "sqrt(px*px + py*py)[E>100]")
.Histo1D({"pt", "pt", 16, 0, 4}, "good_pt")->DrawCopy();
}
Expand Down
15 changes: 7 additions & 8 deletions tutorials/dataframe/df101_h1Analysis.C
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,20 @@
/// \authors Axel Naumann, Danilo Piparo (CERN)

auto Select = [](ROOT::RDataFrame &dataFrame) {
using Farray_t = ROOT::VecOps::RVec<float>;
using Iarray_t = ROOT::VecOps::RVec<int>;
using namespace ROOT;

auto ret = dataFrame.Filter("TMath::Abs(md0_d - 1.8646) < 0.04")
.Filter("ptds_d > 2.5")
.Filter("TMath::Abs(etads_d) < 1.5")
.Filter([](int ik, int ipi, Iarray_t& nhitrp) { return nhitrp[ik - 1] * nhitrp[ipi - 1] > 1; },
.Filter([](int ik, int ipi, RVecI& nhitrp) { return nhitrp[ik - 1] * nhitrp[ipi - 1] > 1; },
{"ik", "ipi", "nhitrp"})
.Filter([](int ik, Farray_t& rstart, Farray_t& rend) { return rend[ik - 1] - rstart[ik - 1] > 22; },
.Filter([](int ik, RVecF& rstart, RVecF& rend) { return rend[ik - 1] - rstart[ik - 1] > 22; },
{"ik", "rstart", "rend"})
.Filter([](int ipi, Farray_t& rstart, Farray_t& rend) { return rend[ipi - 1] - rstart[ipi - 1] > 22; },
.Filter([](int ipi, RVecF& rstart, RVecF& rend) { return rend[ipi - 1] - rstart[ipi - 1] > 22; },
{"ipi", "rstart", "rend"})
.Filter([](int ik, Farray_t& nlhk) { return nlhk[ik - 1] > 0.1; }, {"ik", "nlhk"})
.Filter([](int ipi, Farray_t& nlhpi) { return nlhpi[ipi - 1] > 0.1; }, {"ipi", "nlhpi"})
.Filter([](int ipis, Farray_t& nlhpi) { return nlhpi[ipis - 1] > 0.1; }, {"ipis", "nlhpi"})
.Filter([](int ik, RVecF& nlhk) { return nlhk[ik - 1] > 0.1; }, {"ik", "nlhk"})
.Filter([](int ipi, RVecF& nlhpi) { return nlhpi[ipi - 1] > 0.1; }, {"ipi", "nlhpi"})
.Filter([](int ipis, RVecF& nlhpi) { return nlhpi[ipis - 1] > 0.1; }, {"ipis", "nlhpi"})
.Filter("njets >= 1");

return ret;
Expand Down
29 changes: 14 additions & 15 deletions tutorials/dataframe/df103_NanoAODHiggsAnalysis.C
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@

using namespace ROOT::VecOps;
using RNode = ROOT::RDF::RNode;
using rvec_f = const RVec<float> &;
using rvec_i = const RVec<int> &;
using cRVecF = const ROOT::RVecF &;

const auto z_mass = 91.2;

Expand Down Expand Up @@ -91,7 +90,7 @@ RNode selection_2el2mu(RNode df)
{
auto df_ge2el2mu = df.Filter("nElectron>=2 && nMuon>=2", "At least two electrons and two muons");
auto df_eta = df_ge2el2mu.Filter("All(abs(Electron_eta)<2.5) && All(abs(Muon_eta)<2.4)", "Eta cuts");
auto pt_cuts = [](rvec_f mu_pt, rvec_f el_pt) {
auto pt_cuts = [](cRVecF mu_pt, cRVecF el_pt) {
auto mu_pt_sorted = Reverse(Sort(mu_pt));
if (mu_pt_sorted[0] > 20 && mu_pt_sorted[1] > 10) {
return true;
Expand All @@ -103,7 +102,7 @@ RNode selection_2el2mu(RNode df)
return false;
};
auto df_pt = df_eta.Filter(pt_cuts, {"Muon_pt", "Electron_pt"}, "Pt cuts");
auto dr_cuts = [](rvec_f mu_eta, rvec_f mu_phi, rvec_f el_eta, rvec_f el_phi) {
auto dr_cuts = [](cRVecF mu_eta, cRVecF mu_phi, cRVecF el_eta, cRVecF el_phi) {
auto mu_dr = DeltaR(mu_eta[0], mu_eta[1], mu_phi[0], mu_phi[1]);
auto el_dr = DeltaR(el_eta[0], el_eta[1], el_phi[0], el_phi[1]);
if (mu_dr < 0.02 || el_dr < 0.02) {
Expand Down Expand Up @@ -131,7 +130,7 @@ RNode selection_2el2mu(RNode df)
}

// Reconstruct two Z candidates from four leptons of the same kind
RVec<RVec<size_t>> reco_zz_to_4l(rvec_f pt, rvec_f eta, rvec_f phi, rvec_f mass, rvec_i charge)
RVec<RVec<size_t>> reco_zz_to_4l(cRVecF pt, cRVecF eta, cRVecF phi, cRVecF mass, const ROOT::RVecI & charge)
{
RVec<RVec<size_t>> idx(2);
idx[0].reserve(2); idx[1].reserve(2);
Expand Down Expand Up @@ -169,9 +168,9 @@ RVec<RVec<size_t>> reco_zz_to_4l(rvec_f pt, rvec_f eta, rvec_f phi, rvec_f mass,
}

// Compute Z masses from four leptons of the same kind and sort ascending in distance to Z mass
RVec<float> compute_z_masses_4l(const RVec<RVec<size_t>> &idx, rvec_f pt, rvec_f eta, rvec_f phi, rvec_f mass)
ROOT::RVecF compute_z_masses_4l(const RVec<RVec<size_t>> &idx, cRVecF pt, cRVecF eta, cRVecF phi, cRVecF mass)
{
RVec<float> z_masses(2);
ROOT::RVecF z_masses(2);
for (size_t i = 0; i < 2; i++) {
const auto i1 = idx[i][0]; const auto i2 = idx[i][1];
ROOT::Math::PtEtaPhiMVector p1(pt[i1], eta[i1], phi[i1], mass[i1]);
Expand All @@ -186,7 +185,7 @@ RVec<float> compute_z_masses_4l(const RVec<RVec<size_t>> &idx, rvec_f pt, rvec_f
}

// Compute mass of Higgs from four leptons of the same kind
float compute_higgs_mass_4l(const RVec<RVec<size_t>> &idx, rvec_f pt, rvec_f eta, rvec_f phi, rvec_f mass)
float compute_higgs_mass_4l(const RVec<RVec<size_t>> &idx, cRVecF pt, cRVecF eta, cRVecF phi, cRVecF mass)
{
const auto i1 = idx[0][0]; const auto i2 = idx[0][1];
const auto i3 = idx[1][0]; const auto i4 = idx[1][1];
Expand Down Expand Up @@ -216,7 +215,7 @@ RNode reco_higgs_to_4mu(RNode df)
df_base.Define("Z_idx", reco_zz_to_4l, {"Muon_pt", "Muon_eta", "Muon_phi", "Muon_mass", "Muon_charge"});

// Cut on distance between muons building Z systems
auto filter_z_dr = [](const RVec<RVec<size_t>> &idx, rvec_f eta, rvec_f phi) {
auto filter_z_dr = [](const RVec<RVec<size_t>> &idx, cRVecF eta, cRVecF phi) {
for (size_t i = 0; i < 2; i++) {
const auto i1 = idx[i][0];
const auto i2 = idx[i][1];
Expand Down Expand Up @@ -255,7 +254,7 @@ RNode reco_higgs_to_4el(RNode df)
{"Electron_pt", "Electron_eta", "Electron_phi", "Electron_mass", "Electron_charge"});

// Cut on distance between Electrons building Z systems
auto filter_z_dr = [](const RVec<RVec<size_t>> &idx, rvec_f eta, rvec_f phi) {
auto filter_z_dr = [](const RVec<RVec<size_t>> &idx, cRVecF eta, cRVecF phi) {
for (size_t i = 0; i < 2; i++) {
const auto i1 = idx[i][0];
const auto i2 = idx[i][1];
Expand Down Expand Up @@ -284,16 +283,16 @@ RNode reco_higgs_to_4el(RNode df)
}

// Compute mass of two Z candidates from two electrons and two muons and sort ascending in distance to Z mass
RVec<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,
rvec_f mu_eta, rvec_f mu_phi, rvec_f mu_mass)
ROOT::RVecF compute_z_masses_2el2mu(cRVecF el_pt, cRVecF el_eta, cRVecF el_phi, cRVecF el_mass, cRVecF mu_pt,
cRVecF mu_eta, cRVecF mu_phi, cRVecF mu_mass)
{
ROOT::Math::PtEtaPhiMVector p1(mu_pt[0], mu_eta[0], mu_phi[0], mu_mass[0]);
ROOT::Math::PtEtaPhiMVector p2(mu_pt[1], mu_eta[1], mu_phi[1], mu_mass[1]);
ROOT::Math::PtEtaPhiMVector p3(el_pt[0], el_eta[0], el_phi[0], el_mass[0]);
ROOT::Math::PtEtaPhiMVector p4(el_pt[1], el_eta[1], el_phi[1], el_mass[1]);
auto mu_z = (p1 + p2).M();
auto el_z = (p3 + p4).M();
RVec<float> z_masses(2);
ROOT::RVecF z_masses(2);
if (std::abs(mu_z - z_mass) < std::abs(el_z - z_mass)) {
z_masses[0] = mu_z;
z_masses[1] = el_z;
Expand All @@ -305,8 +304,8 @@ RVec<float> compute_z_masses_2el2mu(rvec_f el_pt, rvec_f el_eta, rvec_f el_phi,
}

// Compute Higgs mass from two electrons and two muons
float 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,
rvec_f mu_phi, rvec_f mu_mass)
float compute_higgs_mass_2el2mu(cRVecF el_pt, cRVecF el_eta, cRVecF el_phi, cRVecF el_mass, cRVecF mu_pt, cRVecF mu_eta,
cRVecF mu_phi, cRVecF mu_mass)
{
ROOT::Math::PtEtaPhiMVector p1(mu_pt[0], mu_eta[0], mu_phi[0], mu_mass[0]);
ROOT::Math::PtEtaPhiMVector p2(mu_pt[1], mu_eta[1], mu_phi[1], mu_mass[1]);
Expand Down
27 changes: 13 additions & 14 deletions tutorials/dataframe/df103_NanoAODHiggsAnalysis_python.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
#include "Math/Vector4D.h"
#include "TStyle.h"

using namespace ROOT;
using namespace ROOT::VecOps;
using RNode = ROOT::RDF::RNode;
using rvec_f = const RVec<float> &;
using rvec_i = const RVec<int> &;
const auto z_mass = 91.2;

// Reconstruct two Z candidates from four leptons of the same kind
RVec<RVec<size_t>> reco_zz_to_4l(rvec_f pt, rvec_f eta, rvec_f phi, rvec_f mass, rvec_i charge)
RVec<RVec<size_t>> reco_zz_to_4l(RVecF pt, RVecF eta, RVecF phi, RVecF mass, RVecI charge)
{
RVec<RVec<size_t>> idx(2);
idx[0].reserve(2); idx[1].reserve(2);
Expand Down Expand Up @@ -61,9 +60,9 @@ RVec<RVec<size_t>> reco_zz_to_4l(rvec_f pt, rvec_f eta, rvec_f phi, rvec_f mass,
}

// Compute Z masses from four leptons of the same kind and sort ascending in distance to Z mass
RVec<float> compute_z_masses_4l(const RVec<RVec<size_t>> &idx, rvec_f pt, rvec_f eta, rvec_f phi, rvec_f mass)
RVecF compute_z_masses_4l(const RVec<RVec<size_t>> &idx, RVecF pt, RVecF eta, RVecF phi, RVecF mass)
{
RVec<float> z_masses(2);
RVecF z_masses(2);
for (size_t i = 0; i < 2; i++) {
const auto i1 = idx[i][0]; const auto i2 = idx[i][1];
ROOT::Math::PtEtaPhiMVector p1(pt[i1], eta[i1], phi[i1], mass[i1]);
Expand All @@ -78,7 +77,7 @@ RVec<float> compute_z_masses_4l(const RVec<RVec<size_t>> &idx, rvec_f pt, rvec_f
}

// Compute mass of Higgs from four leptons of the same kind
float compute_higgs_mass_4l(const RVec<RVec<size_t>> &idx, rvec_f pt, rvec_f eta, rvec_f phi, rvec_f mass)
float compute_higgs_mass_4l(const RVec<RVec<size_t>> &idx, RVecF pt, RVecF eta, RVecF phi, RVecF mass)
{
const auto i1 = idx[0][0]; const auto i2 = idx[0][1];
const auto i3 = idx[1][0]; const auto i4 = idx[1][1];
Expand All @@ -90,16 +89,16 @@ float compute_higgs_mass_4l(const RVec<RVec<size_t>> &idx, rvec_f pt, rvec_f eta
}

// Compute mass of two Z candidates from two electrons and two muons and sort ascending in distance to Z mass
RVec<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,
rvec_f mu_eta, rvec_f mu_phi, rvec_f mu_mass)
RVecF compute_z_masses_2el2mu(RVecF el_pt, RVecF el_eta, RVecF el_phi, RVecF el_mass, RVecF mu_pt,
RVecF mu_eta, RVecF mu_phi, RVecF mu_mass)
{
ROOT::Math::PtEtaPhiMVector p1(mu_pt[0], mu_eta[0], mu_phi[0], mu_mass[0]);
ROOT::Math::PtEtaPhiMVector p2(mu_pt[1], mu_eta[1], mu_phi[1], mu_mass[1]);
ROOT::Math::PtEtaPhiMVector p3(el_pt[0], el_eta[0], el_phi[0], el_mass[0]);
ROOT::Math::PtEtaPhiMVector p4(el_pt[1], el_eta[1], el_phi[1], el_mass[1]);
auto mu_z = (p1 + p2).M();
auto el_z = (p3 + p4).M();
RVec<float> z_masses(2);
RVecF z_masses(2);
if (std::abs(mu_z - z_mass) < std::abs(el_z - z_mass)) {
z_masses[0] = mu_z;
z_masses[1] = el_z;
Expand All @@ -111,8 +110,8 @@ RVec<float> compute_z_masses_2el2mu(rvec_f el_pt, rvec_f el_eta, rvec_f el_phi,
}

// Compute Higgs mass from two electrons and two muons
float 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,
rvec_f mu_phi, rvec_f mu_mass)
float compute_higgs_mass_2el2mu(RVecF el_pt, RVecF el_eta, RVecF el_phi, RVecF el_mass, RVecF mu_pt, RVecF mu_eta,
RVecF mu_phi, RVecF mu_mass)
{
ROOT::Math::PtEtaPhiMVector p1(mu_pt[0], mu_eta[0], mu_phi[0], mu_mass[0]);
ROOT::Math::PtEtaPhiMVector p2(mu_pt[1], mu_eta[1], mu_phi[1], mu_mass[1]);
Expand All @@ -121,7 +120,7 @@ float compute_higgs_mass_2el2mu(rvec_f el_pt, rvec_f el_eta, rvec_f el_phi, rvec
return (p1 + p2 + p3 + p4).M();
}

bool filter_z_dr(const RVec<RVec<size_t>> &idx, rvec_f eta, rvec_f phi)
bool filter_z_dr(const RVec<RVec<size_t>> &idx, RVecF eta, RVecF phi)
{
for (size_t i = 0; i < 2; i++) {
const auto i1 = idx[i][0];
Expand All @@ -134,7 +133,7 @@ bool filter_z_dr(const RVec<RVec<size_t>> &idx, rvec_f eta, rvec_f phi)
return true;
};

bool pt_cuts(rvec_f mu_pt, rvec_f el_pt)
bool pt_cuts(RVecF mu_pt, RVecF el_pt)
{
auto mu_pt_sorted = Reverse(Sort(mu_pt));
if (mu_pt_sorted[0] > 20 && mu_pt_sorted[1] > 10) {
Expand All @@ -147,7 +146,7 @@ bool pt_cuts(rvec_f mu_pt, rvec_f el_pt)
return false;
}

bool dr_cuts(rvec_f mu_eta, rvec_f mu_phi, rvec_f el_eta, rvec_f el_phi)
bool dr_cuts(RVecF mu_eta, RVecF mu_phi, RVecF el_eta, RVecF el_phi)
{
auto mu_dr = DeltaR(mu_eta[0], mu_eta[1], mu_phi[0], mu_phi[1]);
auto el_dr = DeltaR(el_eta[0], el_eta[1], el_phi[0], el_phi[1]);
Expand Down
4 changes: 2 additions & 2 deletions tutorials/dataframe/df104_HiggsToTwoPhotons.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
# Compile a function to compute the invariant mass of the diphoton system
ROOT.gInterpreter.Declare(
"""
using Vec_t = const ROOT::VecOps::RVec<float>;
float ComputeInvariantMass(Vec_t& pt, Vec_t& eta, Vec_t& phi, Vec_t& e) {
using namespace ROOT;
float ComputeInvariantMass(RVecF pt, RVecF eta, RVecF phi, RVecF e) {
ROOT::Math::PtEtaPhiEVector p1(pt[0], eta[0], phi[0], e[0]);
ROOT::Math::PtEtaPhiEVector p2(pt[1], eta[1], phi[1], e[1]);
return (p1 + p2).mass() / 1000.0;
Expand Down
7 changes: 3 additions & 4 deletions tutorials/dataframe/df106_HiggsToFourLeptons.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@

# Select events for the analysis
ROOT.gInterpreter.Declare("""
using VecF_t = const ROOT::RVec<float>&;
using VecI_t = const ROOT::RVec<int>&;
bool GoodElectronsAndMuons(VecI_t type, VecF_t pt, VecF_t eta, VecF_t phi, VecF_t e, VecF_t trackd0pv, VecF_t tracksigd0pv, VecF_t z0)
using cRVecF = const ROOT::RVecF &;
bool GoodElectronsAndMuons(const ROOT::RVecI & type, cRVecF pt, cRVecF eta, cRVecF phi, cRVecF e, cRVecF trackd0pv, cRVecF tracksigd0pv, cRVecF z0)
{
for (size_t i = 0; i < type.size(); i++) {
ROOT::Math::PtEtaPhiEVector p(pt[i] / 1000.0, eta[i], phi[i], e[i] / 1000.0);
Expand Down Expand Up @@ -96,7 +95,7 @@

# Compute invariant mass of the four lepton system and make a histogram
ROOT.gInterpreter.Declare("""
float ComputeInvariantMass(VecF_t pt, VecF_t eta, VecF_t phi, VecF_t e)
float ComputeInvariantMass(cRVecF pt, cRVecF eta, cRVecF phi, cRVecF e)
{
ROOT::Math::PtEtaPhiEVector p1(pt[0], eta[0], phi[0], e[0]);
ROOT::Math::PtEtaPhiEVector p2(pt[1], eta[1], phi[1], e[1]);
Expand Down
6 changes: 3 additions & 3 deletions tutorials/dataframe/df107_SingleTopAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@

# Just-in-time compile custom helper function performing complex computations
ROOT.gInterpreter.Declare("""
using VecF_t = const ROOT::RVec<float>&;
using VecI_t = const ROOT::RVec<int>&;
int FindGoodLepton(VecI_t goodlep, VecI_t type, VecF_t lep_pt, VecF_t lep_eta, VecF_t lep_phi, VecF_t lep_e, VecF_t trackd0pv, VecF_t tracksigd0pv, VecF_t z0)
using cRVecF = const ROOT::RVecF &;
using cRVecI = const ROOT::RVecI &;
int FindGoodLepton(cRVecI goodlep, cRVecI type, cRVecF lep_pt, cRVecF lep_eta, cRVecF lep_phi, cRVecF lep_e, cRVecF trackd0pv, cRVecF tracksigd0pv, cRVecF z0)
{
int idx = -1; // Return -1 if no good lepton is found.
for(auto i = 0; i < type.size(); i++) {
Expand Down