fix(E4): guard XGB sidecar file opens by reconstruction method and cut type#355
Conversation
…t type Non-XGB effective-area and stereo-analysis jobs were unconditionally opening both XGB friend files (stereo + gamma-hadron) whenever their suffix strings were non-empty, even when the active reconstruction method and gamma-hadron cut type did not require them. Changes: - CData: store data file name in fDataFileName for deferred tree loading - CData::loadGHXGBTree(): new idempotent method to load the GH XGB friend tree on demand, after the analysis type is known - VStereoAnalysis::getDataFromFile(): pass stereo suffix only when fEnergyReconstructionMethod==2 or fDirectionReconstructionMethod==2; always pass empty GH suffix (deferred loading) - VStereoAnalysis::fillHistograms(): call loadGHXGBTree() after setCuts() if and only if fCuts->useXGBoostCuts() is true - makeEffectiveArea.cpp: guard both suffixes at construction time; fCuts->readCuts() is already called before CData is built Fixes: #352 (item E4) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes issue #352 item E4 by preventing non-XGB jobs from unconditionally opening XGB sidecar ROOT files. The fix gates the stereo-XGB suffix on the reconstruction method (==2) and the gamma-hadron-XGB suffix on the analysis type (useXGBoostCuts()). Because the analysis type is only known after VGammaHadronCuts::readCuts(), in VStereoAnalysis the GH friend tree is loaded lazily via a new idempotent CData::loadGHXGBTree() after setCuts(). In makeEffectiveArea, both decisions are made at construction time since readCuts() runs first.
Changes:
- Add
CData::fDataFileNameand idempotentCData::loadGHXGBTree()for deferred GH friend-tree loading. - In
VStereoAnalysis::getDataFromFile(), gate stereo-XGB suffix on reconstruction method and pass empty GH suffix; load GH friend tree later infillHistograms()aftersetCuts()whenuseXGBoostCuts()is true. - In
makeEffectiveArea.cpp, guard both suffixes atCDataconstruction using the reconstruction method andfCuts->useXGBoostCuts().
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/CData.cpp | Stores data filename and adds loadGHXGBTree() for deferred GH friend-tree opening. |
| inc/CData.h | Declares fDataFileName member and loadGHXGBTree() method. |
| src/VStereoAnalysis.cpp | Conditionally passes stereo-XGB suffix at construction; defers GH-XGB loading until after setCuts(). |
| src/makeEffectiveArea.cpp | Guards both XGB suffixes at CData construction using reconstruction method and cut type. |
| docs/changes/352.bugfix.md | Adds changelog entry describing the fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes issue #352 item E4: non-XGB jobs were unconditionally opening both XGB sidecar files causing spurious ROOT file-open errors and hidden artifact dependencies.
Changes: