20 TFile oldfile(
"tree108.root");
22 oldfile.GetObject(
"t4", oldtree);
25 for (
auto activeBranchName : {
"event_split",
"fNtrack",
"fNseg",
"fH"}) {
30 TFile newfile(
"tree111.root",
"recreate");
35 newtree->CopyEntries(oldtree);
46 gROOT->ProcessLine(
".L " + tutdir +
"/io/tree/Event.cxx+");
47 gROOT->ProcessLine(
"#define ACTUAL_RUN yes");
48 gROOT->ProcessLine(
"#include \"" __FILE__
"\"");
49 gROOT->ProcessLine(
"run()");
virtual void SetFile(TFile *file=nullptr)
Set file where this branch writes/reads its buffers.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
A TTree represents a columnar dataset.
virtual void SetBranchStatus(const char *bname, bool status=true, UInt_t *found=nullptr)
Set branch status to Process or DoNotProcess.
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
virtual TTree * CloneTree(Long64_t nentries=-1, Option_t *option="")
Create a clone of this tree and copy nentries.