#!/usr/bin/env python # This simple script adds the branch in the root tree called # weight which contains the weight to correct for the fact that # all neutrinos are forced to interact in the detector # # Author: Juande Zornoza # # Last modification of this line: 12-08-06 # from I3Tray import * from os.path import expandvars inphysfile = "test.i3.gz" outrootfile = "neutrino-generator.tree.root" if len(sys.argv) > 1: inphysfile = sys.argv[1] if len(sys.argv) > 2: outrootfile = sys.argv[2] load("libicetray") load("libdataclasses") load("libphys-services") load("libdataio") load("libanalysis-tree") load("libI3MCListRollingPin") load("libweightwatcher") tray = I3Tray() tray.AddService("I3ReaderServiceFactory","reader")( ("Filename", inphysfile), ("skipunregistered",True), ) tray.AddService("I3RootTreeServiceFactory","treeservice")( ("TreeFileName",outrootfile)) tray.AddModule("I3Muxer", "multiplex") tray.AddModule("I3MCListRollingPin","flattenmclist") tray.AddModule("InteractionWeight","interactionweight")( ("WeightDictLocation","I3MCWeightsDict"), ("WeightNames",["TotalInteractionProbability", "TotalColumnDepth", "TotalCrosssection"]), ) tray.AddModule("I3RootTreeModule","roottree")( ) tray.AddModule("I3MCTreeModule","mctree")( ("MCName","flatmclist"), ) tray.AddModule("Dump","dump") tray.AddModule("TrashCan", "bye") tray.Execute(10) tray.Finish()