Index

src/helpers/invariant-mass.ts

atlasClassifyEvent
atlasClassifyEvent(tagCounts: Record)

Default event classifier for ATLAS Z-path masterclass. Classifies events by electron/muon/photon counts.

Parameters :
Name Type Optional
tagCounts Record No
Returns : string
fourMomentumFromCluster
fourMomentumFromCluster(userData: any)

Extract a 4-momentum vector from a calorimeter cluster. Clusters have energy, eta, phi (treated as massless).

Parameters :
Name Type Optional
userData any No
fourMomentumFromTrack
fourMomentumFromTrack(userData: any, mass: number)

Extract a 4-momentum vector from track userData. Tracks have pT, eta/phi (or dparams), and we assign mass from the tag definition.

Parameters :
Name Type Optional Description
userData any No

Track user data containing kinematic properties.

mass number No

Particle rest mass in MeV/c².

invariantMass
invariantMass(momenta)

Compute the invariant mass of a set of particles in MeV. M² = (ΣE)² - (Σpx)² - (Σpy)² - (Σpz)²

Parameters :
Name Optional
momenta No
Returns : number

src/helpers/event-summary.ts

buildEventSummaries
buildEventSummaries(eventsData: PhoenixEventsData)

Pre-scan all events and build a summary index. This is the main entry point for the event browser.

Parameters :
Name Type Optional
eventsData PhoenixEventsData No
Returns : EventSummary[]
computeMET
computeMET(eventData: PhoenixEventData)

Compute missing transverse energy magnitude from MET collections. Returns NaN if no MET data is present.

Parameters :
Name Type Optional
eventData PhoenixEventData No
Returns : number
countCollections
countCollections(eventData: PhoenixEventData)

Count all physics objects in a single event. Each collection type (Tracks, Jets, etc.) can have multiple named sub-collections.

Parameters :
Name Type Optional
eventData PhoenixEventData No
Returns : literal type
getAvailableColumns
getAvailableColumns(summaries)

Get all unique collection type names across all events. Reconstructed physics objects are listed first, detector-level types last.

Parameters :
Name Optional
summaries No
Returns : string[]
summarizeEvent
summarizeEvent(eventKey: string, eventData: PhoenixEventData)

Build a summary for a single event.

Parameters :
Name Type Optional
eventKey string No
eventData PhoenixEventData No
Returns : EventSummary

src/managers/session-manager/session-codec.ts

decodeSessionFromBase64
decodeSessionFromBase64(base64: string)

Decode a base64 deflate-compressed session payload, validate it, and cap the decompressed output to defend against compression bombs.

Parameters :
Name Type Optional Description
base64 string No

Base64 input from a URL parameter or share link.

Returns : Promise<SessionV1>

Validated SessionV1.

decodeSessionFromJson
decodeSessionFromJson(text: string)

Parse a raw JSON .phnxreplay file payload and validate it.

Parameters :
Name Type Optional Description
text string No

JSON text from a file upload.

Returns : SessionV1

Validated SessionV1.

encodeSessionToBase64
encodeSessionToBase64(session: SessionV1)

Encode a session as a URL-safe base64 string of deflate-compressed JSON. Mirrors the share-link-dialog state encoding so the decoder can use the existing DecompressionStream('deflate') plumbing.

Parameters :
Name Type Optional Description
session SessionV1 No

The session payload to encode.

Returns : Promise<string>

Base64 string suitable for ?replay= URLs.

encodeSessionToBlob
encodeSessionToBlob(session: SessionV1)

Serialize a session to a downloadable JSON Blob (compact, uncompressed) for sharing as a .phnxreplay file. Compact (not pretty-printed) keeps the file small while staying valid JSON that the ?session= loader can re-read.

Parameters :
Name Type Optional Description
session SessionV1 No

The session payload to serialize.

Returns : Blob

Blob with MIME type application/json.

pipeThroughStream
pipeThroughStream(input: Uint8Array, stream)

Pipe a Uint8Array through a transform stream and collect the output. Avoids Blob.stream() and Response, both of which jsdom lacks.

Parameters :
Name Type Optional Description
input Uint8Array No

Source bytes.

stream No

Transform stream (compression or decompression).

Returns : Promise<Uint8Array>

Concatenated output bytes.

src/managers/session-manager/session-manager.ts

errorMessage
errorMessage(e)

Extract a human-readable message from an unknown thrown value.

Parameters :
Name Optional Description
e No

The caught value.

Returns : string

The error message string.

src/loaders/object-type-registry.ts

getDefaultObjectTypeConfigs
getDefaultObjectTypeConfigs()

Returns default configs for all built-in Phoenix object types.

Returns : ObjectTypeConfig[]

src/managers/three-manager/color-manager.ts

getMaterialsColors
getMaterialsColors(object: Object3D)

Get the colors of the materials of an object, which are the colors it is drawn with.

Most materials have a color, but some - like the shader material jets are drawn with - keep it in a uniform instead.

Parameters :
Name Type Optional Description
object Object3D No

Object whose material colors are to be found.

Returns : Color[]

The colors of the object's materials, as references which can be changed to recolor the object.

getObjectColor
getObjectColor(object: Object3D)

Get the colour an object is currently drawn with.

This is the counterpart of setColorForObject and has to stay in step with it: it is used to show the collection's real colour in the UI, rather than guessing it from the event data.

Parameters :
Name Type Optional Description
object Object3D No

Object whose colour is to be read.

Returns : Color | undefined

The colour of the first coloured object found, or undefined if there is none.

setColorForObject
setColorForObject(object: Object3D, color: any)

Change colour of object.

Parameters :
Name Type Optional Description
object Object3D No

Object to be update

color any No

Color to set for the object.

src/managers/session-manager/session-player.ts

lerp
lerp(a: number, b: number, alpha: number)

Linear interpolation between two numbers.

Parameters :
Name Type Optional Description
a number No

Start value.

b number No

End value.

alpha number No

Fraction in [0, 1].

Returns : number

The interpolated value.

src/helpers/color-utils.ts

parseColor
parseColor(value: any)

Parse a colour as it may appear in event data.

Event data is written by many different producers, so the same colour turns up as ff0000, #ff0000 or 0xff0000. All three are accepted here, along with a number, an existing Color, and any style Color.set understands (rgb(...), hsl(...), or a named colour).

Anything unrecognised gives undefined rather than a silently wrong colour, so callers can fall back to a sensible default of their own - see EVENT_DATA_TYPE_COLORS.

Parameters :
Name Type Optional Description
value any No

Colour to parse.

Returns : Color | undefined

The parsed colour, or undefined if it could not be parsed.

src/managers/session-manager/session-format.ts

validateSession
validateSession(value)

Validate that an arbitrary value is a structurally-valid SessionV1. Defensive against malformed JSON, untrusted URL payloads and version skew from older or newer producers.

Parameters :
Name Optional Description
value No

The parsed-JSON value to validate.

Returns : SessionV1 | null

The value typed as SessionV1, or null when invalid.

results matching ""

    No results matching ""