Skip to content

Commit

Permalink
Merge pull request #21983 from gartung/TrackingTools-KalmanUpdators-r…
Browse files Browse the repository at this point in the history
…eturntype

TrackingTools/KalmanUpdators: Remove class member that are not needed.
  • Loading branch information
cmsbuild committed Jan 29, 2018
2 parents 24db03f + 5c9a305 commit 9773c53
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 27 deletions.
Expand Up @@ -17,9 +17,8 @@ class KFSwitching1DUpdatorESProducer: public edm::ESProducer{
public:
KFSwitching1DUpdatorESProducer(const edm::ParameterSet & p);
~KFSwitching1DUpdatorESProducer() override;
std::shared_ptr<TrajectoryStateUpdator> produce(const TrackingComponentsRecord &);
std::unique_ptr<TrajectoryStateUpdator> produce(const TrackingComponentsRecord &);
private:
std::shared_ptr<TrajectoryStateUpdator> _updator;
edm::ParameterSet pset_;
};

Expand Down
3 changes: 1 addition & 2 deletions TrackingTools/KalmanUpdators/interface/KFUpdatorESProducer.h
Expand Up @@ -17,9 +17,8 @@ class KFUpdatorESProducer: public edm::ESProducer{
public:
KFUpdatorESProducer(const edm::ParameterSet & p);
~KFUpdatorESProducer() override;
std::shared_ptr<TrajectoryStateUpdator> produce(const TrackingComponentsRecord &);
std::unique_ptr<TrajectoryStateUpdator> produce(const TrackingComponentsRecord &);
private:
std::shared_ptr<TrajectoryStateUpdator> _updator;
edm::ParameterSet pset_;
};

Expand Down
Expand Up @@ -12,9 +12,8 @@ class TrackingRecHitPropagatorESProducer: public edm::ESProducer{
public:
TrackingRecHitPropagatorESProducer(const edm::ParameterSet & p);
~TrackingRecHitPropagatorESProducer() override;
std::shared_ptr<TrackingRecHitPropagator> produce(const TrackingComponentsRecord&);
std::unique_ptr<TrackingRecHitPropagator> produce(const TrackingComponentsRecord&);
private:
std::shared_ptr<TrackingRecHitPropagator> theHitPropagator;
edm::ParameterSet pset_;
};

Expand Down
Expand Up @@ -17,12 +17,11 @@ class Chi2MeasurementEstimatorESProducer: public edm::ESProducer{
public:
Chi2MeasurementEstimatorESProducer(const edm::ParameterSet & p);
~Chi2MeasurementEstimatorESProducer() override;
std::shared_ptr<Chi2MeasurementEstimatorBase> produce(const TrackingComponentsRecord &);
std::unique_ptr<Chi2MeasurementEstimatorBase> produce(const TrackingComponentsRecord &);

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

private:
std::shared_ptr<Chi2MeasurementEstimatorBase> m_estimator;
edm::ParameterSet const m_pset;
};

