[nuisance_nlls] add option to show first and second order derivatives

Hi @mrieger,

This PR adds an option to additionally plot the first and second order derivatives of the NLL with respect to a systematic. This helps to identify systematics which are 'bad' for the fit in the sense, that the minimisation is based on the first and second order derivatives (Hessian), thus requiring a smooth description of those.
The option to be added via CLI is --show-derivatives.

Exemplary healthy systematic: nuisance_nlls_derivatives_healthy.pdf. Here, one can see a nice quadratic NLL, and thus a linear first derivative, and a constant for the second order derivative.

Exemplary broken systematic: nuisance_nlls_derivatives_broken.pdf. Here, one can see a very unstable second order derivative with a lot of spikes, which likely leads to problems during minimisation. This artefact was not visible before where only the NLL was plotted.

Best, Peter

PS: The derivative calculation is based on the one in CombineHarvester-FastScan

Edited by Marcel Rieger

Merge request reports