CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/Validation/RecoTau/python/dataTypes/ValidateTausOnZTTFastSim_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.ValidateTausOnZTT_cff')# import *
00009 
00010 procAttributes = dir(proc) #Takes a snapshot of what there in the process
00011 helpers.cloneProcessingSnippet( proc, proc.TauValNumeratorAndDenominatorZTT, 'FastSim') #clones the sequence inside the process with ZTT postfix
00012 helpers.cloneProcessingSnippet( proc, proc.TauEfficienciesZTT, 'FastSim') #clones the sequence inside the process with ZTT postfix
00013 proc.produceDenominatorZTTFastSim = helpers.cloneProcessingSnippet( proc, proc.produceDenominatorZTT, '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.TauValNumeratorAndDenominatorZTTFastSim.visit(zttModifier)
00019 
00020 #Sets the correct naming to efficiency histograms
00021 proc.efficienciesZTTFastSim.plots = Utils.SetPlotSequence(proc.TauValNumeratorAndDenominatorZTTFastSim)
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 = produceDenominatorZTTFastSim
00031 
00032 runTauValidationBatchMode = cms.Sequence(
00033       produceDenominatorZTTFastSim
00034       +TauValNumeratorAndDenominatorZTTFastSim
00035       )
00036 
00037 runTauValidation = cms.Sequence(
00038       runTauValidationBatchMode
00039       +TauEfficienciesZTTFastSim
00040       )
00041