{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "data": { "application/javascript": [ "\n", "require(['notebook'],\n", " function() {\n", " IPython.CodeCell.config_defaults.highlight_modes['magic_text/x-c++src'] = {'reg':[/^%%cpp/]};\n", " console.log(\"JupyROOT - %%cpp magic configured\");\n", " }\n", ");\n" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Welcome to JupyROOT 6.08/02\n" ] } ], "source": [ "import ROOT\n", "from ROOT import gSystem\n", "gSystem.CompileMacro(\"MiniTree.cpp\")\n", "\n", "%load_ext autoreload\n", "%autoreload 2\n", "# from canvas_wrapper import canvas\n", "import utils\n", "import plotter" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Finished filling histograms for file TTTT_ext_treeProducerSusyMultilepton_tree.root\n", "Finished filling histograms for file TTZToLLNuNu_treeProducerSusyMultilepton_tree.root\n", "Finished filling histograms for file TTWToLNu_treeProducerSusyMultilepton_tree.root\n" ] } ], "source": [ "hists_TTTT = ROOT.build_histograms(\"TTTT\", \"TTTT_ext_treeProducerSusyMultilepton_tree.root\")\n", "hists_TTZ = ROOT.build_histograms(\"TTZ\", \"TTZToLLNuNu_treeProducerSusyMultilepton_tree.root\")\n", "hists_TTW = ROOT.build_histograms(\"TTW\", \"TTWToLNu_treeProducerSusyMultilepton_tree.root\")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# can = canvas(size=(1600, 1200))\n", "%jsroot on\n", "can = ROOT.TCanvas(\"c1\", \"\", 1600, 1200)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "shape = ROOT.pair(\"int\", \"int\")\n", "hists_TTTT.draw(can, shape(4,4))\n", "can.Draw()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "can.Clear()\n", "ROOT.gStyle.SetOptStat(1111111)\n", "hists_TTTT.b_jet_discriminator.SetStats(1)\n", "hists_TTTT.b_jet_discriminator.Draw()\n", "hists_TTTT.b_jet_discriminator.GetBinContent(21)\n", "can.Draw()" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "can.Clear()\n", "hists, labels = zip(*[(h.b_jet_count, h.get_sample_name()) for h in [hists_TTTT, hists_TTZ, hists_TTW]])\n", "utils.stack_hist(hists, labels, id_=\"b_jet_count_stack\", enable_fill=True, normalize_to=1, draw=True)\n", "can.BuildLegend(0.75, 0.75, 0.95, 0.95, \"\")\n", "can.Draw()" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "can.Clear()\n", "hists, labels = zip(*[(h.lepton_count, h.get_sample_name()) for h in [hists_TTTT, hists_TTZ, hists_TTW]])\n", "utils.stack_hist(hists, labels, id_=\"lepton_count_stack\", enable_fill=True, normalize_to=1, draw=True)\n", "can.BuildLegend(0.75, 0.75, 0.95, 0.95, \"\")\n", "can.Draw()" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "utils.stack_hist_array(can, [hists_TTZ, hists_TTW, hists_TTTT],\n", " *zip(('jet_count_os_dilepton','Jet Multiplicity for Opposite-Sign Dilepton Events'),\n", " ('jet_count_ss_dilepton','Jet Multiplicity for Same-Sign Dilepton Events'),\n", " ('jet_count_trilepton', 'Jet Multiplicity for Trilepton Events')\n", " ),\n", " normalize_to=1,\n", " enable_fill=True)\n", "can.Draw()" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "
\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "utils.stack_hist_array(can, [hists_TTZ, hists_TTW, hists_TTTT], ['lepton_count', 'lepton_count_pass_miniiso'],\n", " ['Count of leptons passing pre-selection',\n", " 'Count of leptons passing mini-iso Requirement'],\n", " shape = (1,2),\n", " enable_fill=True)\n", "can.Draw()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.0" } }, "nbformat": 4, "nbformat_minor": 2 }