Example scripts for MC production with genie-reader

Two example scripts are provided, as well as example cluster submissin scripts: one is mimicking the step 1 of oscNext production and the other one is a generic generation script. For both of these scripts their operation consists of the two main parts:

  1. GENIE is ran through subprocess. First, events are generated with gevgen. Then output GHEP root-files are converted into both GST and gRooTracker formats using gntpc. After this, if non-empty list of systematics was passed, systematic weight files are generated with grwght1p.

  2. Resulting output files are passed to genie-reader, which samples event geometry and converts them to I3Files.

Caution

Unlike genie-icetray, gevgen and, consequently, the two described production scripts can not simulate a mix of neutrinos and antineutrinos. This means that, for example, in order to get NuMu and NuMuBar mix one would need to run the choosen script separately for NuMu and NuMuBar.

Step1 oscNext-style GENIE production

Location: reosurces/scripts/step1_genie.py.

This script is based on the script for the step 1 of oscNext neutrino production: http://code.icecube.wisc.edu/svn/sandbox/hignight/oscnext_scripts/step_1_genie.py. The main feature is that it uses predefined energy ranges with corresponding cylinder length and radius, as well as spectral indeces, which were optimized for oscNext. Also, if generated neutrino type is NuMu or NuMuBar, outgoing muon will be propagated with PROPOSAL.

Random seed

Random number generator seed in this script is calculated based on input parameters:

seed = int( str(run_id) + str(file_number) )

The same seed is used for both GENIE and IceTray random generators.

Arguments

The summary of the step1_genie.py arguments is provided here. The same information can also be accessed by running

$ python step1_genie.py --help

Main:

-o OUTPUT_FILE, –output-file OUTPUT_FILE (default: 'genie.i3')
Write output to OUTFILE (.i3{.gz} format)

-l FILENR, –filenr FILENR (default: 1)
File number, stream of I3SPRNGRandomService

-r RUN_ID, –run-id RUN_ID (default: 1)
The run number for this simulation, also the seed for random number simulations

-n N_EVENTS, –n-events N_EVENTS (default: 10000)
Number of events to generate

-f PRIMARY_TYPE, –primary-type PRIMARY_TYPE (default: 'NuE')
The flavor of the neutrino produced

–energy-range ENERGY_RANGE (default: 'P')
A=lowest, B=medium, C=high, D, Z, CUSTOM, AA (only for NuTau)

–elow ELOW (default: 100.0)
What is the lower energy bound in GeV (only used if energy range is CUSTOM)

–ehigh EHIGH (default: 9999.9)
What is the upper energy bound in GeV (only used if energy range is CUSTOM)

–radius RADIUS (default: 800.0)
Generation volume cylinder radius in m (only used if energy range is CUSTOM)

–length LENGTH (default: 16000.0)
Generation volume cylinder length in m (only used if energyrange is CUSTOM)

–min-zenith MIN_ZENITH (default: 0*I3Units.degree)
Lower limit of allowed zenith range

–max-zenith MAX_ZENITH (default: 180*I3Units.degree)
Higher limit of allowed zenith range

–min-azimuth MIN_AZIMUTH (default: 0*I3Units.degree)
Lower limit of allowed azimuth range

–max-azimuth MAX_AZIMUTH (default: 360*I3Units.degree)
Higher limit of allowed azimuth range

–power-law-index POWER_LAW_INDEX (default: 2)
Flux power law index (\(\gamma\))

–oxygen-fraction OXYGEN_FRACTION (default: 0.8881016)
Oxigen fraction in ice

–cross-section CROSS_SECTION (default: '/cvmfs/icecube.opensciencegrid.org/users/mliubarska/py2-v3.1.1/GENIE/xsec_splines/GENIE_2_12_8_Water_splines.xml')
GENIE cross section splines (.xml format)

–free-nucl-target (default: False)
Use n-p target?

Select specific GENIE tune or event generato list (optional):

–genie-tune GENIE_TUNE (default: '')
GENIE comprehensive neutrino interaction model tune
(for GENIE v3)

–event-generator-list EVENT_GENERATOR_LIST (default: '')
GENIE event generator list

GENIE Reweight configuration:

–syst-list SYST_LIST [SYST_LIST …] (default: ['MaCCRES','MaNCRES','MaCCQE','MaNCEL','MaCOHpi','AhtBY','BhtBY','CV1uBY','CV2uBY'])
List of genie systematics to calculate

–n-tweaks N_TWEAKS (default: 4)
Number of tweak points for systematic weight calculation

–min-tweak MIN_TWEAK (default: -2)
Min tweak point (in sigmas)

–max-tweak MAX_TWEAK (default: 2)
Max tweak point (in sigmas)

It is possible to not delete intermediate GENIE files after conversion:

–save-genie-files (default: False)
Do not delete intermediate GENIE files

Subprocess environment setup (will only affect GENIE):

–env-workdir ENV_WORKDIR (default: '/cvmfs/icecube.opensciencegrid.org/users/mliubarska/py2-v3.1.1/GENIE/R-2_12_8')
WORKDIR enviromental variable for generation

–env-log4cpp ENV_LOG4CPP (default: '')
LOG4CPP enviromental variable for generation

–env-rootsys ENV_ROOTSYS (default: '/cvmfs/icecube.opensciencegrid.org/users/mliubarska/py2-v3.1.1/ROOT/build-6.09.02')
ROOTSYS enviromental variable for generation

–env-pythia ENV_PYTHIA (default: '/cvmfs/icecube.opensciencegrid.org/py2-v3.1.1/RHEL_7_x86_64/lib')
PYTHIA6 enviromental variable for generation

–env-lhapdf ENV_LHAPDF (default: '/cvmfs/icecube.opensciencegrid.org/py2-v3.1.1/RHEL_7_x86_64/lib')
LHAPDF enviromental variable for generation

–env-lhapath ENV_LHAPATH (default: '')
LHAPATH enviromental variable for generation (path to PDFs)

Generic GENIE production

Location: reosurces/scripts/genie-generator.py.

This script is similar to step1_genie.py, the main differences being that energy and cylinder parameters need to be specified directly (predifined energy ranges aren’t available). The same applies to the seed - it is not composed from other input parameters and should be specified directly.

With this outgoing muon (or any other particle) is not propagated in the ice.

Random seed

If random number generator seed is provided through the corresponding argument, the provided number will be used. Is seed is not specified, file number (filenr) will be used instead.

Arguments

The summary of the genie-generator.py arguments is provided here. The same information can also be accessed by running

$ python genie-generator.py --help

Main:

-o OUTPUT_FILE, –output-file OUTPUT_FILE (default: 'genie.i3')
Write output to OUTFILE (.i3{.gz} format)

-l FILENR, –filenr FILENR (default: 1)
File number, stream of I3SPRNGRandomService

-r RUN_ID, –run-id RUN_ID (default: 1)
The run number for this simulation, also the seed for random number simulations

-n N_EVENTS, –n-events N_EVENTS (default: 10000)
Number of events to generate

-f PRIMARY_TYPE, –primary-type PRIMARY_TYPE (default: 'NuE')
The flavor of the neutrino produced

–cylinder-height HEIGHT (default: 1950.*I3Units.m)
Generation volume cylinder hight

–cylinder-radius RADIUS (default: 1200.*I3Units.m)
Generation volume cylinder radius

–min-zenith MIN_ZENITH (default: 0*I3Units.degree)
Lower limit of allowed zenith range

–max-zenith MAX_ZENITH (default: 180*I3Units.degree)
Higher limit of allowed zenith range

–min-azimuth MIN_AZIMUTH (default: 0*I3Units.degree)
Lower limit of allowed azimuth range

–max-azimuth MAX_AZIMUTH (default: 360*I3Units.degree)
Higher limit of allowed azimuth range

–min-energy MIN_ENERGY (default: 1)
What is the lower energy bound in GeV

–max-energy MAX_ENERGY (default: 1)
What is the upper energy bound in GeV

–power-law-index POWER_LAW_INDEX (default: 2)
Flux power law index (\(\gamma\))

–oxygen-fraction OXYGEN_FRACTION (default: 0.8881016)
Oxigen fraction in ice

–cross-section CROSS_SECTION (default: '/cvmfs/icecube.opensciencegrid.org/users/mliubarska/py2-v3.1.1/GENIE/xsec_splines/GENIE_2_12_8_Water_splines.xml')
GENIE cross section splines (.xml format)

–genie-seed GENIE_SEED (default: None)
Random number generator seed for gevgen and I3SPRNGRandomService.
If None, filenr will be used as a seed.

GENIE Reweight configuration:

–syst-list SYST_LIST [SYST_LIST …] (default: ['MaCCRES','MaNCRES','MaCCQE','MaNCEL','MaCOHpi','AhtBY','BhtBY','CV1uBY','CV2uBY'])
List of genie systematics to calculate

–n-tweaks N_TWEAKS (default: 4)
Number of tweak points for systematic weight calculation

–min-tweak MIN_TWEAK (default: -2)
Min tweak point (in sigmas)

–max-tweak MAX_TWEAK (default: 2)
Max tweak point (in sigmas)

It is possible to not delete intermediate GENIE files after conversion:

–save-genie-files (default: False)
Do not delete intermediate GENIE files

Subprocess environment setup (will only affect GENIE):

–env-workdir ENV_WORKDIR (default: '/cvmfs/icecube.opensciencegrid.org/users/mliubarska/py2-v3.1.1/GENIE/R-2_12_8')
WORKDIR enviromental variable for generation

–env-log4cpp ENV_LOG4CPP (default: '')
LOG4CPP enviromental variable for generation

–env-rootsys ENV_ROOTSYS (default: '/cvmfs/icecube.opensciencegrid.org/users/mliubarska/py2-v3.1.1/ROOT/build-6.09.02')
ROOTSYS enviromental variable for generation

–env-pythia ENV_PYTHIA (default: '/cvmfs/icecube.opensciencegrid.org/py2-v3.1.1/RHEL_7_x86_64/lib')
PYTHIA6 enviromental variable for generation

–env-lhapdf ENV_LHAPDF (default: '/cvmfs/icecube.opensciencegrid.org/py2-v3.1.1/RHEL_7_x86_64/lib')
LHAPDF enviromental variable for generation

–env-lhapath ENV_LHAPATH (default: '')
LHAPATH enviromental variable for generation (path to PDFs)