Skip to content
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

Use unique_ptr, not auto_ptr in RecoEgamma and RecoEcal #15857

Merged

Conversation

wmtan
Copy link
Contributor

@wmtan wmtan commented Sep 14, 2016

In preparation for removing framework support for deprecated auto_ptr arguments in put() calls, this pull request replaces the use of auto_ptr with unique_ptr in RecoEgamma and RecoEcal packages. Also, std::make_unique is used when appropriate. Also, there was a case where a reference to an auto_ptr was an input argument to a function, which is a bad practice because it obscures the possible transfer of ownership. In the cases here, ownership was transferred, so the unique_ptr was passed by value.

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @wmtan for CMSSW_8_1_X.

It involves the following packages:

RecoEcal/EgammaClusterAlgos
RecoEcal/EgammaClusterProducers
RecoEgamma/EgammaElectronAlgos
RecoEgamma/EgammaElectronProducers
RecoEgamma/EgammaHFProducers
RecoEgamma/EgammaHLTProducers
RecoEgamma/EgammaIsolationAlgos
RecoEgamma/EgammaPhotonProducers
RecoEgamma/EgammaTools
RecoEgamma/ElectronIdentification
RecoEgamma/PhotonIdentification

@perrotta, @cmsbuild, @silviodonato, @cvuosalo, @fwyzard, @Martin-Grunewald, @slava77, @davidlange6 can you please review it and eventually sign? Thanks.
@Sam-Harper, @battibass, @rafaellopesdesa, @argiro, @HuguesBrun, @lgray this is something you requested to watch as well.
@slava77, @smuzaffar you are the release manager for this.

cms-bot commands are list here #13028

@wmtan
Copy link
Contributor Author

wmtan commented Sep 14, 2016

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 14, 2016

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/15145/console

@fwyzard
Copy link
Contributor

fwyzard commented Sep 14, 2016

+1

@fwyzard
Copy link
Contributor

fwyzard commented Sep 14, 2016

I have a related question, though it goes beyond the scope of this PR.

I see that in many modules, a RecoEcalCandidateIsolationMap is first built on the stack, and later copied into an std::unique_ptr<RecoEcalCandidateIsolationMap> , which is then moved into the event.

Does this actually incur in an additional copy ?
Would it be better to build the object on the heap in the first place ?

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

@cvuosalo
Copy link
Contributor

+1

For #15857 c37e7a0

Migrating deprecated auto_ptr to unique_ptr in RecoEgamma and RecoEcal. There should be no change in monitored quantities.

The code changes are satisfactory, and Jenkins tests against baseline CMSSW_8_1_X_2016-09-14-1100 show no significant differences, as expected.

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_8_1_X IBs (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @slava77, @davidlange6, @smuzaffar

@davidlange6
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 62f955a into cms-sw:CMSSW_8_1_X Sep 16, 2016
@wmtan wmtan deleted the UseUniquePtrInRecoEgammaAndRecoEcal branch September 19, 2016 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants