Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions packages/phoenix-event-display/src/helpers/eta-phi-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/** Configuration for the eta-phi energy map panel. */
export interface EtaPhiConfig {
/** Eta axis range. Defaults to [-5, 5]. */
etaRange?: [number, number];
/** Phi axis range in radians. Defaults to [-pi, pi]. */
phiRange?: [number, number];
/** Number of bins along eta. Defaults to 100. */
etaBins?: number;
/** Number of bins along phi. Defaults to 63. */
phiBins?: number;
/** Minimum energy (GeV) to display. Defaults to 0 (hide noise). */
energyThreshold?: number;
/** Use logarithmic color scale. Defaults to true. */
logScale?: boolean;
}

/** Default ATLAS-style eta-phi configuration. */
export const DEFAULT_ETA_PHI_CONFIG: Required<EtaPhiConfig> = {
etaRange: [-5, 5],
phiRange: [-Math.PI, Math.PI],
etaBins: 100,
phiBins: 63,
energyThreshold: 0,
logScale: true,
};
1 change: 1 addition & 0 deletions packages/phoenix-event-display/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export * from './helpers/runge-kutta';
export * from './helpers/pretty-symbols';
export * from './helpers/active-variable';
export * from './helpers/zip';
export * from './helpers/eta-phi-config';

// Loaders
export * from './loaders/event-data-loader';
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ import {
EventDataExplorerComponent,
EventDataExplorerDialogComponent,
CycleEventsComponent,
EtaPhiPanelComponent,
EtaPhiPanelOverlayComponent,
} from './ui-menu';

import { AttributePipe } from '../services/extras/attribute.pipe';
Expand Down Expand Up @@ -127,6 +129,8 @@ const PHOENIX_COMPONENTS: Type<any>[] = [
FileExplorerComponent,
RingLoaderComponent,
CycleEventsComponent,
EtaPhiPanelComponent,
EtaPhiPanelOverlayComponent,
];

@NgModule({
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<app-overlay
overlayTitle="Eta-Phi Energy Map"
icon="eta-phi"
[active]="showPanel"
>
<div class="eta-phi-container">
<div class="eta-phi-controls">
<label class="scale-toggle">
<input
type="checkbox"
[checked]="logScale"
(change)="toggleLogScale()"
/>
Log scale
</label>
<label class="overlay-toggle">
<input
type="checkbox"
[checked]="showOverlays"
(change)="toggleOverlays()"
/>
Overlays
</label>
</div>
<div class="canvas-wrapper">
<canvas #etaPhiCanvas width="600" height="380"></canvas>
</div>
<div class="color-bar">
<canvas #colorBarCanvas width="300" height="14"></canvas>
<div class="color-bar-labels">
<span>{{ colorBarMin }}</span>
<span>{{ colorBarMax }}</span>
</div>
</div>
</div>
</app-overlay>
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.eta-phi-container {
padding: 8px;
min-width: 620px;
}

.eta-phi-controls {
display: flex;
gap: 16px;
margin-bottom: 6px;
font-size: 12px;
color: #ccc;

label {
display: flex;
align-items: center;
gap: 4px;
cursor: pointer;
user-select: none;
}

input[type='checkbox'] {
cursor: pointer;
}
}

.canvas-wrapper {
position: relative;
display: inline-block;

canvas {
display: block;
border: 1px solid #444;
border-radius: 2px;
cursor: crosshair;
}
}

.color-bar {
margin-top: 4px;
display: flex;
flex-direction: column;
align-items: center;

canvas {
border-radius: 2px;
}
}

.color-bar-labels {
display: flex;
justify-content: space-between;
width: 300px;
font-size: 10px;
color: #999;
}
Loading
Loading