/// \file /// \ingroup tutorial_dataframe /// \notebook -draw /// This tutorial shows how to write out datasets in ROOT formatusing the RDataFrame /// \macro_code /// /// \date April 2017 /// \author Danilo Piparo // A simple helper function to fill a test tree: this makes the example // stand-alone. void fill_tree(const char *treeName, const char *fileName) { ROOT::RDataFrame d(10000); int i(0); d.Define("b1", [&i]() { return i; }) .Define("b2", [&i]() { float j = i * i; ++i; return j; }) .Snapshot(treeName, fileName); } int doit() { // We prepare an input tree to run on auto fileName = "df007_snapshot.root"; auto outFileName = "df007_snapshot_output.root"; auto outFileNameAllColumns = "df007_snapshot_output_allColumns.root"; auto treeName = "myTree"; fill_tree(treeName, fileName); return 0; } int df007_snapshot() { while (1) doit(); }