Skip to content

Calo data overlay macro update#1288

Merged
pinkenburg merged 5 commits intosPHENIX-Collaboration:masterfrom
bseidlit:master
Feb 24, 2026
Merged

Calo data overlay macro update#1288
pinkenburg merged 5 commits intosPHENIX-Collaboration:masterfrom
bseidlit:master

Conversation

@bseidlit
Copy link
Contributor

@bseidlit bseidlit commented Feb 9, 2026

Calorimeter Data Overlay Macro Update

Motivation / Context

This PR updates the calorimeter data overlay macros as part of a broader code quality and infrastructure improvement effort. The changes address clang-tidy code quality issues and relocate the G4Setup_sPHENIX.C file to a common location for reusability. The PR author notes that while clang-tidy identifies issues, certain blocking errors need resolution, with fixes available in the next build release.

Key Changes

Fun4All_G4_Embed_data.C (new, 783 lines)

  • New comprehensive embedding macro for calorimeter tower overlay using Fun4All/sPHENIX framework
  • Includes library loading for G4, CaloEmbedding, Centrality, Jet, and GlobalVertex modules
  • Implements multi-calorimeter waveform simulation (CEMC, HCALIN, HCALOUT) with CaloWaveformSim, applying TEMPLATE processing
  • Sets up tower embedding via caloTowerEmbed for three calorimeter systems
  • Reconstructs truth jets using AntiKt algorithms at multiple radius parameters (r=0.2 through r=0.8) for both truth and simulated particles
  • Creates four specialized DST output files: truth+G4hits, truth+jets (with retowered variants), processed calorimeter towers, and global reconstruction data
  • Defines AddCommonNodes() helper function to standardize output by adding Sync and EventHeader nodes across all output managers
  • Configurable via parameters: event count (default 2), CDB tag (default MDC2), jet trigger type (default Jet10), input DST file

Fun4All_PrepDataFitting.C (+132/-21 lines)

  • Reduced default nEvents from 1e4 to 1e2 for faster processing
  • Expanded library dependencies: EpdReco, ZdcReco, Calo_Calib, CaloTowerBuilder, CaloWaveformProcessing, CentralityReco, MinimumBiasClassifier, TriggerDSTSkimmer
  • Refactored subsystem initialization order—moved reconstruction components (EPD, ZDC, MinimumBias, Centrality, CaloFittingQA) to post-input setup phase
  • Added multiple CaloTowerBuilder instances for detector-specific tower construction (ZDC, EMCal, HCALin, HCALout, EPD)
  • Integrated TriggerDSTSkimmer with configurable trigger masks and maximum event limits
  • Introduced file I/O: DST output path now written to prepData.txt for downstream workflow coordination
  • Modified event processing to se->run(nEvents*2)—doubling processed events while maintaining output finalization and QA

Potential Risk Areas

  • Code Quality Issues: Clang-tidy reports unresolved warnings in both macros; blocking errors must be addressed before accepting fixes per reviewer feedback
  • I/O Format Changes: PrepDataFitting now writes state to prepData.txt—downstream workflows expecting DST output path must be updated and validated
  • Event Processing Change: Doubling of processed events in PrepDataFitting (nEvents*2) significantly impacts resource usage and runtime; fitting convergence and output quality should be validated
  • Tower Embedding Reconstruction: Three independent caloTowerEmbed instances (CEMC, IHCAL, OHCAL) in embedding macro introduce sequential embedding steps; synchronization with waveform processing chains requires validation
  • CDB Interface Integration: Dynamic CDB_GLOBALTAG and TIMESTAMP handling around embedding pipeline requires careful testing to ensure calibration contexts are correctly applied and reused across procedures
  • Truth Jet Output Expansion: Adding 14 truth/simulated jet variants (7 radius values × 2 algorithms) plus 7 retowered versions increases output file size; disk I/O and memory impact should be monitored
  • Default Event Count Reduction: PrepDataFitting default reduction from 10,000 to 100 events may affect statistical quality of calibration fits if used as-is

Possible Future Improvements

  • Resolve all outstanding clang-tidy warnings and integrate clang-tidy --fix into continuous integration workflow
  • Consolidate AddCommonNodes output node lists with other production macros to reduce duplication
  • Optimize tower embedding pipeline to reduce redundant calorimeter processing steps
  • Document CDB tag and timestamp management for calibration reproducibility and debugging
  • Add configurability for event doubling factor in PrepDataFitting based on data type (data vs. simulation)

Note: AI-generated analyses can contain errors. Verify critical details (event count doubling, file I/O paths, embedding configurations, and output node lists) against actual code usage in downstream workflows before deployment.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f0806c and eb15398.

📒 Files selected for processing (1)
  • DataOverlayProduction/Fun4All_G4_Embed_data.C

📝 Walkthrough

Walkthrough

This PR introduces a complete G4 embedding macro for Fun4All/sPHENIX with configurable PYTHIA8 generation, calorimeter embedding, and multi-stream output handling. Additionally, it refactors the PrepDataFitting macro to include tower builders and reconstruction components for EPD, ZDC, and centrality determination.

Changes

