Skip to content

Subtract the CDC pedestal in double so a large pedestal gives a negative charge - #1269

Merged
nsjarvis merged 1 commit into
masterfrom
auto-hunt/cdc-charge-gh492
Dec 2, 2026
Merged

nsjarvis merged 1 commit into
masterfrom
auto-hunt/cdc-charge-gh492

Conversation

@DraTeots

@DraTeots DraTeots commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Addresses part of #492 (observation 4).

Change

src/libraries/CDC/DCDCHit_factory_Calib.cc, charge computation: convert the shifted pulse integral and the pedestal
sum to double before subtracting. When the pedestal sum exceeds the integral the charge is now negative, and
DParticleID::GetDCdEdxHits skips the hit (dE <= 0, "pedestal > signal"), as it was written to. Before, the unsigned
subtraction wrapped to about 2^32.

Tested

Run 132404 file 001, first 20000 events (19997 printed), one thread, calibtime=2025-12-24-00-00-01 with the same CCDB copy for both sides, hd_dump compared event by
event: CDC hits with a wrapped charge 84644 of 1507852 (5.6%) before, 0 after; the same 84644 hits have q < 0 after.
The track parameters printed by hd_dump (momentum, position, fit chi-square, FOM) are unchanged; the track dE/dx members written to REST (dEdx CDC, amplitude dE/dx, number of CDC hits used) were not dumped and are expected to change. Particle-ID hypotheses change in 4444 of 19997 events (22%), 15142 of 210264 hypotheses (7.2%);
dE/dx chi-square change median -0.34, mean -16.4. Two identical runs before the fix agree (0 of 19997 events differ).

Not tested

  • That the patch removes the non-reproducibility of the issue title: it was not reproduced on current code.
  • Other runs, other calibration periods, multi-thread running, the Monte Carlo path.
  • A full build on current master c6ad386: the change was built and run on the bug hunt's tree 115209d, where the file is identical, and the patched file compiles (syntax check) on c6ad386. The standard test jobs.

Side effects

CDC hit charge and energy loss of the 5.6% of hits with the pedestal above the integral change from about 1 GeV to
negative values. Particle-ID quantities (dE/dx chi-square, PID chi-square, PID figure of merit) change for 7.2% of
hypotheses. Any reader of DCDCHit::q that assumed a positive value now sees negative ones for these hits.

Card: https://pages.jlab.org/halld/auto-hunt/cards/gh-492-cdc-charge-unsigned-pedestal-wrap/

Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

🤖 Generated with Claude Code

…s the pulse integral

DCDCHit_factory_Calib subtracts the pedestal sum from the unsigned pulse integral in unsigned arithmetic, so a
pedestal larger than the integral gives a charge near 2^32 (dE about 1 GeV) instead of a negative value, and the
"pedestal > signal" skip in DParticleID::GetDCdEdxHits never acts. Now both terms are converted to double before the
subtraction. Run 132404 file 001, 19997 events: 84644 of 1507852 CDC hits (5.6%) wrapped before, 0 after.
Card: https://pages.jlab.org/halld/auto-hunt/cards/gh-492-cdc-charge-unsigned-pedestal-wrap/

Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gluex

gluex commented Dec 2, 2026

Copy link
Copy Markdown

Test status for this pull request: SUCCESS

Summary: summary.txt
Logs: results/log

Build log: make_auto-hunt_cdc-charge-gh492.log
Build report: report_auto-hunt_cdc-charge-gh492.txt

@nsjarvis nsjarvis 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.

Looks good.

@nsjarvis
nsjarvis merged commit d8e0134 into master Dec 2, 2026
2 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.

3 participants