{ "cells": [ { "cell_type": "markdown", "id": "cc9c6fb7", "metadata": {}, "source": [ "# pdf000_Laplace\n", "Test the TMath::LaplaceDist and TMath::LaplaceDistI functions\n", "\n", "\n", "\n", "\n", "**Author:** Anna Kreshuk \n", "This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Tuesday, May 19, 2026 at 08:26 PM." ] }, { "cell_type": "code", "execution_count": 1, "id": "868f636e", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:26:25.396299Z", "iopub.status.busy": "2026-05-19T20:26:25.396188Z", "iopub.status.idle": "2026-05-19T20:26:25.862476Z", "shell.execute_reply": "2026-05-19T20:26:25.861847Z" } }, "outputs": [], "source": [ "TCanvas *c1=new TCanvas(\"c1\", \"TMath::LaplaceDist\",600,800);\n", "c1->Divide(1, 2);\n", "TVirtualPad *pad1 = c1->cd(1);\n", "pad1->SetGrid();\n", "TF1 *flaplace = new TF1(\"flaplace\", \"TMath::LaplaceDist(x, [0], [1])\", -10, 10);\n", "flaplace->SetParameters(0, 1);\n", "TF1 *f1 = flaplace->DrawCopy();\n", "f1->SetLineColor(kRed);\n", "f1->SetLineWidth(1);\n", "flaplace->SetParameters(0, 2);\n", "TF1 *f2 = flaplace->DrawCopy(\"same\");\n", "f2->SetLineColor(kGreen);\n", "f2->SetLineWidth(1);\n", "flaplace->SetParameters(2, 1);\n", "TF1 *f3 = flaplace->DrawCopy(\"same\");\n", "f3->SetLineColor(kBlue);\n", "f3->SetLineWidth(1);\n", "flaplace->SetParameters(2, 2);\n", "TF1 *f4 = flaplace->DrawCopy(\"same\");\n", "f4->SetLineColor(kMagenta);\n", "f4->SetLineWidth(1);\n", "TLegend *legend1 = new TLegend(.7,.7,.9,.9);\n", "legend1->AddEntry(f1,\"alpha=0 beta=1\",\"l\");\n", "legend1->AddEntry(f2,\"alpha=0 beta=2\",\"l\");\n", "legend1->AddEntry(f3,\"alpha=2 beta=1\",\"l\");\n", "legend1->AddEntry(f4,\"alpha=2 beta=2\",\"l\");\n", "legend1->Draw();\n", "\n", "TVirtualPad *pad2 = c1->cd(2);\n", "pad2->SetGrid();\n", "TF1 *flaplacei=new TF1(\"flaplacei\", \"TMath::LaplaceDistI(x, [0], [1])\", -10, 10);\n", "flaplacei->SetParameters(0, 1);\n", "TF1 *g1=flaplacei->DrawCopy();\n", "g1->SetLineColor(kRed);\n", "g1->SetLineWidth(1);\n", "flaplacei->SetParameters(0, 2);\n", "TF1 *g2=flaplacei->DrawCopy(\"same\");\n", "g2->SetLineColor(kGreen);\n", "g2->SetLineWidth(1);\n", "flaplacei->SetParameters(2, 1);\n", "TF1 *g3=flaplacei->DrawCopy(\"same\");\n", "g3->SetLineColor(kBlue);\n", "g3->SetLineWidth(1);\n", "flaplacei->SetParameters(2, 2);\n", "TF1 *g4=flaplacei->DrawCopy(\"same\");\n", "g4->SetLineColor(kMagenta);\n", "g4->SetLineWidth(1);\n", "\n", "TLegend *legend2 = new TLegend(.7,.15,0.9,.35);\n", "legend2->AddEntry(f1,\"alpha=0 beta=1\",\"l\");\n", "legend2->AddEntry(f2,\"alpha=0 beta=2\",\"l\");\n", "legend2->AddEntry(f3,\"alpha=2 beta=1\",\"l\");\n", "legend2->AddEntry(f4,\"alpha=2 beta=2\",\"l\");\n", "legend2->Draw();\n", "c1->cd();" ] }, { "cell_type": "markdown", "id": "bec2026b", "metadata": {}, "source": [ "Draw all canvases " ] }, { "cell_type": "code", "execution_count": 2, "id": "880636fe", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:26:25.864190Z", "iopub.status.busy": "2026-05-19T20:26:25.864067Z", "iopub.status.idle": "2026-05-19T20:26:26.179151Z", "shell.execute_reply": "2026-05-19T20:26:26.178546Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "
\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "gROOT->GetListOfCanvases()->Draw()" ] } ], "metadata": { "kernelspec": { "display_name": "ROOT C++", "language": "c++", "name": "root" }, "language_info": { "codemirror_mode": "text/x-c++src", "file_extension": ".C", "mimetype": " text/x-c++src", "name": "c++" } }, "nbformat": 4, "nbformat_minor": 5 }