From 878001166464a4f01334be70e50e502900a885b3 Mon Sep 17 00:00:00 2001 From: Jan Kieseler Date: Mon, 9 Oct 2023 14:08:27 +0200 Subject: [PATCH] vis stuff --- bind/G4Calo.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bind/G4Calo.py b/bind/G4Calo.py index ce9c794..385ae4d 100644 --- a/bind/G4Calo.py +++ b/bind/G4Calo.py @@ -33,7 +33,7 @@ class __G4System(_G4System): df = index_out_of_bounds_workaround(ttree["Hits;1"]) return df - def displayEvent(self, renderer=None): + def displayEvent(self, logE = False, renderer=None): # for loop over all layers to_plot = [] material_dict = {} @@ -99,6 +99,11 @@ class __G4System(_G4System): hwidth = sensor.getdx() /2. energy = sensor.getEnergy() + use_energy = float(energy / total_dep_energy) + if logE: + raise NotImplementedError + use_energy = np.log(use_energy+1.) # - np.log(total_dep_energy) + to_plot.append(go.Mesh3d( # 8 vertices of a cube x = np.array([-1, -1, 1, 1, -1, -1, 1, 1]) * hwidth + x_center, @@ -108,7 +113,7 @@ class __G4System(_G4System): flatshading=True, color='black', name='Sensor', - opacity= max(0.03, float(energy / total_dep_energy)), + opacity= max(0.03, use_energy), showlegend=False, ))