Created
September 3, 2019 08:11
-
-
Save marty1885/4a68a9edccbf78684133b8ad44bd35ac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void missing_creator() | |
{ | |
// Now we can use the new and improved RDataFrame interface | |
auto rdf = ROOT::RDataFrame("library", "library.root"); | |
auto rdf_missing = rdf.Filter("creator != \"\" && publication_year != 0x7fffffff"); | |
std::map<std::string, int> books; | |
rdf_missing.Foreach([&](std::string title, int year) {books[title] = year;}, {"title", "publication_year"}); | |
auto h1 = new TH1F("h1", "books with missing creator", 100, 1850, 2019); | |
for(auto [title, year] : books) | |
h1->Fill(year); | |
h1->Draw(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment