Df 1 0 3_ Nano A O D Higgs Analysis

An example of complex analysis with RDataFrame: reconstructing the Higgs boson.

This tutorial is a simplified but yet complex example of an analysis reconstructing the Higgs boson decaying to two Z bosons from events with four leptons. The data and simulated events are taken from CERN OpenData representing a subset of the data recorded in 2012 with the CMS detector at the LHC. The tutorials follows the Higgs to four leptons analysis published on CERN Open Data portal (10.7483/OPENDATA.CMS.JKB8.RR42). The resulting plots show the invariant mass of the selected four lepton systems in different decay modes (four muons, four electrons and two of each kind) and in a combined plot indicating the decay of the Higgs boson with a mass of about 125 GeV.

The following steps are performed for each sample with data and simulated events in order to reconstruct the Higgs boson from the selected muons and electrons:

  1. Select interesting events with multiple cuts on event properties, e.g., number of leptons, kinematics of the leptons and quality of the tracks.
  2. Reconstruct two Z bosons of which only one on the mass shell from the selected events and apply additional cuts on the reconstructed objects.
  3. Reconstruct the Higgs boson from the remaining Z boson candidates and calculate its invariant mass.

The tutorial has the fast mode enabled by default, which reads the data from already skimmed datasets with a total size of only 51MB. If the fast mode is disabled, the tutorial runs over the full dataset with a size of 12GB.

Author: Stefan Wunsch (KIT, CERN)
This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Thursday, June 24, 2021 at 07:22 AM.

In [1]:
%%cpp -d
#include "ROOT/RDataFrame.hxx"
#include "ROOT/RVec.hxx"
#include "ROOT/RDF/RInterface.hxx"
#include "TCanvas.h"
#include "TH1D.h"
#include "TLatex.h"
#include "TLegend.h"
#include <Math/Vector4Dfwd.h>
#include <Math/GenVector/LorentzVector.h>
#include <Math/GenVector/PtEtaPhiM4D.h>
#include "TStyle.h"
#include <string>

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;

Select interesting events with four muons

In [2]:
RNode selection_4mu(RNode df)
{
   auto df_ge4m = df.Filter("nMuon>=4", "At least four muons");
   auto df_iso = df_ge4m.Filter("All(abs(Muon_pfRelIso04_all)<0.40)", "Require good isolation");
   auto df_kin = df_iso.Filter("All(Muon_pt>5) && All(abs(Muon_eta)<2.4)", "Good muon kinematics");
   auto df_ip3d = df_kin.Define("Muon_ip3d", "sqrt(Muon_dxy*Muon_dxy + Muon_dz*Muon_dz)");
   auto df_sip3d = df_ip3d.Define("Muon_sip3d", "Muon_ip3d/sqrt(Muon_dxyErr*Muon_dxyErr + Muon_dzErr*Muon_dzErr)");
   auto df_pv = df_sip3d.Filter("All(Muon_sip3d<4) && All(abs(Muon_dxy)<0.5) && All(abs(Muon_dz)<1.0)",
                                "Track close to primary vertex with small uncertainty");
   auto df_2p2n = df_pv.Filter("nMuon==4 && Sum(Muon_charge==1)==2 && Sum(Muon_charge==-1)==2",
                               "Two positive and two negative muons");
   return df_2p2n;
}

Select interesting events with four electrons

In [3]:
RNode selection_4el(RNode df)
{
   auto df_ge4el = df.Filter("nElectron>=4", "At least our electrons");
   auto df_iso = df_ge4el.Filter("All(abs(Electron_pfRelIso03_all)<0.40)", "Require good isolation");
   auto df_kin = df_iso.Filter("All(Electron_pt>7) && All(abs(Electron_eta)<2.5)", "Good Electron kinematics");
   auto df_ip3d = df_kin.Define("Electron_ip3d", "sqrt(Electron_dxy*Electron_dxy + Electron_dz*Electron_dz)");
   auto df_sip3d = df_ip3d.Define("Electron_sip3d",
                                  "Electron_ip3d/sqrt(Electron_dxyErr*Electron_dxyErr + Electron_dzErr*Electron_dzErr)");
   auto df_pv = df_sip3d.Filter("All(Electron_sip3d<4) && All(abs(Electron_dxy)<0.5) && "
                                "All(abs(Electron_dz)<1.0)",
                                "Track close to primary vertex with small uncertainty");
   auto df_2p2n = df_pv.Filter("nElectron==4 && Sum(Electron_charge==1)==2 && Sum(Electron_charge==-1)==2",
                               "Two positive and two negative electrons");
   return df_2p2n;
}

Select interesting events with two electrons and two muons

In [4]:
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 mu_pt_sorted = Reverse(Sort(mu_pt));
      if (mu_pt_sorted[0] > 20 && mu_pt_sorted[1] > 10) {
         return true;
      }
      auto el_pt_sorted = Reverse(Sort(el_pt));
      if (el_pt_sorted[0] > 20 && el_pt_sorted[1] > 10) {
         return true;
      }
      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 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) {
         return false;
      }
      return true;
   };
   auto df_dr = df_pt.Filter(dr_cuts, {"Muon_eta", "Muon_phi", "Electron_eta", "Electron_phi"}, "Dr cuts");
   auto df_iso = df_dr.Filter("All(abs(Electron_pfRelIso03_all)<0.40) && All(abs(Muon_pfRelIso04_all)<0.40)",
                              "Require good isolation");
   auto df_el_ip3d = df_iso.Define("Electron_ip3d_el", "sqrt(Electron_dxy*Electron_dxy + Electron_dz*Electron_dz)");
   auto df_el_sip3d = df_el_ip3d.Define("Electron_sip3d_el",
                                        "Electron_ip3d_el/sqrt(Electron_dxyErr*Electron_dxyErr + "
                                        "Electron_dzErr*Electron_dzErr)");
   auto df_el_track = df_el_sip3d.Filter("All(Electron_sip3d_el<4) && All(abs(Electron_dxy)<0.5) && All(abs(Electron_dz)<1.0)",
                                         "Electron track close to primary vertex with small uncertainty");
   auto df_mu_ip3d = df_el_track.Define("Muon_ip3d_mu", "sqrt(Muon_dxy*Muon_dxy + Muon_dz*Muon_dz)");
   auto df_mu_sip3d = df_mu_ip3d.Define("Muon_sip3d_mu",
                                        "Muon_ip3d_mu/sqrt(Muon_dxyErr*Muon_dxyErr + Muon_dzErr*Muon_dzErr)");
   auto df_mu_track = df_mu_sip3d.Filter("All(Muon_sip3d_mu<4) && All(abs(Muon_dxy)<0.5) && All(abs(Muon_dz)<1.0)",
                                         "Muon track close to primary vertex with small uncertainty");
   auto df_2p2n = df_mu_track.Filter("Sum(Electron_charge)==0 && Sum(Muon_charge)==0",
                                     "Two opposite charged electron and muon pairs");
   return df_2p2n;
}

Reconstruct two z candidates from four leptons of the same kind

In [5]:
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>> idx(2);
   idx[0].reserve(2); idx[1].reserve(2);

   // Find first lepton pair with invariant mass closest to Z mass
   auto idx_cmb = Combinations(pt, 2);
   auto best_mass = -1;
   size_t best_i1 = 0; size_t best_i2 = 0;
   for (size_t i = 0; i < idx_cmb[0].size(); i++) {
      const auto i1 = idx_cmb[0][i];
      const auto i2 = idx_cmb[1][i];
      if (charge[i1] != charge[i2]) {
         ROOT::Math::PtEtaPhiMVector p1(pt[i1], eta[i1], phi[i1], mass[i1]);
         ROOT::Math::PtEtaPhiMVector p2(pt[i2], eta[i2], phi[i2], mass[i2]);
         const auto this_mass = (p1 + p2).M();
         if (std::abs(z_mass - this_mass) < std::abs(z_mass - best_mass)) {
            best_mass = this_mass;
            best_i1 = i1;
            best_i2 = i2;
         }
      }
   }
   idx[0].emplace_back(best_i1);
   idx[0].emplace_back(best_i2);

   // Reconstruct second Z from remaining lepton pair
   for (size_t i = 0; i < 4; i++) {
      if (i != best_i1 && i != best_i2) {
         idx[1].emplace_back(i);
      }
   }

   // Return indices of the pairs building two Z bosons
   return idx;
}
input_line_50:3:1: error: function definition is not allowed here
{
^

Compute z masses from four leptons of the same kind and sort ascending in distance to z mass

In [6]:
RVec<float> compute_z_masses_4l(const RVec<RVec<size_t>> &idx, rvec_f pt, rvec_f eta, rvec_f phi, rvec_f mass)
{
   RVec<float> 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]);
      ROOT::Math::PtEtaPhiMVector p2(pt[i2], eta[i2], phi[i2], mass[i2]);
      z_masses[i] = (p1 + p2).M();
   }
   if (std::abs(z_masses[0] - z_mass) < std::abs(z_masses[1] - z_mass)) {
      return z_masses;
   } else {
      return Reverse(z_masses);
   }
}
input_line_51:3:1: error: function definition is not allowed here
{
^

Apply selection on reconstructed z candidates

In [7]:
RNode filter_z_candidates(RNode df)
{
   auto df_z1_cut = df.Filter("Z_mass[0] > 40 && Z_mass[0] < 120", "Mass of first Z candidate in [40, 120]");
   auto df_z2_cut = df_z1_cut.Filter("Z_mass[1] > 12 && Z_mass[1] < 120", "Mass of second Z candidate in [12, 120]");
   return df_z2_cut;
}

Reconstruct higgs from four muons

In [8]:
RNode reco_higgs_to_4mu(RNode df)
{
   // Filter interesting events
   auto df_base = selection_4mu(df);

   // Reconstruct Z systems
   auto df_z_idx =
      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) {
      for (size_t i = 0; i < 2; i++) {
         const auto i1 = idx[i][0];
         const auto i2 = idx[i][1];
         const auto dr = DeltaR(eta[i1], eta[i2], phi[i1], phi[i2]);
         if (dr < 0.02) {
            return false;
         }
      }
      return true;
   };
   auto df_z_dr =
      df_z_idx.Filter(filter_z_dr, {"Z_idx", "Muon_eta", "Muon_phi"}, "Delta R separation of muons building Z system");

   // Compute masses of Z systems
   auto df_z_mass =
      df_z_dr.Define("Z_mass", compute_z_masses_4l, {"Z_idx", "Muon_pt", "Muon_eta", "Muon_phi", "Muon_mass"});

   // Cut on mass of Z candidates
   auto df_z_cut = filter_z_candidates(df_z_mass);

   // Reconstruct H mass
   auto df_h_mass =
      df_z_cut.Define("H_mass", compute_higgs_mass_4l, {"Z_idx", "Muon_pt", "Muon_eta", "Muon_phi", "Muon_mass"});

   return df_h_mass;
}
input_line_53:8:31: error: use of undeclared identifier 'reco_zz_to_4l'
      df_base.Define("Z_idx", reco_zz_to_4l, {"Muon_pt", "Muon_eta", "Muon_phi", "Muon_mass", "Muon_charge"});
                              ^
