{ "cells": [ { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The autoreload extension is already loaded. To reload it, use:\n", " %reload_ext autoreload\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Info in : creating shared library /home/caleb/Sources/TTTT/MiniTree_cpp.so\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" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Finished filling histograms for file TTTT_ext_treeProducerSusyMultilepton_tree.root with 11983 events.\n", "Finished filling histograms for file TTZToLLNuNu_treeProducerSusyMultilepton_tree.root with 114004 events.\n", "Finished filling histograms for file TTWToLNu_treeProducerSusyMultilepton_tree.root with 69659 events.\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": 6, "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": 7, "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(5,5))\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": [ "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": 9, "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, draw_option=\"nostackb\")\n", "can.BuildLegend(0.75, 0.75, 0.95, 0.95, \"\")\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": [ "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": 11, "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": 12, "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()" ] }, { "cell_type": "code", "execution_count": 13, "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],\n", " *zip(('trilepton_iso_1', 'Lepton Isolation - First'),\n", " ('trilepton_iso_2', 'Lepton Isolation - Second'),\n", " ('trilepton_iso_3', 'Lepton Isolation - Third')\n", " ),\n", " normalize_to=1,\n", " enable_fill=True,\n", " draw_option=\"nostackb\")\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": [ "utils.stack_hist_array(can, [hists_TTZ, hists_TTW, hists_TTTT],\n", " *zip(('trilepton_jet_iso_1', 'Trilepton Jet Isolation - First'),\n", " ('trilepton_jet_iso_2', 'Trilepton Jet Isolation - Second'),\n", " ('trilepton_jet_iso_3', 'Trilepton Jet Isolation - Third')\n", " ),\n", " normalize_to=1,\n", " enable_fill=True,\n", " draw_option=\"nostackb\")\n", "can.Draw()" ] }, { "cell_type": "code", "execution_count": 15, "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(('dijet_mass', 'Dijet Mass'),\n", " ),\n", " normalize_to=1,\n", " enable_fill=True,\n", " draw_option=\"nostackb\")\n", "can.Draw()" ] }, { "cell_type": "code", "execution_count": 18, "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(\n", " ('lepton_count', 'Lepton Count'),\n", " ('lepton_count_pass_miniiso_event', 'Lepton Count where event passes miniiso'),\n", " ('lepton_count_pass_miniiso_ratio', 'Lepton Count ratio of passing events'),\n", " ),\n", " normalize_to=0,\n", " enable_fill=True,\n", " draw_option=\"nostackb\")\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 }