Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
df029_SQlitePlatformDistribution.C File Reference

Detailed Description

View in nbviewer Open in SWAN
Use RDataFrame to display data about ROOT downloads.

In order to display the Platform Distribution of ROOT, we choose to create two TH1F histograms: one that includes all types of platforms, other filtering and classifying them. This procedure is using a lambda expression taking as parameter the values stored in the "Platform" column from the database. At the end, the histograms are filled with their specific demand regarding the platform's type.

auto rdf = ROOT::RDF::FromSqlite("http://root.cern/files/root_download_stats.sqlite", "SELECT * FROM accesslog;");
TH1F hRootPlatform("hrootPlatform", "Platform Distribution", 7, 0, -1);
TH1F hShortRootPlatform("hShortRootPlatform", "Short Platform Distribution", 7, 0, -1);
auto fillRootPlatform = [&hRootPlatform, &hShortRootPlatform] ( const std::string &platform ) {
if ( Platform.Contains("win32") ){
} else if ( Platform.Contains("Linux") ){
} else if ( Platform.Contains("source") ){
} else if ( Platform.Contains("macosx64") ){
} else if ( Platform.Contains("IRIX64") ){
}
};
rdf.Foreach( fillRootPlatform, { "Platform" } );
auto c1 = new TCanvas();
c1->SetLogy(1);
hRootPlatform.GetXaxis()->LabelsOption("a");
hRootPlatform.LabelsDeflate("X");
hRootPlatform.DrawClone();
auto c2 = new TCanvas();
hShortRootPlatform.GetXaxis()->LabelsOption("a");
hShortRootPlatform.LabelsDeflate("X");
hShortRootPlatform.DrawClone();
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
The Canvas class.
Definition TCanvas.h:23
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:622
Basic string class.
Definition TString.h:139
return c1
Definition legend1.C:41
return c2
Definition legend2.C:14
RDataFrame FromSqlite(std::string_view fileName, std::string_view query)
Factory method to create a SQlite RDataFrame.
Date
August 2018
Author
Alexandra-Maria Dobrescu

Definition in file df029_SQlitePlatformDistribution.C.