input_line_53:27:32: error: use of undeclared identifier 'compute_z_masses_4l'
      df_z_dr.Define("Z_mass", compute_z_masses_4l, {"Z_idx", "Muon_pt", "Muon_eta", "Muon_phi", "Muon_mass"});
                               ^
input_line_53:34:33: error: use of undeclared identifier 'compute_higgs_mass_4l'
      df_z_cut.Define("H_mass", compute_higgs_mass_4l, {"Z_idx", "Muon_pt", "Muon_eta", "Muon_phi", "Muon_mass"});
                                ^

Reconstruct higgs from four electrons

In [9]:
RNode reco_higgs_to_4el(RNode df)
{
   // Filter interesting events
   auto df_base = selection_4el(df);

   // Reconstruct Z systems
   auto df_z_idx = df_base.Define("Z_idx", reco_zz_to_4l,
                                  {"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) {
      for (size_t i = 0; i < 2; i++) {
         const auto i1 = idx[i][0];
         const auto i2 = idx[i][1];
         const auto dr = DeltaR(eta[i1], eta[i2], phi[i1], phi[i2]);
         if (dr < 0.02) {
            return false;
         }
      }
      return true;
   };
   auto df_z_dr = df_z_idx.Filter(filter_z_dr, {"Z_idx", "Electron_eta", "Electron_phi"},
                                  "Delta R separation of Electrons building Z system");

   // Compute masses of Z systems
   auto df_z_mass = df_z_dr.Define("Z_mass", compute_z_masses_4l,
                                   {"Z_idx", "Electron_pt", "Electron_eta", "Electron_phi", "Electron_mass"});

   // Cut on mass of Z candidates
   auto df_z_cut = filter_z_candidates(df_z_mass);

   // Reconstruct H mass
   auto df_h_mass = df_z_cut.Define("H_mass", compute_higgs_mass_4l,
                                    {"Z_idx", "Electron_pt", "Electron_eta", "Electron_phi", "Electron_mass"});

   return df_h_mass;
}
input_line_54:7:44: error: use of undeclared identifier 'reco_zz_to_4l'
   auto df_z_idx = df_base.Define("Z_idx", reco_zz_to_4l,
                                           ^
input_line_54:26:46: error: use of undeclared identifier 'compute_z_masses_4l'
   auto df_z_mass = df_z_dr.Define("Z_mass", compute_z_masses_4l,
                                             ^
input_line_54:33:47: error: use of undeclared identifier 'compute_higgs_mass_4l'
   auto df_h_mass = df_z_cut.Define("H_mass", compute_higgs_mass_4l,
                                              ^

Compute mass of two z candidates from two electrons and two muons and sort ascending in distance to z mass

In [10]:
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::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);
   if (std::abs(mu_z - z_mass) < std::abs(el_z - z_mass)) {
      z_masses[0] = mu_z;
      z_masses[1] = el_z;
   } else {
      z_masses[0] = el_z;
      z_masses[1] = mu_z;
   }
   return z_masses;
}
input_line_55:4:1: error: function definition is not allowed here
{
^

Reconstruct higgs from two electrons and two muons

In [11]:
RNode reco_higgs_to_2el2mu(RNode df)
{
   // Filter interesting events
   auto df_base = selection_2el2mu(df);

   // Compute masses of Z systems
   auto df_z_mass =
      df_base.Define("Z_mass", compute_z_masses_2el2mu, {"Electron_pt", "Electron_eta", "Electron_phi", "Electron_mass",
                                                       "Muon_pt", "Muon_eta", "Muon_phi", "Muon_mass"});

   // Cut on mass of Z candidates
   auto df_z_cut = filter_z_candidates(df_z_mass);

   // Reconstruct H mass
   auto df_h_mass = df_z_cut.Define(
      "H_mass", compute_higgs_mass_2el2mu,
      {"Electron_pt", "Electron_eta", "Electron_phi", "Electron_mass", "Muon_pt", "Muon_eta", "Muon_phi", "Muon_mass"});

   return df_h_mass;
}
input_line_56:8:32: error: use of undeclared identifier 'compute_z_masses_2el2mu'
      df_base.Define("Z_mass", compute_z_masses_2el2mu, {"Electron_pt", "Electron_eta", "Electron_phi", "Electron_mass",
                               ^
input_line_56:16:17: error: use of undeclared identifier 'compute_higgs_mass_2el2mu'
      "H_mass", compute_higgs_mass_2el2mu,
                ^

Plot invariant mass for signal and background processes from simulated events overlay the measured data.

In [12]:
template <typename T>
Unbalanced braces. This cell was not processed.

Compute mass of Higgs from four leptons of the same kind

In [13]:
%%cpp -d
float compute_higgs_mass_4l(const RVec<RVec<size_t>> &idx, rvec_f pt, rvec_f eta, rvec_f phi, rvec_f 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];
   ROOT::Math::PtEtaPhiMVector p1(pt[i1], eta[i1], phi[i1], mass[i1]);
   ROOT::Math::PtEtaPhiMVector p2(pt[i2], eta[i2], phi[i2], mass[i2]);
   ROOT::Math::PtEtaPhiMVector p3(pt[i3], eta[i3], phi[i3], mass[i3]);
   ROOT::Math::PtEtaPhiMVector p4(pt[i4], eta[i4], phi[i4], mass[i4]);
   return (p1 + p2 + p3 + p4).M();
}

Compute Higgs mass from two electrons and two muons

In [14]:
%%cpp -d
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)
{
   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]);
   return (p1 + p2 + p3 + p4).M();
}

A helper function is created:

In [15]:
%%cpp -d
void plot(T sig, T bkg, T data, const std::string &x_label, const std::string &filename)
{
   // Canvas and general style options
   gStyle->SetOptStat(0);
   gStyle->SetTextFont(42);
   auto c = new TCanvas("c", "", 800, 700);
   c->SetLeftMargin(0.15);

   // Get signal and background histograms and stack them to show Higgs signal
   // on top of the background process
   auto h_sig = *sig;
   auto h_bkg = *bkg;
   auto h_cmb = *(TH1D*)(sig->Clone());
   h_cmb.Add(&h_bkg);
   h_cmb.SetTitle("");
   h_cmb.GetXaxis()->SetTitle(x_label.c_str());
   h_cmb.GetXaxis()->SetTitleSize(0.04);
   h_cmb.GetYaxis()->SetTitle("N_{Events}");
   h_cmb.GetYaxis()->SetTitleSize(0.04);
   h_cmb.SetLineColor(kRed);
   h_cmb.SetLineWidth(2);
   h_cmb.SetMaximum(18);

   h_bkg.SetLineWidth(2);
   h_bkg.SetFillStyle(1001);
   h_bkg.SetLineColor(kBlack);
   h_bkg.SetFillColor(kAzure - 9);

   // Get histogram of data points
   auto h_data = *data;
   h_data.SetLineWidth(1);
   h_data.SetMarkerStyle(20);
   h_data.SetMarkerSize(1.0);
   h_data.SetMarkerColor(kBlack);
   h_data.SetLineColor(kBlack);

   // Draw histograms
   h_cmb.DrawClone("HIST");
   h_bkg.DrawClone("HIST SAME");
   h_data.DrawClone("PE1 SAME");

   // Add legend
   TLegend legend(0.62, 0.70, 0.82, 0.88);
   legend.SetFillColor(0);
   legend.SetBorderSize(0);
   legend.SetTextSize(0.03);
   legend.AddEntry(&h_data, "Data", "PE1");
   legend.AddEntry(&h_bkg, "ZZ", "f");
   legend.AddEntry(&h_cmb, "m_{H} = 125 GeV", "f");
   legend.DrawClone();

   // Add header
   TLatex cms_label;
   cms_label.SetTextSize(0.04);
   cms_label.DrawLatexNDC(0.16, 0.92, "#bf{CMS Open Data}");
   TLatex header;
   header.SetTextSize(0.03);
   header.DrawLatexNDC(0.63, 0.92, "#sqrt{s} = 8 TeV, L_{int} = 11.6 fb^{-1}");

   // Save plot
   c->SaveAs(filename.c_str());
}
input_line_60:1:11: error: unknown type name 'T'
void plot(T sig, T bkg, T data, const std::string &x_label, const std::string &filename)
          ^
input_line_60:1:18: error: unknown type name 'T'
void plot(T sig, T bkg, T data, const std::string &x_label, const std::string &filename)
                 ^
input_line_60:1:25: error: unknown type name 'T'
void plot(T sig, T bkg, T data, const std::string &x_label, const std::string &filename)
                        ^

Arguments are defined.

In [16]:
const bool run_fast = true;

Enable multi-threading

In [17]:
ROOT::EnableImplicitMT();

In fast mode, take samples from /cms_opendata_2012_nanoaod_skimmed/, which has the preselections from the selection_* functions already applied.

In [18]:
std::string path = "root://eospublic.cern.ch//eos/root-eos/cms_opendata_2012_nanoaod/";
if (run_fast) path = "root://eospublic.cern.ch//eos/root-eos/cms_opendata_2012_nanoaod_skimmed/";

Create dataframes for signal, background and data samples

Signal: higgs -> 4 leptons

In [19]:
ROOT::RDataFrame df_sig_4l("Events", path + "SMHiggsToZZTo4L.root");

Background: zz -> 4 leptons Note that additional background processes from the original paper with minor contribution were left out for this tutorial.

In [20]:
ROOT::RDataFrame df_bkg_4mu("Events", path + "ZZTo4mu.root");
ROOT::RDataFrame df_bkg_4el("Events", path + "ZZTo4e.root");
ROOT::RDataFrame df_bkg_2el2mu("Events", path + "ZZTo2e2mu.root");

Cms data taken in 2012 (11.6 fb^-1 integrated luminosity)

In [21]:
ROOT::RDataFrame df_data_doublemu(
   "Events", {path + "Run2012B_DoubleMuParked.root", path + "Run2012C_DoubleMuParked.root"});
ROOT::RDataFrame df_data_doubleel(
   "Events", {path + "Run2012B_DoubleElectron.root", path + "Run2012C_DoubleElectron.root"});

Reconstruct higgs to 4 muons

In [22]:
auto df_sig_4mu_reco = reco_higgs_to_4mu(df_sig_4l);
const auto luminosity = 11580.0;            // Integrated luminosity of the data samples
const auto xsec_SMHiggsToZZTo4L = 0.0065;   // H->4l: Standard Model cross-section
const auto nevt_SMHiggsToZZTo4L = 299973.0; // H->4l: Number of simulated events
const auto nbins = 36;                      // Number of bins for the invariant mass spectrum
auto df_h_sig_4mu = df_sig_4mu_reco
      .Define("weight", [&]() { return luminosity * xsec_SMHiggsToZZTo4L / nevt_SMHiggsToZZTo4L; }, {})
      .Histo1D({"h_sig_4mu", "", nbins, 70, 180}, "H_mass", "weight");

const auto scale_ZZTo4l = 1.386;     // ZZ->4mu: Scale factor for ZZ to four leptons
const auto xsec_ZZTo4mu = 0.077;     // ZZ->4mu: Standard Model cross-section
const auto nevt_ZZTo4mu = 1499064.0; // ZZ->4mu: Number of simulated events
auto df_bkg_4mu_reco = reco_higgs_to_4mu(df_bkg_4mu);
auto df_h_bkg_4mu = df_bkg_4mu_reco
      .Define("weight", [&]() { return luminosity * xsec_ZZTo4mu * scale_ZZTo4l / nevt_ZZTo4mu; }, {})
      .Histo1D({"h_bkg_4mu", "", nbins, 70, 180}, "H_mass", "weight");

auto df_data_4mu_reco = reco_higgs_to_4mu(df_data_doublemu);
auto df_h_data_4mu = df_data_4mu_reco
      .Define("weight", []() { return 1.0; }, {})
      .Histo1D({"h_data_4mu", "", nbins, 70, 180}, "H_mass", "weight");
input_line_67:2:2: error: Syntax error
 auto df_sig_4mu_reco = reco_higgs_to_4mu(df_sig_4l);
 ^
FunctionDecl 0x7fc20623f108 <input_line_67:1:1, line:24:1> line:1:6 __cling_Un1Qu330 'void (void *)'
|-ParmVarDecl 0x7fc20623f050 <col:23, col:29> col:29 vpClingValue 'void *'
|-CompoundStmt 0x7fc2065d9640 <col:43, line:24:1>
| |-DeclStmt 0x7fc20623f448 <line:2:2, col:53>
| | `-VarDecl 0x7fc20623f1e8 <col:2, col:52> col:7 used df_sig_4mu_reco 'auto' cinit
| |   `-CallExpr 0x7fc20623f420 <col:25, col:52> '<dependent type>'
| |     |-DeclRefExpr 0x7fc20623f3c0 <col:25> '<dependent type>' lvalue Var 0x7fc20623f328 'reco_higgs_to_4mu' '<dependent type>'
| |     `-DeclRefExpr 0x7fc20623f400 <col:43> 'ROOT::RDataFrame':'ROOT::RDataFrame' lvalue Var 0x6bdf660 'df_sig_4l' 'ROOT::RDataFrame':'ROOT::RDataFrame'
| |-DeclStmt 0x7fc20623f578 <line:3:1, col:32>
| | `-VarDecl 0x7fc20623f478 <col:1, col:25> col:12 used luminosity 'const double':'const double' cinit
| |   `-FloatingLiteral 0x7fc20623f4e0 <col:25> 'double' 1.158000e+04
| |-DeclStmt 0x7fc20623f6a8 <line:4:1, col:41>
| | `-VarDecl 0x7fc20623f5a8 <col:1, col:35> col:12 used xsec_SMHiggsToZZTo4L 'const double':'const double' cinit
| |   `-FloatingLiteral 0x7fc20623f610 <col:35> 'double' 6.500000e-03
| |-DeclStmt 0x7fc20623f7d8 <line:5:1, col:43>
| | `-VarDecl 0x7fc20623f6d8 <col:1, col:35> col:12 used nevt_SMHiggsToZZTo4L 'const double':'const double' cinit
| |   `-FloatingLiteral 0x7fc20623f740 <col:35> 'double' 2.999730e+05
| |-DeclStmt 0x7fc20623f9a8 <line:6:1, col:22>
| | `-VarDecl 0x7fc20623f808 <col:1, col:20> col:12 used nbins 'const int':'const int' cinit
| |   `-IntegerLiteral 0x7fc20623f870 <col:20> 'int' 36
| |-DeclStmt 0x7fc206240640 <line:7:1, line:9:70>
| | `-VarDecl 0x7fc20623f9d8 <line:7:1, line:9:69> line:7:6 df_h_sig_4mu 'auto' cinit
| |   `-CallExpr 0x7fc206240608 <col:21, line:9:69> '<dependent type>'
| |     |-CXXDependentScopeMemberExpr 0x7fc206240478 <line:7:21, line:9:8> '<dependent type>' lvalue .Histo1D
| |     | `-CallExpr 0x7fc206240440 <line:7:21, line:8:103> '<dependent type>'
| |     |   |-CXXDependentScopeMemberExpr 0x7fc20623fa80 <line:7:21, line:8:8> '<dependent type>' lvalue .Define
| |     |   | `-DeclRefExpr 0x7fc20623fa40 <line:7:21> 'auto' lvalue Var 0x7fc20623f1e8 'df_sig_4mu_reco' 'auto'
| |     |   |-StringLiteral 0x7fc20623fac8 <line:8:15> 'const char [7]' lvalue "weight"
| |     |   |-LambdaExpr 0x7fc206240278 <col:25, col:98> '(lambda at input_line_67:8:25)'
| |     |   | |-CXXRecordDecl 0x7fc20623fb40 <col:25> col:25 implicit class definition
| |     |   | | |-DefinitionData lambda pass_in_registers trivially_copyable can_const_default_init
| |     |   | | | |-DefaultConstructor
| |     |   | | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
| |     |   | | | |-MoveConstructor exists simple trivial needs_implicit
| |     |   | | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
| |     |   | | | |-MoveAssignment
| |     |   | | | `-Destructor simple irrelevant trivial
| |     |   | | |-CXXMethodDecl 0x7fc20623fca8 <col:29, col:98> col:25 operator() 'double () const' inline
| |     |   | | | `-CompoundStmt 0x7fc2062400b0 <col:31, col:98>
| |     |   | | |   `-ReturnStmt 0x7fc2062400a0 <col:33, col:76>
| |     |   | | |     `-BinaryOperator 0x7fc20623feb0 <col:40, col:76> 'double' '/'
| |     |   | | |       |-BinaryOperator 0x7fc20623fe38 <col:40, col:53> 'double' '*'
| |     |   | | |       | |-ImplicitCastExpr 0x7fc20623fe08 <col:40> 'double':'double' <LValueToRValue>
| |     |   | | |       | | `-DeclRefExpr 0x7fc20623fd88 <col:40> 'const double':'const double' lvalue Var 0x7fc20623f478 'luminosity' 'const double':'const double'
| |     |   | | |       | `-ImplicitCastExpr 0x7fc20623fe20 <col:53> 'double':'double' <LValueToRValue>
| |     |   | | |       |   `-DeclRefExpr 0x7fc20623fdc8 <col:53> 'const double':'const double' lvalue Var 0x7fc20623f5a8 'xsec_SMHiggsToZZTo4L' 'const double':'const double'
| |     |   | | |       `-ImplicitCastExpr 0x7fc20623fe98 <col:76> 'double':'double' <LValueToRValue>
| |     |   | | |         `-DeclRefExpr 0x7fc20623fe58 <col:76> 'const double':'const double' lvalue Var 0x7fc20623f6d8 'nevt_SMHiggsToZZTo4L' 'const double':'const double'
| |     |   | | |-FieldDecl 0x7fc206240100 <col:40> col:40 implicit 'const double &'
| |     |   | | |-FieldDecl 0x7fc206240188 <col:53> col:53 implicit 'const double &'
| |     |   | | |-FieldDecl 0x7fc206240210 <col:76> col:76 implicit 'const double &'
| |     |   | | `-CXXDestructorDecl 0x7fc2062402f8 <col:25> col:25 implicit referenced ~ 'void () noexcept' inline default trivial
| |     |   | |-DeclRefExpr 0x7fc2062400c8 <col:26> 'const double':'const double' lvalue Var 0x7fc20623f478 'luminosity' 'const double':'const double'
| |     |   | |-DeclRefExpr 0x7fc206240150 <col:26> 'const double':'const double' lvalue Var 0x7fc20623f5a8 'xsec_SMHiggsToZZTo4L' 'const double':'const double'
| |     |   | |-DeclRefExpr 0x7fc2062401d8 <col:26> 'const double':'const double' lvalue Var 0x7fc20623f6d8 'nevt_SMHiggsToZZTo4L' 'const double':'const double'
| |     |   | `-CompoundStmt 0x7fc2062400b0 <col:31, col:98>
| |     |   |   `-ReturnStmt 0x7fc2062400a0 <col:33, col:76>
| |     |   |     `-BinaryOperator 0x7fc20623feb0 <col:40, col:76> 'double' '/'
| |     |   |       |-BinaryOperator 0x7fc20623fe38 <col:40, col:53> 'double' '*'
| |     |   |       | |-ImplicitCastExpr 0x7fc20623fe08 <col:40> 'double':'double' <LValueToRValue>
| |     |   |       | | `-DeclRefExpr 0x7fc20623fd88 <col:40> 'const double':'const double' lvalue Var 0x7fc20623f478 'luminosity' 'const double':'const double'
| |     |   |       | `-ImplicitCastExpr 0x7fc20623fe20 <col:53> 'double':'double' <LValueToRValue>
| |     |   |       |   `-DeclRefExpr 0x7fc20623fdc8 <col:53> 'const double':'const double' lvalue Var 0x7fc20623f5a8 'xsec_SMHiggsToZZTo4L' 'const double':'const double'
| |     |   |       `-ImplicitCastExpr 0x7fc20623fe98 <col:76> 'double':'double' <LValueToRValue>
| |     |   |         `-DeclRefExpr 0x7fc20623fe58 <col:76> 'const double':'const double' lvalue Var 0x7fc20623f6d8 'nevt_SMHiggsToZZTo4L' 'const double':'const double'
| |     |   `-InitListExpr 0x7fc206240400 <col:101, col:102> 'void'
| |     |-InitListExpr 0x7fc206240560 <line:9:16, col:48> 'void'
| |     | |-StringLiteral 0x7fc2062404c0 <col:17> 'const char [10]' lvalue "h_sig_4mu"
| |     | |-StringLiteral 0x7fc2062404e8 <col:30> 'const char [1]' lvalue ""
| |     | |-DeclRefExpr 0x7fc206240500 <col:34> 'const int':'const int' lvalue Var 0x7fc20623f808 'nbins' 'const int':'const int'
| |     | |-IntegerLiteral 0x7fc206240520 <col:41> 'int' 70
| |     | `-IntegerLiteral 0x7fc206240540 <col:45> 'int' 180
| |     |-StringLiteral 0x7fc2062405c8 <col:51> 'const char [7]' lvalue "H_mass"
| |     `-StringLiteral 0x7fc2062405e8 <col:61> 'const char [7]' lvalue "weight"
| |-DeclStmt 0x7fc206240778 <line:11:1, col:32>
| | `-VarDecl 0x7fc206240670 <col:1, col:27> col:12 used scale_ZZTo4l 'const double':'const double' cinit
| |   `-FloatingLiteral 0x7fc2062406d8 <col:27> 'double' 1.386000e+00
| |-DeclStmt 0x7fc2062408a8 <line:12:1, col:32>
| | `-VarDecl 0x7fc2062407a8 <col:1, col:27> col:12 used xsec_ZZTo4mu 'const double':'const double' cinit
| |   `-FloatingLiteral 0x7fc206240810 <col:27> 'double' 7.700000e-02
| |-DeclStmt 0x7fc2062409d8 <line:13:1, col:36>
| | `-VarDecl 0x7fc2062408d8 <col:1, col:27> col:12 used nevt_ZZTo4mu 'const double':'const double' cinit
| |   `-FloatingLiteral 0x7fc206240940 <col:27> 'double' 1.499064e+06
| |-DeclStmt 0x7fc206240c38 <line:14:1, col:53>
| | `-VarDecl 0x7fc206240a08 <col:1, col:52> col:6 used df_bkg_4mu_reco 'auto' cinit
| |   `-CallExpr 0x7fc206240c10 <col:24, col:52> '<dependent type>'
| |     |-DeclRefExpr 0x7fc206240bb0 <col:24> '<dependent type>' lvalue Var 0x7fc206240b18 'reco_higgs_to_4mu' '<dependent type>'
| |     `-DeclRefExpr 0x7fc206240bf0 <col:42> 'ROOT::RDataFrame':'ROOT::RDataFrame' lvalue Var 0x7fc20622dbb0 'df_bkg_4mu' 'ROOT::RDataFrame':'ROOT::RDataFrame'
| |-DeclStmt 0x7fc206241940 <line:15:1, line:17:70>
| | `-VarDecl 0x7fc206240c68 <line:15:1, line:17:69> line:15:6 df_h_bkg_4mu 'auto' cinit
| |   `-CallExpr 0x7fc206241908 <col:21, line:17:69> '<dependent type>'
| |     |-CXXDependentScopeMemberExpr 0x7fc206241778 <line:15:21, line:17:8> '<dependent type>' lvalue .Histo1D
| |     | `-CallExpr 0x7fc206241740 <line:15:21, line:16:102> '<dependent type>'
| |     |   |-CXXDependentScopeMemberExpr 0x7fc206240d10 <line:15:21, line:16:8> '<dependent type>' lvalue .Define
| |     |   | `-DeclRefExpr 0x7fc206240cd0 <line:15:21> 'auto' lvalue Var 0x7fc206240a08 'df_bkg_4mu_reco' 'auto'
| |     |   |-StringLiteral 0x7fc206240d58 <line:16:15> 'const char [7]' lvalue "weight"
| |     |   |-LambdaExpr 0x7fc206241560 <col:25, col:97> '(lambda at input_line_67:16:25)'
| |     |   | |-CXXRecordDecl 0x7fc206240da0 <col:25> col:25 implicit class definition
| |     |   | | |-DefinitionData lambda pass_in_registers trivially_copyable can_const_default_init
| |     |   | | | |-DefaultConstructor
| |     |   | | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
| |     |   | | | |-MoveConstructor exists simple trivial needs_implicit
| |     |   | | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
| |     |   | | | |-MoveAssignment
| |     |   | | | `-Destructor simple irrelevant trivial
| |     |   | | |-CXXMethodDecl 0x7fc206240f08 <col:29, col:97> col:25 operator() 'double () const' inline
| |     |   | | | `-CompoundStmt 0x7fc206241310 <col:31, col:97>
| |     |   | | |   `-ReturnStmt 0x7fc206241300 <col:33, col:83>
| |     |   | | |     `-BinaryOperator 0x7fc206241138 <col:40, col:83> 'double' '/'
| |     |   | | |       |-BinaryOperator 0x7fc2062410c0 <col:40, col:68> 'double' '*'
| |     |   | | |       | |-BinaryOperator 0x7fc206241048 <col:40, col:53> 'double' '*'
| |     |   | | |       | | |-ImplicitCastExpr 0x7fc206241018 <col:40> 'double':'double' <LValueToRValue>
| |     |   | | |       | | | `-DeclRefExpr 0x7fc206240fb8 <col:40> 'const double':'const double' lvalue Var 0x7fc20623f478 'luminosity' 'const double':'const double'
| |     |   | | |       | | `-ImplicitCastExpr 0x7fc206241030 <col:53> 'double':'double' <LValueToRValue>
| |     |   | | |       | |   `-DeclRefExpr 0x7fc206240fd8 <col:53> 'const double':'const double' lvalue Var 0x7fc2062407a8 'xsec_ZZTo4mu' 'const double':'const double'
| |     |   | | |       | `-ImplicitCastExpr 0x7fc2062410a8 <col:68> 'double':'double' <LValueToRValue>
| |     |   | | |       |   `-DeclRefExpr 0x7fc206241068 <col:68> 'const double':'const double' lvalue Var 0x7fc206240670 'scale_ZZTo4l' 'const double':'const double'
| |     |   | | |       `-ImplicitCastExpr 0x7fc206241120 <col:83> 'double':'double' <LValueToRValue>
| |     |   | | |         `-DeclRefExpr 0x7fc2062410e0 <col:83> 'const double':'const double' lvalue Var 0x7fc2062408d8 'nevt_ZZTo4mu' 'const double':'const double'
| |     |   | | |-FieldDecl 0x7fc206241360 <col:40> col:40 implicit 'const double &'
| |     |   | | |-FieldDecl 0x7fc2062413e8 <col:53> col:53 implicit 'const double &'
| |     |   | | |-FieldDecl 0x7fc206241470 <col:68> col:68 implicit 'const double &'
| |     |   | | |-FieldDecl 0x7fc2062414f8 <col:83> col:83 implicit 'const double &'
| |     |   | | `-CXXDestructorDecl 0x7fc2062415f8 <col:25> col:25 implicit referenced ~ 'void () noexcept' inline default trivial
| |     |   | |-DeclRefExpr 0x7fc206241328 <col:26> 'const double':'const double' lvalue Var 0x7fc20623f478 'luminosity' 'const double':'const double'
| |     |   | |-DeclRefExpr 0x7fc2062413b0 <col:26> 'const double':'const double' lvalue Var 0x7fc2062407a8 'xsec_ZZTo4mu' 'const double':'const double'
| |     |   | |-DeclRefExpr 0x7fc206241438 <col:26> 'const double':'const double' lvalue Var 0x7fc206240670 'scale_ZZTo4l' 'const double':'const double'
| |     |   | |-DeclRefExpr 0x7fc2062414c0 <col:26> 'const double':'const double' lvalue Var 0x7fc2062408d8 'nevt_ZZTo4mu' 'const double':'const double'
| |     |   | `-CompoundStmt 0x7fc206241310 <col:31, col:97>
| |     |   |   `-ReturnStmt 0x7fc206241300 <col:33, col:83>
| |     |   |     `-BinaryOperator 0x7fc206241138 <col:40, col:83> 'double' '/'
| |     |   |       |-BinaryOperator 0x7fc2062410c0 <col:40, col:68> 'double' '*'
| |     |   |       | |-BinaryOperator 0x7fc206241048 <col:40, col:53> 'double' '*'
| |     |   |       | | |-ImplicitCastExpr 0x7fc206241018 <col:40> 'double':'double' <LValueToRValue>
| |     |   |       | | | `-DeclRefExpr 0x7fc206240fb8 <col:40> 'const double':'const double' lvalue Var 0x7fc20623f478 'luminosity' 'const double':'const double'
| |     |   |       | | `-ImplicitCastExpr 0x7fc206241030 <col:53> 'double':'double' <LValueToRValue>
| |     |   |       | |   `-DeclRefExpr 0x7fc206240fd8 <col:53> 'const double':'const double' lvalue Var 0x7fc2062407a8 'xsec_ZZTo4mu' 'const double':'const double'
| |     |   |       | `-ImplicitCastExpr 0x7fc2062410a8 <col:68> 'double':'double' <LValueToRValue>
| |     |   |       |   `-DeclRefExpr 0x7fc206241068 <col:68> 'const double':'const double' lvalue Var 0x7fc206240670 'scale_ZZTo4l' 'const double':'const double'
| |     |   |       `-ImplicitCastExpr 0x7fc206241120 <col:83> 'double':'double' <LValueToRValue>
| |     |   |         `-DeclRefExpr 0x7fc2062410e0 <col:83> 'const double':'const double' lvalue Var 0x7fc2062408d8 'nevt_ZZTo4mu' 'const double':'const double'
| |     |   `-InitListExpr 0x7fc206241700 <col:100, col:101> 'void'
| |     |-InitListExpr 0x7fc206241860 <line:17:16, col:48> 'void'
| |     | |-StringLiteral 0x7fc2062417c0 <col:17> 'const char [10]' lvalue "h_bkg_4mu"
| |     | |-StringLiteral 0x7fc2062417e8 <col:30> 'const char [1]' lvalue ""
| |     | |-DeclRefExpr 0x7fc206241800 <col:34> 'const int':'const int' lvalue Var 0x7fc20623f808 'nbins' 'const int':'const int'
| |     | |-IntegerLiteral 0x7fc206241820 <col:41> 'int' 70
| |     | `-IntegerLiteral 0x7fc206241840 <col:45> 'int' 180
| |     |-StringLiteral 0x7fc2062418c8 <col:51> 'const char [7]' lvalue "H_mass"
| |     `-StringLiteral 0x7fc2062418e8 <col:61> 'const char [7]' lvalue "weight"
| |-DeclStmt 0x7fc206241ba0 <line:19:1, col:60>
| | `-VarDecl 0x7fc206241970 <col:1, col:59> col:6 used df_data_4mu_reco 'auto' cinit
| |   `-CallExpr 0x7fc206241b78 <col:25, col:59> '<dependent type>'
| |     |-DeclRefExpr 0x7fc206241b18 <col:25> '<dependent type>' lvalue Var 0x7fc206241a80 'reco_higgs_to_4mu' '<dependent type>'
| |     `-DeclRefExpr 0x7fc206241b58 <col:43> 'ROOT::RDataFrame':'ROOT::RDataFrame' lvalue Var 0x7fc206235960 'df_data_doublemu' 'ROOT::RDataFrame':'ROOT::RDataFrame'
| |-DeclStmt 0x7fc2065d9620 <line:20:1, line:22:71>
| | `-VarDecl 0x7fc206241bd0 <line:20:1, line:22:70> line:20:6 df_h_data_4mu 'auto' cinit
| |   `-CallExpr 0x7fc2065d95e8 <col:22, line:22:70> '<dependent type>'
| |     |-CXXDependentScopeMemberExpr 0x7fc2065d9458 <line:20:22, line:22:8> '<dependent type>' lvalue .Histo1D
| |     | `-CallExpr 0x7fc2065d9420 <line:20:22, line:21:49> '<dependent type>'
| |     |   |-CXXDependentScopeMemberExpr 0x7fc206241c78 <line:20:22, line:21:8> '<dependent type>' lvalue .Define
| |     |   | `-DeclRefExpr 0x7fc206241c38 <line:20:22> 'auto' lvalue Var 0x7fc206241970 'df_data_4mu_reco' 'auto'
| |     |   |-StringLiteral 0x7fc206241cc0 <line:21:15> 'const char [7]' lvalue "weight"
| |     |   |-LambdaExpr 0x7fc2062422b0 <col:25, col:44> '(lambda at input_line_67:21:25)'
| |     |   | |-CXXRecordDecl 0x7fc206241d08 <col:25> col:25 implicit class definition
| |     |   | | |-DefinitionData lambda pass_in_registers empty standard_layout trivially_copyable can_const_default_init
| |     |   | | | |-DefaultConstructor defaulted_is_constexpr
| |     |   | | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
| |     |   | | | |-MoveConstructor exists simple trivial needs_implicit
| |     |   | | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
| |     |   | | | |-MoveAssignment
| |     |   | | | `-Destructor simple irrelevant trivial
| |     |   | | |-CXXMethodDecl 0x7fc206241e68 <col:28, col:44> col:25 operator() 'double () const' inline
| |     |   | | | `-CompoundStmt 0x7fc206241fe8 <col:30, col:44>
| |     |   | | |   `-ReturnStmt 0x7fc206241fd8 <col:32, col:39>
| |     |   | | |     `-FloatingLiteral 0x7fc206241f18 <col:39> 'double' 1.000000e+00
| |     |   | | |-CXXConversionDecl 0x7fc206242140 <col:25, col:44> col:25 implicit operator double (*)() 'double (*() const noexcept)()' inline
| |     |   | | |-CXXMethodDecl 0x7fc2062421f8 <col:25, col:44> col:25 implicit __invoke 'double ()' static inline
| |     |   | | `-CXXDestructorDecl 0x7fc2062422e8 <col:25> col:25 implicit referenced ~ 'void () noexcept' inline default trivial
| |     |   | `-CompoundStmt 0x7fc206241fe8 <col:30, col:44>
| |     |   |   `-ReturnStmt 0x7fc206241fd8 <col:32, col:39>
| |     |   |     `-FloatingLiteral 0x7fc206241f18 <col:39> 'double' 1.000000e+00
| |     |   `-InitListExpr 0x7fc2062423f0 <col:47, col:48> 'void'
| |     |-InitListExpr 0x7fc2065d9540 <line:22:16, col:49> 'void'
| |     | |-StringLiteral 0x7fc2065d94a0 <col:17> 'const char [11]' lvalue "h_data_4mu"
| |     | |-StringLiteral 0x7fc2065d94c8 <col:31> 'const char [1]' lvalue ""
| |     | |-DeclRefExpr 0x7fc2065d94e0 <col:35> 'const int':'const int' lvalue Var 0x7fc20623f808 'nbins' 'const int':'const int'
| |     | |-IntegerLiteral 0x7fc2065d9500 <col:42> 'int' 70
| |     | `-IntegerLiteral 0x7fc2065d9520 <col:46> 'int' 180
| |     |-StringLiteral 0x7fc2065d95a8 <col:52> 'const char [7]' lvalue "H_mass"
| |     `-StringLiteral 0x7fc2065d95c8 <col:62> 'const char [7]' lvalue "weight"
| `-NullStmt 0x7fc2065d9638 <line:23:1>
|-AnnotateAttr 0x7fc20623f2c0 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
|-AnnotateAttr 0x7fc20623f390 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
|-AnnotateAttr 0x7fc206240ae0 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
|-AnnotateAttr 0x7fc206240b80 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
|-AnnotateAttr 0x7fc206241a48 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
`-AnnotateAttr 0x7fc206241ae8 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
<<<NULL>>>

Reconstruct higgs to 4 electrons

In [23]:
auto df_sig_4el_reco = reco_higgs_to_4el(df_sig_4l);
auto df_h_sig_4el = df_sig_4el_reco
      .Define("weight", [&]() { return luminosity * xsec_SMHiggsToZZTo4L / nevt_SMHiggsToZZTo4L; }, {})
      .Histo1D({"h_sig_4el", "", nbins, 70, 180}, "H_mass", "weight");

const auto xsec_ZZTo4el = xsec_ZZTo4mu; // ZZ->4el: Standard Model cross-section
const auto nevt_ZZTo4el = 1499093.0;    // ZZ->4el: Number of simulated events
auto df_bkg_4el_reco = reco_higgs_to_4el(df_bkg_4el);
auto df_h_bkg_4el = df_bkg_4el_reco
      .Define("weight", [&]() { return luminosity * xsec_ZZTo4el * scale_ZZTo4l / nevt_ZZTo4el; }, {})
      .Histo1D({"h_bkg_4el", "", nbins, 70, 180}, "H_mass", "weight");

auto df_data_4el_reco = reco_higgs_to_4el(df_data_doubleel);
auto df_h_data_4el = df_data_4el_reco.Define("weight", []() { return 1.0; }, {})
                        .Histo1D({"h_data_4el", "", nbins, 70, 180}, "H_mass", "weight");
input_line_68:4:40: error: use of undeclared identifier 'luminosity'
      .Define("weight", [&]() { return luminosity * xsec_SMHiggsToZZTo4L / nevt_SMHiggsToZZTo4L; }, {})
                                       ^
input_line_68:4:53: error: use of undeclared identifier 'xsec_SMHiggsToZZTo4L'
      .Define("weight", [&]() { return luminosity * xsec_SMHiggsToZZTo4L / nevt_SMHiggsToZZTo4L; }, {})
                                                    ^
input_line_68:4:76: error: use of undeclared identifier 'nevt_SMHiggsToZZTo4L'
      .Define("weight", [&]() { return luminosity * xsec_SMHiggsToZZTo4L / nevt_SMHiggsToZZTo4L; }, {})
                                                                           ^
input_line_68:5:34: error: use of undeclared identifier 'nbins'
      .Histo1D({"h_sig_4el", "", nbins, 70, 180}, "H_mass", "weight");
                                 ^
input_line_68:7:27: error: use of undeclared identifier 'xsec_ZZTo4mu'
const auto xsec_ZZTo4el = xsec_ZZTo4mu; // ZZ->4el: Standard Model cross-section
                          ^
input_line_68:9:24: error: use of undeclared identifier 'reco_higgs_to_4el'
auto df_bkg_4el_reco = reco_higgs_to_4el(df_bkg_4el);
                       ^
input_line_68:11:40: error: use of undeclared identifier 'luminosity'
      .Define("weight", [&]() { return luminosity * xsec_ZZTo4el * scale_ZZTo4l / nevt_ZZTo4el; }, {})
                                       ^
input_line_68:11:68: error: use of undeclared identifier 'scale_ZZTo4l'
      .Define("weight", [&]() { return luminosity * xsec_ZZTo4el * scale_ZZTo4l / nevt_ZZTo4el; }, {})
                                                                   ^
input_line_68:12:34: error: use of undeclared identifier 'nbins'
      .Histo1D({"h_bkg_4el", "", nbins, 70, 180}, "H_mass", "weight");
                                 ^
input_line_68:14:25: error: use of undeclared identifier 'reco_higgs_to_4el'
auto df_data_4el_reco = reco_higgs_to_4el(df_data_doubleel);
                        ^
input_line_68:16:53: error: use of undeclared identifier 'nbins'
                        .Histo1D({"h_data_4el", "", nbins, 70, 180}, "H_mass", "weight");
                                                    ^
input_line_68:2:2: error: Syntax error
 auto df_sig_4el_reco = reco_higgs_to_4el(df_sig_4l);
 ^
FunctionDecl 0x7fc20724a4f0 <input_line_68:1:1, line:18:1> line:1:6 __cling_Un1Qu331 'void (void *)'
|-ParmVarDecl 0x7fc20724a438 <col:23, col:29> col:29 vpClingValue 'void *'
|-CompoundStmt 0x7fc20724c150 <col:43, line:18:1>
| |-DeclStmt 0x7fc20724a830 <line:2:2, col:53>
| | `-VarDecl 0x7fc20724a5d0 <col:2, col:52> col:7 used df_sig_4el_reco 'auto' cinit
| |   `-CallExpr 0x7fc20724a808 <col:25, col:52> '<dependent type>'
| |     |-DeclRefExpr 0x7fc20724a7a8 <col:25> '<dependent type>' lvalue Var 0x7fc20724a710 'reco_higgs_to_4el' '<dependent type>'
| |     `-DeclRefExpr 0x7fc20724a7e8 <col:43> 'ROOT::RDataFrame':'ROOT::RDataFrame' lvalue Var 0x6bdf660 'df_sig_4l' 'ROOT::RDataFrame':'ROOT::RDataFrame'
| |-DeclStmt 0x7fc20724af00 <line:3:1, line:5:70>
| | `-VarDecl 0x7fc20724a860 <line:3:1, col:6> col:6 invalid df_h_sig_4el 'auto'
| |-DeclStmt 0x7fc20724af98 <line:7:1, col:39>
| | `-VarDecl 0x7fc20724af30 <col:1, col:12> col:12 invalid xsec_ZZTo4el 'const auto'
| |-DeclStmt 0x7fc20724b0c8 <line:8:1, col:36>
| | `-VarDecl 0x7fc20724afc8 <col:1, col:27> col:12 used nevt_ZZTo4el 'const double':'const double' cinit
| |   `-FloatingLiteral 0x7fc20724b030 <col:27> 'double' 1.499093e+06
| |-DeclStmt 0x7fc20724b1c0 <line:9:1, col:53>
| | `-VarDecl 0x7fc20724b0f8 <col:1, col:6> col:6 invalid df_bkg_4el_reco 'auto'
| |-DeclStmt 0x7fc20724b840 <line:10:1, line:12:70>
| | `-VarDecl 0x7fc20724b1f0 <line:10:1, col:6> col:6 invalid df_h_bkg_4el 'auto'
| |-DeclStmt 0x7fc20724b938 <line:14:1, col:60>
| | `-VarDecl 0x7fc20724b870 <col:1, col:6> col:6 invalid df_data_4el_reco 'auto'
| |-DeclStmt 0x7fc20724c130 <line:15:1, line:16:89>
| | `-VarDecl 0x7fc20724b968 <line:15:1, col:6> col:6 invalid df_h_data_4el 'auto'
| `-NullStmt 0x7fc20724c148 <line:17:1>
|-AnnotateAttr 0x7fc20724a6a8 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
`-AnnotateAttr 0x7fc20724a778 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
<<<NULL>>>

Reconstruct higgs to 2 electrons and 2 muons

In [24]:
auto df_sig_2el2mu_reco = reco_higgs_to_2el2mu(df_sig_4l);
auto df_h_sig_2el2mu = df_sig_2el2mu_reco
      .Define("weight", [&]() { return luminosity * xsec_SMHiggsToZZTo4L / nevt_SMHiggsToZZTo4L; }, {})
      .Histo1D({"h_sig_2el2mu", "", nbins, 70, 180}, "H_mass", "weight");

const auto xsec_ZZTo2el2mu = 0.18;      // ZZ->2el2mu: Standard Model cross-section
const auto nevt_ZZTo2el2mu = 1497445.0; // ZZ->2el2mu: Number of simulated events
auto df_bkg_2el2mu_reco = reco_higgs_to_2el2mu(df_bkg_2el2mu);
auto df_h_bkg_2el2mu = df_bkg_2el2mu_reco
      .Define("weight", [&]() { return luminosity * xsec_ZZTo2el2mu * scale_ZZTo4l / nevt_ZZTo2el2mu; }, {})
      .Histo1D({"h_bkg_2el2mu", "", nbins, 70, 180}, "H_mass", "weight");

auto df_data_2el2mu_reco = reco_higgs_to_2el2mu(df_data_doublemu);
auto df_h_data_2el2mu = df_data_2el2mu_reco.Define("weight", []() { return 1.0; }, {})
                           .Histo1D({"h_data_2el2mu_doublemu", "", nbins, 70, 180}, "H_mass", "weight");
input_line_69:4:40: error: use of undeclared identifier 'luminosity'
      .Define("weight", [&]() { return luminosity * xsec_SMHiggsToZZTo4L / nevt_SMHiggsToZZTo4L; }, {})
                                       ^
input_line_69:4:53: error: use of undeclared identifier 'xsec_SMHiggsToZZTo4L'
      .Define("weight", [&]() { return luminosity * xsec_SMHiggsToZZTo4L / nevt_SMHiggsToZZTo4L; }, {})
                                                    ^
input_line_69:4:76: error: use of undeclared identifier 'nevt_SMHiggsToZZTo4L'
      .Define("weight", [&]() { return luminosity * xsec_SMHiggsToZZTo4L / nevt_SMHiggsToZZTo4L; }, {})
                                                                           ^
input_line_69:5:37: error: use of undeclared identifier 'nbins'
      .Histo1D({"h_sig_2el2mu", "", nbins, 70, 180}, "H_mass", "weight");
                                    ^
input_line_69:9:27: error: use of undeclared identifier 'reco_higgs_to_2el2mu'
auto df_bkg_2el2mu_reco = reco_higgs_to_2el2mu(df_bkg_2el2mu);
                          ^
input_line_69:11:40: error: use of undeclared identifier 'luminosity'
      .Define("weight", [&]() { return luminosity * xsec_ZZTo2el2mu * scale_ZZTo4l / nevt_ZZTo2el2mu; }, {})
                                       ^
input_line_69:11:71: error: use of undeclared identifier 'scale_ZZTo4l'
      .Define("weight", [&]() { return luminosity * xsec_ZZTo2el2mu * scale_ZZTo4l / nevt_ZZTo2el2mu; }, {})
                                                                      ^
input_line_69:12:37: error: use of undeclared identifier 'nbins'
      .Histo1D({"h_bkg_2el2mu", "", nbins, 70, 180}, "H_mass", "weight");
                                    ^
input_line_69:14:28: error: use of undeclared identifier 'reco_higgs_to_2el2mu'
auto df_data_2el2mu_reco = reco_higgs_to_2el2mu(df_data_doublemu);
                           ^
input_line_69:16:68: error: use of undeclared identifier 'nbins'
                           .Histo1D({"h_data_2el2mu_doublemu", "", nbins, 70, 180}, "H_mass", "weight");
                                                                   ^
input_line_69:2:2: error: Syntax error
 auto df_sig_2el2mu_reco = reco_higgs_to_2el2mu(df_sig_4l);
 ^
FunctionDecl 0x7fc20724c340 <input_line_69:1:1, line:18:1> line:1:6 __cling_Un1Qu332 'void (void *)'
|-ParmVarDecl 0x7fc20724c288 <col:23, col:29> col:29 vpClingValue 'void *'
|-CompoundStmt 0x7fc20724e0f8 <col:43, line:18:1>
| |-DeclStmt 0x7fc20724c680 <line:2:2, col:59>
| | `-VarDecl 0x7fc20724c420 <col:2, col:58> col:7 used df_sig_2el2mu_reco 'auto' cinit
| |   `-CallExpr 0x7fc20724c658 <col:28, col:58> '<dependent type>'
| |     |-DeclRefExpr 0x7fc20724c5f8 <col:28> '<dependent type>' lvalue Var 0x7fc20724c560 'reco_higgs_to_2el2mu' '<dependent type>'
| |     `-DeclRefExpr 0x7fc20724c638 <col:49> 'ROOT::RDataFrame':'ROOT::RDataFrame' lvalue Var 0x6bdf660 'df_sig_4l' 'ROOT::RDataFrame':'ROOT::RDataFrame'
| |-DeclStmt 0x7fc20724cd20 <line:3:1, line:5:73>
| | `-VarDecl 0x7fc20724c6b0 <line:3:1, col:6> col:6 invalid df_h_sig_2el2mu 'auto'
| |-DeclStmt 0x7fc20724ce58 <line:7:1, col:34>
| | `-VarDecl 0x7fc20724cd50 <col:1, col:30> col:12 used xsec_ZZTo2el2mu 'const double':'const double' cinit
| |   `-FloatingLiteral 0x7fc20724cdb8 <col:30> 'double' 1.800000e-01
| |-DeclStmt 0x7fc20724cf88 <line:8:1, col:39>
| | `-VarDecl 0x7fc20724ce88 <col:1, col:30> col:12 used nevt_ZZTo2el2mu 'const double':'const double' cinit
| |   `-FloatingLiteral 0x7fc20724cef0 <col:30> 'double' 1.497445e+06
| |-DeclStmt 0x7fc20724d080 <line:9:1, col:62>
| | `-VarDecl 0x7fc20724cfb8 <col:1, col:6> col:6 invalid df_bkg_2el2mu_reco 'auto'
| |-DeclStmt 0x7fc20724d7e0 <line:10:1, line:12:73>
| | `-VarDecl 0x7fc20724d0b0 <line:10:1, col:6> col:6 invalid df_h_bkg_2el2mu 'auto'
| |-DeclStmt 0x7fc20724d8d8 <line:14:1, col:66>
| | `-VarDecl 0x7fc20724d810 <col:1, col:6> col:6 invalid df_data_2el2mu_reco 'auto'
| |-DeclStmt 0x7fc20724e0d8 <line:15:1, line:16:104>
| | `-VarDecl 0x7fc20724d908 <line:15:1, col:6> col:6 invalid df_h_data_2el2mu 'auto'
| `-NullStmt 0x7fc20724e0f0 <line:17:1>
|-AnnotateAttr 0x7fc20724c4f8 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
`-AnnotateAttr 0x7fc20724c5c8 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
<<<NULL>>>

Rungraphs allows to run the event loops of the separate rdataframe graphs concurrently. This results in an improved usage of the available resources if each separate RDataFrame can not utilize all available resources, e.g., because not enough data is available.

In [25]:
ROOT::RDF::RunGraphs({df_h_sig_4mu, df_h_bkg_4mu, df_h_data_4mu,
                      df_h_sig_4el, df_h_bkg_4el, df_h_data_4el,
                      df_h_sig_2el2mu, df_h_bkg_2el2mu, df_h_data_2el2mu});
input_line_70:2:2: error: cannot initialize an array element of type 'void *' with an rvalue of type 'void (*)(std::vector<RResultHandle>)'
 ROOT::RDF::RunGraphs({df_h_sig_4mu, df_h_bkg_4mu, df_h_data_4mu,
 ^~~~~~~~~~~~~~~~~~~~

Make plots

In [26]:
plot(df_h_sig_4mu, df_h_bkg_4mu, df_h_data_4mu, "m_{4#mu} (GeV)", "higgs_4mu.pdf");
plot(df_h_sig_4el, df_h_bkg_4el, df_h_data_4el, "m_{4e} (GeV)", "higgs_4el.pdf");
plot(df_h_sig_2el2mu, df_h_bkg_2el2mu, df_h_data_2el2mu, "m_{2e2#mu} (GeV)", "higgs_2el2mu.pdf");
IncrementalExecutor::executeFunction: symbol '_ZN5cling7runtime8internal9EvaluateTIvEET_PNS1_15DynamicExprInfoEPN5clang11DeclContextE' unresolved while linking [cling interface function]!
You are probably missing the definition of void cling::runtime::internal::EvaluateT<void>(cling::runtime::internal::DynamicExprInfo*, clang::DeclContext*)
Maybe you need to load the corresponding shared library?

Combine channels for final plot

In [27]:
auto h_data_4l = df_h_data_4mu.GetPtr();
h_data_4l->Add(df_h_data_4el.GetPtr());
h_data_4l->Add(df_h_data_2el2mu.GetPtr());
auto h_sig_4l = df_h_sig_4mu.GetPtr();
h_sig_4l->Add(df_h_sig_4el.GetPtr());
h_sig_4l->Add(df_h_sig_2el2mu.GetPtr());
auto h_bkg_4l = df_h_bkg_4mu.GetPtr();
h_bkg_4l->Add(df_h_bkg_4el.GetPtr());
h_bkg_4l->Add(df_h_bkg_2el2mu.GetPtr());
plot(h_sig_4l, h_bkg_4l, h_data_4l, "m_{4l} (GeV)", "higgs_4l.pdf");
input_line_72:2:2: error: Syntax error
 auto h_data_4l = df_h_data_4mu.GetPtr();
 ^
FunctionDecl 0x7fc207253380 <input_line_72:1:1, line:13:1> line:1:6 __cling_Un1Qu335 'void (void *)'
|-ParmVarDecl 0x7fc2072532c8 <col:23, col:29> col:29 vpClingValue 'void *'
|-CompoundStmt 0x7fc207254768 <col:43, line:13:1>
| |-DeclStmt 0x7fc207253640 <line:2:2, col:41>
| | `-VarDecl 0x7fc207253460 <col:2, col:40> col:7 used h_data_4l 'auto' cinit
| |   `-CallExpr 0x7fc207253620 <col:19, col:40> '<dependent type>'
| |     `-CXXDependentScopeMemberExpr 0x7fc2072535d8 <col:19, col:33> '<dependent type>' lvalue .GetPtr
| |       `-DeclRefExpr 0x7fc207253598 <col:19> '<dependent type>' lvalue Var 0x7fc2072534d0 'df_h_data_4mu' '<dependent type>'
| |-CallExpr 0x7fc207253828 <line:3:1, col:38> '<dependent type>'
| | |-CXXDependentScopeMemberExpr 0x7fc207253698 <col:1, col:12> '<dependent type>' lvalue ->Add
| | | `-DeclRefExpr 0x7fc207253658 <col:1> 'auto' lvalue Var 0x7fc207253460 'h_data_4l' 'auto'
| | `-CallExpr 0x7fc207253808 <col:16, col:37> '<dependent type>'
| |   `-CXXDependentScopeMemberExpr 0x7fc2072537c0 <col:16, col:30> '<dependent type>' lvalue .GetPtr
| |     `-DeclRefExpr 0x7fc207253780 <col:16> '<dependent type>' lvalue Var 0x7fc2072536e8 'df_h_data_4el' '<dependent type>'
| |-CallExpr 0x7fc207253a00 <line:4:1, col:41> '<dependent type>'
| | |-CXXDependentScopeMemberExpr 0x7fc207253870 <col:1, col:12> '<dependent type>' lvalue ->Add
| | | `-DeclRefExpr 0x7fc207253850 <col:1> 'auto' lvalue Var 0x7fc207253460 'h_data_4l' 'auto'
| | `-CallExpr 0x7fc2072539e0 <col:16, col:40> '<dependent type>'
| |   `-CXXDependentScopeMemberExpr 0x7fc207253998 <col:16, col:33> '<dependent type>' lvalue .GetPtr
| |     `-DeclRefExpr 0x7fc207253958 <col:16> '<dependent type>' lvalue Var 0x7fc2072538c0 'df_h_data_2el2mu' '<dependent type>'
| |-DeclStmt 0x7fc207253bf0 <line:5:1, col:38>
| | `-VarDecl 0x7fc207253a40 <col:1, col:37> col:6 used h_sig_4l 'auto' cinit
| |   `-CallExpr 0x7fc207253bd0 <col:17, col:37> '<dependent type>'
| |     `-CXXDependentScopeMemberExpr 0x7fc207253b88 <col:17, col:30> '<dependent type>' lvalue .GetPtr
| |       `-DeclRefExpr 0x7fc207253b48 <col:17> '<dependent type>' lvalue Var 0x7fc207253ab0 'df_h_sig_4mu' '<dependent type>'
| |-CallExpr 0x7fc207253dd8 <line:6:1, col:36> '<dependent type>'
| | |-CXXDependentScopeMemberExpr 0x7fc207253c48 <col:1, col:11> '<dependent type>' lvalue ->Add
| | | `-DeclRefExpr 0x7fc207253c08 <col:1> 'auto' lvalue Var 0x7fc207253a40 'h_sig_4l' 'auto'
| | `-CallExpr 0x7fc207253db8 <col:15, col:35> '<dependent type>'
| |   `-CXXDependentScopeMemberExpr 0x7fc207253d70 <col:15, col:28> '<dependent type>' lvalue .GetPtr
| |     `-DeclRefExpr 0x7fc207253d30 <col:15> '<dependent type>' lvalue Var 0x7fc207253c98 'df_h_sig_4el' '<dependent type>'
| |-CallExpr 0x7fc207253fb0 <line:7:1, col:39> '<dependent type>'
| | |-CXXDependentScopeMemberExpr 0x7fc207253e20 <col:1, col:11> '<dependent type>' lvalue ->Add
| | | `-DeclRefExpr 0x7fc207253e00 <col:1> 'auto' lvalue Var 0x7fc207253a40 'h_sig_4l' 'auto'
| | `-CallExpr 0x7fc207253f90 <col:15, col:38> '<dependent type>'
| |   `-CXXDependentScopeMemberExpr 0x7fc207253f48 <col:15, col:31> '<dependent type>' lvalue .GetPtr
| |     `-DeclRefExpr 0x7fc207253f08 <col:15> '<dependent type>' lvalue Var 0x7fc207253e70 'df_h_sig_2el2mu' '<dependent type>'
| |-DeclStmt 0x7fc2072541a0 <line:8:1, col:38>
| | `-VarDecl 0x7fc207253ff0 <col:1, col:37> col:6 used h_bkg_4l 'auto' cinit
| |   `-CallExpr 0x7fc207254180 <col:17, col:37> '<dependent type>'
| |     `-CXXDependentScopeMemberExpr 0x7fc207254138 <col:17, col:30> '<dependent type>' lvalue .GetPtr
| |       `-DeclRefExpr 0x7fc2072540f8 <col:17> '<dependent type>' lvalue Var 0x7fc207254060 'df_h_bkg_4mu' '<dependent type>'
| |-CallExpr 0x7fc207254388 <line:9:1, col:36> '<dependent type>'
| | |-CXXDependentScopeMemberExpr 0x7fc2072541f8 <col:1, col:11> '<dependent type>' lvalue ->Add
| | | `-DeclRefExpr 0x7fc2072541b8 <col:1> 'auto' lvalue Var 0x7fc207253ff0 'h_bkg_4l' 'auto'
| | `-CallExpr 0x7fc207254368 <col:15, col:35> '<dependent type>'
| |   `-CXXDependentScopeMemberExpr 0x7fc207254320 <col:15, col:28> '<dependent type>' lvalue .GetPtr
| |     `-DeclRefExpr 0x7fc2072542e0 <col:15> '<dependent type>' lvalue Var 0x7fc207254248 'df_h_bkg_4el' '<dependent type>'
| |-CallExpr 0x7fc207254560 <line:10:1, col:39> '<dependent type>'
| | |-CXXDependentScopeMemberExpr 0x7fc2072543d0 <col:1, col:11> '<dependent type>' lvalue ->Add
| | | `-DeclRefExpr 0x7fc2072543b0 <col:1> 'auto' lvalue Var 0x7fc207253ff0 'h_bkg_4l' 'auto'
| | `-CallExpr 0x7fc207254540 <col:15, col:38> '<dependent type>'
| |   `-CXXDependentScopeMemberExpr 0x7fc2072544f8 <col:15, col:31> '<dependent type>' lvalue .GetPtr
| |     `-DeclRefExpr 0x7fc2072544b8 <col:15> '<dependent type>' lvalue Var 0x7fc207254420 'df_h_bkg_2el2mu' '<dependent type>'
| |-CallExpr 0x7fc207254718 <line:11:1, col:67> '<dependent type>'
| | |-DeclRefExpr 0x7fc207254628 <col:1> '<dependent type>' lvalue Var 0x7fc207254590 'plot' '<dependent type>'
| | |-DeclRefExpr 0x7fc207254668 <col:6> 'auto' lvalue Var 0x7fc207253a40 'h_sig_4l' 'auto'
| | |-DeclRefExpr 0x7fc207254688 <col:16> 'auto' lvalue Var 0x7fc207253ff0 'h_bkg_4l' 'auto'
| | |-DeclRefExpr 0x7fc2072546a8 <col:26> 'auto' lvalue Var 0x7fc207253460 'h_data_4l' 'auto'
| | |-StringLiteral 0x7fc2072546c8 <col:37> 'const char [13]' lvalue "m_{4l} (GeV)"
| | `-StringLiteral 0x7fc2072546f0 <col:53> 'const char [13]' lvalue "higgs_4l.pdf"
| `-NullStmt 0x7fc207254760 <line:12:1>
|-AnnotateAttr 0x7fc207253538 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
|-AnnotateAttr 0x7fc207253750 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
|-AnnotateAttr 0x7fc207253928 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
|-AnnotateAttr 0x7fc207253b18 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
|-AnnotateAttr 0x7fc207253d00 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
|-AnnotateAttr 0x7fc207253ed8 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
|-AnnotateAttr 0x7fc2072540c8 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
|-AnnotateAttr 0x7fc2072542b0 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
|-AnnotateAttr 0x7fc207254488 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
`-AnnotateAttr 0x7fc2072545f8 <<invalid sloc>> R"ATTRDUMP(__ResolveAtRuntime)ATTRDUMP"
<<<NULL>>>

Draw all canvases

In [28]:
gROOT->GetListOfCanvases()->Draw()