CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
mitigatedMETSequence_cff.py
Go to the documentation of this file.
2 
4 
5 
6 ##================================================
7 ## MVA MET sequence
8 ##================================================
11 from RecoJets.JetProducers.PileupJetIDParams_cfi import JetIdParams
12 
13 from RecoJets.JetProducers.kt4PFJets_cfi import kt4PFJets
14 kt6PFJets = kt4PFJets.clone(rParam = cms.double(0.6), doRhoFastjet = True )
15 
16 calibratedAK4PFJetsForPFMVAMEt = cms.EDProducer('PFJetCorrectionProducer',
17  src = cms.InputTag('ak4PFJets'),
18  correctors = cms.vstring("ak4PFL1FastL2L3") # NOTE: use "ak5PFL1FastL2L3" for MC / "ak5PFL1FastL2L3Residual" for Data
19 )
20 
21 pfMVAMEt = cms.EDProducer("PFMETProducerMVA",
22  srcCorrJets = cms.InputTag('calibratedAK4PFJetsForPFMVAMEt'),
23  srcUncorrJets = cms.InputTag('ak4PFJets'),
24  srcPFCandidates = cms.InputTag('particleFlow'),
25  srcVertices = cms.InputTag('offlinePrimaryVertices'),
26  srcLeptons = cms.VInputTag('selectedElectrons',
27  'selectedMuons',
28  'selectedTaus',
29  'selectedPhotons',
30  'selectedJets'),
31  minNumLeptons = cms.int32(0),
32  srcRho = cms.InputTag('fixedGridRhoFastjetAll'),
33  globalThreshold = cms.double(-1.),
34  minCorrJetPt = cms.double(-1.),
35  inputFileNames = cms.PSet(
36  U = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrmet_53_June2013_type1.root'),
37  DPhi = cms.FileInPath('RecoMET/METPUSubtraction/data/gbrmetphi_53_June2013_type1.root'),
38  CovU1 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru1cov_53_Dec2012.root'),
39  CovU2 = cms.FileInPath('RecoMET/METPUSubtraction/data/gbru2cov_53_Dec2012.root')
40  ),
41  loadMVAfromDB = cms.bool(False),
42  is42 = cms.bool(False), # CV: set this flag to true if you are running mvaPFMET in CMSSW_4_2_x
43  corrector = cms.string("ak4PFL1Fastjet"),
44  useType1 = cms.bool(True),
45  useOld42 = cms.bool(False),
46  dZcut = cms.double(0.1),
47  impactParTkThreshold = cms.double(0.),
48  tmvaWeights = cms.string("RecoJets/JetProducers/data/TMVAClassificationCategory_JetID_MET_53X_Dec2012.weights.xml.gz"),
49  tmvaMethod = cms.string("JetID"),
50  version = cms.int32(-1),
51  cutBased = cms.bool(False),
52  tmvaVariables = cms.vstring(
53  "nvtx",
54  "jetPt",
55  "jetEta",
56  "jetPhi",
57  "dZ",
58  "beta",
59  "betaStar",
60  "nCharged",
61  "nNeutrals",
62  "dR2Mean",
63  "ptD",
64  "frac01",
65  "frac02",
66  "frac03",
67  "frac04",
68  "frac05"
69  ),
70  tmvaSpectators = cms.vstring(),
71  JetIdParams = JetIdParams,
72  verbosity = cms.int32(0)
73 )
74 
75 pfMVAMEtSequence = cms.Sequence(
76  kt6PFJets*
77  calibratedAK4PFJetsForPFMVAMEt*
78  pfMVAMEt
79 )
80 
81 
82 ##================================================
83 ## Pf No Pileup MET sequence
84 ##================================================
85 pfNoPUMEtSequence = cms.Sequence()
86 
88 calibratedAK4PFJetsForPFNoPUMEt = cms.EDProducer('PFJetCorrectionProducer',
89  src = cms.InputTag('ak4PFJets'),
90  correctors = cms.vstring('ak4PFL1FastL2L3Residual') # NOTE: use "ak4PFL1FastL2L3" for MC / "ak4PFL1FastL2L3Residual" for Data
91 )
92 ak4PFJetSequenceForPFNoPUMEt = cms.Sequence(calibratedAK4PFJetsForPFNoPUMEt)
93 pfNoPUMEtSequence += ak4PFJetSequenceForPFNoPUMEt
94 
95 from RecoJets.JetProducers.pileupjetidproducer_cfi import pileupJetIdEvaluator
96 from RecoJets.JetProducers.puJetIDAlgo_cff import full_53x,cutbased,PhilV1
97 puJetIdForPFNoPUMEt = pileupJetIdEvaluator.clone(
98  algos = cms.VPSet(
99  full_53x,
100  cutbased,
101  PhilV1
102  ),
103 # label = cms.string("fullId"), #MM does not work for weird reasons, cannot be cloned properly
104  produceJetIds = cms.bool(True),
105  runMvas = cms.bool(True),
106  jets = cms.InputTag("calibratedAK4PFJetsForPFNoPUMEt"),
107  applyJec = cms.bool(False),
108  inputIsCorrected = cms.bool(True),
109  )
110 pfNoPUMEtSequence += puJetIdForPFNoPUMEt
111 
113 pfNoPUMEtSequence += type0PFMEtCorrection
114 pfCandidateToVertexAssociationForPFNoPUMEt = pfCandidateToVertexAssociation.clone(
115  MaxNumberOfAssociations = cms.int32(1),
116  doReassociation = cms.bool(False),
117  FinalAssociation = cms.untracked.int32(1),
118  nTrackWeight = cms.double(0.)
119 )
120 pfNoPUMEtSequence += pfCandidateToVertexAssociationForPFNoPUMEt
121 pfMETcorrType0ForPFNoPUMEt = pfMETcorrType0.clone(
122  srcPFCandidateToVertexAssociations = cms.InputTag('pfCandidateToVertexAssociationForPFNoPUMEt')
123 )
124 pfNoPUMEtSequence += pfMETcorrType0ForPFNoPUMEt
125 
126 jvfJetIdForPFNoPUMEt = cms.EDProducer("JVFJetIdProducer",
127  srcJets = cms.InputTag('calibratedAK4PFJetsForPFNoPUMEt'),
128  srcPFCandidates = cms.InputTag('particleFlow'),
129  srcPFCandToVertexAssociations = cms.InputTag('pfCandidateToVertexAssociationForPFNoPUMEt'),
130  srcHardScatterVertex = cms.InputTag('selectedPrimaryVertexHighestPtTrackSumForPFMEtCorrType0'),
131  minTrackPt = cms.double(1.),
132  dZcut = cms.double(0.2), # cm
133  JVFcut = cms.double(0.75),
134  neutralJetOption = cms.string("noPU")
135 )
136 pfNoPUMEtSequence += jvfJetIdForPFNoPUMEt
137 
138 import RecoMET.METProducers.METSigParams_cfi as met_config
139 pfNoPUMEtData = cms.EDProducer("NoPileUpPFMEtDataProducer",
140  srcJets = cms.InputTag('calibratedAK4PFJetsForPFNoPUMEt'),
141  srcJetIds = cms.InputTag('puJetIdForPFNoPUMEt', 'full53xId'),
142 
143  minJetPt = cms.double(30.0),
144  jetIdSelection = cms.string('loose'),
145  jetEnOffsetCorrLabel = cms.string("ak4PFL1Fastjet"),
146  srcPFCandidates = cms.InputTag('particleFlow'),
147  srcPFCandToVertexAssociations = cms.InputTag('pfCandidateToVertexAssociationForPFNoPUMEt'),
148  srcJetsForMEtCov = cms.InputTag('ak4PFJets'),
149  minJetPtForMEtCov = cms.double(10.),
150  srcHardScatterVertex = cms.InputTag('selectedPrimaryVertexHighestPtTrackSumForPFMEtCorrType0'),
151  dZcut = cms.double(0.2), # cm
152  resolution = met_config.METSignificance_params,
153  verbosity = cms.int32(0)
154 )
155 pfNoPUMEtSequence += pfNoPUMEtData
156 
157 pfNoPUMEt = cms.EDProducer("NoPileUpPFMEtProducer",
158  srcMEt = cms.InputTag('pfMet'),
159  srcMEtCov = cms.InputTag(''), # NOTE: leave empty to take MET covariance matrix from reco::PFMET object //MM 08/29/14, bypass hardcoded as this variable has never been used so far
160  srcMVAMEtData = cms.InputTag('pfNoPUMEtData'),
161  srcLeptons = cms.VInputTag( 'selectedElectrons',
162  'selectedMuons',
163  'selectedTaus',
164  'selectedPhotons',
165  'selectedJets'),
166 # NOTE: you need to set this to collections of electrons, muons and tau-jets
167 #passing the lepton reconstruction & identification criteria applied in your analysis
168  srcMVAMEtDataLeptonMatch = cms.InputTag('pfNoPUMEtData'),
169  srcType0Correction = cms.InputTag('pfMETcorrType0ForPFNoPUMEt'),
170  sfNoPUjets = cms.double(1.0),
171  sfNoPUjetOffsetEnCorr = cms.double(0.0),
172  sfPUjets = cms.double(1.0),
173  sfNoPUunclChargedCands = cms.double(1.0),
174  sfPUunclChargedCands = cms.double(1.0),
175  sfUnclNeutralCands = cms.double(0.6),
176  sfType0Correction = cms.double(1.0),
177  sfLeptonIsoCones = cms.double(0.6),
178  resolution = met_config.METSignificance_params,
179  sfMEtCovMin = cms.double(0.6),
180  sfMEtCovMax = cms.double(1.0),
181  saveInputs = cms.bool(True),
182  verbosity = cms.int32(0)
183 )
184 pfNoPUMEtSequence += pfNoPUMEt
185 
186 
187 mitigatedMETSequence = cms.Sequence(
188 selectionSequenceForMVANoPUMET+
189 pfMVAMEtSequence+
190 pfNoPUMEtSequence
191 )
____________________________________________________________________________||