Hi all,
I’m trying to copy a histogram from one file to a new tree in a new file, and can’t seem to get the syntax right. So far I can create the new file & tree without any problems, but I’m not able to copy a histogram to the tree. What I have so far is:
TFile* nfile = new TFile("histos_A.root");
TFile hfile("output_file.root","RECREATE");
TTree *TreeB = new TTree("TreeB","TreeB");
TreeB->Branch("pt","pt/F");
...
TreeB->Fill();
TreeB->Print();
hfile.Write();
hfile.Close();
Where I’ve removed the incorrect attempts to copy the histogram across (they were in place of ‘…’). I think that creating the branch with pt given as a float is incorrect, but I leave this here as I don’t have the correct syntax.
Any advice would be greatly appreciated!