-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Update FitWithRooFit
in Alignment/OfflineValidation to fix memory leaks
#42900
Conversation
* 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_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 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.