-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.PbPb.html
571 lines (504 loc) · 23.5 KB
/
index.PbPb.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<script src="d3.min.js"></script>
<script src="jquery.min.js"></script>
<script src="jquery-ui.js"></script>
<script src="jstree.min.js"></script>
<script src="common-functions.js"></script>
<script src="geometry/geometries.js"></script>
<script src="components/trd-dimensions.js"></script>
<script src="components/padrow-dimensions.js"></script>
<script src="components/component-base.js"></script>
<script src="components/sector-view.js"></script>
<script src="components/sector-zoom-view.js"></script>
<script src="components/supermodule-view.js"></script>
<script src="components/supermodule-zoom-view.js"></script>
<script src="components/digits-view.js"></script>
<script src="components/event-tree.js"></script>
<script src="components/component-coordinator.js"></script>
<script src="components/track-information.js"></script>
<script src="components/timebin-view.js"></script>
<script src="components/display-mapper.js"></script>
<script src="data/PbPb/script.js"></script>
<title>ALICE TRD Event Display - Alpha</title>
<link href='./proton/style.min.css' rel='stylesheet' />
<link href='./components/sector-view.css' rel='stylesheet' />
<link href='./components/supermodule-view.css' rel='stylesheet' />
<link href='./components/digits-view.css' rel='stylesheet' />
<link href='./components/timebin-view.css' rel='stylesheet' />
<link href='./components/track-information.css' rel='stylesheet' />
<link rel="stylesheet" href="jquery-ui.css">
<style>
*,
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.428571429;
/* background-color: #6d6d6d; */
}
.ui-draggable,
.ui-droppable {
background-position: top;
}
/* Component borders */
svg,
canvas,
#tree-container,
div.track-information,
div.time-bin-view {
border: none;
/* border: 1px solid black; */
}
p {
margin: 0 0 10px;
}
#tree-container {
width: 300px;
height: 360px;
overflow-y: auto;
overflow-x: hidden;
margin-top: 20px;
padding-left: 0.5em;
}
div.component {
margin-right: 0.5em;
margin-bottom: 1.5em;
}
div.component p {
text-align: center;
font-weight: bold;
margin-bottom: 0.25em;
color: darkslategray;
}
div.component p span.label-left {
float: left;
margin-left: 2em;
}
div.component p span.label-right {
float: right;
margin-right: 2em;
}
div.time-bin-view {
max-height: 380px;
overflow-y: scroll;
text-align: center;
display: block;
}
#sector-view-zoom {
stroke-width: 0.1;
font-size: 5px;
}
#sector-view-zoom path.tracklet {
stroke-width: 0.3;
}
#supermodule-view-zoom {
stroke-width: 0.3;
font-size: x-small;
}
#sector-view .sector-view-component text.layer-number {
display: none;
}
#sector-view-zoom .sector-view-component text.layer-number {
font-size: 2px;
}
#sector-view-zoom .zoom-box {
display: none;
}
#sector-view-zoom .sector-view-component path.track {
stroke-dasharray: 1;
stroke-width: 0.3px;
}
#sector-view-zoom .sector-view-component path.track.not-selected {
stroke-dasharray: 1;
stroke-width: 0.1px;
}
#supermodule-view-zoom .supermodule-view-component .track path {
stroke-dasharray: 2;
stroke-width: 0.8px;
}
#supermodule-view-zoom .supermodule-view-component .track.not-selected path {
stroke-dasharray: 1;
stroke-width: 0.3px;
}
input[type=number] {
width: 4em;
text-align: center;
margin-right: 1em;
}
/* Tooltip container */
.tooltip {
position: relative;
display: inline-block;
border-bottom: 1px dotted black;
/* If you want dots under the hoverable text */
}
/* Tooltip text */
.tooltip .tooltiptext {
visibility: hidden;
width: 250px;
background-color: rgb(211, 90, 90);
color: #fff;
text-align: center;
padding: 5px 5px;
border-radius: 6px;
white-space: pre-line;
/* Position the tooltip text - see examples below! */
position: absolute;
z-index: 1;
top: 100%;
left: 50%;
margin-left: -125px;
/* Use half of the width (120/2 = 60), to center the tooltip */
}
/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
visibility: visible;
}
.header {
width: 100%;
height: 100px;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.header h1 {
font-size: 50px;
margin-block-start: 0em;
vertical-align: top;
}
.logo {
background-image: url("img/alice_logo.png");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
width: 80px;
height: 80px;
display: inline-block;
}
.header-text {
display: inline-block;
vertical-align: bottom;
height: 80px;
margin-left: 0.5em;
margin-right: 1em;
color: #b7412d
}
.legend {
display: flex;
flex-direction: row;
justify-content: center;
width: 100%;
/* border: 1px solid blue; */
}
.legend-color {
width: 20px;
height: 10px;
display: inline-block;
margin-right: 5px;
border: 1px darkgray solid;
}
.legend-text {
display: inline-block;
}
.legend > div {
margin: 0 20px;
}
</style>
</head>
<body>
<div class="header">
<div>
<div class="logo"></div>
</div>
<h1>
<div class="header-text">TRD Event Display</div>
</h1>
<div>
<div class="logo"></div>
</div>
</div>
<div style="display: flex; flex-direction: row; justify-content: center; width: 100%;">
<div style="display: flex; flex-direction: column; width: 100%; justify-content: space-between; ">
<div style="display: flex; flex-direction: row; justify-content: space-between; flex-wrap: wrap; width: 100%;">
<div class="component">
<p>
<span class="tooltip">Available Events
<span class="tooltiptext" style="word-wrap: pre-wrap;">Each event is a collision between two
atomic nuclei that results in a fireball (Quark Gluon Plasma), and many different
particles are produced out of this inferno.
The ALICE detector measures the interaction of these particles with fixed targets, and
uses this to reconstruct all aspects of the particle.
The blue tracks shown to the right are the result of this reconstruction.
</span>
</span>
</p>
<div id="tree-container">
<div id="dataTree">
</div>
</div>
</div>
<div class="component">
<p>
<span class="label-left tooltip">Sector
<span class="tooltiptext">The TRD is divided into 18 sectors, spaced at 20 degree
intervals</span>
</span>
<span class="tooltip">Summary
<span class="tooltiptext">This view shows all the reconstructed particle tracks in blue, and
all the measured TRD signals in red.</span>
</span>
<span class="label-right tooltip">XY plane
<span class="tooltiptext">The XY plane is equivalent to looking down the beam pipe, with the
ring centre to your right</span>
</span>
</p>
<svg id="sector-view" style="width: 380px; height: 380px;" preserveAspectRatio="xMidYMid"></svg>
</div>
<div class="component">
<p>
<span class="label-left tooltip">Supermodule
<span class="tooltiptext">Each supermodule is further divided into 5 stacks, and each stack
has 6 layers</span>
</span>
<span class="tooltip">Summary
<span class="tooltiptext">This view shows all the reconstructed particle tracks in blue, and
all the measured TRD signals in red.</span>
</span>
<span class="label-right tooltip">ZR plane
<span class="tooltiptext">The ZR plane is equivalent to looking radially out from the centre
of the beam pipe</span>
</span>
</p>
<svg id="supermodule-view" style="width: 380px; height: 380px;"
preserveAspectRatio="xMidYMid"></svg>
</div>
<div class="component">
<p>
<span class="tooltip">3D interactive view
<span class="tooltiptext">This view shows all reconstructed particle tracks in blue,
together with the TRD modules.
You can click-and-drag to rotate the display, and use the mouse-wheel to zoom in and
out.
</span>
</span>
</p>
<canvas id="threejs-view" style="width: 520px; height: 380px;"></canvas>
<div
style="vertical-align: top; padding-bottom: 13px; margin-top:-15px; text-align: center; z-index: 100; position: absolute; width: 520px;">
<input id="toggleDetectors" type="button" value="Toggle detectors" />
<input id="toggleTracklets" type="button" value="Hide tracklets" />
<input id="toggleTracks" type="button" value="Hide tracks" />
<input id="resetControls" type="button" value="Reset camera" />
</div>
</div>
</div>
<div style="width: 100%; height: 10px;"></div>
<div style="display: flex; flex-direction: row; justify-content: space-between; flex-wrap: wrap; width: 100%;">
<div class="component" style="vertical-align: top; padding-top: 0.4em;">
<p>Information</p>
<div id="track-information" class="track-information">
<div class="info-title">Event</div>
<div style="text-align: center;" class="info-event"></div>
<div class="info-title info-track">Track</div>
<div style="text-align: center;" class="info-track info-track-text"></div>
<div class="info-title info-tracklets">Tracklets</div>
<div style="text-align: center;" class="info-tracklets info-tracklets-text"></div>
<div class="info-title">Triggers</div>
<div style="text-align: center;" class="info-triggers"></div>
</div>
</div>
<div class="component">
<p>
<span class="label-left tooltip">Sector
<span class="tooltiptext">The TRD is divided into 18 sectors or supermodules, spaced at 20
degree intervals</span>
</span>
<span class="tooltip">Detail
<span class="tooltiptext">This view focuses on a single selected track, and the
corresponding measured data in a single TRD module.</span>
</span>
<span class="label-right tooltip">XY plane
<span class="tooltiptext">The XY plane is equivalent to looking down the beam pipe, with the
ring centre to your right</span>
</span>
</p>
<svg id="sector-zoom-view" style="width: 380px; height: 380px;"
preserveAspectRatio="xMidYMid meet"></svg>
</div>
<div class="component">
<p>
<span class="label-left tooltip">Supermodule
<span class="tooltiptext">Each supermodule is further divided into 5 stacks, and each stack
has 6 layers</span>
</span>
<span class="tooltip">Detail
<span class="tooltiptext">This view focuses on a single selected track, and the
corresponding measured data in a single TRD module.</span>
</span>
<span class="label-right tooltip">ZR plane
<span class="tooltiptext">The ZR plane is equivalent to looking radially out from the centre
of the beam pipe</span>
</span>
</p>
<svg id="supermodule-zoom-view" style="width: 380px; height: 380px;"
preserveAspectRatio="xMidYMid meet"></svg>
</div>
<div class="component">
<p>
<span class="tooltip">Time-bin view
<span class="tooltiptext">
This view shows how data is used to reconstruct a single TRD tracklet.
Charge deposition is measured in 30 time bins of 2 micro-seconds each.
At least 3 tracklets are required to match a reconstructed track.
</span>
</span>
</p>
<div class="time-bin-view">
<svg id="timebin-view-zoom" style="width: 500px; height: 1600px; border: none;"
preserveAspectRatio="xMidYMid meet"></svg>
</div>
</div>
</div>
<div class="legend">
<div style="font-weight: bold; font-size: 16px; align-self: center;">Legend</div>
<div style="display: flex; flex-direction: column;">
<div><div style="border: darkgray 2px solid;" class="legend-color"></div><div class="legend-text">Detector module</div></div>
<div><div style="border-color: lightgray;" class="legend-color"></div><div class="legend-text">Detector pad</div></div>
<div><div style="background-color: #f4f4f4; border: none;" class="legend-color"></div><div class="legend-text">ALICE TPC</div></div>
</div>
<div style="display: flex; flex-direction: column;">
<div><div style="background-color: #3392e3;" class="legend-color"></div><div class="legend-text">Selected TRD track</div></div>
<div><div style="background-color: #b37ce5;" class="legend-color"></div><div class="legend-text">Other TRD track</div></div>
<div><div style="background-color: #cfe9ff;" class="legend-color"></div><div class="legend-text">Background track</div></div>
</div>
<div style="display: flex; flex-direction: column;">
<div><div style="background-color: #f03b20;" class="legend-color"></div><div class="legend-text">Selected TRD tracklet</div></div>
<div><div style="background-color: #feb24c;" class="legend-color"></div><div class="legend-text">Matched TRD tracklet</div></div>
<div><div style="background-color: #ffeda0;" class="legend-color"></div><div class="legend-text">Other TRD tracklet</div></div>
</div>
<div style="display: flex; flex-direction: column;">
<div>
<svg class="legend-color time-bin-view">
<path d="M0,4 L20,4" class="tracklet"></path>
</svg>
<div class="legend-text">Lorentz corrected tracklet</div></div>
<div>
<svg class="legend-color time-bin-view">
<path d="M0,4 L20,4" class="tracklet lorentz"></path>
</svg>
<div class="legend-text">Raw reconstructed tracklet</div>
</div>
</div>
</div>
</div>
<div style="display: none; flex-direction: row;">
<div class="column">
<div class="component">
<p>Digits detail view</p>
<p>
<span><label for="event-input">Event: </label><input type="text" value="11" id="event-input"
min="0" /></span>
<span><label for="sector-input">Sector: </label><input type="number" value="0" id="sector-input"
min="0" /></span>
<span><label for="stack-input">Stack: </label><input type="number" value="0" id="stack-input"
min="0" /></span>
<span><label for="max-csum-input">Max Cum. Sum: </label><input type="number" value="500"
id="max-csum-input" min="0" style="width: 6em;" /></span>
<span><input type="button" value="Load" id="load-digits" /></span>
</p>
<div style="text-align: center;">
<div style="display: inline-block; margin: 1em 2em; width: 50%; text-align: center;">
<div>
<label for="amount">Timebin: </label>
<input type="text" id="timebin-display" readonly value="0"
style="border:0; color:#f6931f; font-weight:bold; width: 2em;">
</div>
<div id="timebin-slider" style="margin: 0 0;">
</div>
</div>
</div>
<canvas id="digits-view" width="1480" height="580" style="background: inherit;"></canvas>
</div>
</div>
</div>
</div>
</div>
<script type="module">
import { ThreejsComponent } from './components/threejs-view.js';
function ajoin(a, b) { return a.concat(b); }
const data = [...mapToDisplayDataFormat(getData())];
const digitsLoadUrl = getDigitsLoadUrl;
const coordinator = new ComponentCoordinator(data);
const tree = new EventTree("#dataTree", data, coordinator.treeSelect.bind(coordinator));
coordinator.addComponent(new SectorViewComponent("#sector-view", 380, 380));
coordinator.addComponent(new SectorZoomViewComponent("#sector-zoom-view", 380, 380));
coordinator.addComponent(new SupermoduleViewComponent("#supermodule-view", 380, 380));
coordinator.addComponent(new SupermoduleZoomViewComponent("#supermodule-zoom-view", 380, 380));
// ** ThreeJS initialisation
const three = new ThreejsComponent("threejs-view", 520, 380);
coordinator.addComponent(three);
document.getElementById("toggleDetectors").addEventListener("click", (button) => {
const visible = three.toggleDetectors();
});
document.getElementById("toggleTracklets").addEventListener("click", (button) => {
const visible = three.toggleTracklets();
button.currentTarget.value = `${visible ? "Hide" : "Show"} tracklets`;
});
document.getElementById("toggleTracks").addEventListener("click", (button) => {
const visible = three.toggleTracks();
button.currentTarget.value = `${visible ? "Hide" : "Show"} tracks`;
});
document.getElementById("resetControls").addEventListener("click", (button) => {
three.resetControls();
});
// ** ThreeJS initialisation
coordinator.addComponent(new TimebinViewComponent("#timebin-view-zoom", 500, 1600, null, {
dataLoadUrl: digitsLoadUrl
}));
coordinator.addComponent(new TrackInformationComponent("#track-information"));
const timebinDisplay = $("timebin-display");
$("#timebin-slider").slider({
value: 0,
min: 0,
max: 29,
step: 1,
change: function (event, ui) {
$("#timebin-display").val(ui.value);
}
});
// const digitsView = new DigitsViewComponent("#digits-view", 1480, 650, null, {
// eventInput: "#event-input",
// sectorInput: "#sector-input",
// stackInput: "#stack-input",
// maxCsumInput: "#max-csum-input",
// buttons: ["#load-digits"],
// dataLoadUrl: digitsLoadUrl,
// padClick: coordinator.padSelect.bind(coordinator),
// timeBinChange: (timebin) => { $("#timebin-slider").slider("option", "value", timebin); }
// });
// $("#timebin-slider").on("slide", function (event, ui) {
// digitsView.drawPads(ui.value);
// $("#timebin-display").val(ui.value);
// });
// coordinator.addComponent(digitsView);
if (true) {
setTimeout(function () {
//$("#dataTree").jstree("select_node", tree.treeData[2].children[1]);
tree.changeSelection();
//digitsView.drawDigits();
}, 1500);
}
</script>
</body>
</html>