Skip to content

Shower Normalization Tools - #883

Open
carriganm95 wants to merge 53 commits into
SBNSoftware:developfrom
carriganm95:showerNormTools
Open

carriganm95 wants to merge 53 commits into
SBNSoftware:developfrom
carriganm95:showerNormTools

Conversation

@carriganm95

@carriganm95 carriganm95 commented Jan 26, 2026

Copy link
Copy Markdown

This PR adds the ability to use tools to normalize the shower dEdx and energy using the TPC, YZ, and drift sqlite normalization tools.

For MC only the TPC and YZ normalization tools are used. Additionally, because the maps change based on run and the MC does not have valid run numbers to look up the maps in the sqlite database the run must be hard coded in the fcl files. Based on the run set in the fcl file a run from the correct Run era will be used to obtain the correct maps from the database. In the future overlays should fix the need for these hard coded values.

This PR also depends on a PR to larpandora which adds functions to the energy/dedx tools to run the normalizations.

gputnam and others added 30 commits May 16, 2025 11:11
…forms

keep PMT waveforms in stage and add fcl to drop them later
…tage0dropPMT-metadata

Enable Metadata Injection for Production
Copilot AI review requested due to automatic review settings January 26, 2026 22:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds shower normalization capabilities using TPC, YZ, and drift SQLite normalization tools to improve energy/dEdx calibration. The implementation includes new per-plane TPC normalization tools, updated calibration constants based on Run 2 stopping muons, and infrastructure for MC support via hardcoded run numbers (pending future overlay improvements).

Changes:

  • New normalization tools (NormalizeTPCPerPlane, NormalizeTPCPerPlaneSQL) with per-plane TPC equalization
  • Updated calibration constants and database tags (TPC_CalibrationTags_Jul2025, TPC_CalibrationTags_Oct2025)
  • HitMerger module extended with ChannelROI associations
  • Wire-Cell configuration updates for shifted YZ map files and configurable parameters
  • Extensive FCL file reorganization (standard/ directory restructured into mc/, data/, overlay/ subdirectories)
  • MC normalization support via hardcoded run numbers (Run 1-4) based on fcl-configured run period
  • Updated CAF maker workflows with geant4weight additions
  • CRT module code formatting improvements

Reviewed changes

Copilot reviewed 90 out of 96 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
ups/product_deps Updated dependency versions (icarus_data v10_06_02, icarusalg v10_06_00_06, sbncode v10_06_00_06)
HitMerger_module.cc Added ChannelROI-to-Hit associations for normalization tool access
wcls-multitpc-sim-drift-simchannel-yzsim-refactored.jsonnet Updated to use shifted YZ map files and external variables for configuration
wcls-multitpc-sim-drift-simchannel-refactored.jsonnet Added overlay_drifter support and configurable drifter selection
sim.jsonnet Externalized DBFileName and DBTag for runtime configuration
detsimmodules_wirecell_ICARUS.fcl Added YZ map configuration, updated gains, and time offsets for 2D deconvolution
normtools_icarus.fcl Updated to per-plane TPC normalization, added MC flag, new calibration constants
calorimetryICARUS.fcl MC gains now match data gains per updated calibration
NormalizeYZSQL_tool.cc Added MC flag for hardcoded run number lookup
NormalizeTPCSQL_tool.cc Added MC flag and debug output
NormalizeTPCPerPlane_tool.cc New HTTP-based per-plane TPC normalization tool
NormalizeTPCPerPlaneSQL_tool.cc New SQL-based per-plane TPC normalization tool
CMakeLists.txt (Calorimetry) Added build targets for new per-plane normalization tools
CRTDataAnalysis_module.cc Code formatting improvements and added fHitRun/fHitSubRun branches
fcl/standard/* Reorganized into mc/, data/, overlay/ subdirectories with new CMakeLists structure
stage1_run2_icarus_MC.fcl Added normalization tool configuration for MC showers with hardcoded run periods
stage1_icarus_defs.fcl Updated hit merger integration, pulse train hits, and normalization tool setup
cafmaker configurations Added geant4weight to systematic weight sequences
calibration_database_*_icarus.fcl New tag sets for Jul2025 and Oct2025 calibrations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread icaruscode/TPC/Calorimetry/NormalizeTPCSQL_tool.cc
Comment thread icaruscode/TPC/Calorimetry/NormalizeTPCSQL_tool.cc
Comment thread icaruscode/TPC/Calorimetry/NormalizeTPCPerPlane_tool.cc Outdated
Comment thread icaruscode/TPC/SignalProcessing/HitFinder/HitMerger_module.cc
Comment thread fcl/reco/Stage1/mc/stage1_run2_icarus_MC.fcl Outdated
Comment thread fcl/standard/overlay/standard_overlay_caf_iarus.fcl
@jas1005

jas1005 commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

@carriganm95 and @gputnam

Do y'all have reviewers in mind for this PR? I want to assign people to get things rolling before the collaboration meeting rolls around.

@carriganm95

Copy link
Copy Markdown
Author

@carriganm95 and @gputnam

Do y'all have reviewers in mind for this PR? I want to assign people to get things rolling before the collaboration meeting rolls around.

@carriganm95 and @gputnam

Do y'all have reviewers in mind for this PR? I want to assign people to get things rolling before the collaboration meeting rolls around.

Hi, no I don't have anyone specific in mind. @brucehoward-physics or @cerati know the most about it if they have some time.

@rtriozzi

rtriozzi commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

(Not really a review, I just started testing the tools on ICARUS 1D samples, and since I've gone through the code in detail I figured I'd leave some comments. In particular, for the 1D case, I'm sticking to the "old" non-per-plane NormalizeTPCSQL tool, so I didn't test the new per-plane tools, nor the new calibration DB tags (whatever they mean 😄). By the way, do you happen to know the status of PandoraPFAOrg/larpandora#36? Ultimately, everything will depend on that. About the tools themselves, I have a concern regarding how the default lifetime correction gets done in the shower energy tool.)

@jas1005

jas1005 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

@carriganm95 and @rtriozzi,

I remember Michael saying that work from LArPandora PR #50 (which has been closed without being merged) might need to be migrated into LArPandora in some other way. Michael, has this been done?

There are also many merge conflicts in this PR. Can one/both of you resolve them? I've taken a peek at some of the differences, and it seems quite easy to fix. I could do it myself, but there are some ambiguities I would defer to y'all for anyway.

Additionally, neither Bruce nor Giuseppe have given their approval, and neither of them have been formally added as reviewers. I will need approval from someone outside of those who authored this PR before merging everything into develop.

All other PRs requested by the Pandora Shower TF seem to build fine. This is the only roadblock for cutting the TF's ICARUSCode release.

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.

6 participants