def get_stream(phy_frame): if reco_q.is_data(phy_frame): return True if (phy_frame['I3EventHeader'].sub_event_stream == 'Final') & (phy_frame['I3EventHeader'].sub_event_id == 0): return True else: return False
def print_info(phy_frame): if reco_q.is_data(phy_frame): return True print('run_id {} ev_id {} dep_E {} classification {} signature {} track_length {}'.format( phy_frame['I3EventHeader'].run_id, phy_frame['I3EventHeader'].event_id, phy_frame['depE'].value, phy_frame['classification'].value, phy_frame['signature'].value, phy_frame['track_length'].value)) return
def atmo_weight(frame): if reco_q.is_data(frame): return True if 'I3MCWeightDict' not in phy_frame: return conv = frame['I3MCWeightDict']['OneWeight'] * flux_conv.getFlux( frame['I3MCWeightDict']['PrimaryNeutrinoType'], frame['MCPrimary1'].energy, np.cos(frame['MCPrimary1'].dir.zenith)) frame.Put("conv", dataclasses.I3Double(conv)) return
def calc_gen_ow(frame): if reco_q.is_data(frame): return True gen_w = generator(frame['MCPrimary1'].energy, frame['I3MCWeightDict']['PrimaryNeutrinoType'], np.cos(frame['MCPrimary1'].dir.zenith)) pint = frame['I3MCWeightDict']['TotalWeight'] ow = pint / gen_w / unit print('ow {}'.format(ow)) frame.Put("correct_ow", dataclasses.I3Double(ow)) return
def atmo_weight(frame): if reco_q.is_data(frame): return True flux = NewNuFlux.makeFlux('honda2006') flux.knee_reweighting_model = "gaisserH4a_elbert" conv = frame['correct_ow'].value * flux.getFlux( frame['I3MCWeightDict']['PrimaryNeutrinoType'], frame['MCPrimary1'].energy, np.cos(frame['MCPrimary1'].dir.zenith)) print('conv {}'.format(conv)) frame.Put("conv", dataclasses.I3Double(conv)) return
def add_weighted_primary(phy_frame): if reco_q.is_data(phy_frame): return True if not 'MCPrimary1' in phy_frame.keys(): get_weighted_primary(phy_frame, MCPrimary='MCPrimary1') return
def get_stream(phy_frame): if reco_q.is_data(phy_frame): return True return True
def get_primary(phy_frame): if reco_q.is_data(phy_frame): return True phy_frame.Put("MCTrack1", phy_frame['I3MCTree'][1]) return