CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ValidateTausOnZTTFastSim_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.ValidateTausOnZTT_cff')# import *
9 
10 procAttributes = dir(proc) #Takes a snapshot of what there in the process
11 helpers.cloneProcessingSnippet( proc, proc.TauValNumeratorAndDenominatorZTT, 'FastSim') #clones the sequence inside the process with ZTT postfix
12 helpers.cloneProcessingSnippet( proc, proc.TauEfficienciesZTT, 'FastSim') #clones the sequence inside the process with ZTT postfix
13 proc.produceDenominatorZTTFastSim = helpers.cloneProcessingSnippet( proc, proc.produceDenominatorZTT, '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.TauValNumeratorAndDenominatorZTTFastSim.visit(zttModifier)
19 
20 #Sets the correct naming to efficiency histograms
21 proc.efficienciesZTTFastSim.plots = Utils.SetPlotSequence(proc.TauValNumeratorAndDenominatorZTTFastSim)
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(produceDenominatorZTTFastSim)
31 
32 runTauValidationBatchMode = cms.Sequence(
33  produceDenominatorZTTFastSim
34  +TauValNumeratorAndDenominatorZTTFastSim
35  )
36 
37 runTauValidation = cms.Sequence(
38  runTauValidationBatchMode
39  +TauEfficienciesZTTFastSim
40  )
41 
def cloneProcessingSnippet
Definition: helpers.py:315
dbl *** dir
Definition: mlp_gen.cc:35