Пример #1
0
    def test_nearest_z1000_y0(self):
        """
            |-----------------------------------------------------|
            |                                                     |
            |                                                     |
          y |                                                   o |
            |                                                  / \|
            |                                                 /   |
            |------------------------------------------------/----|
                                        z
        """
        xyz = [0., 0., 1033.]
        col_idx, col_start, u_idx, u_start, v_idx, v_start = nearest_wire(
            xyz, return_start=True)

        u_crossing_botm = get_bottom_crossing(xyz, "u")
        v_crossing_side = get_side_corssing(xyz, "v")

        assert (np.allclose(u_start, u_crossing_botm, atol=0.6))
        assert (np.allclose(v_start, v_crossing_side, atol=0.6))
Пример #2
0
    def test_nearest_z500_y100(self):
        """
            |-----------------------------------------------------|
            |                          o                          |
            |                         / \                         |
          y |                        /   \                        |
            |                       /     \                       |
            |                      /       \                      |
            |---------------------/---------\---------------------|
                                        z
        """
        xyz = [0., 100., 500.]
        col_idx, col_start, u_idx, u_start, v_idx, v_start = nearest_wire(
            xyz, return_start=True)

        u_crossing_botm = get_bottom_crossing(xyz, "u")
        v_crossing_botm = get_bottom_crossing(xyz, "v")

        assert (np.allclose(u_start, u_crossing_botm, atol=0.6))
        assert (np.allclose(v_start, v_crossing_botm, atol=0.6))
Пример #3
0
    subrun)
np.set_printoptions(precision=4)

df = lard.LarData(filename)
df.read_ids()
df.read_hits(planes="u")
df.read_laser()

for evt in range(50):

    fig, axes = plt.subplots(3, 1)
    laser_data = df.get_laser(evt)

    laser_entry = [laser_data['entry_{}'.format(dim)] for dim in "xyz"]
    laser_exit = [laser_data['exit_{}'.format(dim)] for dim in "xyz"]
    laser_entry_wireidx = lark.nearest_wire(laser_entry)
    laser_exit_wireidx = lark.nearest_wire(laser_exit)

    event = evt
    for plane in reversed(range(3)):

        print(laser_entry_wireidx)
        print(laser_exit_wireidx)

        print(lard.get_wire(df, event, plane))

        track_z = get_z(df, event, plane)
        track_x = get_x(df, event, plane)
        width_x = get_x_width(df, event, plane)

        track_z = np.flipud(track_z)