Add initial documentation and fix energy loss bugs#260
Merged
anthoak13 merged 10 commits intoATTPC:developfrom Apr 2, 2026
Merged
Add initial documentation and fix energy loss bugs#260anthoak13 merged 10 commits intoATTPC:developfrom
anthoak13 merged 10 commits intoATTPC:developfrom
Conversation
- GetElossStraggling/GetdEdxStraggling: evaluate dEdx at energyFin (Tschalar formula requires stopping power at the exit point, not entrance; error was largest near the Bragg peak) - BuildSpline: replace manual trapezoidal rule for Ω²(E) with a spline of 1/dEdx³ and segment-wise Simpson integration (exact for cubics) - AtELossCATIMA: add fConfig member and SetConfig() so callers can tune the CATIMA calculation model; thread fConfig through all catima API calls (default_config preserves existing behaviour) - AtELossBetheBlochTest: add AtELossBetheBlochVsCATIMAFixture comparing GetRangeVariance and GetElossStraggling against pure-Bohr CATIMA (z_eff_type::none) at narrow and wide energy traversals up to 10→1 MeV
Adds macro/tests/ELossComparison/ELossComparison.C with four scenarios (proton/deuteron/alpha in D2, proton in He) comparing BetheBloch, CATIMA, and SRIM Table models via dE/dx, range, Bragg curve, and straggling plots.
Add documentation into four subdirectories directly under docs/: - tooling/: installation, daily-use (merged setup+building), testing - contributing/: contributor guide, new-module, code-style - reference/: modules, data-model, branch-io-contracts, macro-cookbook - subsystems/: simulation/reconstruction pipelines, generators, psa, energy-loss docs/development/ is reserved for branch-specific in-progress notes (fitting-status.md, UKF.md, etc.). Update all cross-links and the CLAUDE.md to point to the new docs rather than repeat the information.
GetBraggCurve stored result.dEdxi * fDensity directly (MeV/cm) into the output vector, while all other paths (GetdEdx, base-class GetBraggCurve) divide by 10 to convert to MeV/mm. The energy-step calculation in the same loop used dEdx * rangeStepSize / 10, which accidentally cancelled the unit error during tracking, so range and energy results were unaffected — only the returned dEdx y-values were 10× too large, inflating the displayed Bragg peak height relative to BB and SRIM curves. Adds a fourth model per scenario — CATIMA with bare projectile charge (z_eff_type::none) and dEdx corrections disabled (no Barkas, Lindhard, or shell corrections) — to isolate which physics differences drive the disagreement between Bethe-Bloch and full CATIMA: - dEdx/range divergence at low energy → effective charge (Pierce-Blann) - Range straggling floor in BB vs steep fall in CATIMA → Firsov/Lindhard-X straggling correction (hardwired in CATIMA, absent in BB) - Bragg peak shape difference → effective charge suppressing dEdx as v→0
ea4e636 to
32a9fae
Compare
Also fixes clang-formatting
32a9fae to
5dae8c1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR:
docsfolder