I3GenieReaderSegment

Reads GENIE Generator variables and then, if OutputSystWeights == True adds systematic weights specified in SystWghtFileNameList.

This segment combines I3GenieTracReader (geometry resampling and GENIE event info conversion to .i3) and I3GenieSystWeightTracReader (GENIE systematic weights conversion to .i3) I3Modules.

Caution

Requires both GST and GRooTracker root-files to read generator variables. For systematic weights requires ReWeight output root-files.

Example usage

For the full example see resources/scripts/step1_genie.py

from icecube.icetray import I3Tray, I3Units
from icecube import phys_services, genie_reader

info = I3GenieInfo()
# fill input information in I3GenieInfo
# ...

tray = I3Tray()

# Random number generator
randomService = phys_services.I3SPRNGRandomService(
                                           seed = 1,
                                           nstreams = 10,
                                           streamnum = 1)

tray.AddModule("I3InfiniteSource","streams",
               Stream=icetray.I3Frame.DAQ)

tray.AddSegment(genie_reader.I3GenieReaderSegment, 'genie_reader',
                GenieFileGST = 'gntp.NuMu.A.1400002.gst.root',
                GenieFileGRooTracker = 'gntp.NuMu.A.1400002.gtrac.root',
                SystWghtFileNameList = ['systw.NuMu.A.1400002.MaCCRES.root', 'systw.NuMu.A.1400002.MaCCQE.root'],
                GenieInfo = info,
                RandomService=randomService,
                IceDensity = 0.93*I3Units.g/I3Units.cm3,
                GenVolCenter = I3Position(46.29,-34.88,-330.0),
                OutputResultDict = True)

Signature

class icecube.genie_reader.I3GenieReaderSegment(tray, name, GenieFileGST='', GenieFileGRooTracker='', SystWghtFileNameList=None, GenieInfo=None, IceDensity=5.804604062395718e+30, RandomService=None, ResultDictName='I3GenieResult', SystWghtDictName='I3GenieSystWeightDict', MCTreeName='I3MCTree', MCWeightDictName='I3MCWeightDict', OutputResultDict=True, OutputSystWeights=True, GenVolCenter=I3Position(0, 0, 0))

Reads GENIE Generator variables and then adds systematic weights from GENIE ReWeight.

Requires both GST and GRooTracker root-files to read generator variables.

For systematic weights requires ReWeight output root-files.

Parameters:
  • GenieFileGST (str, default='') – Name of the GENIE gst file to read events from.

  • GenieFileGRooTracker (str, default='') – Name of the GENIE gRooTracker file to read events from. Assumes that it is converted from the same GHEP file as the input gst file.

  • SystWghtFileNameList (list of str, default=None) – List of names for the GENIE reweight files to use. Assumes that they are generated for the same GHEP file as the input gst and gRooTracker files.

  • GenieInfo (I3GenieInfo (struct), default=None) – I3GenieInfo object with generation info (defined in simclasses).

  • IceDensity (float, default=0.93*I3Units.g/I3Units.cm3) – Ice density.

  • RandomService (default=None) – The I3RandomService we are going to use.

  • ResultDictName (str, default="I3GenieResult") – Name of the output I3GenieResult frame object.

  • SystWghtDictName (str, default="I3GenieSystWeightDict") – Name of the output systematic weight dictionary.

  • MCTreeName (str, default="I3MCTree") – Name of the output I3MCTree frame object.

  • MCWeightDictName (str, default=I3MCWeightDict") – Name of the output I3MCWeightDict frame object.

  • OutputResultDict (bool, default=True) – Choose whether or not to output I3GenieResult.

  • OutputSystWeights (bool, default=True) – Choose whether or not to output I3GenieSystWeightDict.

  • GenVolCenter (dataclasses.I3Position, default=I3Position(0.,0.,0.)*I3Units.m) – I3Position of generation volume center.

Output objects

I3GenieReaderSegment produces 5 types of output objects:

  • I3GenieInfo in S-Frame (for the description see I3GenieTracReader)

  • I3MCTree, I3MCWeightDict and I3GenieResult in Q-Frame (for the description see I3GenieTracReader)

  • I3GenieSystWeightDict in Q-Frame if OutputSystWeights == True and non-empty list of GENIE Reweight files is passes (for the description see I3GenieSystWeightTracReader)