Skip to content

CaloTowerStatus: Z-Score Patch#4314

Merged
pinkenburg merged 2 commits into
sPHENIX-Collaboration:masterfrom
Steepspace:CaloTowerStatus
Jun 24, 2026
Merged

CaloTowerStatus: Z-Score Patch#4314
pinkenburg merged 2 commits into
sPHENIX-Collaboration:masterfrom
Steepspace:CaloTowerStatus

Conversation

@Steepspace

@Steepspace Steepspace commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work for users)
  • Requiring change in macros repository (Please provide links to the macros pull request in the last section)
  • I am a member of GitHub organization of sPHENIX Collaboration, EIC, or ECCE (contact Chris Pinkenburg to join)

What kind of change does this PR introduce? (Bug fix, feature, ...)

  • Modified CaloTowerStatus::LoadCalib to calculate need_z_score based on whether z_score_threshold deviates from its default.
  • Wrapped the GetFloatValue call for the z_score field in a conditional check, eliminating the slowdowns for EMCal Hot Map CDB TTree that do not have the "CEMC_sigma" field.

TODOs (if applicable)

Links to other PRs in macros and calibration repositories (if applicable)

This PR improves the robustness and performance of CaloTowerStatus::LoadCalib for EMCal hot-tower CDB TTrees, particularly when the tree schema does not include the CEMC_sigma (z-score) field.

Key changes

  • need_z_score behavior is replaced by a direct condition: z-score (GetFloatValue of the sigma field) is fetched only when z_score_threshold differs from z_score_threshold_default.
  • The z-score field lookup from cdbttree_hotMap is now guarded, avoiding repeated access to a potentially missing CDB field for every tower.
  • Default hot-tower classification continues to rely solely on the hot-map status codes when z_score_threshold == z_score_threshold_default.

Potential risk areas

  • Reconstruction/calibration behavior: hot-tower decisions now more explicitly depend on whether z_score_threshold equals the configured default; unusual configurations should be checked for intended behavior.
  • CDB schema variability: while the guard avoids reads when the default threshold is used, a run with a non-default threshold will still expect the sigma field to exist.
  • Performance: intended improvement in load time/I/O overhead; should be validated on representative hot-map datasets.

Possible future improvements

  • Add tests for both CDB hot-map formats (with and without the sigma field) under default and non-default z_score_threshold settings.
  • Improve defensive handling (or clearer logging) when z_score_threshold is non-default but the sigma field is absent.

AI can make mistakes—please use best judgment when reviewing the change.

- Modified `CaloTowerStatus::LoadCalib` to calculate `need_z_score` based on whether `z_score_threshold` deviates from its default.
- Wrapped the `GetFloatValue` call for the z_score field in a conditional check, eliminating the slowdowns for EMCal Hot Map CDB TTree that do not have the "CEMC_sigma" field.
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d4fdafc0-4c68-4c00-a3a0-6b29b145be4f

📥 Commits

Reviewing files that changed from the base of the PR and between 638d7c5 and 95f03f6.

📒 Files selected for processing (1)
  • offline/packages/CaloReco/CaloTowerStatus.cc
🚧 Files skipped from review as they are similar to previous changes (1)
  • offline/packages/CaloReco/CaloTowerStatus.cc

📝 Walkthrough

Walkthrough

CaloTowerStatus::LoadCalib now checks whether z_score_threshold differs from its default and only reads per-tower z_score values from the hot-map calibration tree when needed.

Changes

Calo tower z_score load gating

Layer / File(s) Summary
Gate z_score field reads
offline/packages/CaloReco/CaloTowerStatus.cc
LoadCalib conditions hot-map z_score access on z_score_threshold != z_score_threshold_default, skipping the per-tower read when the default threshold is active.

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.

@sphenix-jenkins-ci

Copy link
Copy Markdown

Build & test report

Report for commit 638d7c59520864d50529ca72ebbd219b07d56f52:
Jenkins passed


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@Steepspace Steepspace marked this pull request as ready for review June 23, 2026 14:13
Copilot AI review requested due to automatic review settings June 23, 2026 14:13

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 reduces overhead in CaloTowerStatus::LoadCalib by avoiding per-tower z-score lookups from the hot map CDB unless a non-default z_score_threshold makes z-score–based masking necessary, which prevents slow behavior when the hot map CDB payload does not contain the <DET>_sigma field.

Changes:

  • Compute a need_z_score flag based on whether z_score_threshold differs from its default.
  • Conditionally call CDBTTree::GetFloatValue(..., m_fieldname_z_score) only when z-score evaluation is needed.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pinkenburg

Copy link
Copy Markdown
Contributor

replacing the boolean by a direct comparison makes this more readable for the occasional browsing. There is no speed advantage to calculating the boolean ahead of the loop.

@sphenix-jenkins-ci

Copy link
Copy Markdown

Build & test report

Report for commit 95f03f62fa98103cd65afea377eca0033773bc75:
Jenkins passed


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@pinkenburg pinkenburg merged commit 802edc3 into sPHENIX-Collaboration:master Jun 24, 2026
22 checks passed
@Steepspace Steepspace deleted the CaloTowerStatus branch June 24, 2026 18:39
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.

3 participants