Skip to content

Commit

Permalink
RecoLocalTracker/Phase2TrackerRecHits: Update ESProcer return type t…
Browse files Browse the repository at this point in the history
…o unique_ptr.
  • Loading branch information
gartung committed Jan 29, 2018
1 parent 97a68a4 commit d616263
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Phase2StripCPEESProducer: public edm::ESProducer {
public:

Phase2StripCPEESProducer(const edm::ParameterSet&);
std::shared_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> > produce(const TkStripCPERecord & iRecord);
std::unique_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> > produce(const TkStripCPERecord & iRecord);

private:

Expand All @@ -32,7 +32,6 @@ class Phase2StripCPEESProducer: public edm::ESProducer {

CPE_t cpeNum_;
edm::ParameterSet pset_;
std::shared_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> > cpe_;

};

Expand All @@ -51,19 +50,20 @@ Phase2StripCPEESProducer::Phase2StripCPEESProducer(const edm::ParameterSet & p)
}


std::shared_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> > Phase2StripCPEESProducer::produce(const TkStripCPERecord & iRecord) {
std::unique_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> > Phase2StripCPEESProducer::produce(const TkStripCPERecord & iRecord) {

edm::ESHandle<MagneticField> magfield;
edm::ESHandle<TrackerGeometry> pDD;

std::unique_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> > cpe_;
switch(cpeNum_) {
case DEFAULT:
iRecord.getRecord<IdealMagneticFieldRecord>().get(magfield );
iRecord.getRecord<TrackerDigiGeometryRecord>().get( pDD );
cpe_ = std::make_shared<Phase2StripCPE>(pset_, *magfield,*pDD);
cpe_ = std::make_unique<Phase2StripCPE>(pset_, *magfield,*pDD);
break;
case GEOMETRIC:
cpe_ = std::make_shared<Phase2StripCPEGeometric>(pset_);
cpe_ = std::make_unique<Phase2StripCPEGeometric>(pset_);
break;
}
return cpe_;
Expand Down

0 comments on commit d616263

Please sign in to comment.