Skip to content

Add code and documentation for TrackPID#5

Open
lborrel wants to merge 1 commit intoMu2e:mainfrom
lborrel:main
Open

Add code and documentation for TrackPID#5
lborrel wants to merge 1 commit intoMu2e:mainfrom
lborrel:main

Conversation

@lborrel
Copy link
Copy Markdown

@lborrel lborrel commented Mar 20, 2026

Python code used to generate the TrackPID neural network model, along with documentation

@lborrel
Copy link
Copy Markdown
Author

lborrel commented Mar 20, 2026

@AndrewEdmonds11 I realized recently that I completely forgot to upload my TrackPID code and documentation. Let me know if you have any comment

@oksuzian
Copy link
Copy Markdown

Took a look through this PR. A few things worth addressing before merging:

Bugs

  • Broken README link. TrkPID/README.md links to [TrackPIDTrain.py](TrkPIDTrain.py) — target is TrkPIDTrain.py but the file is TrackPIDTrain.py. 404s on GitHub.
  • NameError when switch_make_dataset=True. The main block calls make_dataset('mu', MU_dataset_name, "MU_temp.csv"), but only MU1_dataset_name and MU2_dataset_name are defined. The dataset-creation path is dead-on-arrival.
  • apply_cut falls through silently on unknown particle. If particle is neither 'e' nor 'mu', mc_pdg / label_particle are unbound and you get an UnboundLocalError later. An explicit else: raise ValueError(...) would fail fast.

Nits / polish

  • Magic constant 1695 in np.mod(array_mc['trksegsmc','time'], 1695) — presumably the microbunch period in ns; worth a named constant or comment.
  • Docstring typo: "EvenNtuple""EventNtuple" in import_evtntuple.
  • Outputs (PID_model.keras, train_history.json, TrackPID.onnx) are written to cwd. TrkQual/ uses a model/ subdirectory — might be worth matching that convention.
  • README is missing the "table of commits per training version" that TrkQual/README.md establishes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants