Exemple #1
0
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
Exemple #2
0
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
Exemple #3
0
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
Exemple #4
0
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
Exemple #5
0
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
Exemple #6
0
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
Exemple #7
0
def get_stream(phy_frame):
    if reco_q.is_data(phy_frame):
        return True
    return True
Exemple #8
0
def get_primary(phy_frame):
    if reco_q.is_data(phy_frame):
        return True
    phy_frame.Put("MCTrack1", phy_frame['I3MCTree'][1])
    return