Add flags for SinglePdfGenInfo to avoid using gen spec when changing nuisances per toy. #836
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.
We don't want to use a GenSpec object for generating the toys if we want to change the nuisance (i.e. when not doing frequentist toys) values for each toy, since the genSpec object is fixed, and updating the values of the nuisance parameters in the pdf won't change the values the toys are generated with.
For frequentist toys, only the constraint term (i.e. global observable) is changed, which doesn't affect the observed data so using the genSpec is fine.
I've added a flag in the
SimPdfGenInfo
constructor which enables or disables the use of the spec object when generating events.By default this is allowed, so the default behaviour when this flag isnt passed is unchanged.
I think this only needed to be changed when generating the toys from the
Combine
object itself, as other places where theSimPdfGenInfo
object is used seem only to need Asimov Toys, and then there is no problem.@nucleosynthesis, it would be good to test this with your setup where you spotted the bug, to make sure its actually fixed. I've only run a couple simple sanity checks, not tested it thoroughly.