Skip to content

add option to not do rescaling in RetowerCEMC#4283

Merged
pinkenburg merged 4 commits into
sPHENIX-Collaboration:masterfrom
vbailey2:retowermasking
Jun 5, 2026
Merged

add option to not do rescaling in RetowerCEMC#4283
pinkenburg merged 4 commits into
sPHENIX-Collaboration:masterfrom
vbailey2:retowermasking

Conversation

@vbailey2

@vbailey2 vbailey2 commented Jun 3, 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, ...)

Adding flag to not rescale EMCal retower energy by fraction of dead area. See details of the problems this causes in Dennis's presentation here: https://indico.bnl.gov/event/33114/

TODOs (if applicable)

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

HIJetReco update coming

Motivation / Context

EMCal retowering previously unconditionally rescaled retowered energy by the fraction of good area when towers exceeded a dead-area threshold. That behavior can bias reconstruction in regions with dead towers; this PR introduces a configurable option to disable that rescaling so groups can choose the reconstruction strategy that matches their analyses (motivated by Dennis's presentation).

Note: this summary was produced with AI assistance — AI can make mistakes; please verify details against the code and tests.

Key changes

  • Add boolean configuration flag _do_rescale with public setter set_do_rescale(bool) to control whether retowered energy is divided by (1 - dead_fraction).
    • Default is false (no rescaling).
  • Change default _frac_cut from 0.5 → 1.0 (effectively disabling automatic masking by default).
  • In RetowerCEMC::process_event (TowerInfo path), conditionalize rescaling:
    • If scalefactor > _frac_cut → set energy=0 and mark hot.
    • Else set energy = retower_e_temp / (1 - scalefactor) when _do_rescale==true, otherwise set energy = retower_e_temp.
    • Time calculation unchanged; chi2 is used to store scalefactor for monitoring.
  • No exported API removals; only a setter added.

Potential risk areas

  • Reconstruction behavior change: defaults now avoid rescaling and use _frac_cut = 1.0. Workflows expecting previous behavior must explicitly set _do_rescale = true or restore _frac_cut.
  • Inconsistency risk: the conditional rescaling is applied in the TowerInfo/code path shown in the diff; ensure the RawTower path (used when m_use_towerinfo==false) is treated consistently if needed (current RawTower path builds retower energies without dead-area handling).
  • IO / format: no new persisted data formats, but retowered energy interpretation changes unless macros are updated.
  • Validation risk: physics-level validation (jet energy scale, efficiencies) required to quantify effects.
  • Thread-safety / performance: no new shared mutable state or algorithmic complexity; _do_rescale is a simple config flag.

Possible future improvements

  • Apply the _do_rescale conditional (or equivalent dead-area handling) to alternate code paths (RawTower path) for consistent behavior.
  • Add unit/integration tests that exercise both settings and document expected physics impacts.
  • Add runtime logging/verbosity to report masking/rescaling decisions for validation.
  • Provide migration notes and update macros (HIJetReco) alongside this PR to avoid surprises in downstream workflows.

@coderabbitai

coderabbitai Bot commented Jun 3, 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: 52234fa3-2c7a-44a9-9346-1c5e0b95b836

📥 Commits

Reviewing files that changed from the base of the PR and between 8d386e9 and 25eecda.

📒 Files selected for processing (2)
  • offline/packages/jetbackground/RetowerCEMC.cc
  • offline/packages/jetbackground/RetowerCEMC.h
🚧 Files skipped from review as they are similar to previous changes (2)
  • offline/packages/jetbackground/RetowerCEMC.cc
  • offline/packages/jetbackground/RetowerCEMC.h

📝 Walkthrough

Walkthrough

RetowerCEMC adds a public configuration flag _do_rescale (default false) and raises _frac_cut default from 0.5 to 1. In process_event, the energy-rescaling division by (1 − scalefactor) for towers with scalefactor <= _frac_cut is applied only when _do_rescale is true; time and chi2 assignments are unchanged.

Changes

Configurable tower energy rescaling

Layer / File(s) Summary
Configuration interface and defaults
offline/packages/jetbackground/RetowerCEMC.h
New public inline setter set_do_rescale(bool) added. Private defaults updated: _frac_cut default raised from 0.5 to 1, and new _do_rescale boolean member added with default false.
Conditional rescaling implementation
offline/packages/jetbackground/RetowerCEMC.cc
In the scalefactor <= _frac_cut branch of process_event, the energy rescaling formula dividing retower_e_temp by (1 - scalefactor) is now applied only when _do_rescale is true. Time and chi2 calculations remain unconditional in this branch.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Infer (1.2.0)
offline/packages/jetbackground/RetowerCEMC.cc

In file included from offline/packages/jetbackground/RetowerCEMC.cc:1:
offline/packages/jetbackground/RetowerCEMC.h:4:10: fatal error: 'fun4all/SubsysReco.h' file not found
4 | #include <fun4all/SubsysReco.h>
| ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Error: the following clang command did not run successfully:
/opt/infer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang-18
@/tmp/coderabbit-infer/25eecda311902299ca488b54b7e02fe361266675-017e50aac346ccde/tmp/clang_command_.tmp.9368c3.txt
++Contents of '/tmp/coderabbit-infer/25eecda311902299ca488b54b7e02fe361266675-017e50aac346ccde/tmp/clang_command_.tmp.9368c3.txt':
"-cc1" "-load"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib"
"-add-plugin" "BiniouASTExporter" "-plugin-arg-BiniouASTExporter" "-"
"-plugin-arg-BiniouASTExporter" "PREPEND_CURRENT_DIR=1"
"-plugin-arg-BiniouASTExporter" "M

... [truncated 1200 characters] ...

nclude"
"-internal-isystem" "/usr/local/include" "-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-Wno-ignored-optimization-argument" "-Wno-everything"
"-fdeprecated-macro" "-ferror-limit" "19" "-fgnuc-version=4.2.1"
"-fskip-odr-check-in-gmf" "-fcxx-exceptions" "-fexceptions"
"-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o"
"/tmp/coderabbit-infer/017e50aac346ccde/file.o" "-x" "c++"
"offline/packages/jetbackground/RetowerCEMC.cc" "-O0" "-fno-builtin"
"-include"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../lib/clang_wrappers/global_defines.h"
"-Wno-everything"


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.

@vbailey2 vbailey2 marked this pull request as ready for review June 3, 2026 22:49

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c8b65300-6d78-4641-b28a-f4263d9aadc8

📥 Commits

Reviewing files that changed from the base of the PR and between 60d8546 and 7d93cb5.

📒 Files selected for processing (2)
  • offline/packages/jetbackground/RetowerCEMC.cc
  • offline/packages/jetbackground/RetowerCEMC.h

Comment on lines +148 to +152
if(_do_rescale)
{
towerinfo->set_energy(retower_e_temp / (double) (1 - scalefactor));
}
else towerinfo->set_energy(retower_e_temp);

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.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Division by zero when scalefactor == 1.0 and rescaling is enabled.

If a retower bin has 100% bad area (scalefactor = 1.0) and _do_rescale is true, line 150 will divide by zero: retower_e_temp / (1 - 1) = retower_e_temp / 0, producing NaN or inf. This case is reachable because:

  1. The masking condition at line 141 is scalefactor > _frac_cut. With the new default _frac_cut = 1, a tower with exactly scalefactor = 1 passes through to the rescaling branch.
  2. When all contributing EMCal towers in a bin are bad, scalefactor = retower_badarea / retower_totalarea = 1.

Add a guard to prevent division by zero or by values very close to zero.

🛡️ Proposed fix to guard against division by zero
         else
         {
           if(_do_rescale)
 	  {
-	    towerinfo->set_energy(retower_e_temp / (double) (1 - scalefactor));
+	    if (scalefactor < 1.0)
+	    {
+	      towerinfo->set_energy(retower_e_temp / (double) (1 - scalefactor));
+	    }
+	    else
+	    {
+	      towerinfo->set_energy(0);  // or handle as masked tower
+	    }
 	  }
 	  else towerinfo->set_energy(retower_e_temp);

Alternatively, consider whether towers with scalefactor approaching 1 should be masked rather than rescaled.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if(_do_rescale)
{
towerinfo->set_energy(retower_e_temp / (double) (1 - scalefactor));
}
else towerinfo->set_energy(retower_e_temp);
if(_do_rescale)
{
if (scalefactor < 1.0)
{
towerinfo->set_energy(retower_e_temp / (double) (1 - scalefactor));
}
else
{
towerinfo->set_energy(0); // or handle as masked tower
}
}
else towerinfo->set_energy(retower_e_temp);

Comment on lines +36 to +37
double _frac_cut{1};
bool _do_rescale{false};

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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the impact of the _frac_cut default change on downstream tower usage

# Search for how the retower output is consumed and whether masking behavior matters
rg -nP --type=cc -C3 'TOWER_CALIB_CEMC_RETOWER|CEMC_RETOWER' -g '!RetowerCEMC.cc'

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 105


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 1) Locate and inspect RetowerCEMC.h around the relevant lines
REPO_ROOT="$(pwd)"
FILE="$(fd -a --full-path 'RetowerCEMC.h' . | head -n 1 || true)"
echo "Found RetowerCEMC.h: $FILE"
if [[ -n "${FILE:-}" ]]; then
  echo "---- RetowerCEMC.h lines 1-120 ----"
  nl -ba "$FILE" | sed -n '1,120p'
fi

# 2) Find all usages of _frac_cut and masking logic
if [[ -n "${FILE:-}" ]]; then
  echo "---- _frac_cut usage ----"
  rg -n "_frac_cut" "$FILE" -C2 || true
  echo "---- _frac_cut usage across repo (limited to likely files) ----"
  rg -n "_frac_cut" -S . | head -n 200
fi

# 3) Find strings for retower outputs and downstream consumption
echo "---- Search for retower output consumers ----"
rg -n --hidden --no-ignore-vcs -S 'TOWER_CALIB_CEMC_RETOWER|CEMC_RETOWER' . | head -n 200

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 261


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 1) Locate and inspect RetowerCEMC.h around the relevant lines
REPO_ROOT="$(pwd)"
FILE="$(fd -a --full-path 'RetowerCEMC.h' . | head -n 1 || true)"
echo "Found RetowerCEMC.h: $FILE"
if [[ -n "${FILE:-}" ]]; then
  echo "---- RetowerCEMC.h lines 1-120 ----"
  nl -ba "$FILE" | sed -n '1,120p'
