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

TrackingTools/PatternTools: ESProducers updated to return unique_ptr. #22017

Merged
merged 3 commits into from Jan 30, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -27,7 +27,7 @@ class TSCBLBuilderNoMaterialESProducer : public edm::ESProducer {
TSCBLBuilderNoMaterialESProducer(const edm::ParameterSet&);
~TSCBLBuilderNoMaterialESProducer() override;

typedef std::shared_ptr<TrajectoryStateClosestToBeamLineBuilder> ReturnType;
typedef std::unique_ptr<TrajectoryStateClosestToBeamLineBuilder> ReturnType;

ReturnType produce(const TrackingComponentsRecord&);
private:
Expand Down Expand Up @@ -74,10 +74,10 @@ TSCBLBuilderNoMaterialESProducer::ReturnType
TSCBLBuilderNoMaterialESProducer::produce(const TrackingComponentsRecord& iRecord)
{
using namespace edm::es;
TSCBLBuilderNoMaterialESProducer::ReturnType pTSCBLBuilderNoMaterial(new TSCBLBuilderNoMaterial()) ;
auto pTSCBLBuilderNoMaterial = std::make_unique<TSCBLBuilderNoMaterial>() ;


return pTSCBLBuilderNoMaterial ;
return std::move(pTSCBLBuilderNoMaterial) ;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The std::move before the return is not needed (and actually can turn off a compiler optimization).

}

//define this as a plug-in
Expand Down
Expand Up @@ -27,7 +27,7 @@ class TSCBLBuilderWithPropagatorESProducer : public edm::ESProducer {
TSCBLBuilderWithPropagatorESProducer(const edm::ParameterSet&);
~TSCBLBuilderWithPropagatorESProducer() override;

typedef std::shared_ptr<TrajectoryStateClosestToBeamLineBuilder> ReturnType;
typedef std::unique_ptr<TrajectoryStateClosestToBeamLineBuilder> ReturnType;

ReturnType produce(const TrackingComponentsRecord&);
private:
Expand Down Expand Up @@ -83,10 +83,10 @@ TSCBLBuilderWithPropagatorESProducer::produce(const TrackingComponentsRecord& iR

const Propagator * pro = theProp.product();

TSCBLBuilderWithPropagatorESProducer::ReturnType pTSCBLBuilderWithPropagator(new TSCBLBuilderWithPropagator(*pro)) ;
auto pTSCBLBuilderWithPropagator = std::make_unique<TSCBLBuilderWithPropagator>(*pro) ;


return pTSCBLBuilderWithPropagator ;
return std::move(pTSCBLBuilderWithPropagator) ;
}

//define this as a plug-in
Expand Down