Skip to content

Commit

Permalink
Merge pull request #230 from blinkseb/fake_muon_filter
Browse files Browse the repository at this point in the history
Reject fake muons
  • Loading branch information
swertz authored Jan 26, 2017
2 parents 6b47d75 + 8f7989a commit 92bfbb6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMSSW.release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CMSSW_8_0_24_patch1
CMSSW_8_0_25
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Common framework for all cp3-llbb analyses

## CMSSW release

**CMSSW 8.0.24 patch 1**
**CMSSW 8.0.25**

## First time setup instructions

Expand All @@ -18,8 +18,8 @@ source /nfs/soft/grid/ui_sl6/setup/grid-env.sh
source /cvmfs/cms.cern.ch/cmsset_default.sh

export SCRAM_ARCH=slc6_amd64_gcc530
cmsrel CMSSW_8_0_24_patch1
cd CMSSW_8_0_24_patch1/src
cmsrel CMSSW_8_0_25
cd CMSSW_8_0_25/src
cmsenv

git cms-init
Expand All @@ -40,6 +40,9 @@ popd
# Electron regression
git cms-merge-topic rafaellopesdesa:Regression80XEgammaAnalysis

# Fake-muon filter
git cms-merge-topic gpetruc:badMuonFilters_80X_v2

scram b -j 4

# Add the area containing the MVA weights (from cms-data, to appear in “external”).
Expand Down
1 change: 1 addition & 0 deletions bootstrap_jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

git cms-merge-topic ikrav:egm_id_80X_v2
git cms-merge-topic rafaellopesdesa:Regression80XEgammaAnalysis
git cms-merge-topic gpetruc:badMuonFilters_80X_v2

git clone -o upstream https://github.com/bachtis/analysis.git -b KaMuCa_V4 KaMuCa
pushd KaMuCa
Expand Down
22 changes: 20 additions & 2 deletions python/Framework.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import copy

import FWCore.ParameterSet.Config as cms
from FWCore.ParameterSet.SequenceTypes import _SequenceCollection

from Configuration.StandardSequences.Eras import eras

from cp3_llbb.Framework.Tools import change_process_name, change_input_tags_and_strings, StdStreamSilenter
Expand Down Expand Up @@ -61,8 +63,12 @@ def __init__(self, isData, era, **kwargs):
self.process = process
self.path = cms.Path()

# Workaround a bug in cms.Path.insert, where _seq is None and no check is done to create it
if self.path._seq is None:
self.path.__dict__["_seq"] = _SequenceCollection()

process.options = cms.untracked.PSet(
wantSummary = cms.untracked.bool(False),
wantSummary = cms.untracked.bool(True),
allowUnscheduled = cms.untracked.bool(True)
)

Expand All @@ -86,6 +92,7 @@ def __init__(self, isData, era, **kwargs):
process.source = cms.Source("PoolSource")

self.configureFramework_()
self.addFakeMuonFilter()

def create(self):
"""
Expand Down Expand Up @@ -426,7 +433,7 @@ def applyElectronRegression(self):
self.process.load('EgammaAnalysis.ElectronTools.regressionApplication_cff')

# Rename the collection
self.process.slimmedElectronsWithRegression = self.process.regressionElectrons.clone()
self.process.slimmedElectronsWithRegression = self.process.slimmedElectrons.clone()

# Look for producers using the default electron input
for producer in self.producers:
Expand Down Expand Up @@ -548,3 +555,14 @@ def configureFramework_(self):
# MET Filters
from cp3_llbb.Framework import METFilter
self.process.framework.filters.met = copy.deepcopy(METFilter.default_configuration)

def addFakeMuonFilter(self):
if not self.isData:
return

self.process.load('RecoMET.METFilters.badGlobalMuonTaggersMiniAOD_cff')

self.process.badGlobalMuonTagger.verbose = cms.untracked.bool(False)
self.process.cloneGlobalMuonTagger.verbose = cms.untracked.bool(False)

self.path.insert(0, self.process.noBadGlobalMuons)
3 changes: 1 addition & 2 deletions test/TestConfigurationData.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
process = framework.create()

process.source.fileNames = cms.untracked.vstring(
'/store/data/Run2016H/DoubleEG/MINIAOD/PromptReco-v3/000/284/036/00000/1878DF24-619F-E611-A962-02163E0146C8.root'
# '/store/data/Run2016B/DoubleMuon/MINIAOD/PromptReco-v2/000/273/158/00000/A6AC80E5-121A-E611-A689-02163E01439E.root'
'/store/data/Run2016F/DoubleMuon/MINIAOD/23Sep2016-v1/50000/040EDEBA-0490-E611-A424-008CFA110C68.root'
)

process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1000))

0 comments on commit 92bfbb6

Please sign in to comment.