Skip to content

New GaussianConvolution & GaussianSqrtConvolution classes; Update to Scale systematic#84

Open
dcookman wants to merge 5 commits into
snoplus:masterfrom
dcookman:update_convscale
Open

New GaussianConvolution & GaussianSqrtConvolution classes; Update to Scale systematic#84
dcookman wants to merge 5 commits into
snoplus:masterfrom
dcookman:update_convscale

Conversation

@dcookman
Copy link
Copy Markdown

This PR does a number of things, but its primary aim is the creation of two new "ready-to-use" Systematic classes that have been much asked for: GaussianConvolution and GaussianSqrtConvolution. These both derive from the underlying Convolution class, handling the special case of a 1D Gaussian smearing kernel; the latter also includes a square root scaling dependence to the kernel's width that is often used when smearing along an energy axis.

Because of various special properties that a Gaussian kernel has, the ConstructSubMatrix() method was overloaded in both classes to allow for much faster response matrix generation. This was achieved through two main tricks:

  1. Because of the translational symmetry of the kernel (particularly in the case of GaussianConvolution with constant bin widths) the calculated contributions will often be highly repeated; we now cache results and check to see if they've already been calculated.
  2. Beyond a certain distance (by default 5 sigma) the Gaussian kernel outputs a 0 contribution. We know there's no point looking beyond there along that row! So instead of scanning along the rows and columns of the response matrix in the usual way, we instead start along the diagonal and move outwards in both directions, ending a sub-loop once we've hit a zero.

Further updates were made to support these new classes:

  • We want the GaussianConvolution class to have the FitComponent interface accessing the sigma of the Gaussian only, not the mean (which is irrelevant during a smearing convolution). A new option to HideMeanParameters() was added within the Gaussian and GaussianFitter classes to support this.
  • The private members/methods of the underlying Convolution class are updated to being protected, so that our new classes can access them.
  • Unit tests were written for both new classes.
  • The MCMC.cpp example code has been updated to include these new classes as a demonstration.

In addition, an update to the Scale systematic's Construct() method was made so that one single SetComponents() call was made instead of many individual SetComponent() calls. This should hopefully make Scale that bit faster too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant