CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/TopQuarkAnalysis/TopEventProducers/python/sequences/ttFullLepEvtBuilder_cff.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 
00003 
00004 ################################################################################
00005 # produce ttFullLepEvent structure with all necessary ingredients
00006 ################################################################################
00007 
00008 ## std sequence to produce the ttFullLepEventHypotheses
00009 from TopQuarkAnalysis.TopEventProducers.sequences.ttFullLepEvtHypotheses_cff import *
00010 
00011 ## configure ttFullLepEventBuilder
00012 from TopQuarkAnalysis.TopEventProducers.producers.TtFullLepEvtBuilder_cfi import *
00013 
00014 ## make ttFullLepEvent
00015 makeTtFullLepEvent = cms.Sequence(makeTtFullLepHypotheses *
00016                                   ttFullLepEvent
00017                                   )
00018 
00019 
00020 ################################################################################
00021 ## helper functions
00022 ## (examples of usage can be found in the ttFullLepEvtBuilder_cfg.py)
00023 ################################################################################
00024 
00025 ## remove genMatch hypothesis from the process
00026 def removeTtFullLepHypGenMatch(process):
00027     process.makeTtFullLepHypotheses.remove(process.makeHypothesis_genMatch)
00028     process.ttFullLepEvent.hypotheses.remove("ttFullLepHypGenMatch")
00029 
00030 
00031 ## set a specific attribute for all hypotheses to a given value
00032 ## -> this works for "jets", "leps", "mets", "maxNJets"
00033 def setForAllTtFullLepHypotheses(process, attribute, value):
00034     modules = ["ttFullLepJetPartonMatch",
00035                "ttFullLepHypGenMatch",     
00036                "ttFullLepHypKinSolution",
00037                "kinSolutionTtFullLepEventHypothesis"]
00038     for obj in range(len(modules)):
00039         object = getattr(process, modules[obj])
00040         if hasattr(object, attribute):
00041             setattr(object, attribute, value)
00042 
00043 
00044