File indexing completed on 2024-04-06 12:33:18
0001 import FWCore.ParameterSet.Config as cms
0002 from Validation.RecoTau.RecoTauValidation_cfi import *
0003 import copy
0004
0005 from PhysicsTools.HepMCCandAlgos.genParticles_cfi import *
0006 from RecoJets.Configuration.RecoGenJets_cff import *
0007 from RecoJets.Configuration.GenJetParticles_cff import *
0008 import PhysicsTools.PatAlgos.tools.helpers as helpers
0009
0010 kinematicSelectedTauValDenominatorQCD = cms.EDFilter(
0011 "GenJetSelector",
0012 src = cms.InputTag('slimmedGenJets'),
0013 cut = kinematicSelectedTauValDenominatorCut,
0014 filter = cms.bool(False)
0015 )
0016
0017 procAttributes = dir(proc)
0018 helpers.cloneProcessingSnippet( proc, proc.TauValNumeratorAndDenominator, 'QCD')
0019 helpers.cloneProcessingSnippet( proc, proc.TauEfficiencies, 'QCD')
0020 helpers.massSearchReplaceAnyInputTag(proc.TauValNumeratorAndDenominatorQCD, 'kinematicSelectedTauValDenominator', 'kinematicSelectedTauValDenominatorQCD')
0021
0022
0023 zttLabeler = lambda module : SetValidationExtention(module, 'QCD')
0024 zttModifier = ApplyFunctionToSequence(zttLabeler)
0025 proc.TauValNumeratorAndDenominatorQCD.visit(zttModifier)
0026
0027
0028 discs_to_retain = ['ByDecayModeFinding', 'CombinedIsolationDBSumPtCorr3Hits', 'IsolationMVArun2v1DBoldDMwLT', 'IsolationMVArun2v1DBnewDMwLT']
0029 proc.RunHPSValidationQCD.discriminators = cms.VPSet([p for p in proc.RunHPSValidationQCD.discriminators if any(disc in p.discriminator.value() for disc in discs_to_retain) ])
0030
0031
0032 proc.efficienciesQCD.plots = Utils.SetPlotSequence(proc.TauValNumeratorAndDenominatorQCD)
0033 proc.efficienciesQCDSummary = cms.EDProducer("TauDQMHistEffProducer",
0034 plots = cms.PSet(
0035 Summary = cms.PSet(
0036 denominator = cms.string('RecoTauV/standardValidation/hpsPFTauProducerQCD_Summary/#PAR#PlotDen'),
0037 efficiency = cms.string('RecoTauV/standardValidation/hpsPFTauProducerQCD_Summary/#PAR#Plot'),
0038 numerator = cms.string('RecoTauV/standardValidation/hpsPFTauProducerQCD_Summary/#PAR#PlotNum'),
0039 parameter = cms.vstring('summary'),
0040 stepByStep = cms.bool(True)
0041 ),
0042 )
0043 )
0044
0045
0046 newProcAttributes = [x for x in dir(proc) if (x not in procAttributes) and (x.find('QCD') != -1)]
0047
0048
0049 for newAttr in newProcAttributes:
0050 locals()[newAttr] = getattr(proc,newAttr)
0051
0052 produceDenominatorQCD = cms.Sequence(
0053 cms.ignore(kinematicSelectedTauValDenominatorQCD)
0054 )
0055
0056 produceDenominator = cms.Sequence(produceDenominatorQCD)
0057
0058 runTauValidationBatchMode = cms.Sequence(
0059 produceDenominatorQCD
0060 +TauValNumeratorAndDenominatorQCD
0061 )
0062
0063 runTauValidation = cms.Sequence(
0064 runTauValidationBatchMode
0065 +TauEfficienciesQCD
0066 )