#include void maketrees() { gROOT->LoadMacro("totree.C"); totree(25,0); for (int i=1; i<9; ++i) { totree(26,i); } for (int i=0; i<9; ++i) { totree(27,i); } for (int i=0; i<5; ++i) { totree(28,i); } } void extendtrees() { TFile file("trees.root","update"); gROOT->LoadMacro("wedges.C"); std::stringstream names; for (int i=1; i<9; ++i) { names.str(""); names << "run26_" << i; TTree *tree = (TTree*)gROOT->FindObject(names.str().c_str()); wedges we(tree); we.Loop(); names << "e"; tree = (TTree*)gROOT->FindObject(names.str().c_str()); tree->Write(); } for (int i=0; i<9; ++i) { names.str(""); names << "run27_" << i; TTree *tree = (TTree*)gROOT->FindObject(names.str().c_str()); wedges we(tree); we.Loop(); names << "e"; tree = (TTree*)gROOT->FindObject(names.str().c_str()); tree->Write(); } for (int i=0; i<5; ++i) { names.str(""); std::stringstream names; names << "run28_" << i; TTree *tree = (TTree*)gROOT->FindObject(names.str().c_str()); wedges we(tree); we.Loop(); names << "e"; tree = (TTree*)gROOT->FindObject(names.str().c_str()); tree->Write(); } file.Close(); }