diff --git a/packages/phoenix-event-display/src/loaders/jivexml-loader.ts b/packages/phoenix-event-display/src/loaders/jivexml-loader.ts index 810dd15e5..4e761aac1 100644 --- a/packages/phoenix-event-display/src/loaders/jivexml-loader.ts +++ b/packages/phoenix-event-display/src/loaders/jivexml-loader.ts @@ -243,7 +243,7 @@ export class JiveXMLLoader extends PhoenixLoader { track.pos = pos; } // Now loop over hits, and if possible, see if we can extend the track - if (numHits.length>0) { + if (numHits.length > 0) { let hitIdentifier = 0; let distance = 0.0; let found = false; @@ -324,7 +324,7 @@ export class JiveXMLLoader extends PhoenixLoader { eventData.Hits.SCT = []; for (let i = 0; i < numOfSCTClusters; i++) { - let sct = { pos: [], id: 0, phiModule:0, side:0 }; + let sct = { pos: [], id: 0, phiModule: 0, side: 0 }; sct.pos = [x0[i] * 10.0, y0[i] * 10.0, z0[i] * 10.0]; sct.id = id[i]; sct.phiModule = phiModule[i]; @@ -353,7 +353,10 @@ export class JiveXMLLoader extends PhoenixLoader { const rhoz = this.getNumberArrayFromHTML(dcHTML, 'rhoz'); const sub = this.getNumberArrayFromHTML(dcHTML, 'sub'); const threshold = this.getNumberArrayFromHTML(dcHTML, 'threshold'); - const timeOverThreshold = this.getNumberArrayFromHTML(dcHTML, 'timeOverThreshold'); + const timeOverThreshold = this.getNumberArrayFromHTML( + dcHTML, + 'timeOverThreshold' + ); eventData.Hits.TRT = []; @@ -366,7 +369,7 @@ export class JiveXMLLoader extends PhoenixLoader { driftR: 0.0, threshold: 0.0, timeOverThreshold: 0.0, - noise: false + noise: false, }; if (sub[i] == 1 || sub[i] == 2) { @@ -376,7 +379,8 @@ export class JiveXMLLoader extends PhoenixLoader { trt.pos = [ Math.cos(phi[i]) * rhoz[i] * 10.0, Math.sin(phi[i]) * rhoz[i] * 10.0, - z1, Math.cos(phi[i]) * rhoz[i] * 10.0, + z1, + Math.cos(phi[i]) * rhoz[i] * 10.0, Math.sin(phi[i]) * rhoz[i] * 10.0, z2, ]; @@ -419,8 +423,8 @@ export class JiveXMLLoader extends PhoenixLoader { const dcHTML = firstEvent.getElementsByTagName(name)[0]; // Bit of a nasty hack, but JiveXML stores CSCs as CSCD for some reason. - if (name=='CSCD') name = 'CSC'; - + if (name == 'CSCD') name = 'CSC'; + const numOfDC = Number(dcHTML.getAttribute('count')); const x = this.getNumberArrayFromHTML(dcHTML, 'x'); const y = this.getNumberArrayFromHTML(dcHTML, 'y'); diff --git a/packages/phoenix-event-display/src/loaders/objects/phoenix-objects.ts b/packages/phoenix-event-display/src/loaders/objects/phoenix-objects.ts index e0de12069..63b7ac8cf 100644 --- a/packages/phoenix-event-display/src/loaders/objects/phoenix-objects.ts +++ b/packages/phoenix-event-display/src/loaders/objects/phoenix-objects.ts @@ -70,7 +70,7 @@ export class PhoenixObjects { positions = RKHelper.extrapolateTrackPositions(trackParams, inBounds); } - } + } // Check again, in case there was an issue with the extrapolation. if (positions.length < 3) { @@ -196,42 +196,53 @@ export class PhoenixObjects { * @param type Tells Phoenix how to draw this - currently can be Point (default), or Line. * @returns Hits object. */ - public static getHits(hitsParams: [ { pos:[], type?: string }]): Object3D { + public static getHits(hitsParams: [{ pos: []; type?: string }]): Object3D { let hitsParamsClone = hitsParams; - let type:string = 'Point'; // Default is point and 3 coordinates per hit + let type: string = 'Point'; // Default is point and 3 coordinates per hit let coordlength = 3; - if (hitsParams.length>1){ + if (hitsParams.length > 1) { // Peek at first one. Would be better to make these properties of the collections. if ('type' in hitsParams[0]) { type = hitsParams[0].type; - coordlength=6; + coordlength = 6; } } // attributes - const pointPos = new Float32Array(hitsParams.length*coordlength); + const pointPos = new Float32Array(hitsParams.length * coordlength); let i = 0; let imax = 0; for (const hit of hitsParams) { - imax = i+coordlength; - for (let j=0 ; j