-
Notifications
You must be signed in to change notification settings - Fork 2
Tutorial
Last revised: 2026-06-15
This tutorial walks through a first successful dune-tms run: build the code, choose an input file, run detector simulation + reconstruction, and inspect the output.
For installation details, see Software Installation and Dependencies. For the detector-simulation model, see TMS Simulation. For the code architecture, see dune-tms Primer.
By the end of this tutorial, you should be able to:
- build
dune-tmson the DUNE GPVMs - run
ConvertToTMSTree.exeon an edep-sim file - confirm that an output ROOT file was produced
- identify the main output trees
- know where to go next for validation, plotting, or code changes
The recommended environment is a DUNE GPVM.
kinit [email protected]
ssh dunegpvmXX.fnal.govGPVMs should be used for interactive development, small tests, and debugging. They should not be used for sustained large-scale production. Large production requests should go through the ND production team.
Clone and build in your DUNE app area:
cd /exp/dune/app/users/${USER}
git clone [email protected]:DUNE/dune-tms.git
cd dune-tms
source setup_FNAL.sh
makeIf SSH cloning is not set up, HTTPS should also work:
git clone https://github.com/DUNE/dune-tms.gitFor GitHub SSH setup, use GitHub's official documentation: Adding a new SSH key to your GitHub account.
Some workflows may need the older SL7 environment. Enter the SL7 container with:
/cvmfs/oasis.opensciencegrid.org/mis/apptainer/current/bin/apptainer shell \
--shell=/bin/bash \
-B /cvmfs,/exp,/nashome,/pnfs/dune,/opt,/run/user,/etc/hostname,/etc/hosts,/etc/krb5.conf \
--ipc --pid \
/cvmfs/singularity.opensciencegrid.org/fermilab/fnal-dev-sl7:latestThen set up and build with:
cd /exp/dune/app/users/${USER}/dune-tms
. setup.sh
makeIf you already built in a different environment, run make clean before rebuilding inside SL7.
ConvertToTMSTree.exe runs on edep-sim ROOT files.
For local dune-tms development, the most useful inputs are usually spill-like edep-sim files from official production. These already group events into spill-like units and are useful for testing detector-simulation, time-slicing, reconstruction, and output changes.
For example, MicroProdN4p1 spill-like files are under:
/pnfs/dune/persistent/physicsgroups/dunendsim/abooth/nd-production/MicroProdN4p1/run-spill-build/MicroProdN4p1_NDComplex_FHC.spill.full/
See Datasets for more sample locations and for the distinction between:
- individual edep-sim event files
- spill-like edep-sim files
- existing TMS reconstruction output
For a first test, pick one small edep-sim ROOT file from a spill-like directory.
The executable is:
ConvertToTMSTree.exe input_edep_file.root output_tmsreco_file.rootExample pattern:
ConvertToTMSTree.exe \
/path/to/input_edep_file.root \
/path/to/output_tmsreco_file.rootIf you omit the output filename, ConvertToTMSTree.exe writes an output file next to the input using the input filename with _output.root appended before the final extension.
For example:
ConvertToTMSTree.exe input.rootwrites:
input_output.root
For quick tests, it is often useful to process only a small number of events. The maximum number of events is controlled in:
config/TMS_Default_Config.toml
Look for:
[Applications]
MaximumNEvents = -1Set MaximumNEvents to a small positive number for a quick smoke test, for example:
MaximumNEvents = 10Set it back to -1 to process all entries.
The time slicer is controlled in:
config/TMS_Default_Config.toml
Look for:
[Recon.Time]
RunTimeSlicer = trueFor modern spill-like production inputs, running with the time slicer on is usually the relevant default. Be aware that:
-
Reco_Tree,Truth_Info, andLine_Candidatesare filled for reconstructed events/time slices -
Truth_Spillis spill-level
This distinction matters when computing efficiencies or matching reconstructed tracks back to truth.
After the run finishes, check that the output file exists:
ls -lh output_tmsreco_file.rootThen inspect the ROOT trees. For example:
root -l output_tmsreco_file.rootInside ROOT:
.ls
Reco_Tree->Print()
Truth_Info->Print()
Truth_Spill->Print()The main trees are:
| Tree | Purpose |
|---|---|
Reco_Tree |
reconstructed 3D TMS tracks |
Truth_Spill |
authoritative spill-level particle and vertex truth |
Truth_Info |
reco-to-truth matching summaries and slice-level truth information |
Line_Candidates |
lower-level Hough lines, clusters, and reco debugging information |
Metadata |
version and geometry provenance |
For details, see Output File Contents.
A first successful run should usually have:
- a non-empty output ROOT file
- a
Metadatatree - entries in
Truth_Spill - entries in
Reco_Tree/Truth_Info/Line_Candidates, depending on reconstruction and time slicing
Simple ROOT checks:
Reco_Tree->GetEntries()
Truth_Info->GetEntries()
Truth_Spill->GetEntries()
Metadata->Scan()If Reco_Tree has no entries, check whether the input file has TMS activity, whether the reconstruction thresholds are appropriate, and whether MaximumNEvents was set too low.
For reconstructed-track analysis, start with:
For particle and vertex truth, use:
For reco-to-truth matching, use:
Important matching convention:
-
RecoTrackPrimaryParticle*describes the true particle contributing the most visible energy to a reconstructed track -
RecoTrackSecondaryParticle*describes the true particle contributing the second-highest visible energy - equivalent summaries are not saved for third-and-later truth contributors
- for the full particle record, use the particle index plus
Truth_Spill
Event-display scripts live under scripts/. The exact script names and options may change, so check the current script help before running:
python3 scripts/Reco/draw_spill_3D_projections.py --helpA typical pattern is:
python3 scripts/Reco/draw_spill_3D_projections.py \
--input_filename output_tmsreco_file.root \
--outdir event_display_outputSee Plotting events / event display for more details.
Start with:
- TMS Simulation
src/TMS_Event.cppsrc/TMS_Readout_Manager.cppconfig/TMS_Readout_Default_Config.toml
Start with:
Start with:
When adding branches, update the relevant wiki page:
Start with:
For questions, ask in the DUNE Slack channel:
#nd_muon_spectrometer
When asking for help, include:
- which GPVM/container environment you used
- the branch or commit you built
- the input file path
- the command you ran
- the error message or unexpected output
- whether you changed any config values