Fitting an 1-dimensional histogram.

Description

An 1-dimensional histogram is booked and filled with random data following a gaussian distribution. The histogram is fitted, the results are printed.

C++ program

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'
exa6

Program flow

  1. A new histogram is created and filled with random data following a normal distribution.
  2. A new function is created. Its parameters take some initial values.
  3. A new fitter is created.
  4. The fitter fits the function parameters with the histogram data and returns a fit result object.
  5. The fit results are printed and inserted into the histogram's annotation.