Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:24:06

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 from JetMETCorrections.Configuration.JetCorrectorsAllAlgos_cff import *
0004 
0005 # load modules for producing Type 1 / Type 1 + 2 corrections for reco::PFMET objects
0006 
0007 #--------------------------------------------------------------------------------
0008 # produce "raw" (uncorrected) pat::MET of calo-type
0009 from PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi import patMETs
0010 patCaloMet = patMETs.clone(
0011     metSource = cms.InputTag('caloMetM'),
0012     addMuonCorrections = cms.bool(False),
0013     genMETSource = cms.InputTag('genMetTrue')
0014 )
0015 #--------------------------------------------------------------------------------
0016 
0017 patCaloMetType1Corr = cms.EDProducer(
0018     "CaloJetMETcorrInputProducer",
0019     src = cms.InputTag('ak4CaloJets'),
0020     jetCorrLabel = cms.InputTag("ak4CaloL2L3Corrector"), # NOTE: use "ak4CaloL2L3Corrector" for MC / "ak4CaloL2L3ResidualCorrector" for Data
0021     jetCorrEtaMax = cms.double(9.9),
0022     type1JetPtThreshold = cms.double(20.0),
0023     skipEM = cms.bool(True),
0024     skipEMfractionThreshold = cms.double(0.90),
0025     srcMET = cms.InputTag('caloMetM')
0026 )
0027 
0028 ##____________________________________________________________________________||
0029 patCaloMetMuCorr = cms.EDProducer("MuonMETcorrInputProducer",
0030     src = cms.InputTag('muons'),
0031     srcMuonCorrections = cms.InputTag('muonMETValueMapProducer', 'muCorrData')
0032 )
0033 
0034 ##____________________________________________________________________________||
0035 patCaloMetType2Corr = cms.EDProducer(
0036     "Type2CorrectionProducer",
0037     srcUnclEnergySums = cms.VInputTag(
0038         cms.InputTag('patCaloMetType1Corr', 'type2'),
0039         cms.InputTag('patCaloMetMuCorr') # NOTE: use this for 'corMetGlobalMuons', do **not** use it for 'met' !!
0040         ),
0041     type2CorrFormula = cms.string("A + B*exp(-C*x)"),
0042     type2CorrParameter = cms.PSet(
0043         A = cms.double(2.0),
0044         B = cms.double(1.3),
0045         C = cms.double(0.1)
0046         )
0047     )
0048 
0049 
0050 
0051 #--------------------------------------------------------------------------------
0052 # use MET corrections to produce Type 1 / Type 1 + 2 corrected PFMET objects
0053 patCaloMetT1 = cms.EDProducer("CorrectedPATMETProducer",
0054     src = cms.InputTag('patCaloMet'),
0055     applyType1Corrections = cms.bool(True),
0056     srcType1Corrections = cms.VInputTag(
0057         cms.InputTag('patCaloMetType1Corr', 'type1'),
0058     ),
0059     applyType2Corrections = cms.bool(False)
0060 )
0061 
0062 patCaloMetT1T2 = cms.EDProducer("CorrectedPATMETProducer",
0063     src = cms.InputTag('patCaloMet'),
0064     applyType1Corrections = cms.bool(True),
0065     srcType1Corrections = cms.VInputTag(
0066         cms.InputTag('patCaloMetType1Corr', 'type1'),
0067     ),
0068     applyType2Corrections = cms.bool(True),
0069     srcUnclEnergySums = cms.VInputTag(
0070         cms.InputTag('patCaloMetType1Corr', 'type2' ),
0071     ),
0072     type2CorrFormula = cms.string("A + B*exp(-C*x)"),
0073     type2CorrParameter = cms.PSet(
0074         A = cms.double(2.0),
0075         B = cms.double(1.3),
0076         C = cms.double(0.1)
0077         )
0078 )
0079 
0080 
0081 ##____________________________________________________________________________||
0082 producePatCaloMETCorrectionsUnc = cms.Sequence(
0083     patCaloMet +
0084     ak4CaloL2L3CorrectorChain + # NOTE: use "ak4CaloL2L3CorrectorChain" for MC / "ak4CaloL2L3ResidualCorrectorChain" for Data
0085     patCaloMetType1Corr +
0086     patCaloMetMuCorr +
0087     patCaloMetType2Corr
0088     )
0089 
0090 ##____________________________________________________________________________||