{ "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", "%jsroot on" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%%cpp -d\n", "#include \n", "\n", "#define tree_cxx\n", "#include \"tree.h\"\n", "#include \n", "#include \n", "#include \n", "\n", "TH1D *lepton_count = new TH1D(\"lepton_count\", \"Good Lepton Count\", 10, 0, 10);\n", "TH1D *delta_pt = new TH1D(\"delta_pt\", \"{\\\\Delta P_T}\", 100, -50, 50);\n", "\n", "void tree::Loop()\n", "{\n", " if (fChain == 0) return;\n", "\n", " Long64_t nentries = fChain->GetEntriesFast();\n", "\n", " Long64_t nbytes = 0, nb = 0;\n", " for (Long64_t jentry=0; jentryGetEntry(jentry); nbytes += nb;\n", " // if (Cut(ientry) < 0) continue;\n", " lepton_count->Fill(nLepGood);\n", " for(int i=0; iFill(LepGood_pt[i] - LepGood_mcPt[i]);\n", " }\n", " }\n", "}" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [], "source": [ "file = ROOT.TFile(\"TTTT_ext_treeProducerSusyMultilepton_tree.root\")\n", "ttree = file.Get(\"tree;3\")\n", "tree = ROOT.tree(ttree)\n", "tree.Loop()\n", "file.Close()" ] }, { "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" }, { "data": { "text/html": [ "\n", "
\n", "
\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "c1 = ROOT.TCanvas(\"c1\")\n", "# ROOT.lepton_count.Draw(\"A\")\n", "ROOT.delta_pt.Draw(\"\")\n", "c1.Draw()\n", "\n", "c2 = ROOT.TCanvas(\"c2\")\n", "ROOT.lepton_count.Draw(\"\")\n", "c2.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 }