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

CSC Halo filter: adding classes for nex filter #11528

Merged
merged 3 commits into from
Sep 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions PhysicsTools/PatAlgos/python/slimming/metFilterPaths_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
## and this triggers an error under unscheduled mode
from RecoMET.METFilters.metFilters_cff import HBHENoiseFilterResultProducer, HBHENoiseFilter, HBHENoiseIsoFilter, hcalLaserEventFilter
from RecoMET.METFilters.metFilters_cff import EcalDeadCellTriggerPrimitiveFilter, eeBadScFilter, ecalLaserCorrFilter, EcalDeadCellBoundaryEnergyFilter
from RecoMET.METFilters.metFilters_cff import primaryVertexFilter, CSCTightHaloFilter, HcalStripHaloFilter

from RecoMET.METFilters.metFilters_cff import primaryVertexFilter, CSCTightHaloFilter, CSCTightHaloTrkMuUnvetoFilter, CSCTightHalo2015Filter, HcalStripHaloFilter
from RecoMET.METFilters.metFilters_cff import goodVertices, trackingFailureFilter, trkPOGFilters, manystripclus53X, toomanystripclus53X, logErrorTooManyClusters
from RecoMET.METFilters.metFilters_cff import metFilters

# individual filters
Flag_HBHENoiseFilter = cms.Path(HBHENoiseFilterResultProducer * HBHENoiseFilter)
Flag_HBHENoiseIsoFilter = cms.Path(HBHENoiseFilterResultProducer * HBHENoiseIsoFilter)
Flag_CSCTightHaloFilter = cms.Path(CSCTightHaloFilter)
Flag_CSCTightHaloTrkMuUnvetoFilter = cms.Path(CSCTightHaloTrkMuUnvetoFilter)
Flag_CSCTightHalo2015Filter = cms.Path(CSCTightHalo2015Filter)
Flag_HcalStripHaloFilter = cms.Path(HcalStripHaloFilter)
Flag_hcalLaserEventFilter = cms.Path(hcalLaserEventFilter)
Flag_EcalDeadCellTriggerPrimitiveFilter = cms.Path(EcalDeadCellTriggerPrimitiveFilter)
Expand All @@ -32,13 +33,13 @@
Flag_METFilters = cms.Path(metFilters)

