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.

NuWro Inputs

This page aims to outline how to use NuWro to create a sample of interactions on your favourite target. We'll also outline how to feed this generated sample through the NUISANCE framework and get good results.

The latest version of the NuWro generator is setup to automatically save the predicted event rate and flux distributions for the generated events. This is everything NUISANCE needs to make properly normalised cross-section predictions with the standard NuWro output.

The latest version of NuWro with recently developed reweight engine can be obtained from here:

Note: If you would like to use events generated with an older version of NuWro this is still possible. Please see:

Wiki content

  1. NuWro Inputs
  2. Downloading and building NuWro
  3. Building NUISANCE with NuWro support
  4. Generate NuWro Events for NUISANCE
  5. Loading NuWro v12+ events into NUISANCE
  6. Loading NuWro <v12 events into NUISANCE
  7. Using NuWro reweight for comparisons
  8. Using NuWro reweight for dial tuning

Downloading and building NuWro

Building NUISANCE with NuWro support

If you have setup NuWro correctly following the steps in the previous sections then the environmental variables NUWRO and PYTHIA6 should already be setup. If these are not, then please point them to the following destinations:

export NUWRO=/path/to/nuwro/top/directory/
export PYTHIA6=/path/to/pythia6/lib/directory/

Once these variables are pointing to a valid destination, enabling support for NuWro is as simple as specifying it during the cmake build procedure:

$ cmake -DUSE_NUWRO=1  ../nuisance/   
$ make 
$ make install

For more details of the cmake build steps see BuildingTheCode?.

Generate NuWro Events for NUISANCE

Loading NuWro v12+ events into NUISANCE

NUISANCE's input handlers are setup to automatically load in the standard output of NuWro v12 onwards. Once you have generated events the MC sample can be loaded in by specifying the "NUWRO" type in the NUISANCE sample input field. An example of this is shown in the following card file.

nuwro_v12_comparison.card:

#sample   sample_id    type:input_file
##########################################
sample    MiniBooNE_CCQE_XSec_1DQ2_nu    NUWRO:/path/to/nuwro/events.root

nuwro_v12_comparison.card(without comments):

sample    MiniBooNE_CCQE_XSec_1DQ2_nu    NUWRO:/path/to/nuwro/events.root

This comparison can be ran with nuiscomp with the following command:

$ nuiscomp -c nuwro_v12_comparison.card -o nuisance_comparison_nuwro_v12.root

The output file (specified with '-o') will be a ROOT file containing a series of useful histograms that compare the NuWro predictions to the MiniBooNE CCQE data.

$ root nuisance_comparison_nuwro_v12.root
$ root[0]: _file0->ls();

MiniBooNE_CCQE_XSec_1DQ2_data:

MiniBooNE_CCQE_XSec_1DQ2_MC:

MiniBooNE_CCQE_XSec_1DQ2_MC_PDG:

Loading NuWro <v12 events into NUISANCE

For versions of NuWro less than v12 there are no flux and event rate histograms saved into the generator output. It is still possible to use these events but NUISANCE must reconstruct the histograms at runtime (a slow process).

This must be done by using the flag input.regen_nuwro_plots=1 at runtime. When this is set NUISANCE will extract the flux histogram spectrum from the NuWro parameters class. It will then bin all the events as a function of Enu and use the NuWro event weight to normalise this event spectrum to a properly normalised predicted event rate for the given input flux.

The following cardfile is an example of how to setup this type of input for the MiniBooNE CCQE dataset.

nuwro_oldversion_comparison.card:

# Config   Name                Value
##########################
config input.regen_plots 1

#sample   sample_id    type:input_file
##########################################
sample    MiniBooNE_CCQE_XSec_1DQ2_nu    NUWRO:/path/to/old/nuwro/events.root

nuwro_oldversion_comparison.card (without comments):

config input.regen_plots 1
sample    MiniBooNE_CCQE_XSec_1DQ2_nu    NUWRO:/path/to/old/nuwro/events.root

Using NuWro reweight for comparisons

Support for the NuWro reweight package is built into NUISANCE. It has immediate access to any reweight dial available in the version of NuWro you built NUISANCE against. An example of a nuiscomp cardfile that will generate predictions with alternate model predictions is shown below:

nuwro_reweighted_comparison.card:

# par_type      dial_name    value
###########################
nuwro_paramater  MaCCQE  +1.0

# sample   SAMPLE_ID    TYPE:INPUT_TYPE
########################################
sample    MiniBooNE_CCQE_XSec_1DQ2_nu    NUWRO:/path/to/nuwro/events.root

nuwro_reweighted_comparison.card(without comments):

neut_paramater  MaCCQE  +1.0
sample    MiniBooNE_CCQE_XSec_1DQ2_nu    NUWRO:/path/to/nuwro/events.root

A list of available dial strings can be found in "$NUWRO/src/reweight/NuWroSyst.h". Comparing the plots below with those shown earlier you can see the difference between the NuWro model predictions with MA = 0.0 and +1.0 sigma.

MiniBooNE_CCQE_XSec_1DQ2_MC (reweighted):

Using NuWro reweight for dial tuning

As for all other reweight engines any dial can be treated as a free parameter for dial tuning studies in nuismin. The following cardfile when used with nuismin will vary the CCQE and Resonant axial mass parameters until a best fit is found to the MiniBooNE CCQELike dataset.

nuwro_reweighted_minimizer.card:

# par_type      dial_name    value
###########################
nuwro_parameter  MaCCQE  +1.0  -4.0  4.0  1.0  FREE   

# sample   SAMPLE_ID    TYPE:INPUT_TYPE
########################################
sample    MiniBooNE_CCQE_XSec_1DQ2_nu    NUWRO:/path/to/nuwro/events.root

nuwro_reweighted_minimizer.card(without comments):

nuwro_parameter  MaCCQE  +1.0  -4.0  4.0  1.0  FREE   
sample    MiniBooNE_CCQE_XSec_1DQ2_nu    NUWRO:/path/to/nuwro/events.root

This can be ran using the NUISANCE minimizer app "nuismin":

$ nuismin -c nuwro_reweighted_minimizer.card -o nuwro_minimizer_results.root

The contents of the nuismin outputfile will be the same as that in the comparison app, but with the predictions now shown for the best fit result. Also included are a series of histograms related to the tuning study (covariance, fit_results, etc)

$ root nuwro_minimizer_results.root
$ root[0]: _file0->ls();
Last modified 7 years ago Last modified on Jan 18, 2017, 11:25:47 AM