v492 dev16#143
Conversation
There was a problem hiding this comment.
Pull request overview
This PR is part of the v492 development cycle and refactors several IRF (Instrument Response Function) production shell scripts. It (a) disables/comments out the "curved atmosphere" MC simulation path while keeping it as a future re-enable marker (CURVED_ATMOSPHERE_MC), (b) consolidates the log directory to live under the output directory across multiple stages, (c) makes the XGB gamma/hadron training script read zenith and NSB binning from the JSON run-parameter file instead of hard-coded arrays, and (d) refines the zenith-angle-dependent disp BDT directory selection (replacing SZE/MZE/LZE/XZE buckets with explicit per-degree subdirectories and adding a flat-atmosphere subpath).
Changes:
- Disable curved-atmosphere input directories across mscw / lookup / TMVA / production scripts and update related log paths.
- Make XGB gamma/hadron training parameterize zenith bins and NSB levels from JSON, and randomize background file selection across all zenith bins via
shuf. - Refine disp BDT directory selection (
_flatsuffix, finer per-zenith bins, RedHV fallback handling) inIRF.mscw_energy_MC_sub.sh.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/IRF.trainXGBforGammaHadronSeparationTraining.sh | Read zenith/NSB bins from JSON; loop over NEZE zenith dirs; combine + reshuffle background lists via tmpfile and shuf. |
| scripts/IRF.trainTMVAforAngularReconstruction.sh | Move LOGDIR under ODIR; comment out curved INDIR; update error wording. |
| scripts/IRF.production.sh | Tweak test config comments; change BCKDIR from _DISP to _XGB; comment out curved simulation branch. |
| scripts/IRF.mscw_energy_MC.sh | Disable curved INDIR; place LOGDIR under ODIR; add ODIR mkdir/chmod. |
| scripts/IRF.generate_lookup_table_parts.sh | Disable curved INDIR; place LOGDIR under ODIR; update error wording. |
| scripts/IRF.generate_effective_area_parts.sh | Move LOGDIR under ODIR. |
| scripts/IRF.combine_lookup_table_parts.sh | Move LOGDIR under ODIR. |
| scripts/helper_scripts/IRF.mscw_energy_MC_sub.sh | Use ${ANATYPE}_flat (else branch only); replace SZE/MZE/LZE/XZE buckets with explicit per-degree dirs; add RedHV fallbacks at high zenith. |
| scripts/helper_scripts/IRF.dispXGB_sub.sh | Remove a stale comment. |
Comments suppressed due to low confidence (1)
scripts/IRF.trainTMVAforAngularReconstruction.sh:101
- After this change, the fallback
INDIRassignment insideif [[ ! -d $INDIR ]]is identical to the primaryINDIRset above (both${INDIRBASE}/ze${ZA}deg_offset${W}deg_NSB${N}MHz). The fallback block is now dead code — the directory check will never succeed on the second attempt if it failed the first. Either remove the redundant fallback, or restore a meaningful alternative path. The error message "(minus curved)" is also confusing now that no curved path is searched.
if [[ ! -d $INDIR ]]; then
INDIR="${INDIRBASE}/ze${ZA}deg_offset${W}deg_NSB${N}MHz"
if [[ ! -d $INDIR ]]; then
echo "Error, could not locate input directory. Locations searched (minus curved):"
echo "$INDIR"
exit 1
fi
fi
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request primarily standardizes directory structures, improves configuration flexibility, and removes legacy support for "curved atmosphere" Monte Carlo (MC) data in various IRF (Instrument Response Function) production scripts. The changes also enhance the reproducibility and maintainability of training and job submission workflows by making parameters more configurable and by improving the handling of training and background files.
Key changes include:
Directory Structure Standardization:
LOGDIR) as subdirectories of their respective output directories (ODIR), rather than using longer, hardcoded paths. This improves clarity and maintainability across the codebase. [1] [2] [3] [4] [5]Removal of Curved Atmosphere MC Handling:
Training and Parameterization Improvements:
IRF.trainXGBforGammaHadronSeparationTraining.sh) now reads zenith and noise bins directly from the JSON parameter file, rather than relying on hardcoded values. This makes training more flexible and easier to configure.Job Submission and Directory Handling Enhancements:
IRF.production.shis now named with a consistent_XGBsuffix, matching the updated workflow.DispBDT Directory and Zenith Handling:
IRF.mscw_energy_MC_sub.shis updated to use a_flatsuffix and to select zenith angle subdirectories by degree (e.g.,20deg,45deg) instead of legacy labels, with special handling for incomplete MC sets.These updates collectively streamline the IRF production process, reduce legacy complexity, and make the scripts more robust and easier to maintain.