{
"cells": [
{
"cell_type": "markdown",
"id": "18322621",
"metadata": {},
"source": [
"# df103_NanoAODHiggsAnalysis\n",
"An example of complex analysis with RDataFrame: reconstructing the Higgs boson.\n",
"\n",
"This tutorial is a simplified but yet complex example of an analysis reconstructing\n",
"the Higgs boson decaying to two Z bosons from events with four leptons. The data\n",
"and simulated events are taken from CERN OpenData representing a subset of the data\n",
"recorded in 2012 with the CMS detector at the LHC. The tutorials follows the Higgs\n",
"to four leptons analysis published on CERN Open Data portal\n",
"([10.7483/OPENDATA.CMS.JKB8.RR42](http://opendata.cern.ch/record/5500)).\n",
"The resulting plots show the invariant mass of the selected four lepton systems\n",
"in different decay modes (four muons, four electrons and two of each kind)\n",
"and in a combined plot indicating the decay of the Higgs boson with a mass\n",
"of about 125 GeV.\n",
"\n",
"The following steps are performed for each sample with data and simulated events\n",
"in order to reconstruct the Higgs boson from the selected muons and electrons:\n",
"1. Select interesting events with multiple cuts on event properties, e.g.,\n",
" number of leptons, kinematics of the leptons and quality of the tracks.\n",
"2. Reconstruct two Z bosons of which only one on the mass shell from the selected events and apply additional cuts\n",
" on the reconstructed objects.\n",
"3. Reconstruct the Higgs boson from the remaining Z boson candidates and calculate\n",
" its invariant mass.\n",
"\n",
"The tutorial has the fast mode enabled by default, which reads the data from already skimmed\n",
"datasets with a total size of only 51MB. If the fast mode is disabled, the tutorial runs over\n",
"the full dataset with a size of 12GB.\n",
"\n",
"\n",
"\n",
"\n",
"**Author:** Stefan Wunsch (KIT, CERN) \n",
"This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Tuesday, March 19, 2024 at 07:07 PM."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "4b167ca0",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2024-03-19T19:07:36.445714Z",
"iopub.status.busy": "2024-03-19T19:07:36.432766Z",
"iopub.status.idle": "2024-03-19T19:07:36.473843Z",
"shell.execute_reply": "2024-03-19T19:07:36.472433Z"
}
},
"outputs": [],
"source": [
"%%cpp -d\n",
"#include \"ROOT/RDataFrame.hxx\"\n",
"#include \"ROOT/RDFHelpers.hxx\"\n",
"#include \"ROOT/RVec.hxx\"\n",
"#include \"ROOT/RDF/RInterface.hxx\"\n",
"#include \"TCanvas.h\"\n",
"#include \"TH1D.h\"\n",
"#include \"TLatex.h\"\n",
"#include \"TLegend.h\"\n",
"#include