-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[RF] Fix problems with dataset generation from a nested RooSimultaneous with proto data
#12022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When generating such a pdf from prototype data, the prototype needs to contain all the subcategories of the super-category, and it does so by checking the super-category servers. However, recently `RooSuperCategory` was changed to contain a `RooMultiCategory` internally, and the only reported direct server is the internal multi-category. This leads to a wrong generation (the prototype data is ignored, the gen context refers to the current labels). The solution that this commit suggests is to use `RooSuperCategory::inputCatList()` to inspect the internal categories instead of using the client-server interface. Actually, the client-server interface is not meant to be used for inspection like that, just for general dependency management in the evaluation. Closes root-project#12020.
* avoid code duplication * less manual memory management * more range-based loops
Plus some code modernization of the gen context implementations
a9b8f57 to
87838c7
Compare
|
Starting build on |
87838c7 to
9e17f70
Compare
|
Starting build on |
|
Build failed on windows10/cxx14. Errors:
|
In the `RooSimultaneous::genContext` function, the logic that figures out which `RooAbsGenContext` implementation to instantiate needs to know the list of all category components. The way to figure this out depends on the type of the index category, and this logic is also reused in the `RooAbsGenContext` implementations for the RooSimultaneous. That's why it is now factored out into a protected function called `RooSimultaneous::flattenCatList()`.
Add unit test that checks if the dataset generation from a nested RooSimultaneous with protodata containing the category values works. Covers GitHub issue root-project#12020.
In the `RooSimGenContex` and `RooSimSplitGenContex` classes, there is a place where the servers of a derived category are redirected. The `mustReplaceAll` flag was set to true here. This made sense when the internal categories were still the only servers of the `RooSuperCategory`, but since the refactor in root-project#5502 this is not the case anymore. Therefore, a harmless error is printed now, which should be avoided by setting the `mustReplaceAll` flag to `false`.
The `RooAbsArg::redirectServers()` funciton has an optional flag to print an error if not all servers listed in the new server set were replaced. However, if one was already using this `mustReplaceAll` flag, it means that the error is intentional and should be considered fatal. An exception should be thrown with it.
9e17f70 to
6bb3d31
Compare
|
Starting build on |
lmoneta
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thank you Jonas for fixing this problem!
When generating such a pdf from prototype data, the prototype needs to
contain all the subcategories of the super-category, and it does so by
checking the super-category servers. However, recently
RooSuperCategorywas changed to contain aRooMultiCategoryinternally, and the only reported direct server is the internal
multi-category. This leads to a wrong generation (the prototype data is
ignored, the gen context refers to the current labels).
The solution that this commit suggests is to use
RooSuperCategory::inputCatList()to inspect the internal categoriesinstead of using the client-server interface. Actually, the
client-server interface is not meant to be used for inspection like
that, just for general dependency management in the evaluation.
Closes #12020.