Skip to content

Commit

Permalink
Merge pull request #5 from Zehvogel/Zehvogel-patch-1
Browse files Browse the repository at this point in the history
Fix momentum and vertex distance calculation
  • Loading branch information
kjvbrt authored Apr 9, 2024
2 parents 607b584 + 9e96dbf commit 19dffb7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions js/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 19dffb7

Please sign in to comment.