refactor: remove obsolete STANDALONE guards from u4 and sysrap#340
Conversation
This is intended as a cleanup/refactor with no behavioral change to the current `U4` build. - remove the `STANDALONE` compile definition from `u4` - make the existing `U4` genstep collection and photon labeling paths unconditional - simplify `OpticksPhoton.hh` and `Local_DsG4Scintillation` by removing dead `STANDALONE` branches - delete the obsolete `OpticksPhotonSTANDALONETest` sources and test list entry
e6d1024 to
30360db
Compare
There was a problem hiding this comment.
Pull request overview
This PR removes the legacy STANDALONE compile-flag plumbing and corresponding dead preprocessor branches, making the U4 genstep collection / photon labeling instrumentation compile unconditionally and deleting the obsolete standalone OpticksPhoton test sources.
Changes:
- Remove
STANDALONEfrom theU4target compile definitions and delete#ifdef STANDALONEbranches in U4 optical processes. - Simplify
sysrap/OpticksPhoton.hhby removing theSTANDALONEexport/header-only split and remove the obsoleteOpticksPhotonSTANDALONETestscripts/sources. - Keep genstep collection / photon labeling calls always compiled (now independent of
STANDALONE).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| u4/Local_G4Cerenkov_modified.cc | Removes STANDALONE guards around U4 instrumentation calls; now compiles those paths unconditionally. |
| u4/Local_DsG4Scintillation.hh | Removes unused STANDALONE/DsPhysConsOptical.h include branching. |
| u4/Local_DsG4Scintillation.cc | Removes STANDALONE guards around U4 instrumentation and verbosity env handling. |
| u4/CMakeLists.txt | Drops STANDALONE compile definition from the U4 target. |
| sysrap/OpticksPhoton.hh | Removes STANDALONE conditional export/header-only subset split. |
| sysrap/tests/tests.txt | Removes the (already commented-out) standalone photon test entry. |
| sysrap/tests/OpticksPhotonSTANDALONETest.sh | Deletes obsolete standalone test runner script. |
| sysrap/tests/OpticksPhotonSTANDALONETest.cc | Deletes obsolete standalone test source. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| //////////////////////////////////////////////////////////////// | ||
|
|
||
| #ifdef STANDALONE | ||
| fNumPhotons = std::min( fNumPhotons, 5 ); // artifical reduction for debugging convenience |
There was a problem hiding this comment.
removing the guard does not newly introduce the cap. STANDALONE was always on.
| const char* fallback = "0"; | ||
| int level = std::atoi(level_ ? level_ : fallback); | ||
| SetVerboseLevel(level); | ||
| std::cout << "Local_DsG4Scintillation::Local_DsG4Scintillation level " << level << " verboseLevel " << verboseLevel << std::endl; |
…NDALONE: remove the cap entirely
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This is intended as a cleanup/refactor with no behavioral change to the current
U4build.STANDALONEcompile definition fromu4U4genstep collection and photon labeling paths unconditionalOpticksPhoton.hhandLocal_DsG4Scintillationby removing deadSTANDALONEbranchesOpticksPhotonSTANDALONETestsources and test list entry