CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/Validation/RecoTau/python/dataTypes/ValidateTausOnQCD_cff.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 from Validation.RecoTau.RecoTauValidation_cfi import *
00003 import copy
00004 
00005 from PhysicsTools.HepMCCandAlgos.genParticles_cfi import *
00006 from RecoJets.Configuration.RecoGenJets_cff import *
00007 from RecoJets.Configuration.GenJetParticles_cff import *
00008 import PhysicsTools.PatAlgos.tools.helpers as helpers
00009 
00010 kinematicSelectedTauValDenominatorQCD = cms.EDFilter(
00011    "GenJetSelector", #"GenJetSelector"
00012    src = cms.InputTag('iterativeCone5GenJets'),
00013    cut = kinematicSelectedTauValDenominatorCut,#cms.string('pt > 5. && abs(eta) < 2.5'), #Defined: Validation.RecoTau.RecoTauValidation_cfi 
00014    filter = cms.bool(False)
00015 )
00016 
00017 
00018 procAttributes = dir(proc) #Takes a snapshot of what there in the process
00019 helpers.cloneProcessingSnippet( proc, proc.TauValNumeratorAndDenominator, 'QCD') #clones the sequence inside the process with QCD postfix
00020 helpers.cloneProcessingSnippet( proc, proc.TauEfficiencies, 'QCD') #clones the sequence inside the process with QCD postfix
00021 helpers.massSearchReplaceAnyInputTag(proc.TauValNumeratorAndDenominatorQCD, 'kinematicSelectedTauValDenominator', 'kinematicSelectedTauValDenominatorQCD') #sets the correct input tag
00022 
00023 #adds to TauValNumeratorAndDenominator modules in the sequence QCD to the extention name
00024 zttLabeler = lambda module : SetValidationExtention(module, 'QCD')
00025 zttModifier = ApplyFunctionToSequence(zttLabeler)
00026 proc.TauValNumeratorAndDenominatorQCD.visit(zttModifier)
00027 
00028 #Sets the correct naming to efficiency histograms
00029 proc.efficienciesQCD.plots = Utils.SetPlotSequence(proc.TauValNumeratorAndDenominatorQCD)
00030 
00031 #checks what's new in the process (the cloned sequences and modules in them)
00032 newProcAttributes = filter( lambda x: (x not in procAttributes) and (x.find('QCD') != -1), dir(proc) )
00033 
00034 #spawns a local variable with the same name as the proc attribute, needed for future process.load
00035 for newAttr in newProcAttributes:
00036     locals()[newAttr] = getattr(proc,newAttr)
00037 
00038 
00039 produceDenominatorQCD = cms.Sequence(
00040     genParticlesForJets
00041     *kinematicSelectedTauValDenominatorQCD
00042     )
00043 
00044 produceDenominator = produceDenominatorQCD
00045 
00046 runTauValidationBatchMode = cms.Sequence(
00047     produceDenominator
00048     +TauValNumeratorAndDenominatorQCD
00049     )
00050 
00051 runTauValidation = cms.Sequence(
00052     runTauValidationBatchMode
00053     +TauEfficienciesQCD
00054     )