nuisance is hosted by Hepforge, IPPP Durham
close Warning: Can't synchronize with repository "(default)" ("(default)" is not readable or not a Git repository.). Look in the Trac log for more information.

Changes between Initial Version and Version 1 of UsageNuisMin


Ignore:
Timestamp:
May 25, 2017, 11:43:51 AM (8 years ago)
Author:
Patrick Stowell
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UsageNuisMin

    v1 v1  
     1= Using NUISMIN =
     2
     3Support for tuning generator parameters is also included in NUISANCE through an interface with the ROOT minimiser libraries. Note for nuismin to be built ROOT must be built with minuit and mathmore: see here.
     4
     5If nuismin is successfully built it can be used by specifying some RW parameters as free in the card file, listing appropriate limits for the dials and step sizes alongside its definition. When run such a card file will vary all free parameters until the likelihood calculated through comparison to listed datasets (see nuiscomp for details on specifying datasets) is minimised.
     6
     7In the following example we will perform a simple tuning of MAQE to MiniBooNE CCQE data, recreating the MiniBooNE puzzle in NUISANCE (and possibly making a lot of people very angry).
     8
     9'''''simpletuning.card''''' :
     10{
     11
     12  # Specify RW dials
     13  genie_parameter   MaCCQE   0.0   -3.0  3.0  1.0  FREE
     14  norm_parameter   MiniBooNE_CCQE_XSec_1DQ2_nu_norm  1.0  0.5  4.0  0.1  FREE
     15
     16  # Load MiniBooNE CCQE Sample
     17  sample  MiniBooNE_CCQE_XSec_1DQ2_nu  GENIE:gntp.genie.file.root
     18
     19}
     20
     21Lets review what is in this card file before we run it. At the start we specify the MaCCQE and MiniBooNE_CCQE_XSec_1DQ2_nu_norm parameters should be varied until a best fit likelihood is found. MaCCQE is a RW parameter listed in $GENIE/src/ReWeight/GSyst.h, any RW dials given in the supported generators NUISANCE can have access to by specifying its name. MiniBooNE_CCQE_XSec_1DQ2_nu_norm is a total normalisation parameter which allows us to float the normalisation of the MC we provide to the data freely (similar to a floating total flux normalisation).
     22
     23Limits of -3.0 to 3.0 sigma and a step size of 1.0 are applied to MaCCQE. Limits of 0.5 to 4.0 and a step size of 0.1 are applied to MiniBooNE_CCQE_XSec_1DQ2_nu_norm. The starting values for MaCCQE and MiniBooNE_CCQE_XSec_1DQ2_nu_norm are set to 0.0 respectively. Both parameters are set to FREE in this example, but in one of the later examples we will show that specific dials can be set to fixed chosen values using "FIX" in this option instead.
     24
     25Finally we list the datasets that should be used to create a likelihood. Only one, the MiniBooNE CCQE data, is used here. But it is also possible to list multiple 'sample' lines, so that their likelihoods are added together (assuming no correlations) to form a larger joint likelihood.
     26
     27Running this fit is then as simple as the following command
     28
     29'''''Running nuismin'''''
     30{{{
     31$ nuismin -c simpletuning.card -o simpletuning.root
     32}}}
     33
     34This will run the nuisance minimiser with default options and try to find a best fit by varying both parameters. Careful, this could take a while!
     35
     36Whilst we wait for this to run, lets go through what is going on under the hood. When we pass a card file to minimiser, first it sets up each of the dataset comparisons previously discussed in the nuiscomp example. Then it parses the reweight parameters specified and sets up a ROOT minimiser instance. nuismin then runs through a list of 'Routines' which are used to run the minimisation. The best fit results from each routine are passed into the next routine so it is possible to string together a long list of possible minimisations if you are trying to tune a model using a particularly complicated likelihood surface.
     37By default nuismin runs the following routine: Migrad,FixAtLim,Migrad
     38Which will try and find a minimum, check if any parameters are near a limit and if they are fix them at that limit, then rerun the Migrad from this point. It is possible however to override this default using the "-f" flag and passing a comma seperated list of fit commands.
     39
     40Some examples of fit commands are given below, with usage examples given later on.
     41- '''Migrad''' :
     42- '''Combined''' :
     43- '''Simplex''' :
     44- '''FixAtLim''' :
     45
     46
     47Okay, back to tuning. When a tuning is ran, the ROOT minimiser will request a likelihood from the NUISANCE JointFCN class given a specific parameter set. The JointFCN is in simple terms just a wrapper that creates all the different data-MC comparisons, and returns a summed likelihood. When this request is made, the JointFCN resets all the MC histograms in NUISANCE, then begins to loop through each of the event samples. For each signal event it calculates an event weight given the specific parameter set that has been chosen and fills this into the MC histograms to produce updated predictions. Once all events have been looped over a prediction is generated for each dataset and a likelihood is returned.
     48
     49This process is repeated for each iteration of the fit, so if Minuit has to calculate the likelihood 600 times, the event loop also has to be ran 600 times. As a result minimisations can sometimes take days, depending on how many events are being ran, so the best thing to do is leave your job running and come back this example when it has finished.
     50
     51If your minimisation has finished you should see a Minimisation Complete output and the root file can be opened. Contained in this file are the same histograms we discussed in the NuisComp usage example, but this time the MC predictions are the best fit predictions obtained from the fit. Alongside these histograms the following are saved:
     52
     53- '''fit_dials''' : Histogram showing the best fit parameter results and their errors
     54- '''correlation''' : Correlation matrix for the best fit parameter set obtained from the last Minuit call
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72