fi

# 2) Find all usages of _frac_cut and masking logic
if [[ -n "${FILE:-}" ]]; then
  echo "---- _frac_cut usage ----"
  rg -n "_frac_cut" "$FILE" -C2 || true
  echo "---- _frac_cut usage across repo (limited to likely files) ----"
  rg -n "_frac_cut" -S . | head -n 200
fi

# 3) Find strings for retower outputs and downstream consumption
echo "---- Search for retower output consumers ----"
rg -n --hidden --no-ignore-vcs -S 'TOWER_CALIB_CEMC_RETOWER|CEMC_RETOWER' . | head -n 200

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 261


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="$(fd -a --full-path 'RetowerCEMC.h' . | head -n 1 || true)"
echo "Found RetowerCEMC.h: $FILE"
if [[ -n "${FILE:-}" ]]; then
  echo "---- RetowerCEMC.h lines 1-160 ----"
  nl -ba "$FILE" | sed -n '1,160p'
fi

if [[ -n "${FILE:-}" ]]; then
  echo "---- _frac_cut usage (within file) ----"
  rg -n "_frac_cut" "$FILE" -C2 || true
fi

echo "---- _frac_cut usage across repo (first 200 hits) ----"
rg -n "_frac_cut" -S . | head -n 200 || true

echo "---- Retower output identifiers usage (first 200 hits) ----"
rg -n --hidden --no-ignore-vcs -S 'TOWER_CALIB_CEMC_RETOWER|CEMC_RETOWER' . | head -n 200 || true

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 260


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="$(fd -a --full-path 'RetowerCEMC.h' . | head -n 1 || true)"
echo "Found RetowerCEMC.h: $FILE"

if [[ -n "${FILE:-}" ]]; then
  echo "---- RetowerCEMC.h excerpt (1-220) with line numbers ----"
  # Use cat -n (available) instead of nl
  cat -n "$FILE" | sed -n '1,220p'
  echo "---- _frac_cut usage (within file) ----"
  rg -n "_frac_cut" "$FILE" -C3 || true
fi

echo "---- Retower output identifier usage (first 200 hits) ----"
rg -n --hidden --no-ignore-vcs -S 'TOWER_CALIB_CEMC_RETOWER|CEMC_RETOWER' . | head -n 200 || true

echo "---- Any masking-related usage nearby ----"
rg -n --hidden --no-ignore-vcs -S 'mask|masked|bad.*frac|frac_cut|rescale|scalefactor' offline/packages/jetbackground/RetowerCEMC.h 2>/dev/null || true

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 10758


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# locate RetowerCEMC.cc
FILE="$(fd -a --full-path 'RetowerCEMC.cc' . | head -n 1 || true)"
echo "Found RetowerCEMC.cc: $FILE"

if [[ -n "${FILE:-}" ]]; then
  echo "---- RetowerCEMC.cc excerpt around _frac_cut ----"
  rg -n "_frac_cut" "$FILE" -n -C3 || true

  echo "---- Search for scalefactor/rescale/mask/bad area logic ----"
  rg -n --hidden --no-ignore-vcs -S 'scalefactor|rescale|rescal|frac_cut|bad.*area|mask|masked|badFrac|fraction' "$FILE" -C2 || true

  echo "---- Show function(s) that likely use _frac_cut (first few matches) ----"
  # Grab some broader context around the first occurrences
  FIRST=$(rg -n "_frac_cut" "$FILE" | head -n 1 | cut -d: -f1 || true)
  if [[ -n "${FIRST:-}" ]]; then
    START=$((FIRST-80))
    END=$((FIRST+120))
    if (( START<1 )); then START=1; fi
    echo "---- RetowerCEMC.cc lines $START-$END ----"
    sed -n "${START},${END}p" "$FILE" | cat -n
  fi
