CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
extraflags_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
4 
5 # Bad/clone muon filters - tagging mode to keep the event
6 from RecoMET.METFilters.badGlobalMuonTaggersMiniAOD_cff import badGlobalMuonTaggerMAOD, cloneGlobalMuonTaggerMAOD
7 badGlobalMuonTagger = badGlobalMuonTaggerMAOD.clone(
8  taggingMode = True
9 )
10 
11 cloneGlobalMuonTagger = cloneGlobalMuonTaggerMAOD.clone(
12  taggingMode = True
13 )
14 
15 from RecoMET.METFilters.BadPFMuonFilter_cfi import BadPFMuonFilter
16 BadPFMuonTagger = BadPFMuonFilter.clone(
17  PFCandidates = cms.InputTag("packedPFCandidates"),
18  muons = cms.InputTag("slimmedMuons"),
19  vtx = cms.InputTag("offlineSlimmedPrimaryVertices"),
20  taggingMode = True,
21 )
22 
23 # Bad charge hadron
24 from RecoMET.METFilters.BadChargedCandidateFilter_cfi import BadChargedCandidateFilter
25 BadChargedCandidateTagger = BadChargedCandidateFilter.clone(
26  PFCandidates = cms.InputTag("packedPFCandidates"),
27  muons = cms.InputTag("slimmedMuons"),
28  vtx = cms.InputTag("offlineSlimmedPrimaryVertices"),
29  taggingMode = True,
30 )
31 
32 extraFlagsTable = cms.EDProducer("GlobalVariablesTableProducer",
33  variables = cms.PSet(
34  Flag_BadGlobalMuon = ExtVar(cms.InputTag("badGlobalMuonTagger:notBadEvent"), bool, doc = "Bad muon flag"),
35  Flag_CloneGlobalMuon = ExtVar(cms.InputTag("cloneGlobalMuonTagger:notBadEvent"), bool, doc = "Clone muon flag"),
36  Flag_BadPFMuonFilter = ExtVar(cms.InputTag("BadPFMuonTagger"), bool, doc = "Bad PF muon flag"),
37  Flag_BadChargedCandidateFilter = ExtVar(cms.InputTag("BadChargedCandidateTagger"), bool, doc = "Bad charged hadron flag"),
38  )
39 )
40 
42 ecalBadCalibFilterNanoTagger = ecalBadCalibFilter.clone(
43  taggingMode = cms.bool(True)
44 )
45 
46 # modify extraFlagsTable to store ecalBadCalibFilter decision which is re-run with updated bad crystal list for 2017 and 2018 samples
47 for modifier in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_102Xv1:
48  modifier.toModify(extraFlagsTable, variables= cms.PSet())
49  modifier.toModify(extraFlagsTable, variables = dict(Flag_ecalBadCalibFilterV2 = ExtVar(cms.InputTag("ecalBadCalibFilterNanoTagger"), bool, doc = "Bad ECAL calib flag (updatedxtal list)")))
50 
51 
52 # empty task as default
53 extraFlagsProducersTask = cms.Task()
54 extraFlagsTableTask = cms.Task()
55 
56 ## those need to be added only for some specific eras
57 extraFlagsProducersTask_80x = cms.Task(badGlobalMuonTagger,cloneGlobalMuonTagger,BadPFMuonTagger,BadChargedCandidateTagger)
58 extraFlagsProducersTask_102x = cms.Task(ecalBadCalibFilterNanoTagger)
59 
60 run2_miniAOD_80XLegacy.toReplaceWith(extraFlagsProducersTask, extraFlagsProducersTask_80x)
61 run2_miniAOD_80XLegacy.toReplaceWith(extraFlagsTableTask, cms.Task(extraFlagsTable))
62 
63 (run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1).toReplaceWith(extraFlagsProducersTask, extraFlagsProducersTask_102x)
64 (run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1).toReplaceWith(extraFlagsTableTask, cms.Task(extraFlagsTable))
def ExtVar
Definition: common_cff.py:31
The muon bad track filter (2016) ________________________________________________||.
The charged hadron track track filter (2016) ____________________________________||.