= How to generate events with GENIE and feed them to NUISANCE = This page aims to outline how to use GENIE 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. {{{ #!div class="important" Contact: [mailto:p.stowell@sheffield.ac.uk Patrick Stowell] }}} [[PageOutline(1-3,Wiki content,inline,numbered)]] = Building GENIE = GENIE can be obtained from here: http://www.genie-mc.org/ = Generating GENIE Events = NUISANCE requires the GHepRecord format when reading in GENIE inputs. This format is required to apply the reweighting procedures to the GENIE events. The standard output of gevgen can be used, all that is required from the user is to ensure the correct target and flux is specified for a given sample. Some examples are below. ''' Generate 1E6 MiniBooNE FHC numu events ''' {{{ gevgen -f miniboone_fhc_numu.root,numu_mb -r 1 -n 1000000 -t 1000060120[0.857],1000010010[0.143] }}} = Preparing GENIE Events = Unfortunately because of the way the GHepRecord is setup an extra step is required to properly normalise the cross-section predictions. The PrepareGENIE app has been added to allow the splines used in the event generation to be fully reconstructed by NUISANCE. This app will loop over all events and build up the cross-section spline for each interaction channel. These are then added together to obtain the total cross-section per target in the sample. Finally the target specification is used to add these total splines together to obtain a single spline for the MC sample. This preparation step needs the target specification as well as the flux histogram passed to gevgen used to generate the events. {{{ $ PrepareGENIE -h PrepareGENIEEvents NUISANCE app. Takes GHep Outputs and prepares events for NUISANCE. PrepareGENIEEvents [-h,-help,--h,--help] [-i inputfile1.root,inputfile2.root,inputfile3.root,...] [-f flux_root_file.root,flux_hist_name] [-t target1,target2,...] Prepare Mode [Default] : Takes a single GHep file, reconstructs the original GENIE splines, and creates a duplicate file that also contains the flux, event rate, and xsec predictions that NUISANCE needs. Following options are required for Prepare Mode: [ -i inputfile.root ] : Reads in a single GHep input file that needs the xsec calculation ran on it. [ -f flux_file.root,hist_name ] : Path to root file containing the flux histogram the GHep records were generated with. A simple method is to point this to the flux histogram genie generatrs '-f /path/to/events/input-flux.root,spectrum'. [ -t target ] : Target that GHepRecords were generated with. Comma seperated list. E.g. for CH2 target=1000060120,1000010010,1000010010 }}} One important note to remember is that the target specification is not the same as the GENIE target fractions. You must give the target explicitly. e.g. 1 carbon and 2 hydrogen for CH2 would be given as {{{ $ PrepareGENIE -i ghep_events.root -f input-flux.root,spectrum -t 1000060120,1000010010,1000010010 }}} The PrepareGENIE app also needs write access to save the input flux and event rate predictions into the GHep event files themselves. = Using GENIE Inputs = Once GENIE inputs have been prepared they can be read into NUISANCE samples using the GENIE type when writing a card file {{{ sample MiniBooNE_CCQE_XSec_1DQ2_nu GENIE:/path/to/my/prepared/genie/file.root }}} = Using GENIE !ReWeight = GHep input predictions can be reweighted using the GENIE reweight engine that NUISANCE was built against. GENIE parameters are handled in the same way other parameters are, having the option to be treated as free or fixed. ''' Fixed +1 sigma axial mass reweight ''' Fixed prediction with MaCCQE reweighted to +1 sigma. {{{ genie_parameter MaCCQE 1.0 }}} ''' Fixed +1 sigma axial mass reweight ''' Fixed prediction with MaCCQE reweighted to +1 sigma. {{{ genie_parameter MaCCQE 1.0 -4.0 4.0 1.0 FIX }}} ''' Free variation of the axial mass ''' Tell NUISANCE the axial mass can be varied between -4.0 and 4.0 sigma with steps of +1.0 sigma, starting at +1.0 sigma. This is used in the nuismin and nuissyst apps. {{{ genie_parameter MaCCQE 1.0 -4.0 4.0 1.0 FREE }}} To see a list of dials look in '$GENIE/src/ReWeight/GSyst.h'.