Back to home page

EIC code displayed by LXR

 
 

    


Warning, /firebird/packages/firebird-ng/api/src/lib/config-keys.ts is written in an unsupported language. File is not indexed.

0001 /**
0002  * The config keys Firebird itself reads, each with its one default and
0003  * validator. Every place that reads or writes one of these keys declares it
0004  * from the schema here (`config.declare(ROOT_EVENT_RANGE_CONFIG)`), so the
0005  * default cannot drift between readers. In development builds
0006  * `ConfigService` warns when a key is declared twice with different
0007  * defaults or validators.
0008  *
0009  * Plain constants on purpose: initial-bundle code (loaders, command
0010  * handlers) and lazy pages import this module, so it must not import the
0011  * display stack.
0012  */
0013 
0014 import { type ConfigSchema, isPersistableUrl } from '@dexvis/app-features';
0015 
0016 // ---------------------------------------------------------------------------
0017 // What the display loads (the data selector writes these; deep links,
0018 // config.jsonc and the config page use the same keys)
0019 // ---------------------------------------------------------------------------
0020 
0021 /** Detector geometry URL. The app-level default arrives through `withDefaultGeometry()`. */
0022 export const GEOMETRY_URL_CONFIG: ConfigSchema<string> = {
0023   key: 'geometry.selectedGeometry', default: '', validator: isPersistableUrl,
0024 };
0025 
0026 /** DEX event file URL (`.firebird.json` or `.zip`). */
0027 export const DEX_EVENTS_SOURCE_CONFIG: ConfigSchema<string> = {
0028   key: 'events.dexEventsSource', default: '', validator: isPersistableUrl,
0029 };
0030 
0031 /** ROOT event file URL, converted to DEX in the browser or by pyrobird. */
0032 export const ROOT_EVENTS_SOURCE_CONFIG: ConfigSchema<string> = {
0033   key: 'events.rootEventSource', default: '', validator: isPersistableUrl,
0034 };
0035 
0036 /** Entries a ROOT event source converts: '0', '0-4', '1,3,5-7'. */
0037 export const ROOT_EVENT_RANGE_CONFIG: ConfigSchema<string> = {
0038   key: 'events.rootEventRange', default: '0',
0039 };
0040 
0041 /**
0042  * Collection groups a ROOT event source converts, comma separated ('' = all):
0043  * 'tracker_hits,mc_particles', the names of `pyrobird convert --collections`.
0044  * Both ROOT event loaders (browser and server conversion) honor it.
0045  */
0046 export const ROOT_COLLECTIONS_CONFIG: ConfigSchema<string> = {
0047   key: 'events.rootCollections', default: '',
0048 };
0049 
0050 /**
0051  * EDM4hep sim hit collections that the browser conversion keeps out of
0052  * MC-truth trajectories, comma separated ('' = none); they still show as hits.
0053  * Packs list their Cherenkov/PID collections here through
0054  * `withConfigDefaults()`. The server conversion applies pyrobird's own list.
0055  */
0056 export const TRAJECTORY_EXCLUDED_COLLECTIONS_CONFIG: ConfigSchema<string> = {
0057   key: 'events.trajectoryExcludedCollections', default: '',
0058 };
0059 
0060 // ---------------------------------------------------------------------------
0061 // Geometry pipeline (config page)
0062 // ---------------------------------------------------------------------------
0063 
0064 /**
0065  * Geometry theme: the id of a `withGeometryTheme()` registration ('grey' is
0066  * built in), or 'off' for the geometry's own colors. Packs set their theme
0067  * through `withConfigDefaults()`.
0068  */
0069 export const GEOMETRY_THEME_CONFIG: ConfigSchema<string> = {
0070   key: 'geometry.themeName', default: 'off',
0071 };
0072 
0073 /** Subdetectors removed before the build: a cut list name from `withRootGeometryRules()`, or 'off'. */
0074 export const GEOMETRY_CUT_LIST_CONFIG: ConfigSchema<string> = {
0075   key: 'geometry.cutListName', default: 'off',
0076 };
0077 
0078 /** ROOT geometry tree cleanup: an edit rule set name from `withRootGeometryRules()`, or 'off'. */
0079 export const GEOMETRY_ROOT_FILTER_CONFIG: ConfigSchema<string> = {
0080   key: 'geometry.rootFilterName', default: 'off',
0081 };
0082 
0083 /** Fast opaque materials for weak GPUs. */
0084 export const GEOMETRY_FAST_MATERIAL_CONFIG: ConfigSchema<boolean> = {
0085   key: 'geometry.FastDefaultMaterial', default: false,
0086 };
0087 
0088 // ---------------------------------------------------------------------------
0089 // Backend and controls (config page)
0090 // ---------------------------------------------------------------------------
0091 
0092 /**
0093  * Use the backend at `server.url` for server-side files (`local://`, plain
0094  * paths) and server conversion. Ignored when pyrobird serves the page: the
0095  * serving backend is used then.
0096  */
0097 export const BACKEND_USE_API_CONFIG: ConfigSchema<boolean> = {
0098   key: 'server.useApi', default: false,
0099 };
0100 
0101 /** Base URL of the backend that `server.useApi` selects. */
0102 export const BACKEND_URL_CONFIG: ConfigSchema<string> = {
0103   key: 'server.url', default: 'http://localhost:5454', validator: isPersistableUrl,
0104 };
0105 
0106 /** Navigate the camera with a game controller. */
0107 export const USE_CONTROLLER_CONFIG: ConfigSchema<boolean> = {
0108   key: 'controls.useController', default: false,
0109 };
0110 
0111 // ---------------------------------------------------------------------------
0112 // Geometry clipping of the main view (the toolbar's clipping panel)
0113 // ---------------------------------------------------------------------------
0114 
0115 /** Wedge (angular) clipping on or off. */
0116 export const CLIPPING_ENABLED_CONFIG: ConfigSchema<boolean> = {
0117   key: 'clippingEnabled', default: true,
0118 };
0119 
0120 /** Wedge start angle [degrees]. */
0121 export const CLIPPING_START_ANGLE_CONFIG: ConfigSchema<number> = {
0122   key: 'clippingStartAngle', default: 0,
0123 };
0124 
0125 /** Wedge opening angle [degrees]. */
0126 export const CLIPPING_OPENING_ANGLE_CONFIG: ConfigSchema<number> = {
0127   key: 'clippingOpeningAngle', default: 180,
0128 };
0129 
0130 /** Z-plane clipping on or off. */
0131 export const Z_CLIPPING_ENABLED_CONFIG: ConfigSchema<boolean> = {
0132   key: 'zClippingEnabled', default: false,
0133 };
0134 
0135 /** Z position of the clipping plane [mm]. */
0136 export const Z_CLIPPING_POSITION_CONFIG: ConfigSchema<number> = {
0137   key: 'zClippingPosition', default: 0,
0138 };
0139 
0140 /** True keeps z >= position, false keeps z <= position. */
0141 export const Z_CLIPPING_FORWARD_CONFIG: ConfigSchema<boolean> = {
0142   key: 'zClippingForward', default: true,
0143 };