breaking: DRAFT Multi-parameter functional shifts#824
Draft
luketpickering wants to merge 5 commits into
Draft
Conversation
|
Hi @luketpickering, thank you for contributing to MaCh3! Please wait for MaCh3 developers to review your PR. If no one answers within a week, please message people from this list: https://github.com/orgs/mach3-software/teams/mach3admin . While waiting, please enjoy this Use this action on your projects. Use jokes on issues instead. |
- SampleHandler Functional functions now have a slightly nicer signature void(std::vector<double> const &, EventType &), This requires a vector of the current parameter values to be set once per reweight in FillArray, but makes the interface less clunky.
Contributor
Author
|
Slight improvement to the proposed sampleHandler interface shown below: RegisterIndividualFunctionalParameter(
DUNEMCEvents, "MyParameter", [](double const &par, EventInfo &ev) {
std::cout << "I'm here with " << par << std::endl;
ev.varied_reco.e_lep *= (1.0 + par);
});
RegisterIndividualFunctionalParameter(
DUNEMCEvents, std::vector<std::string>{"MyParameter", "MyOtherParameter"},
[](std::vector<double> const &pars, EventInfo &ev) {
std::cout << "I'm here with " << pars[0] << " and " << pars[1]
<< std::endl;
ev.varied_reco.e_lep *= (1.0 + pars[0] + pars[1]);
});Now the relevant parameter values are fetched and cached before the event loop, this allows us to pass a vector of parameter values instead of a vector of pointers to parameter values which makes usage cleaner and some patterns more flexible. |
added 3 commits
March 26, 2026 10:46
79f390b to
df14f3d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Pull request description
Attempts to design new Functional Shift interface. Currently, but could probably be made not breaking.
Changes or fixes
n.b. Removes
PrepFunctionalParameterswhich is maybe used by some experiments. Easy to add back in.Key design change is that functional shifts can now be functions of multiple parameters and operate on experiment class event types, rather than taking event indexes. The experiment class event vector is now passed as the first parameter.
The hope was to remove any capturing lambdas from the tight event loop, this implementation doesn't achieve that yet.
Examples