Multiple Histograms with Tree file

Hello all,

I am a new ROOT user, and I was looking through the documentation and I can’t seem to find how to do what I need. I need to put multiple histograms on the same canvas all from the same tree file. If it is supposed to use the “same” command and I am not sure in what context. Currently, here is what I am doing:

TFile *f = new TFile("tree01385.root"); Output->Draw("det.TIC00>>(1000,0,1000)")

This opens my canvas, but I am not sure as to how to draw det.TIC01, det.TIC02, etc. (which are all stored in the same file) on the same canvas without drawing over it. Any help would be more than appreciated.


TFile *f = TFile::Open("tree01385.root"); Output->Draw("det.TIC00>>h_TIC00(1000,0,1000)"); Output->Draw("det.TIC01>>h_TIC01(1000,0,1000)"); Output->Draw("det.TIC02>>h_TIC02(1000,0,1000)"); TH1F *h_TIC00 = (TH1F*)gDirectory->Get("h_TIC00"); TH1F *h_TIC01 = (TH1F*)gDirectory->Get("h_TIC01"); TH1F *h_TIC02 = (TH1F*)gDirectory->Get("h_TIC02"); THStack *hs = new THStack("hs", "det.TIC0*"); hs->Add(h_TIC00); hs->Add(h_TIC01); hs->Add(h_TIC02); hs->Draw("NOSTACK");