fi

echo "---- Inspect likely downstream usage: JetBackgroundCut.h and DetermineTowerBackground.cc ----"
for f in offline/packages/jetbackground/JetBackgroundCut.h offline/packages/jetbackground/DetermineTowerBackground.cc offline/packages/jetbase/TowerJetInput.cc; do
  if [[ -f "$f" ]]; then
    echo "### $f"
    rg -n --no-ignore-vcs -S 'TOWERINFO_CALIB_CEMC_RETOWER|TOWER_CALIB_CEMC_RETOWER|m_input_cemc_tower_node|mask|masked|bad|frac_cut|towerinfo' "$f" -C2 || true
  fi
done

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 35273


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="$(fd -a --full-path 'RetowerCEMC.cc' . | head -n 1 || true)"
echo "RetowerCEMC.cc: $FILE"

if [[ -n "${FILE:-}" ]]; then
  # show sections around get_fraction and get_weighted_fraction and retower_totalarea computation
  # We'll locate "void RetowerCEMC::get_fraction" line numbers
  EF=$(rg -n "void RetowerCEMC::get_fraction" "$FILE" | cut -d: -f1 | head -n1 || true)
  EW=$(rg -n "void RetowerCEMC::get_weighted_fraction" "$FILE" | cut -d: -f1 | head -n1 || true)
  echo "get_fraction starts at: ${EF:-N/A}, get_weighted_fraction starts at: ${EW:-N/A}"

  if [[ -n "${EF:-}" ]]; then
    START=$((EF-40)); END=$((EF+140))
    (( START<1 )) && START=1
    echo "---- RetowerCEMC.cc excerpt around get_fraction ($START-$END) ----"
    sed -n "${START},${END}p" "$FILE" | cat -n
  fi

  if [[ -n "${EW:-}" ]]; then
    START=$((EW-40)); END=$((EW+220))
    (( START<1 )) && START=1
    echo "---- RetowerCEMC.cc excerpt around get_weighted_fraction ($START-$END) ----"
    sed -n "${START},${END}p" "$FILE" | cat -n
  fi
