Fitting Tutorial

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

In this example (as expected by the defined amplitude)\ each wave is defined by (epsilon.l.m) and each parameter has a real and imaginary part.\ i.e a epsilon=-1, l=1 (P wave), m=1 will produce Vs(r.-1.1.1) and Vs(i.-1.1.1) names.\ (In this example the imaginary part of the P-wave is kept fixed at 0 value\ in the fit)

Read data and montecarlos (accepted and generated) samples

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

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

Check that bins have enough number of events for fit

Fitting with Minuit and Extended LogLikelihood

Look at other possibilities through pypwa (use the ?pwa command\ or see or

Looking at the results of fitting

Checking the waves used (and filling waves variable for later use)

Filling strings with wave names (for plotting)

Getting the bin mass values and number of events in datasample for those bins

Calculating the expected number of events in a a mass bin

Plot expected number of events vs mass and data vs mass (both should agree if fitting worked)

Calculate initial intensities (in case we need to check them)

Calculate the expected number of events for each wave (vs mass)

Plot expected number of events vs mass for each wave

Expected number of events vs mass for each wave in a same plot

Calculate Moments

Calculate PhaseMotion between two waves

In this example between 2nd and 3rd waves in amp list

Plot PhaseMotion

Write fitted values (of production amplitudes) to disk