From 9e96dbfe829aa734991cae8c53947c7dc42d53ca Mon Sep 17 00:00:00 2001 From: Leonhard Reichenbach Date: Thu, 21 Mar 2024 14:51:03 +0100 Subject: [PATCH] Fix momentum and vertex distance --- js/tools.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/tools.js b/js/tools.js index b4bb4b52..4afe095a 100644 --- a/js/tools.js +++ b/js/tools.js @@ -11,13 +11,13 @@ export function loadMCParticles(jsonData, eventNum, box.pdg = particle.PDG; box.genStatus = particle.generatorStatus; box.simStatus = particle.simulatorStatus; - box.momentum = Math.sqrt(Math.pow(particle.momentum.x, 2), - Math.pow(particle.momentum.y, 2), - Math.pow(particle.momentum.z, 2)); + box.momentum = Math.sqrt(Math.pow(particle.momentum.x, 2) + + Math.pow(particle.momentum.y, 2) + + Math.pow(particle.momentum.z, 2)); box.momentum = Math.round(box.momentum * 100) / 100; - box.vertex = Math.sqrt(Math.pow(particle.vertex.x, 2), - Math.pow(particle.vertex.y, 2), - Math.pow(particle.vertex.z, 2)); + box.vertex = Math.sqrt(Math.pow(particle.vertex.x, 2) + + Math.pow(particle.vertex.y, 2) + + Math.pow(particle.vertex.z, 2)); box.vertex = Math.round(box.vertex * 100) / 100; box.px = Math.round(particle.momentum.x * 100) / 100; box.py = Math.round(particle.momentum.y * 100) / 100;