CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
ttSemiLepEvtBuilder_cff Namespace Reference

Functions

def addTtSemiLepHypotheses
 helper functions (examples of usage can be found in the ttSemiLepEvtBuilder_cfg.py) More...
 
def removeTtSemiLepHypGenMatch
 remove genMatch hypothesis from the process More...
 
def setForAllTtSemiLepHypotheses
 set a specific attribute for all hypotheses to a given value -> this works for "jets", "leps", "mets", "maxNJets" More...
 
def useElectronsForAllTtSemiLepHypotheses
 use electrons instead of muons for the hypotheses More...
 

Variables

tuple makeTtSemiLepEvent
 make ttSemiLepEvent More...
 

Function Documentation

def ttSemiLepEvtBuilder_cff.addTtSemiLepHypotheses (   process,
  names 
)

helper functions (examples of usage can be found in the ttSemiLepEvtBuilder_cfg.py)

add hypotheses to the process

Definition at line 28 of file ttSemiLepEvtBuilder_cff.py.

28 
29  ):
30 
31  ## edit list of input hypotheses for the TtSemiLepEventBuilder
32  labels = getattr(process.ttSemiLepEvent, "hypotheses")
33  for obj in range(len(names)):
34  ## create correct label from HypoClassKey string (stripping the leading "k")
35  ## e.g. kKinFit -> ttSemiLepHypKinFit
36  label = "ttSemiLepHyp" + names[obj][1:]
37  ## add it to the list
38  labels.append(label)
39  process.ttSemiLepEvent.hypotheses = labels
40 
41  ## include hypotheses in the standard sequence
42  sequence = getattr(process, "makeTtSemiLepHypotheses")
43  for obj in range(len(names)):
44  ## create correct label from HypoClassKey string (stripping the leading "k")
45  ## e.g. kKinFit -> makeHypothesis_kinFit
46  if names[obj][1:4] == "MVA":
47  label = "makeHypothesis_" + names[obj][1:4].lower() + names[obj][4:]
48  else:
49  label = "makeHypothesis_" + names[obj][1:2].lower() + names[obj][2:]
50  ## add it to the sequence
51  sequence += getattr(process, label)
52 
def ttSemiLepEvtBuilder_cff.removeTtSemiLepHypGenMatch (   process)

remove genMatch hypothesis from the process

Definition at line 54 of file ttSemiLepEvtBuilder_cff.py.

54 
55 def removeTtSemiLepHypGenMatch(process):
56  process.makeTtSemiLepHypotheses.remove(process.makeHypothesis_genMatch)
57  process.ttSemiLepEvent.hypotheses.remove("ttSemiLepHypGenMatch")
58 
def removeTtSemiLepHypGenMatch
remove genMatch hypothesis from the process
def ttSemiLepEvtBuilder_cff.setForAllTtSemiLepHypotheses (   process,
  attribute,
  value 
)

set a specific attribute for all hypotheses to a given value -> this works for "jets", "leps", "mets", "maxNJets"

Definition at line 61 of file ttSemiLepEvtBuilder_cff.py.

Referenced by useElectronsForAllTtSemiLepHypotheses().

61 
62 def setForAllTtSemiLepHypotheses(process, attribute, value):
63  modules = ["findTtSemiLepJetCombGeom",
64  "findTtSemiLepJetCombMaxSumPtWMass",
65  "findTtSemiLepJetCombMVA",
66  "findTtSemiLepJetCombWMassDeltaTopMass",
67  "findTtSemiLepJetCombWMassMaxSumPt",
68  "hitFitTtSemiLepEventHypothesis",
69  "kinFitTtSemiLepEventHypothesis",
70  "ttSemiLepJetPartonMatch",
71  "ttSemiLepHypGenMatch",
72  "ttSemiLepHypGeom",
73  "ttSemiLepHypHitFit",
74  "ttSemiLepHypKinFit",
75  "ttSemiLepHypMaxSumPtWMass",
76  "ttSemiLepHypMVADisc",
77  "ttSemiLepHypWMassDeltaTopMass",
78  "ttSemiLepHypWMassMaxSumPt"
79  ]
80  for obj in range(len(modules)):
81  object = getattr(process, modules[obj])
82  if hasattr(object, attribute):
83  setattr(object, attribute, value)
def setForAllTtSemiLepHypotheses
set a specific attribute for all hypotheses to a given value -> this works for "jets", "leps", "mets", "maxNJets"
def ttSemiLepEvtBuilder_cff.useElectronsForAllTtSemiLepHypotheses (   process,
  elecLabel = "selectedPatElectrons" 
)

use electrons instead of muons for the hypotheses

Definition at line 85 of file ttSemiLepEvtBuilder_cff.py.

References setForAllTtSemiLepHypotheses().

85 
86 def useElectronsForAllTtSemiLepHypotheses(process, elecLabel = "selectedPatElectrons"):
87  ## use correct KinFitter module
88  import TopQuarkAnalysis.TopKinFitter.TtSemiLepKinFitProducer_Electrons_cfi
89  process.kinFitTtSemiLepEventHypothesis = TopQuarkAnalysis.TopKinFitter.TtSemiLepKinFitProducer_Electrons_cfi.kinFitTtSemiLepEvent.clone()
90  import TopQuarkAnalysis.TopHitFit.TtSemiLepHitFitProducer_Electrons_cfi
91  process.hitFitTtSemiLepEventHypothesis = TopQuarkAnalysis.TopHitFit.TtSemiLepHitFitProducer_Electrons_cfi.hitFitTtSemiLepEvent.clone()
92  ## replace lepton InputTags in all modules
93  setForAllTtSemiLepHypotheses(process, "leps", elecLabel)
def setForAllTtSemiLepHypotheses
set a specific attribute for all hypotheses to a given value -> this works for "jets", "leps", "mets", "maxNJets"
def useElectronsForAllTtSemiLepHypotheses
use electrons instead of muons for the hypotheses

Variable Documentation

tuple ttSemiLepEvtBuilder_cff.makeTtSemiLepEvent
Initial value:
1 = cms.Sequence(makeTtSemiLepHypotheses *
2  ttSemiLepEvent
3  )

make ttSemiLepEvent

Definition at line 15 of file ttSemiLepEvtBuilder_cff.py.