21void df028_SQliteIPLocation() {
25 auto f =
TFile::Open(
"http://root.cern.ch/files/WM.root");
26 auto worldMap =
f->Get<
TH2Poly>(
"WMUSA");
28 auto fillIPLocation = [&worldMap] (
const std::string &sLongitude,
const std::string &sLatitude ) {
29 if (!( sLongitude ==
"" ) && !( sLatitude ==
"" )) {
30 auto latitude = std::stof(sLatitude);
31 auto longitude = std::stof(sLongitude);
32 worldMap->Fill(longitude, latitude);
36 rdf.Foreach( fillIPLocation, {
"IPLongitude",
"IPLatitude" } );
38 auto worldMapCanvas =
new TCanvas();
39 worldMapCanvas->SetLogz();
40 worldMap->SetTitle(
"ROOT Downloads per Location (GitHub exluded);Longitude;Latitude");
41 worldMap->DrawClone(
"colz");
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
2D Histogram with Polygonal Bins
RDataFrame MakeSqliteDataFrame(std::string_view fileName, std::string_view query)
Factory method to create a SQlite RDataFrame.