{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "f4aa15bf-44c4-4b7c-a021-2ed05502e1b4", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Welcome to JupyROOT 6.24/06\n" ] } ], "source": [ "import ROOT\n", "%jsroot on" ] }, { "cell_type": "code", "execution_count": 2, "id": "7d0a4df2-3d76-438d-8939-09456cc1570f", "metadata": {}, "outputs": [], "source": [ "from array import array" ] }, { "cell_type": "code", "execution_count": 3, "id": "46298ca2-b119-45f1-a1e0-5307137fbd94", "metadata": {}, "outputs": [], "source": [ "import numpy as np" ] }, { "cell_type": "code", "execution_count": 4, "id": "4b41cc47-a08c-4023-8a11-6e90ccf3eac1", "metadata": {}, "outputs": [], "source": [ "import math" ] }, { "cell_type": "code", "execution_count": 5, "id": "0fe73f67-e3d3-49a5-aa9a-2df79722c70b", "metadata": {}, "outputs": [], "source": [ "testFunction = ROOT.TF1('tf','[0]*x*exp([1]*x)',-10,10)\n", "testFunction.SetParameter(0,0.1)\n", "testFunction.SetParameter(1,0.7)" ] }, { "cell_type": "code", "execution_count": 6, "id": "3008818c-1484-4a0e-9515-5428a558c4ee", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "
\n", "
\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "mycanvas = ROOT.TCanvas()\n", "testFunction.SetLineColor(4)\n", "testFunction.Draw()\n", "mycanvas.Draw()" ] }, { "cell_type": "code", "execution_count": 7, "id": "f800cc33-1eae-4ce1-877d-18a29dc722d2", "metadata": {}, "outputs": [], "source": [ "#skewedGaus = ROOT.TF1('f','2*gaus(x,[0],[1],[2])*ROOT::Math::normal_cdf([3]*x,1,0)',-3,3);\n", "#skewedGaus.SetParameters(2,0.5,2,4); " ] }, { "cell_type": "code", "execution_count": 8, "id": "9dc7fdd4-d5c5-4da1-9696-cb10d26e2c34", "metadata": {}, "outputs": [], "source": [ "#mycanvas = ROOT.TCanvas()\n", "#skewedGaus.SetLineColor(4)\n", "#skewedGaus.Draw()\n", "#mycanvas.Draw()" ] }, { "cell_type": "code", "execution_count": 9, "id": "dd8dfc3e-5d71-48c2-8abf-102d22d0399a", "metadata": {}, "outputs": [], "source": [ "smallPhi = ROOT.TF1('phi',\"(1/(2)**0.5)*exp(-([0]*x)**2/2)\",-10,10)\n", "smallPhi.SetParameter(0,2)\n", "smallPhi.SetParameter(1,0.7)" ] }, { "cell_type": "code", "execution_count": 10, "id": "63a10b44-2695-4386-af50-722d86267ebc", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "
\n", "
\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "mycanvas1 = ROOT.TCanvas()\n", "smallPhi.SetLineColor(4)\n", "smallPhi.Draw()\n", "mycanvas1.Draw()" ] }, { "cell_type": "code", "execution_count": 11, "id": "3126b225-6d12-49a9-8dad-5c7edd15aced", "metadata": {}, "outputs": [], "source": [ "errorFunction = ROOT.TF1(\"errF\", \"(1/sqrt([0]))*x*erf([0])\", -10,10)\n", "errorFunction.SetParameter(0,3)" ] }, { "cell_type": "code", "execution_count": 12, "id": "26cbc73e-9f32-4d79-a5e5-3093f57d3b85", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "
\n", "
\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "mycanvas2 = ROOT.TCanvas()\n", "errorFunction.SetLineColor(4)\n", "errorFunction.Draw()\n", "mycanvas2.Update()\n", "mycanvas2.Draw()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3.7", "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.7.7" } }, "nbformat": 4, "nbformat_minor": 5 }