Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dqm memory leaks p2 #4143

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions DQM/Physics/src/SingleTopTChannelLeptonDQM.cc
Expand Up @@ -391,8 +391,8 @@ namespace SingleTopTChannelLepton {
edm::Handle<edm::View<reco::GsfElectron> > elecs_gsf;
edm::Handle<edm::View<reco::PFCandidate> > elecs;
edm::View<reco::PFCandidate>::const_iterator elec_it;
StringCutObjectSelector<reco::PFCandidate, true> *elecSelect = new StringCutObjectSelector<reco::PFCandidate, true>(elecSelect_);
StringCutObjectSelector<reco::PFCandidate, true> *elecIso = new StringCutObjectSelector<reco::PFCandidate, true>(elecIso_);
StringCutObjectSelector<reco::PFCandidate, true> elecSelect(elecSelect_);
StringCutObjectSelector<reco::PFCandidate, true> elecIso(elecIso_);
reco::GsfElectronRef elec;

if( !event.getByToken(elecs_, elecs) ) return;
Expand Down Expand Up @@ -421,7 +421,7 @@ namespace SingleTopTChannelLepton {

if( electronId_.isUninitialized() ? true : ( (eID & eidPattern_) && (eID >=5)) ){

if(!elecSelect || (*elecSelect)(*elec_it)){
if( elecSelect(*elec_it)){
double isolationRel = (elec->dr03TkSumPt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt())/elec->pt();

double isolationChHad = elec->pt()/(elec->pt()+elec->pfIsolationVariables().sumChargedHadronPt);
Expand All @@ -442,7 +442,7 @@ namespace SingleTopTChannelLepton {
}
// in addition to the multiplicity counter buffer the iso
// electron candidates for later overlap check with jets
++eMult; if( !elecIso || (*elecIso)(*elec_it)){ if(eMultIso == 0) e = *elec; isoElecs.push_back(&(*elec)); ++eMultIso; }
++eMult; if( (elecIso)(*elec_it)){ if(eMultIso == 0) e = *elec; isoElecs.push_back(&(*elec)); ++eMultIso; }
}
}
idx_gsf++;
Expand Down