MCMC example

based on demo_JPAC_fit.ipynb

Read processed data

pre-processed by process_data.py

Load Waves for Fit (and input initial values of minuit and fitted parameters).

Load likelihood fit results

To use as start parameters for MCMC

Calculate amplitude and phase from this to sample in this space

Binning of the data/monte-carlo and define amplitude (function) to fit

Here the user defines number of bins, variable to be binned and range

Plot events per bin for visualisation and to make sure there are enough events per bin

Run MCMC after likelihood fit

See if we can improve results by that

Save MCMC results

Draw chains and histograms