Beispiel #1
0
from icecube import phys_services, simclasses, MuonGun
from I3Tray import I3Tray
from os.path import expandvars

tray = I3Tray()

tray.context['I3RandomService'] = phys_services.I3GSLRandomService(1337)

from icecube.MuonGun.segments import GenerateBundles
outer = MuonGun.Cylinder(1600, 800)
inner = MuonGun.Cylinder(300, 150, dataclasses.I3Position(0, 0, -350))
spectrum = MuonGun.OffsetPowerLaw(5, 1e3, 1e1, 1e4)
model = MuonGun.load_model('GaisserH4a_atmod12_SIBYLL')
generator = MuonGun.EnergyDependentSurfaceInjector(
    outer, model.flux, spectrum, model.radius,
    MuonGun.ConstantSurfaceScalingFunction(inner))
tray.AddSegment(
    GenerateBundles,
    'BundleGen',
    NEvents=1000,
    Generator=generator,
    GCDFile=expandvars(
        '$I3_TESTDATA/GCD/GeoCalibDetectorStatus_IC86.55697_corrected_V2.i3.gz'
    ))


class Harvest(icetray.I3ConditionalModule):
    def __init__(self, context):
        super(Harvest, self).__init__(context)
        self.AddOutBox("OutBox")
Beispiel #2
0
model = MuonGun.load_model('GaisserH4a_atmod12_SIBYLL')
model.flux.min_multiplicity = 1
model.flux.max_multiplicity = 1
#Inner and outher target surfaces
outSurface = Cylinder(1600 * I3Units.m, 800 * I3Units.m)
inSurface = Cylinder(500 * I3Units.m, 150 * I3Units.m,
                     I3Position(46.3, -34.9, -300))
#Sets energy and spectral index of muons
#Jackob's spectrum
#spectrum = MuonGun.OffsetPowerLaw(5.0, 5e2, 200, 1e6)
spectrum = MuonGun.OffsetPowerLaw(5.0, 7e2, int(sys.argv[2]), int(sys.argv[3]))
#spectrum = MuonGun.OffsetPowerLaw(5.2, 7e2, 150, 1e5)
#spectrum = MuonGun.OffsetPowerLaw(2, 1e3, 1e3, 1e5)

#This version only aims at inSurface, but muons originate at outSurface
scaling = MuonGun.ConstantSurfaceScalingFunction(inSurface)
#generator = MuonGun.EnergyDependentSurfaceInjector(outSurface, model.flux, spectrum, model.radius, scaling,0,1)
generator = MuonGun.EnergyDependentSurfaceInjector(outSurface, model.flux,
                                                   spectrum, model.radius,
                                                   scaling)
#This version aims at whatever surface you give it, but originates all the muons inside the surface, not at the top layer of ice
#generator = MuonGun.StaticSurfaceInjector(surface, model.flux, spectrum, model.radius)
#Not sure yet what this does?
# generator = MuonGun.Floodlight()

# set up a random number generator
randomService = phys_services.I3SPRNGRandomService(seed=options.SEED * 2,
                                                   nstreams=10000,
                                                   streamnum=options.RUNNUMBER)

tray.context['I3RandomService'] = randomService