I have recently started using root and I cant figure out how to use TChain command. I have a bunch of “L1 Ntuple_.root" that are consisted of many trees ("” stands for the number on the file and goes like 1,2,3,4…) and I am trying to use TChain to combine the entries from these trees into one tree, I proceed as following:
TChain* chain = new TChain (“L1EventTree”)
/* where L1EventTree is one of the trees inside the file*/
chain->Add(“path/to/file/L1Ntuple_1.root/l1EventTree/L1EventTree”)
chain->Add(“path/to/file/L1Ntuple_2.root/l1EventTree/L1EventTree”)
chain->Add(“path/to/file/L1Ntuple_3.root/l1EventTree/L1EventTree”)
.
.
.
.
.
TFile* f = new TFile(“output”,“create”);
f->Write();
f->Close();
but when I use TBrowser it shows an empty output file. I am not sure what I am missing here. Any help is appreciated.