More standard implementation of RooMultiPdf #1024
Merged
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.
The people that implemented RooMultiPdf had a doubt: they didn't dare to
implement
RooMultiPdf::evaluate()
because they were not sure how thenormalization set information is propagated.
The anser is: it's propagated in the base implementation of
getValV()
via the proxies, like the RooListProxy with the pdf in this case. The
propagated normalization set can be queried from the proxy with
nset()
.Hence, this PR suggests to implement
evaluate()
accordingly.Furthermore, the
selfNormalized()
method needs to be overridden, toindicate that the base implementation of
RooAbsPdf::getValV()
doesn'tneed to create any normalization integrals implicitly, which would be a
huge performance hit.
This more standard implementation makes sure that the class is more
compatible with regular RooFit, which expects that
evaluate()
isimplemented.
It was validated with the following command that results and performance
remain unaffected:
Two additional commits in this PR fix a memory leak and refactor the code to be less verbose respectively.