Skip to content
Snippets Groups Projects
Commit 4ac4c4be authored by Stefan Reck's avatar Stefan Reck
Browse files

eliminate need for pandas in bundles.py; warn for exising calib only for hits

parent c444aa82
No related branches found
Tags v4.8.1
No related merge requests found
......@@ -226,12 +226,10 @@ class BundleMCExtractor:
# bundle diameter; only makes sense for 2+ muons
if len(mc_tracks_sel) >= 2:
positions_plane = get_plane_positions(
positions=mc_tracks_sel[["pos_x", "pos_y", "pos_z"]]
.to_dataframe()
.to_numpy(),
directions=mc_tracks_sel[["dir_x", "dir_y", "dir_z"]]
.to_dataframe()
.to_numpy(),
positions=np.concatenate(
[mc_tracks_sel[k][:, None] for k in ("pos_x", "pos_y", "pos_z")], axis=-1),
directions=np.concatenate(
[mc_tracks_sel[k][:, None] for k in ("dir_x", "dir_y", "dir_z")], axis=-1),
plane_point=self.plane_point,
plane_normal=plane_normal,
)
......
......@@ -462,15 +462,16 @@ class DetApplier(kp.Module):
self._cache_shift_center()
def process(self, blob):
if (self.calib_hits or self.calib_mchits) and self._calib_checked is False:
if "pos_x" in blob["Hits"]:
self.log.warn(
"Warning: Using a det file, but pos_x in Hits detected. "
"Is the file already calibrated? This might lead to "
"errors with t0."
)
self._calib_checked = True
if self.calib_hits:
if self._calib_checked is False:
if "pos_x" in blob["Hits"]:
self.log.warn(
"Warning: Using a det file, but pos_x in Hits detected. "
"Is the file already calibrated? This might lead to "
"errors with t0."
)
self._calib_checked = True
blob["Hits"] = self.calib.apply(
blob["Hits"], correct_slewing=self.correct_timeslew
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment