Hi all,
I have been searching on this forum and also on the online documentation and I can’t figure out how to do the following:
[color=#FF0000]I would like to resize (or rebin) the x axis of an histogram to a shorter span (modify the x-axis from 0-8000 to 0-8). So all bins are compressed to 0-8 instead of 0-8000. Makes sense [/color]
Also the histogram that I am trying to plot is coming from an inverse FFT (TVirtualFFT::FFT(1,&range,“C2R M K”) and like all FFT algorithms, the first half of the histogram is inversed with the last half. How can I reorganized the histogram properly so the convoluted gaussians would appear like it should?
So my code is almost complete, only these 2 problems at the end remains… Please help!
[color=#FF8040]Also, the ultimate goal is to fit my data with the convolution of a gaussian with a user defined function (which is another gaussian for now). Let me know if there’s a way to solve this with rooFit or another extension to ROOT. [/color]
I think it cannot be done with rooFit (RooFFTConvPdf), but please let me know if you’ve done it before, or if you’re aware of another extension to ROOT that could get the job done. I’ve been looking at rooFit and tried to modify the 2xx_***.C tutorials… but couldn’t take the convolution of a USER DEFINED FUNCTION with a gaussian. Only the functions already defined inside rooFit are allowed I believe.
I really tried solving this by myself, I’ve spent 2 days of more than 12 hours each trying to fix this… Sorry if the answer is simple…
It’s the first time in more than a year than I find myself at a dead end with ROOT, ususally I come here on the forums and my problems get solved reading the answers to the questions that other fellow ROOTers previously asked. I know it would take me a couple minutes to do this in matlab, but I don’t want to go back. Seriously.
Please run the attached code (modified FFT.C) to understand better what I’m trying to do…
The first graphic you’ll get are the two gaussians on top of each other that I am trying to convolve (convolute?). Then on the second graph you got the screwed up convolution of those previously said gaussians. It is not correct cause the right part <—> left part and also it is spanning to long on the x-axis.
The result at the end should look like the convolution of the 2 gaussians on this webpage (Except shifted to the ).
mathworld.wolfram.com/Convolution.html
Thanks a lot!
Matthieu
FFTconvolution.C (24.4 KB)