{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Z peak example" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We will plot a invariant mass distribution from a LHE input file.\n", "\n", "First, some basic imports." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [], "source": [ "import hist\n", "\n", "import pylhe" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [], "source": [ "# Use an example LHE file from package scikit-hep-testdata\n", "from skhep_testdata import data_path\n", "\n", "lhe_file = data_path(\"pylhe-drell-yan-ll-lhe.gz\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Prepare a histogram to calculate the invariant mass of two particles." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [], "source": [ "mass_hist = hist.Hist.new.Reg(30, 50, 150).Int64()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Use the generator provided by pylhe to read the events." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "data": { "text/html": [ "\n", "