Compare creation of a ROOT dataset with RDataFrame and TTree. 
This tutorial illustrates how much simpler it can be to use a RDataFrame to create a dataset with respect to the usage of the TTree interfaces.
 
{
   TFile f(
"df009_FromScratchVSTTree_classic.root", 
"RECREATE");
 
   TTree t(
"treeName", 
"treeName");
 
   double b1;
   int b2;
   t.Branch("b1", &b1);
   t.Branch("b2", &b2);
   for (int i = 0; i < 10; ++i) {
      b1 = i;
      b2 = i * i;
      t.Fill();
   }
   t.Write();
}
 
{
   df.Define(
"b1", [&
b]() { 
return b++; })
 
     .Define("b2", "(int) b1 * b1") 
     .Snapshot("treeName", "df009_FromScratchVSTTree_df.root");
}
 
{
 
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
 
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
 
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
 
A TTree represents a columnar dataset.
 
- Date
 - August 2017 
 
- Author
 - Danilo Piparo (CERN) 
 
Definition in file df009_FromScratchVSTTree.C.