Question

We need to try and fit a piecewise linear (PWL) function to the I/B calibration curve.

Hypothesis

What are our assumptions?

Experiment

Propose a methodology to test the hypothesis.

Results

This is the I B calibration function with 91 points.

Untitled 6.png

Untitled 1 3.png

It fits I/B pretty well but leaves peaks at the start and end of flat top.

Dividing B by I and plotting vs I we see significantly more information at flat bottom.

Untitled 2 4.png

Untitled 3 3.png

When subtracting B with the discrete function values we see significantly more information at flat bottom with more pronounced decays

We try to fit a function using torchpwl, the notebook is available at ~/cernbox/hysteresis/dipole/notebooks/subtract_discrete_function.ipynb.

Training 2000 epochs it shows the following fit with 200 keypoints:

Untitled 4 2.png

Where the blue shows the original calibration fuction and red the fitted one.