File indexing completed on 2022-05-18 03:27:34
0001
0002
0003 import FWCore.ParameterSet.Config as cms
0004
0005
0006
0007
0008
0009 updatedTauName = "slimmedTausNewID"
0010 minimalOutput = True
0011 eventsToProcess = 100
0012 nThreads = 1
0013
0014 process = cms.Process('TauID')
0015 process.load('Configuration.StandardSequences.MagneticField_cff')
0016 process.load('Configuration.Geometry.GeometryRecoDB_cff')
0017 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0018 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0019
0020 from Configuration.AlCa.GlobalTag import GlobalTag
0021 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2018_realistic', '')
0022
0023
0024 process.source = cms.Source('PoolSource', fileNames = cms.untracked.vstring(
0025
0026 '/store/mc/RunIISummer20UL18MiniAOD/TTToSemiLeptonic_TuneCP5_13TeV-powheg-pythia8/MINIAODSIM/106X_upgrade2018_realistic_v11_L1v1-v2/00000/009636D7-07B2-DB49-882D-C251FD62CCE7.root'
0027 ))
0028
0029 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(eventsToProcess) )
0030
0031
0032 import RecoTauTag.RecoTau.tools.runTauIdMVA as tauIdConfig
0033 toKeep = [ "2017v2", "dR0p32017v2", "newDM2017v2",
0034
0035 "deepTau2017v2p1",
0036 "deepTau2018v2p5",
0037
0038
0039 "againstEle2018",
0040 ]
0041 tauIdEmbedder = tauIdConfig.TauIDEmbedder(process, debug = False,
0042 updatedTauName = updatedTauName,
0043 toKeep = toKeep)
0044 tauIdEmbedder.runTauID()
0045
0046 postfix = "Ver2"
0047 tauIdEmbedder2 = tauIdConfig.TauIDEmbedder(process, debug = False,
0048 originalTauName = "slimmedTaus",
0049 updatedTauName = updatedTauName+postfix,
0050 postfix = postfix,
0051 toKeep = toKeep)
0052 tauIdEmbedder2.runTauID()
0053
0054
0055 process.out = cms.OutputModule("PoolOutputModule",
0056 fileName = cms.untracked.string('patTuple_newTauIDs.root'),
0057 compressionAlgorithm = cms.untracked.string('LZMA'),
0058 compressionLevel = cms.untracked.int32(4),
0059 outputCommands = cms.untracked.vstring('drop *')
0060 )
0061 if not minimalOutput:
0062 print("Store full MiniAOD EventContent")
0063 from Configuration.EventContent.EventContent_cff import MINIAODSIMEventContent
0064 from PhysicsTools.PatAlgos.slimming.MicroEventContent_cff import MiniAODOverrideBranchesSplitLevel
0065 process.out.outputCommands = MINIAODSIMEventContent.outputCommands
0066 process.out.overrideBranchesSplitLevel = MiniAODOverrideBranchesSplitLevel
0067 process.out.outputCommands.append("keep *_"+updatedTauName+"_*_*")
0068 process.out.outputCommands.append("keep *_"+updatedTauName+postfix+"_*_*")
0069
0070
0071 process.p = cms.Path(
0072 process.rerunMvaIsolationSequence *
0073 getattr(process,updatedTauName)
0074 * getattr(process,"rerunMvaIsolationSequence"+postfix) *
0075 getattr(process,updatedTauName+postfix)
0076 )
0077 process.endjob = cms.EndPath(process.endOfProcess)
0078 process.outpath = cms.EndPath(process.out)
0079
0080 process.schedule = cms.Schedule(process.p,process.endjob,process.outpath)
0081
0082
0083 process.load('FWCore.MessageLogger.MessageLogger_cfi')
0084 if process.maxEvents.input.value()>10:
0085 process.MessageLogger.cerr.FwkReport.reportEvery = process.maxEvents.input.value()//10
0086 if process.maxEvents.input.value()>10000 or process.maxEvents.input.value()<0:
0087 process.MessageLogger.cerr.FwkReport.reportEvery = 1000
0088
0089 process.options = cms.untracked.PSet(
0090 wantSummary = cms.untracked.bool(False),
0091 numberOfThreads = cms.untracked.uint32(nThreads),
0092 numberOfStreams = cms.untracked.uint32(0)
0093 )