Update FitWithRooFit in Alignment/OfflineValidation to fix memory leaks#42900
Update FitWithRooFit in Alignment/OfflineValidation to fix memory leaks#42900cmsbuild merged 1 commit intocms-sw:masterfrom guitargeek:fit_with_roofit
FitWithRooFit in Alignment/OfflineValidation to fix memory leaks#42900Conversation
* Avoid memory leak of RooDataHist by wrapping it in `unique_ptr`
* Avoid memory leaks of RooRealVars also by wrapping in `unique_ptr`
* Avoid leaking RooAbsPdf models also with `unique_ptr`
* Avoid memory leak of model components by passing ownership to the top-level pdf via
`RooAbsArg::addOwnedComponents()`
* Use `double` instead of `const double&` for function parameters
* Avoid a leaking fit result because of the `Save()` command argument to `fitTo()`
(if one uses `Save()`, the fitting routine returns a `RooFitResult *`
that needs to be deleted)
FitWithRooFit in Alignment/OfflineValidationFitWithRooFit in Alignment/OfflineValidation to fix memory leaks
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-42900/37047
|
|
A new Pull Request was created by @guitargeek (Jonas Rembser) for master. It involves the following packages:
@consuegs, @saumyaphor4252, @cmsbuild, @perrotta can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
|
please test |
I checked this with the (limited) testing capability of the unit tests in cmssw/DQMOffline/Alignment/test/testDiMuonVertexMonitor.sh Lines 12 to 13 in 8efd906 I put the results here. I don't see anomalies. |
|
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-8e42f5/34966/summary.html Comparison SummarySummary:
|
|
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @antoniovilela, @sextonkennedy, @rappoccio (and backports should be raised in the release meeting by the corresponding L2) |
|
+1 |
PR description:
Avoid memory leak of RooDataHist by wrapping it in
unique_ptrAvoid memory leaks of RooRealVars also by wrapping in
unique_ptrAvoid leaking RooAbsPdf models also with
unique_ptrAvoid memory leak of model components by passing ownership to the top-level pdf via
RooAbsArg::addOwnedComponents()Use
doubleinstead ofconst double&for function parametersAvoid a leaking fit result because of the
Save()command argument tofitTo()(if one usesSave(), the fitting routine returns aRooFitResult *that needs to be deleted)PR validation:
I could do no validation of this refactoring and memory leak fixing work. It should not change any code behavior, but it would be nice if an alignment expert could validate it.
If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:
No backport intended.