Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:48

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 pfNoPUchsMEtTask = cms.Task()
0004 
0005 from JetMETCorrections.Type1MET.ak4PFchsJets_cff import *
0006 pfNoPUchsMEtTask.add(ak4PFchsJetsTask)
0007 
0008 from JetMETCorrections.Configuration.JetCorrectionServices_cff import *
0009 calibratedAK4PFchsJetsForPFNoPUchsMEt = cms.EDProducer('PFJetCorrectionProducer',
0010     src = cms.InputTag('ak4PFchsJets'),
0011     correctors = cms.vstring('ak4PFchsL1FastL2L3Residual') # NOTE: use "ak4PFchsL1FastL2L3" for MC / "ak4PFchsL1FastL2L3Residual" for Data
0012 )
0013 ak4PFJetTaskForPFNoPUchsMEt = cms.Task(calibratedAK4PFchsJetsForPFNoPUchsMEt)
0014 pfNoPUchsMEtTask.add(ak4PFJetTaskForPFNoPUchsMEt)
0015 
0016 from RecoJets.JetProducers.PileupJetID_cfi import *
0017 puJetIdForPFNoPUchsMEt = pileupJetId.clone(
0018     algos = cms.VPSet(
0019         full_53x_chs,
0020         cutbased
0021         ),
0022     label            = "fullId",
0023     produceJetIds    = True,
0024     runMvas          = True,
0025     jets             = "calibratedAK4PFchsJetsForPFNoPUchsMEt",
0026     applyJec         = False,
0027     inputIsCorrected = True,                                     
0028 )
0029 pfNoPUchsMEtTask.add(puJetIdForPFNoPUchsMEt)
0030 
0031 from JetMETCorrections.Type1MET.pfMETCorrectionType0_cfi import *
0032 pfNoPUchsMEtTask.add(type0PFMEtCorrection)
0033 pfCandidateToVertexAssociationForPFNoPUchsMEt = pfCandidateToVertexAssociation.clone(
0034     MaxNumberOfAssociations = 1,    
0035     doReassociation         = False,
0036     FinalAssociation        = 1,                
0037     nTrackWeight            = 0.
0038 )
0039 pfNoPUchsMEtTask.add(pfCandidateToVertexAssociationForPFNoPUchsMEt)
0040 pfMETcorrType0ForPFNoPUchsMEt = pfMETcorrType0.clone(
0041     srcPFCandidateToVertexAssociations = 'pfCandidateToVertexAssociationForPFNoPUchsMEt'
0042 )
0043 pfNoPUchsMEtTask.add(pfMETcorrType0ForPFNoPUchsMEt)
0044 
0045 ##from CommonTools.RecoUtils.pfcand_assomap_cfi import PFCandAssoMap
0046 ##pfPileUpToVertexAssociation = PFCandAssoMap.clone(
0047 ##    VertexTrackAssociationMap = cms.InputTag('trackToVertexAssociation'),
0048 ##    PFCandidateCollection = 'pfPileUpForAK4PFchsJets'
0049 ##)
0050 ##pfNoPUchsMEtTask.add(pfPileUpToVertexAssociation)
0051 
0052 jvfJetIdForPFNoPUchsMEt = cms.EDProducer("JVFJetIdProducer",
0053     srcJets = cms.InputTag('calibratedAK4PFchsJetsForPFNoPUchsMEt'),                                      
0054     srcPFCandidates = cms.InputTag('particleFlow'),
0055     srcPFCandToVertexAssociations = cms.InputTag('pfCandidateToVertexAssociationForPFNoPUchsMEt'),
0056     srcHardScatterVertex = cms.InputTag('selectedPrimaryVertexHighestPtTrackSumForPFMEtCorrType0'),
0057     minTrackPt = cms.double(1.),                                    
0058     dZcut = cms.double(0.2), # cm
0059     JVFcut = cms.double(0.75),
0060     neutralJetOption = cms.string("noPU")
0061 )
0062 pfNoPUchsMEtTask.add(jvfJetIdForPFNoPUchsMEt)
0063 
0064 import RecoMET.METProducers.METSigParams_cfi as met_config
0065 pfNoPUchsMEtData = cms.EDProducer("PFNoPUMEtDataProducer",
0066     srcJets = cms.InputTag('calibratedAK4PFchsJetsForPFNoPUchsMEt'),                               
0067     srcJetIds = cms.InputTag('puJetIdForPFNoPUchsMEt', 'fullId'),
0068     #srcJetIds = cms.InputTag('jvcJetIdForPFNoPUchsMEt', 'Id'),                          
0069     minJetPt = cms.double(30.0), 
0070     jetIdSelection = cms.string('loose'),
0071     jetEnOffsetCorrLabel = cms.string("ak4PFchsL1Fastjet"),
0072     srcPFCandidates = cms.InputTag('particleFlow'),
0073     srcPFCandToVertexAssociations = cms.InputTag('pfCandidateToVertexAssociationForPFNoPUchsMEt'),
0074     ##srcPFCandidates = cms.InputTag('pfPileUpForAK4PFchsJets'),
0075     ##srcPFCandToVertexAssociations = cms.InputTag('pfPileUpToVertexAssociation'),
0076     srcJetsForMEtCov = cms.InputTag('ak4PFchsJets'),                               
0077     minJetPtForMEtCov = cms.double(10.), 
0078     srcHardScatterVertex = cms.InputTag('selectedPrimaryVertexHighestPtTrackSumForPFMEtCorrType0'),
0079     dZcut = cms.double(0.2), # cm
0080     resolution = met_config.METSignificance_params,
0081     verbosity = cms.int32(0)     
0082 )
0083 pfNoPUchsMEtTask.add(pfNoPUchsMEtData)
0084 
0085 pfNoPUchsMEt = cms.EDProducer("PFNoPUMEtProducer",
0086     srcMEt = cms.InputTag('pfMet'),
0087     srcMEtCov = cms.InputTag(''), # NOTE: leave empty to take MET covariance matrix from reco::PFMET object
0088     srcMVAMEtData = cms.InputTag('pfNoPUchsMEtData'),
0089     srcLeptons = cms.VInputTag(), # NOTE: you need to set this to collections of electrons, muons and tau-jets
0090                                   #       passing the lepton reconstruction & identification criteria applied in your analysis
0091     srcMVAMEtDataLeptonMatch = cms.InputTag('pfNoPUchsMEtData'),
0092     srcType0Correction = cms.InputTag('pfMETcorrType0ForPFNoPUchsMEt'),                    
0093     sfNoPUjets = cms.double(1.0),
0094     sfNoPUjetOffsetEnCorr = cms.double(0.0),                    
0095     sfPUjets = cms.double(1.0),
0096     sfNoPUunclChargedCands = cms.double(1.0),
0097     sfPUunclChargedCands = cms.double(1.0),
0098     sfUnclNeutralCands = cms.double(0.6),
0099     sfType0Correction = cms.double(1.0),
0100     sfLeptonIsoCones = cms.double(0.6),                              
0101     resolution = met_config.METSignificance_params,
0102     sfMEtCovMin = cms.double(0.6),
0103     sfMEtCovMax = cms.double(1.0),                               
0104     saveInputs = cms.bool(True),
0105     verbosity = cms.int32(0)                               
0106 )
0107 pfNoPUchsMEtTask.add(pfNoPUchsMEt)
0108 pfNoPUchsMEtSequence = cms.Sequence(pfNoPUchsMEtTask)