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
Manage PluginFactory plugins with unique_ptr in RecoLocalMuon #25899
Conversation
Also change some other raw pointers to unique_ptr, and some other cleanup/modernization.
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-25899/8369
|
A new Pull Request was created by @makortel (Matti Kortelainen) for master. It involves the following packages: RecoLocalMuon/CSCSegment @cmsbuild, @perrotta, @kpedro88, @slava77 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@cmsbuild, please test |
The tests are being triggered in jenkins. |
// Get the concrete reconstruction algo from the factory | ||
string theAlgoName = config.getParameter<string>("recAlgo"); | ||
theAlgo = DTRecHitAlgoFactory::get()->create(theAlgoName, | ||
config.getParameter<ParameterSet>("recAlgoConfig")); | ||
} | ||
|
||
DTRecHitProducer::~DTRecHitProducer(){ | ||
if(debug) | ||
cout << "[DTRecHitProducer] Destructor called" << endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this printout still relevant? (if not, the destructor could be defined as = default
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say that none of these debug printouts are relevant, at least not the ones in the c'tor and d'tor, but maybe also the one in the main method which just counts the number of hits in an unspecified DT layer: could it be simplified further by just removing the "debug" parameter and all its calls in this producer?
@namapane @fcavallo please let us know (answering if you still need the debug printout in the destructor at first, and all the other ones as second)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree the printouts can be removed; I don't think the debug option has ever been activated in the last 10 years at least.
Whether you want to remove all printouts or only those in the dtor is your choice, I generally prefer not to touch working code unless a fix is needed, but if you prefer to clean up I don't have any objection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@perrotta Which way do you prefer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this does not resolve any code check/quality analysis issue, perhaps we just leave it as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this does not resolve any code check/quality analysis issue, perhaps we just leave it as is.
I don't think we flag cout
s, so it indeed would not. I'm fine with leaving this as they are as well.
if(debug) cout << "the Reco2D AlgoName is " << theAlgoName << endl; | ||
theAlgo = DTRecSegment2DAlgoFactory::get()->create(theAlgoName, | ||
pset.getParameter<ParameterSet>("Reco2DAlgoConfig")); | ||
if(debug) cout << "the Reco2D AlgoName is " << pset.getParameter<string>("Reco2DAlgoName") << endl; | ||
} | ||
|
||
/// Destructor | ||
DTRecSegment2DProducer::~DTRecSegment2DProducer() { | ||
if(debug) | ||
cout << "[DTRecSegment2DProducer] Destructor called" << endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this printout still relevant? (if not, the destructor could be defined as = default
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comparison job queued. |
Comparison is ready Comparison Summary:
|
+upgrade |
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. @davidlange6, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
Changed also some other raw pointers to
unique_ptr
, and usedunique_ptr
constructor inRPCRecHitProducer
. This PR is preparatory work to change the PluginFactory to return astd::unique_ptr
.Tested in CMSSW_10_5_X_2019-02-05-1100 , no changes expected.