Skip to content

Commit 0a09a95

Browse files
committed
Merge branch 'main' into extractor_timings
2 parents 9734029 + 737646e commit 0a09a95

10 files changed

Lines changed: 92 additions & 1 deletion

File tree

8.79 KB
Binary file not shown.
23.3 KB
Binary file not shown.
30.3 KB
Binary file not shown.
198 KB
Binary file not shown.
102 KB
Binary file not shown.
7.31 KB
Binary file not shown.

src/graphnet/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@
4242
PROMETHEUS_GEOMETRY_TABLE_DIR = os.path.join(GEOMETRY_TABLE_DIR, "prometheus")
4343
LIQUIDO_GEOMETRY_TABLE_DIR = os.path.join(GEOMETRY_TABLE_DIR, "liquid-o")
4444
MAGIC_GEOMETRY_TABLE_DIR = os.path.join(GEOMETRY_TABLE_DIR, "magic")
45+
NUBENCH_GEOMETRY_TABLE_DIR = os.path.join(GEOMETRY_TABLE_DIR, "nubench")

src/graphnet/models/detector/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
from .liquido import LiquidO_v1
66
from .prometheus import ORCA150
77
from .magic import MAGIC
8+
from .nubench import FlowerS, FlowerL, FlowerXL, Triangle, Cluster, Hexagon
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
"""IceCube-specific `Detector` class(es)."""
2+
3+
from typing import Dict, Callable
4+
import torch
5+
import os
6+
7+
from graphnet.models.detector.detector import Detector
8+
from graphnet.constants import NUBENCH_GEOMETRY_TABLE_DIR
9+
10+
11+
class NuBenchDetector(Detector):
12+
"""Generic Detector Class from the NuBench Paper (arXiv:2511.13111)."""
13+
14+
xyz = ["sensor_pos_x", "sensor_pos_y", "sensor_pos_z"]
15+
string_id_column = "sensor_string_id"
16+
sensor_id_column = "sensor_id"
17+
sensor_time_column = "t"
18+
charge_column = "charge"
19+
20+
def feature_map(self) -> Dict[str, Callable]:
21+
"""Map standardization functions to each dimension."""
22+
feature_map = {
23+
"sensor_pos_x": self._sensor_pos_xy,
24+
"sensor_pos_y": self._sensor_pos_xy,
25+
"sensor_pos_z": self._sensor_pos_z,
26+
"t": self._t,
27+
"charge": self._charge,
28+
}
29+
return feature_map
30+
31+
def _sensor_pos_xy(self, x: torch.tensor) -> torch.tensor:
32+
return x / 100
33+
34+
def _sensor_pos_z(self, x: torch.tensor) -> torch.tensor:
35+
return x / 1000
36+
37+
def _t(self, x: torch.tensor) -> torch.tensor:
38+
return x / 10e5
39+
40+
def _charge(self, x: torch.tensor) -> torch.tensor:
41+
return torch.log10(1 + x)
42+
43+
44+
class FlowerS(NuBenchDetector):
45+
"""`Detector` class for Flower S."""
46+
47+
geometry_table_path = os.path.join(
48+
NUBENCH_GEOMETRY_TABLE_DIR, "flower_s.parquet"
49+
)
50+
51+
52+
class FlowerL(NuBenchDetector):
53+
"""`Detector` class for Flower L."""
54+
55+
geometry_table_path = os.path.join(
56+
NUBENCH_GEOMETRY_TABLE_DIR, "flower_l.parquet"
57+
)
58+
59+
60+
class FlowerXL(NuBenchDetector):
61+
"""`Detector` class for Flower XL."""
62+
63+
geometry_table_path = os.path.join(
64+
NUBENCH_GEOMETRY_TABLE_DIR, "flower_xl.parquet"
65+
)
66+
67+
68+
class Triangle(NuBenchDetector):
69+
"""`Detector` class for Triangle."""
70+
71+
geometry_table_path = os.path.join(
72+
NUBENCH_GEOMETRY_TABLE_DIR, "triangle.parquet"
73+
)
74+
75+
76+
class Cluster(NuBenchDetector):
77+
"""`Detector` class for Cluster."""
78+
79+
geometry_table_path = os.path.join(
80+
NUBENCH_GEOMETRY_TABLE_DIR, "cluster.parquet"
81+
)
82+
83+
84+
class Hexagon(NuBenchDetector):
85+
"""`Detector` class for Hexagon."""
86+
87+
geometry_table_path = os.path.join(
88+
NUBENCH_GEOMETRY_TABLE_DIR, "hexagon.parquet"
89+
)

src/graphnet/models/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
class Model(
2222
Logger, Configurable, LightningModule, ABC, metaclass=ModelConfigSaverABC
2323
):
24-
"""Base class for all components in graphnet."""
24+
"""Base class for all components in GraphNeT."""
2525

2626
verbose_print = True
2727

0 commit comments

Comments
 (0)