Skip to content

Commit

Permalink
Merge pull request #35256 from Dr15Jones/esConsumesMuonCkfTrajectoryB…
Browse files Browse the repository at this point in the history
…uilder

Added esConsumes directly in MuonCkfTrajectoryBuilder
  • Loading branch information
cmsbuild authored Sep 16, 2021
2 parents ba8af8e + d817891 commit 9dae406
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions RecoMuon/L3TrackFinder/interface/MuonCkfTrajectoryBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "RecoTracker/CkfPattern/interface/CkfTrajectoryBuilder.h"
#include "FWCore/Framework/interface/ESWatcher.h"

class TrackingComponentsRecord;
class MuonCkfTrajectoryBuilder : public CkfTrajectoryBuilder {
public:
MuonCkfTrajectoryBuilder(const edm::ParameterSet& conf, edm::ConsumesCollector& iC);
Expand All @@ -30,6 +31,7 @@ class MuonCkfTrajectoryBuilder : public CkfTrajectoryBuilder {
const double theDeltaPhi;
const std::string theProximityPropagatorName;
const Propagator* theProximityPropagator;
const edm::ESGetToken<Propagator, TrackingComponentsRecord> thePropagatorToken;
edm::ESWatcher<BaseCkfTrajectoryBuilder::Chi2MeasurementEstimatorRecord> theEstimatorWatcher;
std::unique_ptr<Chi2MeasurementEstimatorBase> theEtaPhiEstimator;
};
Expand Down
5 changes: 2 additions & 3 deletions RecoMuon/L3TrackFinder/src/MuonCkfTrajectoryBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ MuonCkfTrajectoryBuilder::MuonCkfTrajectoryBuilder(const edm::ParameterSet& conf
theDeltaPhi(conf.getParameter<double>("deltaPhi")),
theProximityPropagatorName(conf.getParameter<std::string>("propagatorProximity")),
theProximityPropagator(nullptr),
thePropagatorToken(iC.esConsumes(edm::ESInputTag("", theProximityPropagatorName))),
theEtaPhiEstimator(nullptr) {
//and something specific to me ?
theUseSeedLayer = conf.getParameter<bool>("useSeedLayer");
Expand All @@ -32,9 +33,7 @@ MuonCkfTrajectoryBuilder::~MuonCkfTrajectoryBuilder() {}
void MuonCkfTrajectoryBuilder::setEvent_(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
CkfTrajectoryBuilder::setEvent_(iEvent, iSetup);

edm::ESHandle<Propagator> propagatorProximityHandle;
iSetup.get<TrackingComponentsRecord>().get(theProximityPropagatorName, propagatorProximityHandle);
theProximityPropagator = propagatorProximityHandle.product();
theProximityPropagator = &iSetup.getData(thePropagatorToken);

// theEstimator is set for this event in the base class
if (theEstimatorWatcher.check(iSetup) && theDeltaEta > 0 && theDeltaPhi > 0)
Expand Down

0 comments on commit 9dae406

Please sign in to comment.