How to select the histogram inside my root file in TBrowser?

Dear All,

I have a root file in which I am able to see all the 24 histograms in “TBrowser”. Now while writing the macro for calibration I have to select only one spectrum. Could you please help?
What should be the small macro for which it only takes that selected histogram?

Thanks and have a nice day.

auto f = new TFile("Eu_26Dec.001.root");
TH1F* h = (TH1F*)f->Get("hist_name");

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

Hi Robert,

Could you in the future open new topics for new issues? Else we (and other readers) get lost which problem is being solved. Thanks!

Cheers, Axel.

Why don’t you store the peak positions in a vector, and then do a loop over the peaks, calling SetParameter with each vector element? This really looks more like a coding question than a question about ROOT, btw…

Thanks @Axel
Actually I have never used vectors in root macro.
Can you please tell me that how can I use vectors in my macro to store the peak positions?
Does using vectors helps in not seting parameters and range again and again?

@moneta
Can you please resolve my query?

Hi Robert,
With an estimate of 20k users we cannot spend a lot of time in teaching basic C++ (or coding, whatever the language). It’s much more efficient for everyone if you can ask close colleagues or friends for help. Could this work? We’re very happy to help with any issues you have with ROOT!
Cheers, Axel.