Cohort / File(s) Summary
New Embedding Macro
DataOverlayProduction/Fun4All_G4_Embed_data.C
New comprehensive embedding workflow with library loading, PYTHIA8 input generation (Jet10/Jet30/Jet40/PhotonJet20), GEANT4 detector configuration, calorimeter embedding (CEMC/HCALIN/HCALOUT), waveform processing, truth jet reconstruction (r02–r08), and configurable output managers. Exposes Fun4All_G4_Embed_data() and AddCommonNodes() public functions.
Refactored Data Preparation
DataOverlayProduction/Fun4All_PrepDataFitting.C
Restructured macro to instantiate calorimeter tower builders (ZDC, EMCal, HCAL), add reconstruction subsystems (EpdReco, ZdcReco, CentralityReco, MinimumBiasClassifier, TriggerDSTSkimmer), and persist DST output path to prepData.txt. Reduced default nEvents from 1e4 to 1e2 and doubled processing via se->run(nEvents*2).

Possibly related PRs


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sphenix-jenkins-ci
Copy link

For repository maintainers, please start the CI check manually (feedback)

This is an automatic message to assist manually starting CI check for this pull request, commit dec63214f21eaafaa6430ac3568a53569b5e879f. macros pull request require a manual start for CI checks, in particular selecting which coresoftware and calibrations versions to check against this macros pull request.

sPHENIX software maintainers: please make your input here and start the Build:

build

Note:

  1. if needed, fill in the pull request ID for the coresoftware pull request, e.g. origin/pr/1697/merge for PR#1697 in sha_coresoftware. Default is to check with the master branch.
  2. click Build button at the end of the long web page to start the test

Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@pinkenburg
Copy link
Contributor

clang-tidy finds a few issues in the macros (e.g. G4Setup_sPHENIX.C is missing):
https://web.sdcc.bnl.gov/jenkins-sphenix/job/sPHENIX/job/clang-tidy-macros-pipeline/123//clang-tidy/new/
The missing include will become available with the release of next new build (30 minutes or so). Then running this in the macro area
clang-tidy *.C -- -Wall -Werror -Wshadow -std=c++20 -Wno-dangling -isystem$OFFLINE_MAIN/include -isystem$ROOTSYS/include -isystem$G4_MAIN/include -isystem$G4_MAIN/include/Geant4 -isystem$OPT_SPHENIX/include -isystem$OFFLINE_MAIN/rootmacros -DHomogeneousField -DEVTGENA_HEPMC3 -DRAVE -DRaveDllExport=
will reproduce jenkins (running with --fix like clang-tidy *.C --fix -- .... will auto correct some warnings after errors are fixed)

@sphenix-jenkins-ci
Copy link

For repository maintainers, please start the CI check manually (feedback)

This is an automatic message to assist manually starting CI check for this pull request, commit ee7272d2e5f9b99fb4b0950555ef7a901ebd7873. macros pull request require a manual start for CI checks, in particular selecting which coresoftware and calibrations versions to check against this macros pull request.

sPHENIX software maintainers: please make your input here and start the Build:

build

Note:

  1. if needed, fill in the pull request ID for the coresoftware pull request, e.g. origin/pr/1697/merge for PR#1697 in sha_coresoftware. Default is to check with the master branch.
  2. click Build button at the end of the long web page to start the test

Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@sphenix-jenkins-ci
Copy link

For repository maintainers, please start the CI check manually (feedback)

This is an automatic message to assist manually starting CI check for this pull request, commit 8ef87e053602511cdf83586ccf32cd6298b01172. macros pull request require a manual start for CI checks, in particular selecting which coresoftware and calibrations versions to check against this macros pull request.

sPHENIX software maintainers: please make your input here and start the Build:

build

Note:

  1. if needed, fill in the pull request ID for the coresoftware pull request, e.g. origin/pr/1697/merge for PR#1697 in sha_coresoftware. Default is to check with the master branch.
  2. click Build button at the end of the long web page to start the test

Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@sphenix-jenkins-ci
Copy link

For repository maintainers, please start the CI check manually (feedback)

This is an automatic message to assist manually starting CI check for this pull request, commit 4f0806c38cd50458b20ba02878cf95d03357b998. macros pull request require a manual start for CI checks, in particular selecting which coresoftware and calibrations versions to check against this macros pull request.

sPHENIX software maintainers: please make your input here and start the Build:

build

Note:

  1. if needed, fill in the pull request ID for the coresoftware pull request, e.g. origin/pr/1697/merge for PR#1697 in sha_coresoftware. Default is to check with the master branch.
  2. click Build button at the end of the long web page to start the test

Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@sphenix-jenkins-ci
Copy link

For repository maintainers, please start the CI check manually (feedback)

This is an automatic message to assist manually starting CI check for this pull request, commit eb1539841b057911a5c5158adb94f39972d7e1c0. macros pull request require a manual start for CI checks, in particular selecting which coresoftware and calibrations versions to check against this macros pull request.

sPHENIX software maintainers: please make your input here and start the Build:

build

Note:

  1. if needed, fill in the pull request ID for the coresoftware pull request, e.g. origin/pr/1697/merge for PR#1697 in sha_coresoftware. Default is to check with the master branch.
  2. click Build button at the end of the long web page to start the test

Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@pinkenburg pinkenburg merged commit 9143e75 into sPHENIX-Collaboration:master Feb 24, 2026
4 checks passed
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.

2 participants