Expand All @@ -34,7 +33,7 @@ Chi2MeasurementEstimatorESProducer::Chi2MeasurementEstimatorESProducer(const edm

Chi2MeasurementEstimatorESProducer::~Chi2MeasurementEstimatorESProducer() {}

std::shared_ptr<Chi2MeasurementEstimatorBase>
std::unique_ptr<Chi2MeasurementEstimatorBase>
Chi2MeasurementEstimatorESProducer::produce(const TrackingComponentsRecord & iRecord){
auto maxChi2 = m_pset.getParameter<double>("MaxChi2");
auto nSigma = m_pset.getParameter<double>("nSigma");
Expand All @@ -43,8 +42,7 @@ Chi2MeasurementEstimatorESProducer::produce(const TrackingComponentsRecord & iRe
auto minTol = m_pset.getParameter<double>("MinimalTolerance");
auto minpt = m_pset.getParameter<double>("MinPtForHitRecoveryInGluedDet");

m_estimator = std::make_shared<Chi2MeasurementEstimator>(maxChi2,nSigma, maxDis, maxSag, minTol,minpt);
return m_estimator;
return std::make_unique<Chi2MeasurementEstimator>(maxChi2,nSigma, maxDis, maxSag, minTol,minpt);
}


Expand Down
Expand Up @@ -21,15 +21,14 @@ KFSwitching1DUpdatorESProducer::KFSwitching1DUpdatorESProducer(const edm::Parame

KFSwitching1DUpdatorESProducer::~KFSwitching1DUpdatorESProducer() {}

std::shared_ptr<TrajectoryStateUpdator>
std::unique_ptr<TrajectoryStateUpdator>
KFSwitching1DUpdatorESProducer::produce(const TrackingComponentsRecord & iRecord){
// if (_updator){
// delete _updator;
// _updator = 0;
// }

_updator = std::make_shared<KFSwitching1DUpdator>(&pset_);
return _updator;
return std::make_unique<KFSwitching1DUpdator>(&pset_);
}


6 changes: 2 additions & 4 deletions TrackingTools/KalmanUpdators/plugins/KFUpdatorESProducer.cc
Expand Up @@ -21,15 +21,13 @@ KFUpdatorESProducer::KFUpdatorESProducer(const edm::ParameterSet & p)

KFUpdatorESProducer::~KFUpdatorESProducer() {}

std::shared_ptr<TrajectoryStateUpdator>
std::unique_ptr<TrajectoryStateUpdator>
KFUpdatorESProducer::produce(const TrackingComponentsRecord & iRecord){
// if (_updator){
// delete _updator;
// _updator = 0;
// }

_updator = std::make_shared<KFUpdator>();
return _updator;
return std::make_unique<KFUpdator>();
}


Expand Up @@ -13,9 +13,8 @@ class MRHChi2MeasurementEstimatorESProducer: public edm::ESProducer{
public:
MRHChi2MeasurementEstimatorESProducer(const edm::ParameterSet & p);
~MRHChi2MeasurementEstimatorESProducer() override;
std::shared_ptr<Chi2MeasurementEstimatorBase> produce(const TrackingComponentsRecord&);
std::unique_ptr<Chi2MeasurementEstimatorBase> produce(const TrackingComponentsRecord&);
private:
std::shared_ptr<Chi2MeasurementEstimatorBase> _estimator;
edm::ParameterSet pset_;
};

Expand All @@ -28,13 +27,11 @@ MRHChi2MeasurementEstimatorESProducer::MRHChi2MeasurementEstimatorESProducer(con

MRHChi2MeasurementEstimatorESProducer::~MRHChi2MeasurementEstimatorESProducer() {}

std::shared_ptr<Chi2MeasurementEstimatorBase>
std::unique_ptr<Chi2MeasurementEstimatorBase>
MRHChi2MeasurementEstimatorESProducer::produce(const TrackingComponentsRecord& iRecord){

double maxChi2 = pset_.getParameter<double>("MaxChi2");
double nSigma = pset_.getParameter<double>("nSigma");
_estimator = std::make_shared<MRHChi2MeasurementEstimator>(maxChi2,nSigma);
return _estimator;
return std::make_unique<MRHChi2MeasurementEstimator>(maxChi2,nSigma);
}

}
Expand Down
Expand Up @@ -20,7 +20,7 @@ TrackingRecHitPropagatorESProducer::TrackingRecHitPropagatorESProducer(const edm

TrackingRecHitPropagatorESProducer::~TrackingRecHitPropagatorESProducer() {}

std::shared_ptr<TrackingRecHitPropagator>
std::unique_ptr<TrackingRecHitPropagator>
TrackingRecHitPropagatorESProducer::produce(const TrackingComponentsRecord& iRecord){
ESHandle<MagneticField> magfield;
std::string mfName = "";
Expand All @@ -29,8 +29,7 @@ TrackingRecHitPropagatorESProducer::produce(const TrackingComponentsRecord& iRec
iRecord.getRecord<IdealMagneticFieldRecord>().get(mfName,magfield);
// edm::ESInputTag mfESInputTag(mfName);
// iRecord.getRecord<IdealMagneticFieldRecord>().get(mfESInputTag,magfield);
theHitPropagator = std::make_shared<TrackingRecHitPropagator>(magfield.product());
return theHitPropagator;
return std::make_unique<TrackingRecHitPropagator>(magfield.product());
}


0 comments on commit 9773c53

Please sign in to comment.