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

Remove const and mutable since they're not required. #1369

Closed
wants to merge 2 commits into from
Closed

Remove const and mutable since they're not required. #1369

wants to merge 2 commits into from

Conversation

vkuznet
Copy link
Contributor

@vkuznet vkuznet commented Nov 7, 2013

As far as I can tell from code, there is no need to use const/mutable within a class for selected methods.

@vkuznet
Copy link
Contributor Author

vkuznet commented Nov 7, 2013

@Dr15Jones please review

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 7, 2013

A new Pull Request was created by @vkuznet (Valentin Kuznetsov) for CMSSW_7_0_X.

Remove const and mutable since they're not required.

It involves the following packages:

FastSimulation/TrackingRecHitProducer

@cmsbuild, @nclopezo, @giamman, @lveldere can you please review it and eventually sign? Thanks.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
@ktf you are the release manager for this.

@Dr15Jones
Copy link
Contributor

Unfortunately, those are virtual functions from the base class ClusterParameterEstimator

http://cmslxr.fnal.gov/lxr/source/RecoLocalTracker/ClusterParameterEstimator/interface/ClusterParameterEstimator.h#012

So the fix would be to remove const from the base class and change all inheriting classes.

@vkuznet
Copy link
Contributor Author

vkuznet commented Nov 8, 2013

I wanted to know if it is appropriate approach in this case. If I modify base class, then SiClusterTranslator.cc will not compile, see its produce method
http://cmslxr.fnal.gov/lxr/source/FastSimulation/TrackingRecHitProducer/src/SiClusterTranslator.cc#078

But I'm not sure that the produce method logic is correct in context of EventSetup. It extracts StripCPE/FastCPE objects from EventSetup, clear up their internal maps and refill it again.
Could you please review it and let me know your thoughts on this.

On Nov 7, 2013, at ,Nov 7, 8:54 AM, Chris Jones wrote:

Unfortunately, those are virtual functions from the base class ClusterParameterEstimator

http://cmslxr.fnal.gov/lxr/source/RecoLocalTracker/ClusterParameterEstimator/interface/ClusterParameterEstimator.h#012

So the fix would be to remove const from the base class and change all inheriting classes.


Reply to this email directly or view it on GitHub.

@Dr15Jones
Copy link
Contributor

It looks to me like the design of the base class ClusterParameterEstimator directly conflicts with CMS' rules about data products not being allowed to change.
My suggestion is we change all the modifying methods to be 'non-const' and add a 'clone()' method which returns a std::unique_ptr<ClusterParameterEstimator>. Classes which inherit from ClusterParameterEstimator have to implement the 'clone()' method. Then users can get the 'ClusterParameterEstimator' from the EventSetup but they call 'clone' to get their own copy which can be modified.

@ktf
Copy link
Contributor

ktf commented Nov 19, 2013

@vkuznet this does not merge anymore. Can you update it?

@cmsbuild
Copy link
Contributor

Pull request #1369 was updated. @nclopezo, @lveldere, @cmsbuild, @thspeer, @giamman, @slava77 can you please check and sign again.

@ktf
Copy link
Contributor

ktf commented Nov 19, 2013

mmm... it still does not merge in the last IB...

@vkuznet
Copy link
Contributor Author

vkuznet commented Nov 19, 2013

is it possible to see merge problem somehow? I can try to re-apply changes again within fresh branch.

@vkuznet
Copy link
Contributor Author

vkuznet commented Nov 20, 2013

Giulio, I regenerated all changes in separate branch, I think it would be easier if we close this one (without merging of course) and I submit new pull request from another branch. Possibly I didn't rebase and it cause merging problem in this branch. Here is new branch with the same set of changes: https://github.com/vkuznet/cmssw/compare/ThreadSafe2_FastSimulation_TrackingRecHitProducer?expand=1

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

4 participants