{ "cells": [ { "cell_type": "markdown", "id": "4b6735d3", "metadata": {}, "source": [ "# hsumanim\n", "This script is a slightly modified version of hsum.C.\n", "\n", "Uncomment the two `c1->Print(...);` lines in order to produce\n", "an animated gif file. The option \"++\" makes an infinite animation.\n", "The animated file `hsumanim.gif` can be visualized within a web browser\n", "\n", "\n", "\n", "\n", "**Author:** Rene Brun, Valeriy Onuchin \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:38 PM." ] }, { "cell_type": "code", "execution_count": 1, "id": "ed6418d1", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:38:38.108783Z", "iopub.status.busy": "2026-05-19T20:38:38.108660Z", "iopub.status.idle": "2026-05-19T20:38:38.452057Z", "shell.execute_reply": "2026-05-19T20:38:38.451303Z" } }, "outputs": [], "source": [ "auto c1 = new TCanvas(\"c1\", \"The HSUM example\", 200, 10, 600, 400);\n", "c1->SetGrid();\n", "\n", "gBenchmark->Start(\"hsum\");" ] }, { "cell_type": "markdown", "id": "d1649af3", "metadata": {}, "source": [ "Create some histograms." ] }, { "cell_type": "code", "execution_count": 2, "id": "0e6e1df4", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:38:38.453990Z", "iopub.status.busy": "2026-05-19T20:38:38.453868Z", "iopub.status.idle": "2026-05-19T20:38:38.661765Z", "shell.execute_reply": "2026-05-19T20:38:38.661175Z" } }, "outputs": [], "source": [ "auto total = new TH1F(\"total\", \"This is the total distribution\", 100, -4, 4);\n", "auto main = new TH1F(\"main\", \"Main contributor\", 100, -4, 4);\n", "auto s1 = new TH1F(\"s1\", \"This is the first signal\", 100, -4, 4);\n", "auto s2 = new TH1F(\"s2\", \"This is the second signal\", 100, -4, 4);\n", "total->Sumw2(); // this makes sure that the sum of squares of weights will be stored\n", "total->SetMarkerStyle(21);\n", "total->SetMarkerSize(0.7);\n", "main->SetFillColor(16);\n", "s1->SetFillColor(42);\n", "s2->SetFillColor(46);\n", "TSlider *slider = 0;\n", "gSystem->Unlink(\"hsumanim.gif\"); // delete old file" ] }, { "cell_type": "markdown", "id": "eaac65ae", "metadata": {}, "source": [ "Fill histograms randomly" ] }, { "cell_type": "code", "execution_count": 3, "id": "d252dc1e", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:38:38.663801Z", "iopub.status.busy": "2026-05-19T20:38:38.663668Z", "iopub.status.idle": "2026-05-19T20:38:38.875917Z", "shell.execute_reply": "2026-05-19T20:38:38.875388Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "