[math][fitter] Fix crash when doing a weighted likelihood fit#14459
[math][fitter] Fix crash when doing a weighted likelihood fit#14459lmoneta merged 1 commit intoroot-project:masterfrom
Conversation
|
Starting build on |
A bug was introduced in root-project#10439 affecting the weighted likelihood fits Add missing test for Weighted likelihood fits in stressHistoFit
3ba8287 to
c911204
Compare
|
Starting build on |
Test Results 10 files 10 suites 1d 23h 33m 57s ⏱️ For more details on these failures, see this check. Results for commit c911204. |
|
@phsft-bot build |
|
Starting build on |
| sObjFunc->UseSumOfWeightSquare(); | ||
| return ApplyWeightCorrection(*sObjFunc); |
There was a problem hiding this comment.
| sObjFunc->UseSumOfWeightSquare(); | |
| return ApplyWeightCorrection(*sObjFunc); | |
| fObjFunction->UseSumOfWeightSquare(); | |
| return ApplyWeightCorrection(*fObjFunction); |
When then problem is that objFunc is invalid because if was moved to fObjFunc, I think the simplest solution is to simply use that one. Then you don't need to create this extra shared pointer.
There was a problem hiding this comment.
The problem is the type required is of the derived class, you would need to do a dynamic_cast. I think is more efficient to just copy the pointer
guitargeek
left a comment
There was a problem hiding this comment.
Thanks for fixing this undefined behavior! I just have one suggestions to simplify the fix
A bug was introduced in #10439 affecting the weighted likelihood fits
This PR fixes #14458