def weight(x, y, z, zenith, azimuth, multiplicity, e, r): axis = dataclasses.I3Particle() axis.pos = dataclasses.I3Position(x, y, z) axis.dir = dataclasses.I3Direction(zenith, azimuth) assert multiplicity == 1 bundle = MuonGun.BundleConfiguration() bundle.append(MuonGun.BundleEntry(float(r), float(e))) return weighter(axis, bundle)
def effective_area(frame, model, generator): mctree = frame["I3MCTree"] primary = mctree.primaries[0] muon = mctree.get_daughters(primary)[0] bundle = MuonGun.BundleConfiguration([MuonGun.BundleEntry(0, muon.energy)]) area = 1 / generator.generated_events(primary, bundle) frame["MCMuon"] = muon frame["MuonEffectiveArea"] = dataclasses.I3Double(area) weighter = MuonGun.WeightCalculator(model, generator) weight = weighter(primary, bundle) frame["MuonWeight"] = dataclasses.I3Double(weight) return True