#include "TFile.h"
#include "TTree.h"

#include "MyLeaf.h"

int main(int, char**)
{
   auto* outFile = new TFile("branchTest.root", "recreate");
   auto* tree = new TTree("branchTest", "Branch Test");

   auto* leaf = new MyLeaf;
   tree->Branch("leaf", "MyLeaf", &leaf);

   for(size_t i = 0; i < 10; ++i) {
      leaf->Fill(i);
      tree->Fill();
   }

   tree->Write();
   outFile->Close();

   delete leaf;
   //delete tree;
   delete outFile;

   return 0;
}
