From 57fc1bc1188c30329c046af366d81aa9b17793da Mon Sep 17 00:00:00 2001
From: Valentin Pestel <vpestel@km3net.de>
Date: Tue, 2 Nov 2021 10:35:15 +0000
Subject: [PATCH] Resolve "Hit amplitude not available when reading offline
 data"

---
 km3io/offline.py      | 2 +-
 tests/test_offline.py | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/km3io/offline.py b/km3io/offline.py
index 1ff2218..a811ae4 100644
--- a/km3io/offline.py
+++ b/km3io/offline.py
@@ -41,7 +41,7 @@ class OfflineReader(EventReader):
             "dir_y": "hits.dir.y",
             "dir_z": "hits.dir.z",
             "tot": "hits.tot",
-            "a": "mc_hits.a",  # hit amplitude (in p.e.)
+            "a": "hits.a",  # hit amplitude (in p.e.)
             "trig": "hits.trig",  # non-zero if the hit is a triggered hit
         },
         "mc_hits": {
diff --git a/tests/test_offline.py b/tests/test_offline.py
index 8adda39..b4310b4 100644
--- a/tests/test_offline.py
+++ b/tests/test_offline.py
@@ -406,6 +406,7 @@ class TestOfflineHits(unittest.TestCase):
         assert "channel_id" in self.hits.fields
         assert "t" in self.hits.fields
         assert "tot" in self.hits.fields
+        assert "a" in self.hits.fields
         assert "trig" in self.hits.fields
         assert "id" in self.hits.fields
 
-- 
GitLab