17 void df029_SQlitePlatformDistribution() {
19 auto rdf = ROOT::RDF::MakeSqliteDataFrame(
"http://root.cern/files/root_download_stats.sqlite",
"SELECT * FROM accesslog;" );
21 TH1F hRootPlatform(
"hrootPlatform",
"Platform Distribution", 7, 0, -1);
22 TH1F hShortRootPlatform(
"hShortRootPlatform",
"Short Platform Distribution", 7, 0, -1);
24 auto fillRootPlatform = [&hRootPlatform, &hShortRootPlatform] (
const std::string &platform ) {
25 TString Platform = platform;
26 TString Platform_0(Platform(0,5));
27 TString Platform_1(Platform(0,6));
28 TString Platform_2(Platform(0,8));
30 if ( Platform.Contains(
"win32") ){
31 hShortRootPlatform.Fill(Platform_0,1);
32 }
else if ( Platform.Contains(
"Linux") ){
33 hShortRootPlatform.Fill(Platform_0,1);
34 }
else if ( Platform.Contains(
"source") ){
35 hShortRootPlatform.Fill(Platform_1,1);
36 }
else if ( Platform.Contains(
"macosx64") ){
37 hShortRootPlatform.Fill(Platform_2,1);
38 }
else if ( Platform.Contains(
"IRIX64") ){
39 hShortRootPlatform.Fill(Platform_1,1);
42 hRootPlatform.Fill(Platform,1);
45 rdf.Foreach( fillRootPlatform, {
"Platform" } );
47 auto PlatformDistributionHistogram =
new TCanvas();
49 hRootPlatform.GetXaxis()->LabelsOption(
"a");
50 hRootPlatform.LabelsDeflate(
"X");
51 hRootPlatform.DrawClone();
53 auto shortPlatformDistributionHistogram =
new TCanvas();
55 hShortRootPlatform.GetXaxis()->LabelsOption(
"a");
56 hShortRootPlatform.LabelsDeflate(
"X");
57 hShortRootPlatform.DrawClone();