Fitting an 1-dimensional histogram.
An 1-dimensional histogram is booked and filled with random data following a gaussian distribution.
The histogram is fitted, the results are printed.
Click to retrieve the C++ source code, the textual
output of the example.
You can build the application typing :
scram b bin exa6
You can run the application typing (using bash shell):
eval `scram runtime -sh'
- A new histogram is created and filled with random data following a normal distribution.
- A new function is created. Its parameters take some initial values.
- A new fitter is created.
- The fitter fits the function parameters with the histogram data and returns a fit result object.
- The fit results are printed and inserted into the histogram's annotation.