#add your new path here!!
allMetFilterPaths=['HBHENoiseFilter','HBHENoiseIsoFilter','CSCTightHaloFilter','HcalStripHaloFilter','hcalLaserEventFilter','EcalDeadCellTriggerPrimitiveFilter','EcalDeadCellBoundaryEnergyFilter','goodVertices','eeBadScFilter',
allMetFilterPaths=['HBHENoiseFilter','HBHENoiseIsoFilter','CSCTightHaloFilter','CSCTightHaloTrkMuUnvetoFilter','CSCTightHalo2015Filter','HcalStripHaloFilter','hcalLaserEventFilter','EcalDeadCellTriggerPrimitiveFilter','EcalDeadCellBoundaryEnergyFilter','goodVertices','eeBadScFilter',
'ecalLaserCorrFilter','trkPOGFilters','trkPOG_manystripclus53X','trkPOG_toomanystripclus53X','trkPOG_logErrorTooManyClusters','METFilters']


def miniAOD_customizeMETFiltersFastSim(process):
"""Replace some MET filters that don't work in FastSim with trivial bools"""
for X in 'CSCTightHaloFilter', 'HBHENoiseFilter', 'HBHENoiseIsoFilter', 'HBHENoiseFilterResultProducer', 'HcalStripHaloFilter':
for X in 'CSCTightHaloFilter', 'CSCTightHaloTrkMuUnvetoFilter','CSCTightHalo2015Filter','HcalStripHaloFilter','HBHENoiseFilter', 'HBHENoiseIsoFilter', 'HBHENoiseFilterResultProducer':
process.globalReplace(X, cms.EDFilter("HLTBool", result=cms.bool(True)))
for X in 'manystripclus53X', 'toomanystripclus53X', 'logErrorTooManyClusters':
process.globalReplace(X, cms.EDFilter("HLTBool", result=cms.bool(False)))
Expand Down
43 changes: 43 additions & 0 deletions RecoMET/METFilters/plugins/CSCTightHalo2015Filter.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/global/EDFilter.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DataFormats/METReco/interface/BeamHaloSummary.h"

class CSCTightHalo2015Filter : public edm::global::EDFilter<> {

public:

explicit CSCTightHalo2015Filter(const edm::ParameterSet & iConfig);
~CSCTightHalo2015Filter() {}

private:

virtual bool filter(edm::StreamID iID, edm::Event & iEvent, const edm::EventSetup & iSetup) const override;

const bool taggingMode_;
edm::EDGetTokenT<reco::BeamHaloSummary> beamHaloSummaryToken_;
};

CSCTightHalo2015Filter::CSCTightHalo2015Filter(const edm::ParameterSet & iConfig)
: taggingMode_ (iConfig.getParameter<bool> ("taggingMode"))
, beamHaloSummaryToken_(consumes<reco::BeamHaloSummary>(edm::InputTag("BeamHaloSummary")))
{

produces<bool>();
}

bool CSCTightHalo2015Filter::filter(edm::StreamID iID, edm::Event & iEvent, const edm::EventSetup & iSetup) const {

edm::Handle<reco::BeamHaloSummary> beamHaloSummary;
iEvent.getByToken(beamHaloSummaryToken_ , beamHaloSummary);

const bool pass = !beamHaloSummary->CSCTightHaloId2015();

iEvent.put( std::auto_ptr<bool>(new bool(pass)) );

return taggingMode_ || !pass; // return false if it is a beamhalo event
}

#include "FWCore/Framework/interface/MakerMacros.h"
DEFINE_FWK_MODULE(CSCTightHalo2015Filter);
8 changes: 4 additions & 4 deletions RecoMET/METFilters/plugins/CSCTightHaloFilter.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDFilter.h"
#include "FWCore/Framework/interface/global/EDFilter.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DataFormats/METReco/interface/BeamHaloSummary.h"

class CSCTightHaloFilter : public edm::EDFilter {
class CSCTightHaloFilter : public edm::global::EDFilter<> {

public:

Expand All @@ -13,7 +13,7 @@ class CSCTightHaloFilter : public edm::EDFilter {

private:

virtual bool filter(edm::Event & iEvent, const edm::EventSetup & iSetup) override;
virtual bool filter(edm::StreamID iID, edm::Event & iEvent, const edm::EventSetup & iSetup) const override;

const bool taggingMode_;
edm::EDGetTokenT<reco::BeamHaloSummary> beamHaloSummaryToken_;
Expand All @@ -27,7 +27,7 @@ CSCTightHaloFilter::CSCTightHaloFilter(const edm::ParameterSet & iConfig)
produces<bool>();
}

bool CSCTightHaloFilter::filter(edm::Event & iEvent, const edm::EventSetup & iSetup) {
bool CSCTightHaloFilter::filter(edm::StreamID iID, edm::Event & iEvent, const edm::EventSetup & iSetup) const {

edm::Handle<reco::BeamHaloSummary> beamHaloSummary;
iEvent.getByToken(beamHaloSummaryToken_ , beamHaloSummary);
Expand Down
43 changes: 43 additions & 0 deletions RecoMET/METFilters/plugins/CSCTightHaloTrkMuUnvetoFilter.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/global/EDFilter.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DataFormats/METReco/interface/BeamHaloSummary.h"

class CSCTightHaloTrkMuUnvetoFilter : public edm::global::EDFilter<> {

public:

explicit CSCTightHaloTrkMuUnvetoFilter(const edm::ParameterSet & iConfig);
~CSCTightHaloTrkMuUnvetoFilter() {}

private:

virtual bool filter(edm::StreamID iID, edm::Event & iEvent, const edm::EventSetup & iSetup) const override;

const bool taggingMode_;
edm::EDGetTokenT<reco::BeamHaloSummary> beamHaloSummaryToken_;
};

CSCTightHaloTrkMuUnvetoFilter::CSCTightHaloTrkMuUnvetoFilter(const edm::ParameterSet & iConfig)
: taggingMode_ (iConfig.getParameter<bool> ("taggingMode"))
, beamHaloSummaryToken_(consumes<reco::BeamHaloSummary>(edm::InputTag("BeamHaloSummary")))
{

produces<bool>();
}

bool CSCTightHaloTrkMuUnvetoFilter::filter(edm::StreamID iID, edm::Event & iEvent, const edm::EventSetup & iSetup) const {

edm::Handle<reco::BeamHaloSummary> beamHaloSummary;
iEvent.getByToken(beamHaloSummaryToken_ , beamHaloSummary);

const bool pass = !beamHaloSummary->CSCTightHaloIdTrkMuUnveto();

iEvent.put( std::auto_ptr<bool>(new bool(pass)) );

return taggingMode_ || pass; // return false if it is a beamhalo event
}

#include "FWCore/Framework/interface/MakerMacros.h"
DEFINE_FWK_MODULE(CSCTightHaloTrkMuUnvetoFilter);
6 changes: 6 additions & 0 deletions RecoMET/METFilters/python/CSCTightHalo2015Filter_cfi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import FWCore.ParameterSet.Config as cms

CSCTightHalo2015Filter = cms.EDFilter(
"CSCTightHalo2015Filter",
taggingMode = cms.bool(False)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import FWCore.ParameterSet.Config as cms

CSCTightHaloTrkMuUnvetoFilter = cms.EDFilter(
"CSCTightHaloTrkMuUnvetoFilter",
taggingMode = cms.bool(False),
)
10 changes: 9 additions & 1 deletion RecoMET/METFilters/python/metFilters_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
## The CSC beam halo tight filter ____________________________________________||
from RecoMET.METFilters.CSCTightHaloFilter_cfi import *

## The CSC beam halo tight filter ____________________________________________||
from RecoMET.METFilters.CSCTightHaloTrkMuUnvetoFilter_cfi import *

## The CSC beam halo tight filter ____________________________________________||
from RecoMET.METFilters.CSCTightHalo2015Filter_cfi import *

## The hcal problematic strip halo filter ____________________________________________||
from RecoMET.METFilters.HcalStripHaloFilter_cfi import *

Expand Down Expand Up @@ -58,11 +64,13 @@
metFilters = cms.Sequence(
HBHENoiseFilterResultProducer *
HBHENoiseFilter *
primaryVertexFilter*
# HBHENoiseIsoFilter*
# HcalStripHaloFilter *
primaryVertexFilter*
CSCTightHaloFilter *
# hcalLaserEventFilter *
# CSCTightHaloTrkMuUnvetoFilter *
# CSCTightHalo2015Filter *
EcalDeadCellTriggerPrimitiveFilter*
# *goodVertices * trackingFailureFilter *
eeBadScFilter
Expand Down