fi

echo "---- Locate TowerInfo definitions for set_isHot/get_isGood ----"
# Find TowerInfo.h/cc and relevant methods
TIH="$(fd -a --full-path 'TowerInfo*' . | rg -m 1 -v '/src/' || true)"
echo "Some TowerInfo* match (first): $TIH"

# Use ripgrep for set_isHot and get_isGood in headers
rg -n --hidden --no-ignore-vcs -S 'set_isHot\(|get_isGood\(' . | head -n 50 || true

# Specifically locate TowerInfo class header if present
TOWERINFO_H=$(fd -a --full-path 'TowerInfo.h' . | head -n 5 || true)
echo "TowerInfo.h candidates:"
echo "$TOWERINFO_H" | head -n 5
for f in $TOWERINFO_H; do
  echo "---- excerpt from $f ----"
  rg -n "class TowerInfo|set_isHot|get_isGood" "$f" -n -C2 || true
done

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 18685


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="$(fd -a --full-path 'RetowerCEMC.cc' . | head -n 1 || true)"
echo "RetowerCEMC.cc: $FILE"

if [[ -n "${FILE:-}" ]]; then
  EF=$(rg -n "void RetowerCEMC::get_fraction" "$FILE" | cut -d: -f1 | head -n1 || true)
  EW=$(rg -n "void RetowerCEMC::get_weighted_fraction" "$FILE" | cut -d: -f1 | head -n1 || true)
  echo "get_fraction starts at: ${EF:-N/A}, get_weighted_fraction starts at: ${EW:-N/A}"

  if [[ -n "${EF:-}" ]]; then
    START=$((EF-40)); END=$((EF+160))
    (( START<1 )) && START=1
    echo "---- RetowerCEMC.cc excerpt around get_fraction ($START-$END) ----"
    sed -n "${START},${END}p" "$FILE" | cat -n
  fi

  if [[ -n "${EW:-}" ]]; then
    START=$((EW-40)); END=$((EW+260))
    (( START<1 )) && START=1
    echo "---- RetowerCEMC.cc excerpt around get_weighted_fraction ($START-$END) ----"
    sed -n "${START},${END}p" "$FILE" | cat -n
  fi
fi

echo "---- Locate TowerInfo definitions for set_isHot/get_isGood ----"
# Search for the methods across the repo (limit output)
rg -n --hidden --no-ignore-vcs -S 'set_isHot\(|get_isGood\(' . | head -n 80 || true

# Try common header name
TOWERINFO_H=$(fd -a --full-path 'TowerInfo*.h' . | head -n 20 || true)
echo "TowerInfo*.h candidates (up to 20):"
echo "$TOWERINFO_H" | head -n 20

for f in $TOWERINFO_H; do
  if [[ -f "$f" ]]; then
    if rg -q "class TowerInfo" "$f" || rg -q "set_isHot" "$f" || rg -q "get_isGood" "$f"; then
      echo "---- relevant excerpt from $f ----"
      rg -n "set_isHot|get_isGood" "$f" -C2 || true
    fi
  fi
done

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 18443


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="$(fd -a --full-path 'RetowerCEMC.cc' . | head -n 1 || true)"
echo "RetowerCEMC.cc: $FILE"

