Skip to content

Commit

Permalink
Merge pull request #17 from Sam-Harper/vid_heepV51_ecalDrivenFix
Browse files Browse the repository at this point in the history
adding EcalDriven cut to VID for HEEP
  • Loading branch information
lgray committed May 24, 2015
2 parents a1a639a + e74fc05 commit 9c36eb5
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 6 deletions.
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();
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
effAreaForEHIso=0.28,
# other cuts
dxyCut=0.02,
maxMissingHitsCut=1
maxMissingHitsCut=1,
ecalDrivenCut=1
)

WP_HEEP51_EE = HEEP_WorkingPoint_V1(
Expand Down Expand Up @@ -78,7 +79,8 @@
effAreaForEHIso=0.28,
# other cuts
dxyCut=0.05,
maxMissingHitsCut=1
maxMissingHitsCut=1,
ecalDrivenCut=1

)

Expand All @@ -95,6 +97,6 @@
# 3) update the MD5 sum strings below and uncomment the lines again.
#

central_id_registry.register(heepElectronID_HEEPV51.idName,"d930c34a554f86e6d4e8c247c4737140")
central_id_registry.register(heepElectronID_HEEPV51.idName,"b0e84f87acbc411de145ab2b8187ef1c")

heepElectronID_HEEPV51.isPOGApproved = cms.untracked.bool(True)
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def __init__(self,
effAreaForEHIso,
# other cuts:
dxyCut,
maxMissingHitsCut
maxMissingHitsCut,
ecalDrivenCut
):
# assign values taken from all the arguments above
self.idName = idName
Expand All @@ -66,7 +67,7 @@ def __init__(self,
self.effAreaForEHIso = effAreaForEHIso
self.dxyCut = dxyCut
self.maxMissingHitsCut = maxMissingHitsCut

self.ecalDrivenCut = ecalDrivenCut
# ==============================================================
# Define individual cut configurations used by complete cut sets
# ==============================================================
Expand Down Expand Up @@ -215,6 +216,15 @@ def psetGsfEleMissingHitsCut(wpEB, wpEE):
needsAdditionalProducts = cms.bool(False),
isIgnored = cms.bool(False)
)
def psetGsfEleEcalDrivenCut(wpEB, wpEE):
return cms.PSet(
cutName = cms.string('GsfEleEcalDrivenCut'),
ecalDrivenEB = cms.int32( wpEB.ecalDrivenCut ),
ecalDrivenEE = cms.int32( wpEE.ecalDrivenCut ),
barrelCutOff = cms.double(ebCutOff),
needsAdditionalProducts = cms.bool(False),
isIgnored = cms.bool(False)
)

# ==============================================================
# Define the complete cut sets
Expand All @@ -239,7 +249,8 @@ def configureHEEPElectronID_V51(wpEB, wpEE):
psetGsfEleTrkPtIsoCut(wpEB,wpEE), #7
psetGsfEleEmHadD1IsoRhoCut(wpEB,wpEE), #8
psetGsfEleDxyCut(wpEB,wpEE), #9
psetGsfEleMissingHitsCut(wpEB,wpEE) #10
psetGsfEleMissingHitsCut(wpEB,wpEE), #10,
psetGsfEleEcalDrivenCut(wpEB,wpEE) #11
)
)
return parameterSet
Expand Down

0 comments on commit 9c36eb5

Please sign in to comment.