Datasets for transformer-oc: CMS Phase-2 (PU200) simulation turned into one PyTorch Geometric graph per event.
step2 RAW (GEN-SIM-DIGI-RAW)
│ cmssw/trackingntuple_maker.sh (CMSSW, cmsRun)
▼
trackingntuple_<name>.root
│ cmssw/lstntuple_maker.sh (CMSSW, LST standalone)
▼
LSTNtuple_<name>.root
│ transformer_datasets.t3_processing (Python)
▼
{train,val}/graph_<N>.pt
The first two stages run in a CMSSW environment, which the scripts set up themselves from /cvmfs if cmsRun or lst_cpu isn't already on the PATH. Only the last stage is Python.
cmssw/: shell scripts for the CMSSW stages.samples/<sample>/: input file lists, one path per line.relval.txtlists the step2 files andtrackingntuple.txtlists the tracking ntuples made from them.src/transformer_datasets/: the Python package.t3_processing.pybuilds the graphs andconstants.pyholds the ntuple column names.tests/: unit tests for the Python package.
The CMSSW stages need a CMSSW release area with LST built (default: /ceph/users/atuna/CMSSW_20_1_0_pre2/src). Override it with CMSSW_SRC for trackingntuple_maker.sh, or edit CMSSW_SRC in lstntuple_maker.sh.
For the Python stage, install the package into a virtual environment (Python ≥ 3.10):
python3.12 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -e .The CPU build of torch is enough. Graph building doesn't use a GPU.
Run from the directory where the outputs should go. For example:
# voms-proxy-init -voms cms, if necessary
cd samples/qcd/
for F in $(cat relval.txt); do ../../cmssw/trackingntuple_maker.sh $F; donelstntuple_parallel.sh runs lstntuple_maker.sh over every file listed in trackingntuple.txt in the current directory. Outputs are LSTNtuple_<name>.root. For example:
cd samples/qcd/
../../cmssw/lstntuple_parallel.shcd samples/qcd/
python -m transformer_datasets.t3_processing --input LSTNtuple_*.root --output graphs/ --seed 42 -n 16Run with --help for all options (--n_events, --split, --nofakes, --overwrite, ...).
Each graph_<N>.pt is a torch_geometric.data.Data.
transformer-oc depends on the column order of x: if you add, remove or reorder features, update the normalization and the η/φ column indices there too.
pytest