= [ page being built ] = 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. = 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.