Go to the documentation of this file.00001 import FWCore.ParameterSet.Config as cms
00002
00003
00004
00005
00006
00007
00008
00009 from TopQuarkAnalysis.TopEventProducers.sequences.ttSemiLepEvtHypotheses_cff import *
00010
00011
00012 from TopQuarkAnalysis.TopEventProducers.producers.TtSemiLepEvtBuilder_cfi import *
00013
00014
00015 makeTtSemiLepEvent = cms.Sequence(makeTtSemiLepHypotheses *
00016 ttSemiLepEvent
00017 )
00018
00019
00020
00021
00022
00023
00024
00025
00026 def addTtSemiLepHypotheses(process,
00027 names
00028 ):
00029
00030
00031 labels = getattr(process.ttSemiLepEvent, "hypotheses")
00032 for obj in range(len(names)):
00033
00034
00035 label = "ttSemiLepHyp" + names[obj][1:]
00036
00037 labels.append(label)
00038 process.ttSemiLepEvent.hypotheses = labels
00039
00040
00041 sequence = getattr(process, "makeTtSemiLepHypotheses")
00042 for obj in range(len(names)):
00043
00044
00045 if names[obj][1:4] == "MVA":
00046 label = "makeHypothesis_" + names[obj][1:4].lower() + names[obj][4:]
00047 else:
00048 label = "makeHypothesis_" + names[obj][1:2].lower() + names[obj][2:]
00049
00050 sequence += getattr(process, label)
00051
00052
00053
00054 def removeTtSemiLepHypGenMatch(process):
00055 process.makeTtSemiLepHypotheses.remove(process.makeHypothesis_genMatch)
00056 process.ttSemiLepEvent.hypotheses.remove("ttSemiLepHypGenMatch")
00057
00058
00059
00060
00061 def setForAllTtSemiLepHypotheses(process, attribute, value):
00062 modules = ["findTtSemiLepJetCombGeom",
00063 "findTtSemiLepJetCombGeom",
00064 "ttSemiLepHypGeom",
00065 "ttSemiLepHypMaxSumPtWMass",
00066 "ttSemiLepHypWMassMaxSumPt",
00067 "ttSemiLepHypWMassDeltaTopMass",
00068 "ttSemiLepJetPartonMatch",
00069 "ttSemiLepHypGenMatch",
00070 "findTtSemiLepJetCombMVA",
00071 "ttSemiLepHypMVADisc",
00072 "kinFitTtSemiLepEventHypothesis",
00073 "ttSemiLepHypKinFit"]
00074 for obj in range(len(modules)):
00075 object = getattr(process, modules[obj])
00076 if hasattr(object, attribute):
00077 setattr(object, attribute, value)
00078
00079
00080 def useElectronsForAllTtSemiLepHypotheses(process, elecLabel = "selectedPatElectrons"):
00081
00082 setForAllTtSemiLepHypotheses(process, "leps", elecLabel)
00083
00084 import TopQuarkAnalysis.TopKinFitter.TtSemiLepKinFitProducer_Electrons_cfi
00085 process.kinFitTtSemiLepEventHypothesis = TopQuarkAnalysis.TopKinFitter.TtSemiLepKinFitProducer_Electrons_cfi.kinFitTtSemiLepEvent.clone()