Skip to content

Commit

Permalink
Merge pull request #8576 from cms-btv-pog/PuppiAndSoftKillerPFCandida…
Browse files Browse the repository at this point in the history
…tes_from-CMSSW_7_4_0_pre9

Puppi and SoftKiller cloning input candidates when they are of PF type
  • Loading branch information
davidlange6 committed Mar 30, 2015
2 parents ceebcf5 + d8a72b5 commit 8d5659d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions CommonTools/PileupAlgos/plugins/PuppiProducer.cc
Expand Up @@ -156,9 +156,8 @@ void PuppiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
//for(unsigned int i0 = 0; i0 < lCandidates.size(); i0++) {
//reco::PFCandidate pCand;
auto id = dummySinceTranslateIsNotStatic.translatePdgIdToType(i0->pdgId());
reco::PFCandidate pCand( i0->charge(),
i0->p4(),
id );
const reco::PFCandidate *pPF = dynamic_cast<const reco::PFCandidate*>(&(*i0));
reco::PFCandidate pCand( pPF ? *pPF : reco::PFCandidate(i0->charge(), i0->p4(), id) );
LorentzVector pVec = i0->p4();
int val = i0 - i0begin;

Expand Down
3 changes: 2 additions & 1 deletion CommonTools/PileupAlgos/plugins/SoftKillerProducer.cc
Expand Up @@ -134,7 +134,8 @@ SoftKillerProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
jend = fjInputs.end(); j != jend; ++j ) {
const reco::Candidate& cand = pfCandidates->at(j->user_index());
auto id = dummySinceTranslateIsNotStatic.translatePdgIdToType(cand.pdgId());
reco::PFCandidate pCand( cand.charge(), cand.p4(), id );
const reco::PFCandidate *pPF = dynamic_cast<const reco::PFCandidate*>(&cand);
reco::PFCandidate pCand( pPF ? *pPF : reco::PFCandidate(cand.charge(), cand.p4(), id) );
auto val = j->user_index();
auto skmatch = find_if( soft_killed_event.begin(), soft_killed_event.end(), [&val](fastjet::PseudoJet const & i){return i.user_index() == val;} );
LorentzVector pVec;
Expand Down

0 comments on commit 8d5659d

Please sign in to comment.