Skip to content

Commit

Permalink
make a clone of the original jet to preserve reference to the origina…
Browse files Browse the repository at this point in the history
…l object it was derived from
  • Loading branch information
ferencek committed Jul 30, 2016
1 parent 6f0c884 commit 518c455
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PhysicsTools/PatAlgos/plugins/PATJetUpdater.cc
Expand Up @@ -126,8 +126,8 @@ void PATJetUpdater::produce(edm::Event & iEvent, const edm::EventSetup & iSetup)
// construct the Jet from the ref -> save ref to original object
unsigned int idx = itJet - jets->begin();
edm::RefToBase<reco::Jet> jetRef = jets->refAt(idx);
edm::Ptr<reco::Jet> jetPtr = jets->ptrAt(idx);
Jet ajet( edm::RefToBase<Jet>(jetRef.castTo<JetRef>()) );
const Jet * origJet = dynamic_cast<const Jet *>( jetRef.get() );
Jet ajet( *origJet );

if (addJetCorrFactors_) {
// undo previous jet energy corrections
Expand Down

0 comments on commit 518c455

Please sign in to comment.