13def execute(muon_tagger_track_hits, drifttubes_track_hits, debug=0):
18 for i_muon_tagger_track
in muon_tagger_track_hits.keys():
20 one_muon_tagger_track = muon_tagger_track_hits[i_muon_tagger_track]
22 for i_drifttubes_track
in drifttubes_track_hits.keys():
24 one_drifttubes_track = drifttubes_track_hits[i_drifttubes_track]
32 atrack[
'drifttubes_track'] = one_drifttubes_track
33 atrack[
'muon_tagger_track'] = one_muon_tagger_track
34 track_hits[i_track] = atrack
39 print(
'i_muon_tagger_track: ', i_muon_tagger_track)
40 print(
'i_drifttubes_track: ', i_drifttubes_track)
61 for ahit
in muon_tagger_track[
'hits_x']:
62 z_coords.append([ahit[
'z']])
63 x_coords.append(ahit[
'xtop'])
65 for ahit
in drifttubes_track[
'34']:
66 z_coords.append([ahit[
'z']])
67 x_coords.append(ahit[
'xtop'])
70 print(
'z_coords:', z_coords)
71 print(
'x_coords:', x_coords)
74 reg = LinearRegression()
75 reg.fit(z_coords, x_coords)
78 x_coords_pred = reg.predict(z_coords)
81 rmse = np.sqrt(mean_squared_error(x_coords, x_coords_pred))