test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ValidateTausOnZEEFastSim_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 import Validation.RecoTau.ValidationUtils as Utils
3 from Validation.RecoTau.RecoTauValidation_cfi import ApplyFunctionToSequence, SetValidationExtention
5 
6 proc = cms.Process('helper')
7 
8 proc.load('Validation.RecoTau.dataTypes.ValidateTausOnZEE_cff')# import *
9 
10 procAttributes = dir(proc) #Takes a snapshot of what there in the process
11 helpers.cloneProcessingSnippet( proc, proc.TauValNumeratorAndDenominatorZEE, 'FastSim') #clones the sequence inside the process with ZEE postfix
12 helpers.cloneProcessingSnippet( proc, proc.TauEfficienciesZEE, 'FastSim') #clones the sequence inside the process with ZEE postfix
13 proc.produceDenominatorZEEFastSim = helpers.cloneProcessingSnippet( proc, proc.produceDenominatorZEE, 'FastSim')
14 
15 #adds to TauValNumeratorAndDenominator modules in the sequence FastSim to the extention name
16 zttLabeler = lambda module : SetValidationExtention(module, 'FastSim')
17 zttModifier = ApplyFunctionToSequence(zttLabeler)
18 proc.TauValNumeratorAndDenominatorZEEFastSim.visit(zttModifier)
19 
20 #Sets the correct naming to efficiency histograms
21 proc.efficienciesZEEFastSim.plots = Utils.SetPlotSequence(proc.TauValNumeratorAndDenominatorZEEFastSim)
22 
23 #checks what's new in the process (the cloned sequences and modules in them)
24 newProcAttributes = filter( lambda x: (x not in procAttributes) and (x.find('FastSim') != -1), dir(proc) )
25 
26 #spawns a local variable with the same name as the proc attribute, needed for future process.load
27 for newAttr in newProcAttributes:
28  locals()[newAttr] = getattr(proc,newAttr)
29 
30 produceDenominator = cms.Sequence(produceDenominatorZEEFastSim)
31 
32 runTauValidationBatchMode = cms.Sequence(
33  produceDenominatorZEEFastSim
34  +TauValNumeratorAndDenominatorZEEFastSim
35  )
36 
37 runTauValidation = cms.Sequence(
38  runTauValidationBatchMode
39  +TauEfficienciesZEEFastSim
40  )
def cloneProcessingSnippet
Definition: helpers.py:309
dbl *** dir
Definition: mlp_gen.cc:35