if [[ -n "${FILE:-}" ]]; then
  EF=$(rg -n "void RetowerCEMC::get_fraction" "$FILE" | cut -d: -f1 | head -n1 || true)
  EW=$(rg -n "void RetowerCEMC::get_weighted_fraction" "$FILE" | cut -d: -f1 | head -n1 || true)
  echo "get_fraction starts at: ${EF:-N/A}, get_weighted_fraction starts at: ${EW:-N/A}"

  if [[ -n "${EF:-}" ]]; then
    START=$((EF-40)); END=$((EF+160))
    (( START<1 )) && START=1
    echo "---- RetowerCEMC.cc excerpt around get_fraction ($START-$END) ----"
    sed -n "${START},${END}p" "$FILE" | cat -n
  fi

  if [[ -n "${EW:-}" ]]; then
    START=$((EW-40)); END=$((EW+260))
    (( START<1 )) && START=1
    echo "---- RetowerCEMC.cc excerpt around get_weighted_fraction ($START-$END) ----"
    sed -n "${START},${END}p" "$FILE" | cat -n
  fi
fi

echo "---- Locate TowerInfo definitions for set_isHot/get_isGood ----"
# Search for the methods across the repo (limit output)
rg -n --hidden --no-ignore-vcs -S 'set_isHot\(|get_isGood\(' . | head -n 80 || true

# Try common header name
TOWERINFO_H=$(fd -a --full-path 'TowerInfo*.h' . | head -n 20 || true)
echo "TowerInfo*.h candidates (up to 20):"
echo "$TOWERINFO_H" | head -n 20

for f in $TOWERINFO_H; do
  if [[ -f "$f" ]]; then
    if rg -q "class TowerInfo" "$f" || rg -q "set_isHot" "$f" || rg -q "get_isGood" "$f"; then
      echo "---- relevant excerpt from $f ----"
      rg -n "set_isHot|get_isGood" "$f" -C2 || true
    fi
  fi
done

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 18443


Major: Raise of _frac_cut default to 1.0 effectively disables retower masking (behavioral impact)

double _frac_cut{1};
bool _do_rescale{false};

In offline/packages/jetbackground/RetowerCEMC.cc, a (retower) tower is masked only when scalefactor = retower_badarea / retower_totalarea[ieta_ihcal] satisfies scalefactor > _frac_cut; then the code sets towerinfo->set_energy(0) and towerinfo->set_isHot(true) (which makes tower->get_isGood() false in TowerInfov2/4). With _frac_cut now defaulting to 1.0, masking should only occur if scalefactor exceeds ~1 due to numerical effects, so high-bad-area towers will generally remain unmasked and therefore propagate through downstream steps like offline/packages/jetbackground/DetermineTowerBackground.cc, which excludes masked towers via !towerinfo->get_isGood() (and also references E==0 exclusion).

Confirm this intended change in default behavior and that downstream analyses expect towers with large bad-area fractions to remain included; PR description should explicitly state analysis impact and whether reprocessing is required.

@sphenix-jenkins-ci

Copy link
Copy Markdown

Build & test report

Report for commit 727d732973ee35d1d373fc7d257681d3383a3883:
Jenkins passed


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@sphenix-jenkins-ci

Copy link
Copy Markdown

Build & test report

Report for commit 7d93cb5d96875dbe87f870924c66912edaccd7e7:
Jenkins passed


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@sphenix-jenkins-ci

Copy link
Copy Markdown

Build & test report

Report for commit 8d386e95729cf8c5a55840b1db142ed8ce4f6e98:
Jenkins passed


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@sphenix-jenkins-ci

Copy link
Copy Markdown

Build & test report

Report for commit 25eecda311902299ca488b54b7e02fe361266675:
Jenkins passed


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@pinkenburg

Copy link
Copy Markdown
Contributor

the valgrind error is from the new acts version and needs to be suppressed

@pinkenburg pinkenburg merged commit 9128ec0 into sPHENIX-Collaboration:master Jun 5, 2026
21 of 22 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