Skip to content

[codex] Use channel energy for hit smearing#127

Merged
lobis merged 1 commit into
masterfrom
codex/channel-specific-hit-smearing
May 26, 2026
Merged

[codex] Use channel energy for hit smearing#127
lobis merged 1 commit into
masterfrom
codex/channel-specific-hit-smearing

Conversation

@lobis

@lobis lobis commented May 19, 2026

Copy link
Copy Markdown
Member

lobis Ok: 17 Powered by Pull Request Badge

Summary

  • Compute the smearing resolution from the energy in the selected channel type instead of the total detector-hit energy.
  • Keep the previous behavior for applying one common stochastic gain to the selected TPC or VETO hits.
  • Leave non-selected hit types unchanged and avoid drawing a smearing factor when the selected channel has zero energy.

Why

TRestDetectorHitsSmearingProcess can be configured with channelType=tpc or channelType=veto, but the resolution was derived from fInputEvent->GetTotalEnergy(). For mixed events containing both TPC and VETO hits, a large energy deposit in the other channel could bias the selected-channel resolution. This is especially visible in cosmic-background simulations where a small TPC deposit may coexist with a large veto deposit.

Validation

  • Ran git diff --check on the patch.
  • Built the RestDetector target on the NAF REST build tree successfully.

@lobis
lobis requested a review from JPorron May 19, 2026 12:01
@lobis
lobis marked this pull request as ready for review May 19, 2026 12:01
@lobis
lobis enabled auto-merge May 19, 2026 12:06
@lobis

lobis commented May 25, 2026

Copy link
Copy Markdown
Member Author

Follow-up verification on 2026-05-25: this patch is still not present on master and remains isolated to src/TRestDetectorHitsSmearingProcess.cxx.

I also rechecked the failing CI job. The only failing check is restG4-validation / Example 12: Generators, which exits from ValidateCosmicGenerator.C with wrong cosmic flux: 0.0172229. That appears tied to the Guan cosmic-muon normalization update in geant4lib, not to this detector-hit smearing patch. The detector-specific validation/build checks are green, and the patched RestDetector target was rebuilt and installed successfully in the NAF REST stack.

@lobis
lobis disabled auto-merge May 26, 2026 08:21
@lobis
lobis merged commit ee99598 into master May 26, 2026
187 of 190 checks passed
@lobis
lobis deleted the codex/channel-specific-hit-smearing branch May 26, 2026 08:21
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.

1 participant