CMS 3D CMS Logo

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 = [x for x in dir(proc) if (x not in procAttributes) and (x.find('FastSim') != -1)]
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(process, sequence, postfix, removePostfix="", noClones=[], addToTask=False)
Definition: helpers.py:256
def SetValidationExtention(module, extension)
dbl *** dir
Definition: mlp_gen.cc:35