is there a way, to rebin a Histogram with variable bin size?
One Idea would be, to create a new Histogram with less bins but same Lower and Upper Range of the X-Axis, and add the old Histogram.
How does Histogram adding work? If it adds the Content of bin i to bin i of the other Histogram it wont work, but if it adds the Content of bin i to GetBinCenter(i) of the other Histogram it would work.
TH1::Add requires the same number of bins and limits. However you can use TH1::Rebins to convert your fix bin histograms into a variable bin size histogram. See root.cern.ch/root/html520/TH1.html#TH1:Rebin
But i have some problems using it, maybe someone can give me a hint:
I have a class, in which my TH1F is rebinned, and want to return *TH1F… but how do i get a pointer to hnew? I’m sure there is a way to find an object like TH1F by name and return the pointer, but I cant find it