Skip to content

Add Capability to Bootstrap Signal and/or Background Datasets - #147

Closed
kevScheuer wants to merge 3 commits into
masterfrom
bootstrapping
Closed

kevScheuer wants to merge 3 commits into
masterfrom
bootstrapping

Conversation

@kevScheuer

Copy link
Copy Markdown
Collaborator

Summary

Previously, if a user wanted to resample their signal (and background) files, they would need to create an entirely new AmpToolsInterface object for every bootstrap sample. The phasespace events are identical for every iteration, though, and so unnecessary and expensive calculations were repeated. This PR allows one to maintain the same AmpToolsInterface, and thus loaded phasespace events, by clearing and loading the signal/background datasets after a user-defined resample method in the associated DataReader is called.

Details

The AmpToolsInterface has new boostrapSignalData and bootstrapBackgroundData methods the user can call before a fit runs. This will de-allocate the associated AmpVecs and resets flags in the LikelihoodCalculator to tell it to reload the events on next calculation. It then calls a new resample method that the user defines for their DataReader, which should oversample with replacement. An optional bootstrap seed parameter can be given to this method for repeat samples to be drawn.

To do this, the data and background blocks within LikelihoodCalculator::dataTerm had to be decoupled and a new m_firstBkgndCalc variable was introduced.

Performance

I used a fit configuration with:

  • 17 free parameters
  • Breit-Wigner functions within the amplitudes that contain free parameters
  • non-static userVars

The fits were performed on a single GPU card. The previous method described above would get me 100 bootstrap samples in ~10,000 seconds. In the same amount of time with these improvements, I can now obtain 1,000 samples

Background events can also be resampled with
replacement via similar methods. An optional seed
integer can be given to the dataReader, so that
bootstrap samples can be reproduced. Other fixes:
- Data reader report fixed for resample method
- LikelihoodCalculator::dataTerm now checks for
  signal and background recalculations separately
@kevScheuer
kevScheuer requested a review from mashephe September 22, 2026 10:11
@kevScheuer

Copy link
Copy Markdown
Collaborator Author

Superseded by #148

@kevScheuer kevScheuer closed this Sep 30, 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.

1 participant