CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/Validation/RecoTau/python/dataTypes/ValidateTausOnZMM_cff.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 from Validation.RecoTau.RecoTauValidation_cfi import *
00003 import copy
00004 
00005 from PhysicsTools.HepMCCandAlgos.genParticles_cfi import *
00006 from RecoJets.Configuration.RecoGenJets_cff import *
00007 from RecoJets.Configuration.GenJetParticles_cff import *
00008 
00009 from SimGeneral.HepPDTESSource.pythiapdt_cfi import *
00010 import PhysicsTools.PatAlgos.tools.helpers as helpers
00011 
00012 selectMuons = cms.EDProducer(
00013     "GenParticlePruner",
00014     src = cms.InputTag("genParticles"),
00015     select = cms.vstring(
00016     "drop  *  ", # this is the default
00017     "keep++ pdgId = 13",
00018     "keep++ pdgId = -13",
00019     )
00020 )
00021 
00022 selectStableMuons = genParticlesForJets.clone(src = cms.InputTag("selectMuons"))
00023 
00024 kinematicSelectedTauValDenominatorZMM = cms.EDFilter(
00025    "TauValGenPRefSelector", #"GenJetSelector"
00026    src = cms.InputTag('selectStableMuons'),
00027    cut = kinematicSelectedTauValDenominatorCut,#cms.string('pt > 5. && abs(eta) < 2.5'), #Defined: Validation.RecoTau.RecoTauValidation_cfi 
00028    filter = cms.bool(False)
00029 )
00030 
00031 procAttributes = dir(proc) #Takes a snapshot of what there in the process
00032 helpers.cloneProcessingSnippet( proc, proc.TauValNumeratorAndDenominator, 'ZMM') #clones the sequence inside the process with ZMM postfix
00033 helpers.cloneProcessingSnippet( proc, proc.TauEfficiencies, 'ZMM') #clones the sequence inside the process with ZMM postfix
00034 helpers.massSearchReplaceAnyInputTag(proc.TauValNumeratorAndDenominatorZMM, 'kinematicSelectedTauValDenominator', 'kinematicSelectedTauValDenominatorZMM') #sets the correct input tag
00035 
00036 #adds to TauValNumeratorAndDenominator modules in the sequence ZMM to the extention name
00037 zttLabeler = lambda module : SetValidationExtention(module, 'ZMM')
00038 zttModifier = ApplyFunctionToSequence(zttLabeler)
00039 proc.TauValNumeratorAndDenominatorZMM.visit(zttModifier)
00040 
00041 #Sets the correct naming to efficiency histograms
00042 proc.efficienciesZMM.plots = Utils.SetPlotSequence(proc.TauValNumeratorAndDenominatorZMM)
00043 
00044 #checks what's new in the process (the cloned sequences and modules in them)
00045 newProcAttributes = filter( lambda x: (x not in procAttributes) and (x.find('ZMM') != -1), dir(proc) )
00046 
00047 #spawns a local variable with the same name as the proc attribute, needed for future process.load
00048 for newAttr in newProcAttributes:
00049     locals()[newAttr] = getattr(proc,newAttr)
00050 
00051 produceDenominatorZMM = cms.Sequence(
00052       selectMuons
00053       +selectStableMuons
00054 #      +objectTypeSelectedTauValDenominatorModule
00055       +kinematicSelectedTauValDenominatorZMM
00056       )
00057 
00058 produceDenominator = produceDenominatorZMM
00059 
00060 runTauValidationBatchMode = cms.Sequence(
00061       produceDenominatorZMM
00062       +TauValNumeratorAndDenominatorZMM
00063       )
00064 
00065 runTauValidation = cms.Sequence(
00066       runTauValidationBatchMode
00067       +TauEfficienciesZMM
00068       )
00069