Skip to content

Commit

Permalink
Use proper method to determine if electron is in the barrel
Browse files Browse the repository at this point in the history
The wrong method of GsfElectron was being used to determine if the
electron was in the barrel.

This was found by clang since an enumeration was being compared to
a static value and that value was outside of the range of the
enumeration so always evaluated to true or false.
  • Loading branch information
Dr15Jones committed Dec 20, 2018
1 parent 33eeaba commit 2999af0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions RecoEgamma/Examples/plugins/GsfElectronFakeAnalyzer.cc
Expand Up @@ -1388,8 +1388,8 @@ GsfElectronFakeAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup
histSclEt_->Fill(sclRef->energy()*(Rt/R));
histSclEtVsEta_->Fill(sclRef->eta(),sclRef->energy()*(Rt/R));
histSclEtVsPhi_->Fill(sclRef->phi(),sclRef->energy()*(Rt/R));
if (bestGsfElectron.classification() < 100) histSclEoEmatchingObject_barrel->Fill(sclRef->energy()/moIter->energy());
if (bestGsfElectron.classification() >= 100) histSclEoEmatchingObject_endcaps->Fill(sclRef->energy()/moIter->energy());
if (bestGsfElectron.isEB()) histSclEoEmatchingObject_barrel->Fill(sclRef->energy()/moIter->energy());
if (bestGsfElectron.isEE()) histSclEoEmatchingObject_endcaps->Fill(sclRef->energy()/moIter->energy());
histSclEta_->Fill(sclRef->eta());
histSclEtaVsPhi_->Fill(sclRef->phi(),sclRef->eta());
histSclPhi_->Fill(sclRef->phi());
Expand Down
4 changes: 2 additions & 2 deletions RecoEgamma/Examples/plugins/GsfElectronMCFakeAnalyzer.cc
Expand Up @@ -1392,8 +1392,8 @@ GsfElectronMCFakeAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet
histSclEt_->Fill(sclRef->energy()*(Rt/R));
histSclEtVsEta_->Fill(sclRef->eta(),sclRef->energy()*(Rt/R));
histSclEtVsPhi_->Fill(sclRef->phi(),sclRef->energy()*(Rt/R));
if (bestGsfElectron.classification() < 100) histSclEoEmatchingObject_barrel->Fill(sclRef->energy()/moIter->energy());
if (bestGsfElectron.classification() >= 100) histSclEoEmatchingObject_endcaps->Fill(sclRef->energy()/moIter->energy());
if (bestGsfElectron.isEB()) histSclEoEmatchingObject_barrel->Fill(sclRef->energy()/moIter->energy());
if (bestGsfElectron.isEE()) histSclEoEmatchingObject_endcaps->Fill(sclRef->energy()/moIter->energy());
histSclEta_->Fill(sclRef->eta());
histSclEtaVsPhi_->Fill(sclRef->phi(),sclRef->eta());
histSclPhi_->Fill(sclRef->phi());
Expand Down

0 comments on commit 2999af0

Please sign in to comment.