File indexing completed on 2024-04-06 12:31:13
0001 import FWCore.ParameterSet.Config as cms
0002
0003
0004
0005
0006
0007
0008
0009 from TopQuarkAnalysis.TopEventProducers.sequences.ttSemiLepEvtHypotheses_cff import *
0010
0011
0012 from TopQuarkAnalysis.TopEventProducers.producers.TtSemiLepEvtBuilder_cfi import *
0013
0014
0015 makeTtSemiLepEventTask = cms.Task(
0016 makeTtSemiLepHypothesesTask,
0017 ttSemiLepEvent
0018 )
0019
0020
0021
0022
0023
0024
0025
0026
0027 def addTtSemiLepHypotheses(process,
0028 names
0029 ):
0030
0031
0032 labels = getattr(process.ttSemiLepEvent, "hypotheses")
0033 for obj in range(len(names)):
0034
0035
0036 label = "ttSemiLepHyp" + names[obj][1:]
0037
0038 labels.append(label)
0039 process.ttSemiLepEvent.hypotheses = labels
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055 def removeTtSemiLepHypGenMatch(process):
0056
0057 process.ttSemiLepEvent.hypotheses.remove("ttSemiLepHypGenMatch")
0058 process.ttSemiLepEvent.genEvent = ''
0059
0060
0061
0062
0063 def setForAllTtSemiLepHypotheses(process, attribute, value):
0064 modules = ["findTtSemiLepJetCombGeom",
0065 "findTtSemiLepJetCombMaxSumPtWMass",
0066 "findTtSemiLepJetCombMVA",
0067 "findTtSemiLepJetCombWMassDeltaTopMass",
0068 "findTtSemiLepJetCombWMassMaxSumPt",
0069 "hitFitTtSemiLepEventHypothesis",
0070 "kinFitTtSemiLepEventHypothesis",
0071 "ttSemiLepJetPartonMatch",
0072 "ttSemiLepHypGenMatch",
0073 "ttSemiLepHypGeom",
0074 "ttSemiLepHypHitFit",
0075 "ttSemiLepHypKinFit",
0076 "ttSemiLepHypMaxSumPtWMass",
0077 "ttSemiLepHypMVADisc",
0078 "ttSemiLepHypWMassDeltaTopMass",
0079 "ttSemiLepHypWMassMaxSumPt"
0080 ]
0081 for obj in range(len(modules)):
0082 object = getattr(process, modules[obj])
0083 if hasattr(object, attribute):
0084 setattr(object, attribute, value)
0085
0086
0087 def useElectronsForAllTtSemiLepHypotheses(process, elecLabel = "selectedPatElectrons"):
0088
0089 import TopQuarkAnalysis.TopKinFitter.TtSemiLepKinFitProducer_Electrons_cfi
0090 process.kinFitTtSemiLepEventHypothesis = TopQuarkAnalysis.TopKinFitter.TtSemiLepKinFitProducer_Electrons_cfi.kinFitTtSemiLepEvent.clone()
0091 import TopQuarkAnalysis.TopHitFit.TtSemiLepHitFitProducer_Electrons_cfi
0092 process.hitFitTtSemiLepEventHypothesis = TopQuarkAnalysis.TopHitFit.TtSemiLepHitFitProducer_Electrons_cfi.hitFitTtSemiLepEvent.clone()
0093
0094 setForAllTtSemiLepHypotheses(process, "leps", elecLabel)