Skip to content

refactor: remove obsolete STANDALONE guards from u4 and sysrap#340

Merged
plexoos merged 3 commits into
mainfrom
remove-standalone-branch
May 28, 2026
Merged

refactor: remove obsolete STANDALONE guards from u4 and sysrap#340
plexoos merged 3 commits into
mainfrom
remove-standalone-branch

Conversation

@plexoos

@plexoos plexoos commented May 26, 2026

Copy link
Copy Markdown
Member

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

Copilot AI review requested due to automatic review settings May 26, 2026 15:42
@plexoos plexoos self-assigned this May 26, 2026
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
@plexoos plexoos force-pushed the remove-standalone-branch branch from e6d1024 to 30360db Compare May 26, 2026 15:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 STANDALONE from the U4 target compile definitions and delete #ifdef STANDALONE branches in U4 optical processes.
  • Simplify sysrap/OpticksPhoton.hh by removing the STANDALONE export/header-only split and remove the obsolete OpticksPhotonSTANDALONETest scripts/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.

Comment thread u4/Local_G4Cerenkov_modified.cc Outdated
////////////////////////////////////////////////////////////////

#ifdef STANDALONE
fNumPhotons = std::min( fNumPhotons, 5 ); // artifical reduction for debugging convenience

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

removing the guard does not newly introduce the cap. STANDALONE was always on.

Comment thread u4/Local_DsG4Scintillation.cc Outdated
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;
@plexoos

plexoos commented May 28, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

@plexoos plexoos merged commit 1ed6074 into main May 28, 2026
14 checks passed
@plexoos plexoos deleted the remove-standalone-branch branch May 28, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants