Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:21:40

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 ##____________________________________________________________________________||
0004 from JetMETCorrections.Configuration.JetCorrectors_cff import *
0005 
0006 ##____________________________________________________________________________||
0007 # select PFCandidates ("unclustered energy") not within jets
0008 # for Type 2 MET correction
0009 from CommonTools.ParticleFlow.TopProjectors.pfNoJet_cfi import pfNoJet as _pfNoJet
0010 # the new TopProjectors now work with Ptrs
0011 # a conversion is needed if objects are not available
0012 # add them upfront of the sequence
0013 pfJetsPtrForMetCorr = cms.EDProducer("PFJetFwdPtrProducer",
0014    src = cms.InputTag("ak4PFJets")
0015 )
0016 # this one is needed only if the input file doesn't have it
0017 # solved automatically with unscheduled execution
0018 from RecoParticleFlow.PFProducer.pfLinker_cff import particleFlowPtrs
0019 # particleFlowPtrs = cms.EDProducer("PFCandidateFwdPtrProducer",
0020 #    src = cms.InputTag("particleFlow")
0021 # )
0022 # FIXME: THIS IS A WASTE, BUT NOT CLEAR HOW TO FIX IT CLEANLY: the module
0023 # downstream operates with View<reco::Candidate>, I wish one could read
0024 # it from std::vector<PFCandidateFwdPtr> directly
0025 pfCandsNotInJetsPtrForMetCorr = _pfNoJet.clone(
0026     topCollection = cms.InputTag('pfJetsPtrForMetCorr'),
0027     bottomCollection = cms.InputTag('particleFlowPtrs')
0028 )
0029 pfCandsNotInJetsForMetCorr = cms.EDProducer("PFCandidateFromFwdPtrProducer",
0030     src = cms.InputTag("pfCandsNotInJetsPtrForMetCorr")
0031 )
0032 
0033 ##____________________________________________________________________________||
0034 corrPfMetType1 = cms.EDProducer(
0035     "PFJetMETcorrInputProducer",
0036     src = cms.InputTag('ak4PFJetsCHS'),
0037     offsetCorrLabel = cms.InputTag("ak4PFCHSL1FastjetCorrector"),
0038     jetCorrLabel = cms.InputTag("ak4PFCHSL1FastL2L3Corrector"), #for MC
0039     jetCorrLabelRes = cms.InputTag("ak4PFCHSL1FastL2L3ResidualCorrector"), # for data, automatic switch
0040     jetCorrEtaMax = cms.double(9.9),
0041     type1JetPtThreshold = cms.double(15.0),
0042     skipEM = cms.bool(True),
0043     skipEMfractionThreshold = cms.double(0.90),
0044     skipMuons = cms.bool(True),
0045     skipMuonSelection = cms.string("isGlobalMuon | isStandAloneMuon")
0046 )
0047 
0048 ##____________________________________________________________________________||
0049 pfCandMETcorr = cms.EDProducer(
0050     "PFCandMETcorrInputProducer",
0051     src = cms.InputTag('pfCandsNotInJetsForMetCorr'),
0052     srcWeights = cms.InputTag('')
0053     )
0054 
0055 ##____________________________________________________________________________||
0056 corrPfMetType2 = cms.EDProducer(
0057     "Type2CorrectionProducer",
0058     srcUnclEnergySums = cms.VInputTag(
0059         cms.InputTag('corrPfMetType1', 'type2'),
0060         cms.InputTag('corrPfMetType1', 'offset'),
0061         cms.InputTag('pfCandMETcorr')
0062     ),
0063     type2CorrFormula = cms.string("A"),
0064     type2CorrParameter = cms.PSet(
0065         A = cms.double(1.4)
0066         )
0067     )
0068 
0069 ##____________________________________________________________________________||
0070 correctionTermsPfMetType1Type2Task = cms.Task(
0071     pfJetsPtrForMetCorr,
0072     particleFlowPtrs,
0073     pfCandsNotInJetsPtrForMetCorr,
0074     pfCandsNotInJetsForMetCorr,
0075     pfCandMETcorr,
0076     ak4PFCHSL1FastL2L3ResidualCorrectorTask, #Data full chain
0077     ak4PFCHSL1FastL2L3CorrectorTask, #MC last corrector, previous are already in the data chain
0078     corrPfMetType1,
0079     corrPfMetType2
0080     )
0081 
0082 correctionTermsPfMetType1Type2 = cms.Sequence(correctionTermsPfMetType1Type2Task)