def todet(frame, surface):
    detmu = MuonGun.muons_at_surface(frame, surface)
    for i in range(len(detmu)):
        frame['EnteringMuon_' + str(i)] = detmu[i]
    if ('EnteringMuon_0'
        ) not in frame:  #does not contain an intersecting muon, toss it
        return False
    else:
        return True
def SurfEneCut(frame):
  dcPart = MuonGun.muons_at_surface(frame,dcSurface)
  max_ene = 0
#  if(frame.Has('I3MCTree')):
#    if(frame["I3MCTree"].most_energetic_muon):
#      if(frame["I3MCTree"].most_energetic_muon.energy<500):
#        return False
#    else:
#      return False
#  else:
#    return False
  if(len(dcPart)>0):
    for i in xrange(len(dcPart)):
      if(dcPart[i].energy>max_ene):
        max_ene = dcPart[i].energy
    if(max_ene>0):
#      print max_ene, len(dcPart)
      return True
    else:
      return False
  else:
    return False 
def todet(frame, surface):
    detmu = MuonGun.muons_at_surface(frame, surface)
    #print "multi: " + str(len(detmu))
    for i in range(len(detmu)):
        frame['EnteringMuon_' + str(i)] = detmu[i]
            elif "9255" in filename: w /= 95000.0
            elif "10282" in filename w /= 11200.0
            elif "10309" in filename w /= 12200.0
            elif "10369" in filename w /= 400.0
            elif "11905" in filename w /= 90000.0
            elif "12268" in filename w /= 96000.0
            elif "12332" in filename w /= 99000.0

            # Now, we want the primary. Let's get it
            primary = dataclasses.get_most_energetic_primary(frame["I3MCTree"])
            muon = dataclasses.get_most_energetic_muon(frame["I3MCTree"])


            # Propagate the muons muons to the MuonGun generating surface
            outSurface = Cylinder(1600*I3Units.m, 800*I3Units.m)
            partVec = MuonGun.muons_at_surface(frame, outSurface)

            muongun_energy = 1e-9
            for p in partVec:
                if p.energy > muongun_energy:
                    muongun_energy = p.energy                    

            weights.append(w)
            energy_of_primary.append(primary.energy)
            energy_at_depth.append(muongun_energy)
            coszens.append(numpy.cos(muon.dir.zenith))
	    code_of_primary.append(primary.pdg_encoding)
	    if not id_1000160320 and primary.pdg_encoding == 1000160320:
		print '1000160320 = %s'%primary.type
		id_1000160320 = True
	    if not id_1000080160 and primary.pdg_encoding == 1000080160:
Example #5
0
def muonstodet(frame, surface):
    detmu = MuonGun.muons_at_surface(frame, surface)
    for i in range(len(detmu)):
        frame['EnteringMuon_' + str(i)] = detmu[i]