Histogram's fluctuations

Hey there.

I am drawing histograms of the transverse momentum of three different masses and energies (six different samples) of the same event (generated in MadGraph). I have already done it for 10k events and used around 25 bins (with his not great at all if you want to compare the six different cases). I also have done a histogram of 50k and 100k events but kept the default number of bins which was 100.

Although the histogram of the 100k generated events is a lot better than the one corresponding to the 10k generated events, it stil has some fluctuations which I would like to reduce to the minimum.

Another question: is it possible to connect the center of all the bins in order to draw a graphic of a gaussian function?

I have attached the histogram of the 100k events and the code I wrote to draw it.

Thank you,
stackhist.cxx (2.13 KB)
pT(T)_100k_100bins.pdf (18.7 KB)

Try to draw your histogram stack using:
hs->Draw(“NOSTACK C”); // smooth curve through histogram bins
or simply:
hs->Draw(“NOSTACK L”); // straight line through histogram bins

If you want to add a Gaussian fit to your histogram, simply try:

Now, it gives me the gauss fit for each of them but I can’t load FitPanel (to edit the fit graph appearance). It may be because some package is not included.

I’ve included:

#include "Fit/DataRange.h" #include "TPluginManager.h"

But it still doesn’t work. Do you know what’s wrong?

I have solved the problem. Thank you!