Skip to content

Commit

Permalink
fix(event-display): fix eta calculation for JiveXML
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwardMoyse committed May 13, 2021
1 parent e081ea1 commit 6dbd797
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packages/phoenix-event-display/src/loaders/jivexml-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,20 +257,24 @@ export class JiveXMLLoader extends PhoenixLoader {
if (numDoF.length >= i) track.dof = numDoF[i];
if (trackAuthor.length >= i) track.author = trackAuthor[i];

const theta = Math.tan(cotTheta[i]);
let theta = Math.atan(1 / cotTheta[i]);

track.pT = Math.abs(pT[i]);
const momentum = (pT[i] / Math.sin(theta)) * 1000; // JiveXML uses GeV
track.dparams = [d0[i], z0[i], phi0[i], theta, 1.0 / momentum];
track.phi = phi0[i];

// if (track.phi == 1.37786) {
if (false && i === 0) {
console.log('Cuplrit found! Index = ', i);
debugTrack = true;
storeTrack = true;
// if (i === 0) {
// console.log('Cuplrit found! Index = ', i);
// debugTrack = true;
// storeTrack = true;
// }

if (theta < 0) {
theta += Math.PI;
// TODO - check if we need to flip phi here?
}

// FIXME - should probably handle this better ... what if phi = 4PI for example?
if (track.phi > Math.PI) {
track.phi -= 2.0 * Math.PI;
Expand Down

0 comments on commit 6dbd797

Please sign in to comment.