src/loaders/lhcb-loader.ts
PhoenixLoader for processing and loading an LHCb event.
Properties |
|
Methods |
|
constructor()
|
Defined in src/loaders/lhcb-loader.ts:8
|
Constructor for the LHCb loader. |
Private data |
Type : any
|
Defined in src/loaders/lhcb-loader.ts:8
|
Event data to be processed. |
Protected eventData |
Type : any
|
Inherited from
PhoenixLoader
|
Defined in
PhoenixLoader:26
|
Event data processed by the loader. |
Private graphicsLibrary |
Type : ThreeManager
|
Inherited from
PhoenixLoader
|
Defined in
PhoenixLoader:22
|
ThreeService to perform three.js related functions. |
Protected labelsObject |
Type : literal type
|
Default value : {}
|
Inherited from
PhoenixLoader
|
Defined in
PhoenixLoader:32
|
Object containing event object labels. |
Protected loadingManager |
Type : LoadingManager
|
Inherited from
PhoenixLoader
|
Defined in
PhoenixLoader:28
|
Loading manager for loadable resources |
Protected stateManager |
Type : StateManager
|
Inherited from
PhoenixLoader
|
Defined in
PhoenixLoader:30
|
Loading manager for loadable resources |
Private ui |
Type : UIManager
|
Inherited from
PhoenixLoader
|
Defined in
PhoenixLoader:24
|
UIService to perform UI related functions. |
Public getEventData |
getEventData()
|
Defined in src/loaders/lhcb-loader.ts:31
|
Process and get the event data.
Returns :
any
The processed event data. |
getEventMetadata |
getEventMetadata()
|
Inherited from
PhoenixLoader
|
Defined in
PhoenixLoader:62
|
Get LHCb specific metadata associated to the event (experiment info, time, run, event...).
Returns :
any[]
Metadata of the event. |
Public process | ||||||||
process(data: any)
|
||||||||
Defined in src/loaders/lhcb-loader.ts:22
|
||||||||
Set the event data for the loader.
Parameters :
Returns :
void
|
Private addCollection | ||||||||||||||||||||||||
addCollection(objectCollection: any, collectionName: string, getObject: (object: any) => void, objectGroup: Group, concatonateObjs: boolean)
|
||||||||||||||||||||||||
Inherited from
PhoenixLoader
|
||||||||||||||||||||||||
Defined in
PhoenixLoader:477
|
||||||||||||||||||||||||
Adds to the event display all the objects inside a collection.
Parameters :
Returns :
void
|
Public addLabelToEventObject | ||||||||||||||||
addLabelToEventObject(label: string, collection: string, indexInCollection: number)
|
||||||||||||||||
Inherited from
PhoenixLoader
|
||||||||||||||||
Defined in
PhoenixLoader:663
|
||||||||||||||||
Add label of event object to the labels object.
Parameters :
Returns :
string
A unique label ID string. |
Protected addObjectType | |||||||||||||||||||||||||||||||||||
addObjectType(object: any, getObject: any, typeName: string, concatonateObjs: boolean, cuts?: Cut[], extendEventDataTypeUI?: (typeFolder?: GUI,typeFolderPM?: PhoenixMenuNode) => void)
|
|||||||||||||||||||||||||||||||||||
Inherited from
PhoenixLoader
|
|||||||||||||||||||||||||||||||||||
Defined in
PhoenixLoader:415
|
|||||||||||||||||||||||||||||||||||
Adds to the event display all collections of a given object type.
Parameters :
Returns :
void
|
Public addScaleOptions | ||||||||||||||||
addScaleOptions(configKey: string, configLabel: string, scaleFunction: (value: number) => void)
|
||||||||||||||||
Inherited from
PhoenixLoader
|
||||||||||||||||
Defined in
PhoenixLoader:697
|
||||||||||||||||
Get function to add options to scale event object type by.
Parameters :
Function which adds scale options to Phoenix menu and dat.GUI menu. |
Public buildEventData | ||||||||||||||||||||
buildEventData(eventData: any, graphicsLibrary: ThreeManager, ui: UIManager, infoLogger: InfoLogger)
|
||||||||||||||||||||
Inherited from
PhoenixLoader
|
||||||||||||||||||||
Defined in
PhoenixLoader:50
|
||||||||||||||||||||
Takes an object that represents ONE event and takes care of adding the different objects to the graphics library and the UI controls.
Parameters :
Returns :
void
|
Public getCollection | ||||||||
getCollection(collectionName: string)
|
||||||||
Inherited from
PhoenixLoader
|
||||||||
Defined in
PhoenixLoader:126
|
||||||||
Get the collection with the given collection name from the event data.
Parameters :
Returns :
any
An object containing the collection. |
Public getCollections |
getCollections()
|
Inherited from
PhoenixLoader
|
Defined in
PhoenixLoader:102
|
Get list of collections in the event data.
Returns :
string[]
List of all collection names. |
Protected getCompound | ||||||||
getCompound(params: any)
|
||||||||
Inherited from
PhoenixLoader
|
||||||||
Defined in
PhoenixLoader:529
|
||||||||
Process the compound object (e.g. Muon, Electron, Photon) from the given parameters and get it as a group. FIXME. This is currently here and not in PhoenixObjects because we need to handle linked objects.
Parameters :
Returns :
Object3D
Muon group containing Clusters and Tracks. |
Public getEventsList | ||||||||
getEventsList(eventsData: any)
|
||||||||
Inherited from
PhoenixLoader
|
||||||||
Defined in
PhoenixLoader:86
|
||||||||
Get the list of event names from the event data.
Parameters :
Returns :
string[]
List of event names. |
Public getLabelsObject |
getLabelsObject()
|
Inherited from
PhoenixLoader
|
Defined in
PhoenixLoader:686
|
Get the object containing labels.
Returns :
literal type
The labels object. |
Private getObjectTypeCollections | ||||||||
getObjectTypeCollections(object: any)
|
||||||||
Inherited from
PhoenixLoader
|
||||||||
Defined in
PhoenixLoader:511
|
||||||||
Get collection names of a given object type.
Parameters :
Returns :
string[]
List of collection names of an object type (Tracks, Jets, CaloClusters etc.). |
Protected loadObjectTypes | ||||||||
loadObjectTypes(eventData: any)
|
||||||||
Inherited from
PhoenixLoader
|
||||||||
Defined in
PhoenixLoader:147
|
||||||||
Receives an object containing the data from an event and parses it to reconstruct the different collections of physics objects.
Parameters :
Returns :
void
|
import { PhoenixLoader } from './phoenix-loader';
/**
* PhoenixLoader for processing and loading an LHCb event.
*/
export class LHCbLoader extends PhoenixLoader {
/** Event data to be processed. */
private data: any;
/**
* Constructor for the LHCb loader.
*/
constructor() {
super();
this.data = {};
}
/**
* Set the event data for the loader.
* @param data Event data as JSON.
*/
public process(data: any) {
console.log('Processing event data');
this.data = data;
}
/**
* Process and get the event data.
* @returns The processed event data.
*/
public getEventData(): any {
const eventData = {
eventNumber: this.data.eventNumber,
runNumber: this.data.runNumber,
Hits: {},
Tracks: {},
};
const part_list = [];
const pdata_list = this.data.PARTICLES;
if (pdata_list) {
for (let j = 0; j < pdata_list.length; j++) {
const pdata = pdata_list[j];
const mom =
Math.pow(pdata.px, 2) + Math.pow(pdata.py, 2) + Math.pow(pdata.pz, 2);
const part = {
particle_id: pdata.name,
pos: pdata.track,
mom,
};
part_list.push(part);
}
}
eventData.Tracks = { Particles: part_list };
return eventData;
}
/**
* Get LHCb specific metadata associated to the event (experiment info, time, run, event...).
* @returns Metadata of the event.
*/
getEventMetadata(): any[] {
const metadata = super.getEventMetadata();
if (this.data['time']) {
metadata.push({
label: 'Data recorded',
value: this.data['time'],
});
}
return metadata;
}
}