Logo ROOT  
Reference Guide
df030_SQliteVersionsOfROOT.C File Reference

Detailed Description

Read an sqlite3 databases with RDataFrame and plot statistics on ROOT downloads.

View in nbviewer Open in SWAN

Plot the downloads of different ROOT versions reading a remote sqlite3 file with RSqliteDS. Then a TH1F histogram is created and filled using a lambda expression which receives the recorded values in the "version" column of the sqlite3 database. The histogram shows the usage of the ROOT development version.

void df030_SQliteVersionsOfROOT() {
auto rdf = ROOT::RDF::MakeSqliteDataFrame("http://root.cern/files/root_download_stats.sqlite", "SELECT Version FROM accesslog;");
TH1F hVersionOfRoot("hVersionOfRoot", "Development Versions of ROOT", 8, 0, -1);
auto fillVersionHisto = [&hVersionOfRoot] (const std::string &version) {
TString copyVersion = version;
TString shortVersion(copyVersion(0,4));
hVersionOfRoot.Fill(shortVersion, 1);
};
rdf.Foreach( fillVersionHisto, { "Version" } );
auto VersionOfRootHistogram = new TCanvas();
hVersionOfRoot.GetXaxis()->LabelsOption("a");
hVersionOfRoot.LabelsDeflate("X");
hVersionOfRoot.DrawClone("");
}
Date
August 2018
Author
Alexandra-Maria Dobrescu

Definition in file df030_SQliteVersionsOfROOT.C.

ROOT::RDF::MakeSqliteDataFrame
RDataFrame MakeSqliteDataFrame(std::string_view fileName, std::string_view query)
Factory method to create a SQlite RDataFrame.
Definition: RSqliteDS.cxx:545
TString
Definition: TString.h:136
gStyle
R__EXTERN TStyle * gStyle
Definition: TStyle.h:412
TStyle::SetOptStat
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
Definition: TStyle.cxx:1592
TCanvas
Definition: TCanvas.h:23
TH1F
1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:572