forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from Sam-Harper/vid_heepV51_ecalDrivenFix
adding EcalDriven cut to VID for HEEP
- Loading branch information
Showing
3 changed files
with
56 additions
and
6 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
RecoEgamma/ElectronIdentification/plugins/cuts/GsfEleEcalDrivenCut.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include "PhysicsTools/SelectorUtils/interface/CutApplicatorBase.h" | ||
#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" | ||
#include "DataFormats/GsfTrackReco/interface/GsfTrack.h" | ||
|
||
class GsfEleEcalDrivenCut : public CutApplicatorBase { | ||
public: | ||
GsfEleEcalDrivenCut(const edm::ParameterSet& c) : | ||
CutApplicatorBase(c), | ||
ecalDrivenEB_(c.getParameter<int>("ecalDrivenEB")), | ||
ecalDrivenEE_(c.getParameter<int>("ecalDrivenEE")), | ||
barrelCutOff_(c.getParameter<double>("barrelCutOff")){ | ||
} | ||
|
||
result_type operator()(const reco::GsfElectronPtr&) const override final; | ||
|
||
CandidateType candidateType() const override final { | ||
return ELECTRON; | ||
} | ||
|
||
private: | ||
const int ecalDrivenEB_, ecalDrivenEE_;// -1 ignore, 0 = fail ecalDriven, 1 =pass ecalDriven | ||
const double barrelCutOff_; | ||
}; | ||
|
||
DEFINE_EDM_PLUGIN(CutApplicatorFactory, | ||
GsfEleEcalDrivenCut, | ||
"GsfEleEcalDrivenCut"); | ||
|
||
CutApplicatorBase::result_type | ||
GsfEleEcalDrivenCut:: | ||
operator()(const reco::GsfElectronPtr& cand) const{ | ||
const bool ecalDriven = std::abs(cand->superCluster()->position().eta()) < barrelCutOff_ ? | ||
ecalDrivenEB_ : ecalDrivenEE_; | ||
if(ecalDriven<0) return true; | ||
else if(ecalDriven==0) return !cand->ecalDriven(); | ||
else return cand->ecalDriven(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters