Example #1
0
def runMVAMet(process, isMC, leptons):

    from RecoJets.JetProducers.ak4PFJets_cfi import ak4PFJets

    if not hasattr(process, "ak4PFJets"):
        setattr(process, "ak4PFJets",
                ak4PFJets.clone(src=cms.InputTag('packedPFCandidates')))

    if not hasattr(process, "ak4PFL1FastL2L3Corrector"):
        process.load('JetMETCorrections.Configuration.JetCorrectors_cff')

    process.calibratedAK4PFJetsForPFMVAMEt = calibratedAK4PFJetsForPFMVAMEt.clone(
        correctors=cms.vstring("ak4PFL1FastL2L3"))

    from JetMETCorrections.Configuration.JetCorrectionServices_cff import ak4PFL1FastL2L3, ak4PFL1FastL2L3Residual, ak4PFL1Fastjet, ak4PFL2Relative, ak4PFL3Absolute, ak4PFResidual

    if not isMC:
        process.ak4PFL1FastL2L3Residual = ak4PFL1FastL2L3Residual.clone()
        process.ak4PFResidual = ak4PFResidual.clone()
        process.calibratedAK4PFJetsForPFMVAMEt.correctors = cms.vstring(
            "ak4PFL1FastL2L3Residual")
    else:
        process.ak4PFL1FastL2L3 = ak4PFL1FastL2L3.clone()

    process.ak4PFL1Fastjet = ak4PFL1Fastjet.clone()
    process.ak4PFL2Relative = ak4PFL2Relative.clone()
    process.ak4PFL3Absolute = ak4PFL3Absolute.clone()

    from RecoJets.JetProducers.PileupJetID_cfi import pileupJetIdEvaluator
    from RecoJets.JetProducers.PileupJetIDParams_cfi import JetIdParams

    process.puJetIdForPFMVAMEt = pileupJetIdEvaluator.clone(
        produceJetIds=cms.bool(True),
        jets=cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"),
        vertexes=cms.InputTag("offlineSlimmedPrimaryVertices"),
        jec=cms.string("AK4PF"))

    process.mvaMET = pfMVAMEt.clone(
        srcPFCandidates=cms.InputTag('packedPFCandidates'),
        srcVertices=cms.InputTag('offlineSlimmedPrimaryVertices'),
        srcLeptons=cms.VInputTag(leptons),
        inputFileNames=cms.
        PSet(U=cms.FileInPath(
            'RecoMET/METPUSubtraction/data/gbru_7_4_X_miniAOD_50NS_July2015.root'
        ),
             DPhi=cms.FileInPath(
                 'RecoMET/METPUSubtraction/data/gbrphi_7_4_X_miniAOD_50NS_July2015.root'
             ),
             CovU1=cms.FileInPath(
                 'RecoMET/METPUSubtraction/data/gbru1cov_7_4_X_miniAOD_50NS_July2015.root'
             ),
             CovU2=cms.FileInPath(
                 'RecoMET/METPUSubtraction/data/gbru2cov_7_4_X_miniAOD_50NS_July2015.root'
             )))
Example #2
0
from RecoJets.JetProducers.PileupJetID_cfi import pileupJetIdEvaluator
from RecoJets.JetProducers.PileupJetIDParams_cfi import JetIdParams
puJetIdForPFMVAMEt = pileupJetIdEvaluator.clone(
    algos=cms.VPSet(
        cms.PSet(
            tmvaVariables=cms.vstring("nvtx", "jetPt", "jetEta", "jetPhi",
                                      "dZ", "beta", "betaStar", "nCharged",
                                      "nNeutrals", "dR2Mean", "ptD", "frac01",
                                      "frac02", "frac03", "frac04", "frac05"),
            tmvaWeights=cms.string(
                "RecoJets/JetProducers/data/TMVAClassificationCategory_JetID_MET_53X_Dec2012.weights.xml.gz"
            ),
            tmvaMethod=cms.string("JetID"),
            tmvaSpectators=cms.vstring(),
            JetIdParams=JetIdParams,
            impactParTkThreshold=cms.double(0.),
            version=cms.int32(-1),
            cutBased=cms.bool(False),
            label=cms.string("full"))),
    produceJetIds=cms.bool(True),
    runMvas=cms.bool(True),
    jets=cms.InputTag(
        "calibratedAK4PFJetsForPFMVAMEt"),  #calibratedAK4PFJetsForPFMVAMEt
    applyJec=cms.bool(True),
    inputIsCorrected=cms.bool(True),
    jec=cms.string("AK4PF"),
)

pfMVAMEt = cms.EDProducer(
    "PFMETProducerMVA",
Example #3
0
puJetIdForPFMVAMEt = pileupJetIdEvaluator.clone(
    algos = cms.VPSet(
        cms.PSet(
        tmvaVariables = cms.vstring(
            "nvtx",
            "jetPt",
            "jetEta",
            "jetPhi",
            "dZ",
            "beta",
            "betaStar",
            "nCharged",
            "nNeutrals",
            "dR2Mean",
            "ptD",
            "frac01",
            "frac02",
            "frac03",
            "frac04",
            "frac05"
            ),
        etaBinnedWeights = cms.bool(False),
        tmvaWeights = cms.string("RecoJets/JetProducers/data/TMVAClassificationCategory_JetID_MET_53X_Dec2012.weights.xml.gz"),
        tmvaMethod = cms.string("JetID"),
        tmvaSpectators = cms.vstring(),
        JetIdParams = JetIdParams,                  
        impactParTkThreshold = cms.double(0.),
        version = cms.int32(-1),
        cutBased = cms.bool(False), 
        label = cms.string("full")
        )
        ),
    produceJetIds = cms.bool(True),
    runMvas = cms.bool(True),
    jets = cms.InputTag("calibratedAK4PFJetsForPFMVAMEt"),#calibratedAK4PFJetsForPFMVAMEt
    applyJec = cms.bool(True),
    inputIsCorrected = cms.bool(True),
    jec     = cms.string("AK4PF"),
)