ho22joshua commited on
Commit
d2d4ccf
·
1 Parent(s): 8344837

feat: add ttH CP parity benchmark configuration

Browse files
docs/quickstart.md CHANGED
@@ -57,6 +57,22 @@ uv run gnn4colliders prepare --config-name config_hf_delphes
57
  The data source, revision, checksum, tree, feature branches, and split rules
58
  are documented in [configuration.md](configuration.md).
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  ## Use your own ROOT file
61
 
62
  Preparation accepts Hydra overrides. Supply the ROOT file, tree, cache path,
 
57
  The data source, revision, checksum, tree, feature branches, and split rules
58
  are documented in [configuration.md](configuration.md).
59
 
60
+ The inclusive no-selection ttH CP benchmark has a dedicated configuration. It
61
+ uses `ttH_NLO.root` as label 0 (CP-even) and `ttH_CPodd.root` as label 1
62
+ (CP-odd), with all configured object branches passed through without event or
63
+ object selections:
64
+
65
+ ```bash
66
+ uv run gnn4colliders prepare \
67
+ --config-name config_tth_cp_even_odd \
68
+ data.num_workers=8
69
+ ```
70
+
71
+ This task configuration enables absolute event weights for optimization
72
+ because the NLO files contain signed weights. The original signed weights are
73
+ still retained in event metadata and used by the configured evaluation
74
+ semantics.
75
+
76
  ## Use your own ROOT file
77
 
78
  Preparation accepts Hydra overrides. Supply the ROOT file, tree, cache path,
src/gnn4colliders/config/application.py CHANGED
@@ -7,6 +7,7 @@ import multiprocessing
7
  import os
8
  import shutil
9
  import tempfile
 
10
  from concurrent.futures import ProcessPoolExecutor
11
  from pathlib import Path
12
  from typing import Any
@@ -187,10 +188,12 @@ def prepare(config: DictConfig) -> Path:
187
  labels_per_file = (
188
  list(labels) if isinstance(labels, (list, tuple)) else [labels] * len(files)
189
  )
 
 
190
  source = RootEventDataset(
191
  files,
192
  tree_name=str(data.tree_name),
193
- label=labels,
194
  feature_branches=plain(data.get("feature_branches")),
195
  global_features=plain(data.get("global_features", [])),
196
  fold_var=str(data.get("fold_var", "eventNumber")),
 
7
  import os
8
  import shutil
9
  import tempfile
10
+ from collections.abc import Sequence
11
  from concurrent.futures import ProcessPoolExecutor
12
  from pathlib import Path
13
  from typing import Any
 
188
  labels_per_file = (
189
  list(labels) if isinstance(labels, (list, tuple)) else [labels] * len(files)
190
  )
191
+ if not isinstance(labels, (list, tuple)) and isinstance(labels, Sequence):
192
+ labels_per_file = list(labels)
193
  source = RootEventDataset(
194
  files,
195
  tree_name=str(data.tree_name),
196
+ label=labels_per_file,
197
  feature_branches=plain(data.get("feature_branches")),
198
  global_features=plain(data.get("global_features", [])),
199
  fold_var=str(data.get("fold_var", "eventNumber")),
src/gnn4colliders/configs/config_tth_cp_even_odd.yaml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ defaults:
2
+ - data: tth_cp_even_odd
3
+ - model: root_gnn/edge_network_binary
4
+ - task: tth_cp_binary
5
+ - trainer: default
6
+ - checkpoint: default
7
+ - inference: default
8
+ - environment: local
9
+ - distributed: single
10
+ - export: onnx
11
+ - _self_
12
+
13
+ experiment:
14
+ name: tth_cp_even_odd
15
+ logging:
16
+ level: INFO
src/gnn4colliders/configs/data/tth_cp_even_odd.yaml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ defaults:
2
+ - _self_
3
+
4
+ # The two files are the inclusive no-selection ttH H->gamma gamma benchmark.
5
+ # Override data.files/data.label when using a different local data layout.
6
+ files:
7
+ - data/raw/ttH_NLO_download/samples/higgs/top-associated/tth/ttH_NLO.root
8
+ - data/raw/ttH_cp_even_odd/samples/higgs/top-associated/tth/ttH_CPodd.root
9
+ label: [0, 1]
10
+ tree_name: output
11
+ feature_branches:
12
+ - [jet_pt, ele_pt, mu_pt, ph_pt, MET_met]
13
+ - [jet_eta, ele_eta, mu_eta, ph_eta, 0]
14
+ - [jet_phi, ele_phi, mu_phi, ph_phi, MET_phi]
15
+ - CALC_E
16
+ - [jet_btag, 0, 0, 0, 0]
17
+ - [0, ele_charge, mu_charge, 0, 0]
18
+ - NODE_TYPE
19
+ object_types: [vector, vector, vector, vector, single]
20
+ scales: [0.1, 1, 1, 0.1, 1, 1, 1]
21
+ global_features: []
22
+ fold_var: Number
23
+ weight_var: weight
24
+ batch_size: 1024
25
+ num_workers: 0
26
+ shuffle: true
27
+ seed: 42
28
+ cache:
29
+ path: outputs/ttH_cp_even_odd/graphs.pt
30
+ splits:
31
+ train_folds: [0, 1, 2, 3, 4, 5, 6, 7]
32
+ validation_folds: [8]
33
+ test_folds: [9]
src/gnn4colliders/configs/model/root_gnn/edge_network_binary.yaml CHANGED
@@ -1,5 +1,8 @@
1
- defaults:
2
- - /model/root_gnn/edge_network
3
- - _self_
4
-
5
  out_size: 1
 
 
 
 
1
+ family: root_gnn
2
+ backend: torch
3
+ name: edge_network
4
+ hid_size: 128
5
  out_size: 1
6
+ n_layers: 2
7
+ n_proc_steps: 4
8
+ dropout: 0.1
src/gnn4colliders/configs/task/tth_cp_binary.yaml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ defaults:
2
+ - binary_classification
3
+ - _self_
4
+
5
+ # NLO samples contain signed weights. Absolute weights make the optimization
6
+ # denominator stable while the original signed weights remain in metadata.
7
+ absolute_weights: true