Skip to content

mcsmear: FDC cathode strip readout thresholds on raw_amp = q/a_scale, per strip from CCDB - #427

Open
rjones30 wants to merge 2 commits into
masterfrom
fdc_strip_thresholds_rtj
Open

rjones30 wants to merge 2 commits into
masterfrom
fdc_strip_thresholds_rtj

Conversation

@rjones30

@rjones30 rjones30 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Split out of #422, as Naomi requested, and extended as she asked to read the thresholds from CCDB.

A strip hit is dropped if raw_amp = q / FDC_ADC_ASCALE is below its readout threshold in ADC counts.

  • Thresholds are read per strip from new tables /FDC/packageN/strip_thresholds. Each table has 12 rows per package, in the same row order as strip_mc_efficiency.
  • Where a table is absent, every strip of that package uses 50 counts. The startup log says which applies.
  • -PFDC:RAW_AMP_THRESHOLD= with n ? 0 overrides the tables with one value for every strip. n = 0 means no cut: strips with q ? 0 are dropped by the sparsification threshold anyway.
  • The cut draws no random numbers. No cut is applied if FDC_ADC_ASCALE is missing.

Needs the peakAmp PR #426 for FDC_ADC_ASCALE. It supersedes the single-value threshold that was on #422, which defaulted to off.

Tests: 300 events, one thread, of a 2018-01 chunk with the merged code: #426 + #422 + this PR + #423. Each output was compared with a reference run.

  • With no table, so 50 counts everywhere, the output is byte-identical to the old code run with a uniform threshold of 50.
  • With FDC:RAW_AMP_THRESHOLD=0 and default options, the output is byte-identical to the output before these changes.
  • With FDC:RAW_AMP_THRESHOLD=0 and the gain options of our rho0 study, the output is byte-identical to that study's mcsmear.

rjones30 and others added 2 commits November 9, 2026 14:55
…carry

it through the random-trigger merge [rtj]

In real data the FDC cathode strips are read out by fADC125s, and the
reconstruction uses the pulse peak amplitude (DFDCHit::pulse_height, with
q = a_scale * pulse_height). mcsmear wrote only the integrated charge q,
so for MC the reconstruction fell back on q where the data use the peak.

FDCSmearer now adds an fdcDigihit to every smeared strip hit, with
peakAmp = q / FDC_ADC_ASCALE (/FDC/digi_scales), i.e. on the data scale.
If FDC_ADC_ASCALE cannot be read from CCDB no fdcDigihit is written and the
behaviour is as before.

The FDC strip merge with random triggers (hddm_s_merger, the earliest-hit
rule of PR #420) now applies the same rule to the peak amplitude as to q:
the earliest random hit replaces the MC hit (time, q and peakAmp) if it is
earlier, both are summed if they fall in the same 8 ns sample, and a later
random hit is ignored. A hit without an fdcDigihit contributes q, which is
what the reconstruction would use for it. The merge also returns
immediately if the random strip has no hits, instead of dereferencing
src.begin() of an empty list.

Validated in the GlueX rho0 data/MC study of 2026-10/11: with this mcsmear
(and the hdgeant4 FDC fixes of rjones30/HDGeant4 PR #37) the change of the
rho0 yield between recon-2018_08 and recon-2019_11 on the same data is
reproduced by the MC to 0.3% (70 chunks of 10k events, runs 51048-51052).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit c362337)
…a_scale, per strip from CCDB [rtj]

A strip hit is dropped if raw_amp = q / FDC_ADC_ASCALE is below its readout
threshold in ADC counts. The thresholds are read per strip from the CCDB
tables /FDC/packageN/strip_thresholds (12 rows per package, in the row
order of strip_mc_efficiency); where a table is absent every strip of that
package uses 50 counts. FDC:RAW_AMP_THRESHOLD >= 0 overrides the tables
with one value for every strip; 0 is no cut, since strips with q <= 0 are
dropped by the sparsification threshold anyway. The cut draws no random
numbers. No cut is applied if FDC/digi_scales FDC_ADC_ASCALE is missing.

Requested by N. Jarvis on PR #422 as a separate PR; needs the peakAmp PR
(FDC_ADC_ASCALE). Supersedes bd0cb53, whose single value defaulted to off.

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

gluex commented Nov 9, 2026

Copy link
Copy Markdown

Test status for this pull request: SUCCESS

Summary: summary.txt
Logs: results/log

Build log: make_fdc_strip_thresholds_rtj.log
Build report: report_fdc_strip_thresholds_rtj.txt

@rjones30 rjones30 mentioned this pull request Nov 9, 2026
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