{ "cells": [ { "cell_type": "markdown", "id": "b74500d7", "metadata": {}, "source": [ "# df030_SQliteVersionsOfROOT\n", "Read an sqlite3 databases with RDataFrame and plot statistics on ROOT downloads.\n", "\n", "Plot the downloads of different ROOT versions reading a remote sqlite3 file with RSqliteDS.\n", "Then a TH1F histogram is created and filled\n", "using a lambda expression which receives the recorded\n", "values in the \"version\" column of the sqlite3 database.\n", "The histogram shows the usage of the ROOT development version.\n", "\n", "\n", "\n", "\n", "**Author:** Alexandra-Maria Dobrescu \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:10 PM." ] }, { "cell_type": "code", "execution_count": 1, "id": "bdeef8de", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:10:06.474098Z", "iopub.status.busy": "2026-05-19T20:10:06.473919Z", "iopub.status.idle": "2026-05-19T20:10:10.538899Z", "shell.execute_reply": "2026-05-19T20:10:10.531643Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "
\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "auto rdf =\n", " ROOT::RDF::FromSqlite(\"http://root.cern/files/root_download_stats.sqlite\", \"SELECT Version FROM accesslog;\");\n", "\n", "TH1F hVersionOfRoot(\"hVersionOfRoot\", \"Development Versions of ROOT\", 8, 0, -1);\n", "\n", "auto fillVersionHisto = [&hVersionOfRoot] (const std::string &version) {\n", " TString copyVersion = version;\n", " TString shortVersion(copyVersion(0,4));\n", " hVersionOfRoot.Fill(shortVersion, 1);\n", "};\n", "\n", "rdf.Foreach( fillVersionHisto, { \"Version\" } );\n", "\n", "auto VersionOfRootHistogram = new TCanvas();\n", "\n", "gStyle->SetOptStat(0);\n", "hVersionOfRoot.GetXaxis()->LabelsOption(\"a\");\n", "hVersionOfRoot.LabelsDeflate(\"X\");\n", "hVersionOfRoot.DrawClone(\"\");" ] }, { "cell_type": "markdown", "id": "11b8b1c3", "metadata": {}, "source": [ "Draw all canvases " ] }, { "cell_type": "code", "execution_count": 2, "id": "2824cff4", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:10:10.544405Z", "iopub.status.busy": "2026-05-19T20:10:10.544253Z", "iopub.status.idle": "2026-05-19T20:10:10.773980Z", "shell.execute_reply": "2026-05-19T20:10:10.770948Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "
\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "%jsroot on\n", "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 }