CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/Validation/RecoTau/python/dataTypes/ValidateTausOnZEE_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 selectElectrons = cms.EDProducer(
00013     "GenParticlePruner",
00014     src = cms.InputTag("genParticles"),
00015     select = cms.vstring(
00016     "drop  *  ", # this is the default
00017     "keep++ pdgId = 11",
00018     "keep++ pdgId = -11",
00019     )
00020 )
00021 
00022 selectStableElectrons = genParticlesForJets.clone(src = cms.InputTag("selectElectrons"))
00023 
00024 #objectTypeSelectedTauValDenominatorModule = copy.deepcopy(iterativeCone5GenJets)
00025 #objectTypeSelectedTauValDenominatorModule.src = cms.InputTag("selectElectronsForGenJets")
00026 
00027 kinematicSelectedTauValDenominatorZEE = cms.EDFilter(
00028    "TauValGenPRefSelector", #"GenJetSelector"
00029    src = cms.InputTag('selectStableElectrons'),
00030    cut = kinematicSelectedTauValDenominatorCut,#cms.string('pt > 5. && abs(eta) < 2.5'), #Defined: Validation.RecoTau.RecoTauValidation_cfi 
00031    filter = cms.bool(False)
00032 )
00033 
00034 procAttributes = dir(proc) #Takes a snapshot of what there in the process
00035 helpers.cloneProcessingSnippet( proc, proc.TauValNumeratorAndDenominator, 'ZEE') #clones the sequence inside the process with ZEE postfix
00036 helpers.cloneProcessingSnippet( proc, proc.TauEfficiencies, 'ZEE') #clones the sequence inside the process with ZEE postfix
00037 helpers.massSearchReplaceAnyInputTag(proc.TauValNumeratorAndDenominatorZEE, 'kinematicSelectedTauValDenominator', 'kinematicSelectedTauValDenominatorZEE') #sets the correct input tag
00038 
00039 #adds to TauValNumeratorAndDenominator modules in the sequence ZEE to the extention name
00040 zttLabeler = lambda module : SetValidationExtention(module, 'ZEE')
00041 zttModifier = ApplyFunctionToSequence(zttLabeler)
00042 proc.TauValNumeratorAndDenominatorZEE.visit(zttModifier)
00043 
00044 #Sets the correct naming to efficiency histograms
00045 proc.efficienciesZEE.plots = Utils.SetPlotSequence(proc.TauValNumeratorAndDenominatorZEE)
00046 
00047 #checks what's new in the process (the cloned sequences and modules in them)
00048 newProcAttributes = filter( lambda x: (x not in procAttributes) and (x.find('ZEE') != -1), dir(proc) )
00049 
00050 #spawns a local variable with the same name as the proc attribute, needed for future process.load
00051 for newAttr in newProcAttributes:
00052     locals()[newAttr] = getattr(proc,newAttr)
00053 
00054 produceDenominatorZEE = cms.Sequence(
00055     selectElectrons*
00056     selectStableElectrons*
00057     kinematicSelectedTauValDenominatorZEE
00058     )
00059 
00060 produceDenominator = produceDenominatorZEE
00061 
00062 runTauValidationBatchMode = cms.Sequence(
00063       produceDenominatorZEE*
00064       TauValNumeratorAndDenominatorZEE
00065       )
00066 
00067 runTauValidation = cms.Sequence(
00068       runTauValidationBatchMode*
00069       TauEfficienciesZEE
00070       )
00071