andrey-popov / PEC-tuples

CMSSW package to save basic physics objects in a simple ROOT format
1 stars 3 forks source link

Review and fix recalculation of MET #71

Closed andrey-popov closed 8 years ago

andrey-popov commented 8 years ago

Recalculation of MET (which is required as a part of issue #64) is packed with problems. Some of them are or will be reported in this thread. Will also use this issue to document the status and progress.

andrey-popov commented 8 years ago

In several places residual corrections are applied when running over simulation. This happens in shiftedPatJetEnUp/Down (as configured here) and patPFMetT1T2Corr. Here are example configurations:

>>> process.shiftedPatJetEnUp
cms.EDProducer("ShiftedPATJetProducer",
    addResidualJES = cms.bool(True),
    jetCorrInputFileName = cms.FileInPath('Analysis/PECTuples/data/Summer15_25nsV6_MC_UncertaintySources_AK4PFchs.txt'),
    jetCorrLabelUpToL3 = cms.InputTag("ak4PFCHSL1FastL2L3Corrector"),
    jetCorrLabelUpToL3Res = cms.InputTag("ak4PFCHSL1FastL2L3ResidualCorrector"),
    jetCorrPayloadName = cms.string('AK4PFchs'),
    jetCorrUncertaintyTag = cms.string('SubTotalMC'),
    shiftBy = cms.double(1.0),
    src = cms.InputTag("slimmedJets")
)
>>> process.patPFMetT1T2Corr
cms.EDProducer("PATPFJetMETcorrInputProducer",
    isMC = cms.bool(False),
    jetCorrLabel = cms.InputTag("L3Absolute"),
    jetCorrLabelRes = cms.InputTag("L2L3Residual"),
    offsetCorrLabel = cms.InputTag("L1FastJet"),
    skipEM = cms.bool(True),
    skipEMfractionThreshold = cms.double(0.9),
    skipMuonSelection = cms.string('isGlobalMuon | isStandAloneMuon'),
    skipMuons = cms.bool(True),
    src = cms.InputTag("slimmedJets"),
    type1JetPtThreshold = cms.double(15.0),
    type2ExtraCorrFactor = cms.double(1.0),
    type2ResidualCorrEtaMax = cms.double(9.9),
    type2ResidualCorrLabel = cms.InputTag(""),
    type2ResidualCorrOffset = cms.double(0.0)
)
andrey-popov commented 8 years ago

According to event summary, some CPU time is spent in modules patPFMetT2Corr and patPFMetTxyCorr. Does this mean that type-2 and phi-modulation corrections are applied?

andrey-popov commented 8 years ago

Need to investigate the jet cleaning applied by the tool. Not clear if I need to apply it and, if yes, how to define “good” leptons and taus when processing MiniAOD.

andrey-popov commented 8 years ago

By default, corrections for phi modulation are evaluated, see last lines in the configuration:

>>> process.slimmedMETs
cms.EDProducer("PATMETSlimmer",
    caloMET = cms.InputTag("patCaloMet"),
    rawVariation = cms.InputTag("patPFMet"),
    runningOnMiniAOD = cms.bool(True),
    src = cms.InputTag("patPFMetT1"),
    t01Variation = cms.InputTag("slimmedMETs","","@skipCurrentProcess"),
    t1Uncertainties = cms.InputTag("patPFMetT1%s"),
    tXYUncForRaw = cms.InputTag("patPFMetTxy"),
    tXYUncForT1 = cms.InputTag("patPFMetT1Txy")
)

However, they are stored as an independent correction in pat::MET (in this line). Thus, they do not modify results returned by pat::MET::shiftedPt(var, pat::MET::Type1) and others.

andrey-popov commented 8 years ago

The MET tool calculates uncertainties even when running over data (with isData = True). Tried to avoid executing corresponding producers by deleting input tag process.slimmedMETs.t1Uncertainties. But then cmsRun fails with a segfault when I try to read MET with pat::MET::shiftedPt(pat::MET::NoShift, pat::MET::Type1). According to the trace, the segfault stems from pat::MET::findMETTotalShift (source code), but I don't see what exactly goes wrong.

For the time being, just calculate the uncertainties, although they are never read.

andrey-popov commented 8 years ago

The MET saga continues in 76X… Some issues reported here. Waiting until the end of week for the corrected recipe to arrive.