CMS 3D CMS Logo

ValidateTausOnQCD_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
3 import copy
4 
9 
10 kinematicSelectedTauValDenominatorQCD = cms.EDFilter(
11  "GenJetSelector", #"GenJetSelector"
12  src = cms.InputTag('ak4GenJets'),
13  cut = kinematicSelectedTauValDenominatorCut,#cms.string('pt > 5. && abs(eta) < 2.5'), #Defined: Validation.RecoTau.RecoTauValidation_cfi
14  filter = cms.bool(False)
15 )
16 
17 
18 procAttributes = dir(proc) #Takes a snapshot of what there in the process
19 helpers.cloneProcessingSnippet( proc, proc.TauValNumeratorAndDenominator, 'QCD') #clones the sequence inside the process with QCD postfix
20 helpers.cloneProcessingSnippet( proc, proc.TauEfficiencies, 'QCD') #clones the sequence inside the process with QCD postfix
21 helpers.massSearchReplaceAnyInputTag(proc.TauValNumeratorAndDenominatorQCD, 'kinematicSelectedTauValDenominator', 'kinematicSelectedTauValDenominatorQCD') #sets the correct input tag
22 
23 #adds to TauValNumeratorAndDenominator modules in the sequence QCD to the extention name
24 zttLabeler = lambda module : SetValidationExtention(module, 'QCD')
25 zttModifier = ApplyFunctionToSequence(zttLabeler)
26 proc.TauValNumeratorAndDenominatorQCD.visit(zttModifier)
27 
28 #Sets the correct naming to efficiency histograms
29 proc.efficienciesQCD.plots = Utils.SetPlotSequence(proc.TauValNumeratorAndDenominatorQCD)
30 
31 #checks what's new in the process (the cloned sequences and modules in them)
32 newProcAttributes = filter( lambda x: (x not in procAttributes) and (x.find('QCD') != -1), dir(proc) )
33 
34 #spawns a local variable with the same name as the proc attribute, needed for future process.load
35 for newAttr in newProcAttributes:
36  locals()[newAttr] = getattr(proc,newAttr)
37 
38 
39 produceDenominatorQCD = cms.Sequence(
40  kinematicSelectedTauValDenominatorQCD
41  )
42 
43 produceDenominator = cms.Sequence(produceDenominatorQCD)
44 
45 runTauValidationBatchMode = cms.Sequence(
46  produceDenominatorQCD
47  +TauValNumeratorAndDenominatorQCD
48  )
49 
50 runTauValidation = cms.Sequence(
51  runTauValidationBatchMode
52  +TauEfficienciesQCD
53  )
def cloneProcessingSnippet(process, sequence, postfix, removePostfix="", noClones=[], addToTask=False)
Definition: helpers.py:255
def SetValidationExtention(module, extension)
dbl *** dir
Definition: mlp_gen.cc:35