= Card File Examples = {{{ #!div class="important" '''Author:''' Patrick Stowell '''Date:''' June 2017 '''Versions:''' `NUISANCE v2r0`, `GENIE 2.12.6` }}} The NUISANCE applications require card files to be written that list different comparison specifications you would like to run with. We call an entry in the card file a 'structure' and there are a number of these structures available to the user when writing card files. These are listed below, with their required and optional arguments. Some structures are valid only for certain routines or apps, so where appropriate these have been labelled. NUISANCE Versions >v2r0 contain support for the card file to be specified in xml format, also opening up additional options to be passed in the structures. To look at examples for the older 'simple card' format that can be saved as a text file, please see the 'Simple Card Structures' section. [[PageOutline(1-3,Wiki content,inline,numbered)]] == XML Card Structures == === XML Structure === When writing XML card files you also need to wrap eveything in a '' root element. {{{ ... }}} If you don't do this, the ROOT XML parser will fail and NUISANCE will think your card file is empty. For example **the following card file is valid** {{{ }}} but **the following card file is NOT valid** as it is missing the root element {{{ }}} === Sample Structure === Data comparison samples are specified by including the 'sample structure, listing the name of the sample and the input. These structures are read by '''nuiscomp''', '''nuismin''', and '''nuissyst''' {{{ }}} - **NAME** : Name string of the sample of interest specified in src/FCN/SampleList.cxx. - **TYPE** : Generator Input Type string telling NUISANCE what the file type is (e.g. GENIE) - **OPTION** : (Optional Argument) Specifying extra sample options that change the way the sample behaves at run time (e.g. SHAPE). If none given, this is left as DEFAULT. - **NORMVALUE** : (Optional Argument) Starting sample normalisation value used to shift total MC normalisation. If none given this is left at the value 1.0. In the XML format, if you don't want to provide optional arguments, these can just be left out completely from the xml entry. Multiple sample structures can be given in the NUISANCE card file to include many data comparisons at once. Since the specifications in the xml structure are given as separate entries it is also not necessary to give them in this exact order, as long as all non-optional arguments are given somewhere within the xml entry. {{{ #!div class="important" NOTE: Reading in Generators requires that Generator to be built and have NUISANCE built against it. E.g. to read GENIE files, you need to have a working install of GENIE and NUISANCE built against that version. }}} **Example 1** : MiniBooNE CCQE comparison using a GENIE file {{{ }}} **Example 2** : MiniBooNE CCQE comparison using a NuWro file {{{ }}} **Example 3** : MiniBooNE CC1pi comparison using a NEUT file {{{ }}} **Example 4** : MiniBooNE CC1pi comparison using a GiBUU file and the SHAPE option {{{ }}} **Example 5** : MINERvA CCQE comparison using a NEUT file and shifting the MC normalisation by 1.0 / 0.9. {{{ }}} **Example 6** : MiniBooNE CCQE comparison using a NuWro, shifting the MC by 0.9 / 1.0 but also adding a normalisation penalty to the likelihood (option=NORM) {{{ }}} **Example 7** : Include both MiniBooNE CCQE and CC1pip data {{{ }}} === Fixed Parameter Structure === Fixed parameters can be specified by using any of the 'parameter' type structures. You must specify the type of parameter first, before listing the name, starting value, and state. These structures are read by '''nuiscomp''', '''nuismin''', and '''nuissyst''' {{{ }}} - **TYPE** : Type of RW parameter, (e.g. genie_parameter, neut_parameter, norm_parameter) - **NAME** : Name of RW parameter, can be any string given in the RW engine. In GENIE this list is given in $GENIE/src/ReWeight/GSyst.h. For normalisation parameters the name of the dial corresponds to SAMPLENAME_norm. (e.g. 'MiniBooNE_CCQELike_XSec_1DQ2_nu_norm') - **VALUE** : Starting value for the dial. In general for RW engine parameters this is given in terms of 1-sigma variations away from the nominal, so that VALUE=0.0 is the nominal generator value. For everything else, like normalisation parameters, this value is in units of the true value. - **STATE** : State of the dial. This should always be left as FIX as this is the only support option for the time being. Multiple parameter structures can be listed in the nuisance card file to make comparisons with many model parameters changed at once. Since the specifications in the xml structure are given as separate entries it is also not necessary to give them in this exact order, as long as all non-optional arguments are given somewhere within the xml entry. {{{ #!div class="important" NOTE: Running with RW parameters changed in Generators requires that specific Generator to be built and have NUISANCE built against it. E.g. to using GENIE RW, you need to have a working install of GENIE+GENIE-RW and NUISANCE built against that version. }}} **Example 1** : Fixed GENIE RW 'MaCCQE' to +1 sigma {{{ }}} **Example 2** : Fixed NuWro RW 'kNuwro_Ma_CCQE' to -1 sigma {{{ }}} **Example 3** : Shift both 'MaCCQE' and 'MaCCRES' in NEUT by 1 sigma {{{ }}} **Example 4** : Change MiniBooNE sample normalisation (alternative to using sample NORMVALUE option) {{{ }}} === Free Parameter Structure === Free parameters can be specified by using any of the 'parameter' type structures. You must specify the type of parameter first, before listing the name, starting value, lower and upper limits, step size and state. This is an extension of the fixed parameter case to include extra information needed by routines that vary parameters. These structures are read by '''nuismin''', and '''nuissyst'''. It is possible to use these structures also in nuiscomp, but the dial limits and step sizes will be ignored, fixing the parameter at the chosen value instead. {{{ }}} - **TYPE** : Type of RW parameter, (e.g. genie_parameter, neut_parameter, norm_parameter) - **NAME** : Name of RW parameter, can be any string given in the RW engine. In GENIE this list is given in $GENIE/src/ReWeight/GSyst.h. For normalisation parameters the name of the dial corresponds to SAMPLENAME_norm. (e.g. 'MiniBooNE_CCQELike_XSec_1DQ2_nu_norm') - **VALUE** : Starting value for the dial. In general for RW engine parameters this is given in terms of 1-sigma variations away from the nominal, so that VALUE=0.0 is the nominal generator value. For everything else, like normalisation parameters, this value is in units of the true value. - **LOW** : Lower limit of the dial in the same units as **VALUE** - **HIGH** : Upper limit of the dial in the same units as **VALUE** - **STEP** : Starting step size of the dial in the same units as **VALUE**. This is the stepsize passed to the minimizer, as well as the step size used in various functions that randomly scan the parameter space. - **STATE** : State of the dial. This can be left as FREE or FIX. If FREE this tells NUISANCE that we will allow the dial to be varied. If FIX then NUISANCE will make sure it is left at **VALUE** for the entire time. FIX is a useful option if you decide you would like to stop a single parameter being floated but would like to keep its limit definitions in case you would like to vary it at a later point. Multiple parameter structures can be listed in the nuisance card file to make comparisons with many model parameters changed at once. Since the specifications in the xml structure are given as separate entries it is also not necessary to give them in this exact order, as long as all non-optional arguments are given somewhere within the xml entry. {{{ #!div class="important" NOTE: Running with RW parameters changed in Generators requires that specific Generator to be built and have NUISANCE built against it. E.g. to using GENIE RW, you need to have a working install of GENIE+GENIE-RW and NUISANCE built against that version. }}} **Example 1** : Free GENIE RW 'MaCCQE' to starting at 0.0 and between -1.0 and 1.0 sigma {{{ }}} **Example 2** : Free NuWro RW 'kNuwro_Ma_CCQE' {{{ }}} **Example 3** : Shift both 'MaCCQE' and 'MaCCRES' in NEUT by 1 sigma. Vary MaCCQE. {{{ }}} **Example 4** : Shift both 'MaCCQE' and 'MaCCRES' in NEUT by 1 sigma. Vary MaCCQE. {{{ }}} **Example 5** : Shift both 'MaCCQE' and 'MaCCRES' in NEUT by 1 sigma. Vary both. {{{ }}} **Example 6** : Vary MiniBooNE sample normalisation between user chosen limits (alternative to using sample NORMVALUE option) {{{ norm_parameter MiniBooNE_CCQE_XSec_1DQ2_nu_norm 0.9 0.8 1.1 0.05 FREE sample MiniBooNE_CCQE_XSec_1DQ2_nu NEUT:/path/to/neutinput.root }}} **Example 7** : Example 5 with a shifted order {{{ }}} === Covariance Structure === Covariance objects are used by NUISANCE to assign likelihood penalty terms to parameters as well as define appropriate parameter throws when studying systematic uncertainties. They can be specified in the card file by providing the 'covar' structure, plus an ID, input definition, and state. {{{ }}} - **ID** : Unique ID specified by the user so they can keep track of this covariance class in the output file. Saved objects from this covariance will be labeled 'ID_label' (e.g. ID_central). - **TYPE** : Covariance type. There are multiple ways to define a covariance, with some examples of these types below. - **INPUT** : Input definition, this depends a lot on what the **TYPE** is defined as. Some examples are below. - **STATE** : State of this covariance, used to tell NUISANCE whether it should use it to apply a likelihood penalty (e.g. GAUSPULL), use it to throw parameters (e.g. GAUSTHROW), or both. ==== Single uncorrelated dial covariances ==== To tell NUISANCE to make a covariance for a single dial, you can specifiy the covariance type as 'DIAL' {{{ }}} - **NAME** : Name of the RW dial. This dial should have also already been setup using one of the 'parameter' structures shown above. - **CENTRAL** : Central value for this dial used in the covariance. For example when you want to include the result from a previous fit, this should be set to the best fit value from that fit. - **WIDTH** : Error on the parameter about the central value. Used as the Gaussian width when generating parameter throws. For example when you want to include the result from a previous fit, this should be set to the best fit error from that fit. ** Example 1 ** : Covariance used to throw MaCCQE uncorrelated in nuissyst using MaCCQE=0.0+-1.0 {{{ }}} ** Example 2 ** : Covariance used to apply an additional MaCCQE pull in nuismin using MaCCQE=0.0+-1.0 {{{ }}} ==== Correlated dial covariances ==== To tell NUISANCE to make a covariance for multiple parameters that have some correlations between the, you can specifiy the covariance type as 'ROOT' and provide a ROOT input file containing the covariaince {{{ }}} - **FILEPATH** : Path to a ROOT file containing the covariance information - **DIAL_HIST** : Name of a TH1D inside **FILEPATH**. This TH1D should be created such that each bin corresponds to a different dial, with the bin contents set to the best fit value for that dial, and the bin label set to the dial name. A good example of such a histogram is given in the standard output of nuismin called 'fit_dials'. - **COVARIANCE_HIST** : Name of a TH2D inside **FILEPATH**. This TH2D should be created such that each bin in x and y corresponds to a different dial, with the bin contents set to the covariance between each dial according to the bins x and y position, and the bin labels set to the corresponding dial names. A good example of such a histogram is given in the standard output of nuismin called 'fit_dials_free'. The following examples assume you have a root histogram called myfitresult.root, containing a TH1D called 'fitresults' with the dial central values in it, and a TH2D covariance histogram called 'cov', and that both these histograms describe the central values and covariance for the 'MaCCQE' and 'MaCCRES' dials. ** Example 1 ** : Covariance ROOT file used to throw MaCCQE and MaCCRES using nuissyst {{{ }}} ** Example 1 ** : Covariance ROOT file used to apply a pull to MaCCQE and MaCCRES using nuismin, where fitresult.root is in the current directory {{{ }}} === Config Structure === Configuration options can be given at runtime by including them in the card file using the 'config' structure. {{{ }}} - **NAME** : Name of configuration parameter - **VALUE** : Value of configuration parameter Including a configuration option will override the defaults given in 'parameters/config.xml'. Multiple configuration options can be overridden at once by listing them on separate lines in the card file. **Example 1 ** : Change the verbosity level {{{ }}} **Example 2 ** : Change the verbosity level and set the maximum number of events to run over {{{ }}} === Comments Structure === Comments can be inserted into the simple card format by using the '#' symbol at the start of a line. {{{ }}} ** Example 1: ** {{{ }}} ** Example 2: ** {{{ config VERBOSITY 4