Skip to content

Example 2 Calculating a simple chi^2

markrosslonergan edited this page Sep 7, 2018 · 3 revisions

In this example we will use the covariance matrix and central values as calculated in Example 1, to calculate a simple chi^2 with and without systematic uncertainties included. If you haven't ran Example 1 and produced the required output you can do so here.

The code

The code for example2 can be found example_2.cxx

The start is the same simple command line nonsense and we will ignore that. In the main program we are doing a few simple things.

  1. Loading up the computed central value histograms into an SBNspec with the aid of the xml.
  2. Repeating this but setting the nu_uboone_nue_leesignal subchannel to 0 (this will be our background only spectra)
  3. Loading up the covariance matrix as calculated in example 1
  4. Scale the lee signal by an order of magnitude in each direction, calculating the chi^2 between this central value and the bkg central value at each point
  5. Make quick plot of it

Running example2

./example2 --xml example.xml

There should 1 plot produced, EXAMPLE2_simple_scaling.pdf. Recall that this is an arbitrary toy model!

Clone this wiki locally