{ "cells": [ { "cell_type": "code", "execution_count": 3, "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", "%jsroot on\n", "%load_ext autoreload\n", "%autoreload 2\n", "import utils\n", "import plotter\n", "can = ROOT.TCanvas(\"c1\", \"\", 1600, 1200)" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Writing log data to ../data/TTTT_ext_treeProducerSusyMultilepton_tree_result.log\n", "Writing log data to ../data/TTZToLLNuNu_treeProducerSusyMultilepton_tree_result.log\n", "Writing log data to ../data/TTWToLNu_treeProducerSusyMultilepton_tree_result.log\n" ] } ], "source": [ "rebuild_hists=True\n", "hists_TTTT = utils.HistCollection(\"TTTT\", \"../data/TTTT_ext_treeProducerSusyMultilepton_tree.root\", rebuild_hists=rebuild_hists)\n", "hists_TTZ = utils.HistCollection(\"TTZ\", \"../data/TTZToLLNuNu_treeProducerSusyMultilepton_tree.root\", rebuild_hists=rebuild_hists)\n", "hists_TTW = utils.HistCollection(\"TTW\", \"../data/TTWToLNu_treeProducerSusyMultilepton_tree.root\", rebuild_hists=rebuild_hists)" ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "collapsed": false, "scrolled": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(4, 4)\n", "0 \n", "1 \n", "2 \n", "3 \n", "4 \n", "5 \n", "6 \n", "7 \n", "8 \n", "9 \n", "10 \n", "11 \n", "12 \n", "13 \n" ] }, { "data": { "text/html": [ "\n", "
\n", "
\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "hists_TTTT.draw(can)\n", "can.Draw()" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(4, 4)\n", "0 \n", "1 \n", "2 \n", "3 \n", "4 \n", "5 \n", "6 \n", "7 \n", "8 \n", "9 \n", "10 \n" ] }, { "data": { "text/html": [ "\n", "
\n", "
\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "hists_TTZ.draw(can)\n", "can.Draw()" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false, "scrolled": true }, "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": 13, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(, , ) ('TTTT', 'TTZ', 'TTW')\n" ] }, { "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.sample_name) for h in [hists_TTTT, hists_TTZ, hists_TTW]])\n", "print(hists, labels)\n", "utils.stack_hist(hists, labels, id_=\"b_jet_count_stack\", enable_fill=True, normalize_to=0, draw=True)\n", "can.BuildLegend(0.75, 0.75, 0.95, 0.95, \"\")\n", "can.Draw()" ] }, { "cell_type": "code", "execution_count": 14, "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.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=0, draw=True)\n", "can.BuildLegend(0.75, 0.75, 0.95, 0.95, \"\")\n", "can.Draw()" ] }, { "cell_type": "code", "execution_count": 20, "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=0,\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 }