CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/Validation/RecoTau/python/dataTypes/ValidateTausOnZEEFastSim_cff.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 import Validation.RecoTau.ValidationUtils as Utils
00003 from Validation.RecoTau.RecoTauValidation_cfi import ApplyFunctionToSequence, SetValidationExtention
00004 import PhysicsTools.PatAlgos.tools.helpers as helpers
00005 
00006 proc = cms.Process('helper')
00007 
00008 proc.load('Validation.RecoTau.dataTypes.ValidateTausOnZEE_cff')# import *
00009 
00010 procAttributes = dir(proc) #Takes a snapshot of what there in the process
00011 helpers.cloneProcessingSnippet( proc, proc.TauValNumeratorAndDenominatorZEE, 'FastSim') #clones the sequence inside the process with ZEE postfix
00012 helpers.cloneProcessingSnippet( proc, proc.TauEfficienciesZEE, 'FastSim') #clones the sequence inside the process with ZEE postfix
00013 proc.produceDenominatorZEEFastSim = helpers.cloneProcessingSnippet( proc, proc.produceDenominatorZEE, 'FastSim')
00014 
00015 #adds to TauValNumeratorAndDenominator modules in the sequence FastSim to the extention name
00016 zttLabeler = lambda module : SetValidationExtention(module, 'FastSim')
00017 zttModifier = ApplyFunctionToSequence(zttLabeler)
00018 proc.TauValNumeratorAndDenominatorZEEFastSim.visit(zttModifier)
00019 
00020 #Sets the correct naming to efficiency histograms
00021 proc.efficienciesZEEFastSim.plots = Utils.SetPlotSequence(proc.TauValNumeratorAndDenominatorZEEFastSim)
00022 
00023 #checks what's new in the process (the cloned sequences and modules in them)
00024 newProcAttributes = filter( lambda x: (x not in procAttributes) and (x.find('FastSim') != -1), dir(proc) )
00025 
00026 #spawns a local variable with the same name as the proc attribute, needed for future process.load
00027 for newAttr in newProcAttributes:
00028     locals()[newAttr] = getattr(proc,newAttr)
00029 
00030 produceDenominator = produceDenominatorZEEFastSim
00031 
00032 runTauValidationBatchMode = cms.Sequence(
00033       produceDenominatorZEEFastSim
00034       +TauValNumeratorAndDenominatorZEEFastSim
00035       )
00036 
00037 runTauValidation = cms.Sequence(
00038       runTauValidationBatchMode
00039       +TauEfficienciesZEEFastSim
00040       )