CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 makeTtSemiLepEventTask
 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 29 of file ttSemiLepEvtBuilder_cff.py.

References sistrip::SpyUtilities.range().

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

remove genMatch hypothesis from the process

Definition at line 55 of file ttSemiLepEvtBuilder_cff.py.

55 
56 def removeTtSemiLepHypGenMatch(process):
57  #process.makeTtSemiLepHypotheses.remove(process.makeHypothesis_genMatch)
58  process.ttSemiLepEvent.hypotheses.remove("ttSemiLepHypGenMatch")
59  process.ttSemiLepEvent.genEvent = ''
60 
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 63 of file ttSemiLepEvtBuilder_cff.py.

References sistrip::SpyUtilities.range().

Referenced by useElectronsForAllTtSemiLepHypotheses().

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

use electrons instead of muons for the hypotheses

Definition at line 87 of file ttSemiLepEvtBuilder_cff.py.

References setForAllTtSemiLepHypotheses().

87 
88 def useElectronsForAllTtSemiLepHypotheses(process, elecLabel = "selectedPatElectrons"):
89  ## use correct KinFitter module
90  import TopQuarkAnalysis.TopKinFitter.TtSemiLepKinFitProducer_Electrons_cfi
91  process.kinFitTtSemiLepEventHypothesis = TopQuarkAnalysis.TopKinFitter.TtSemiLepKinFitProducer_Electrons_cfi.kinFitTtSemiLepEvent.clone()
92  import TopQuarkAnalysis.TopHitFit.TtSemiLepHitFitProducer_Electrons_cfi
93  process.hitFitTtSemiLepEventHypothesis = TopQuarkAnalysis.TopHitFit.TtSemiLepHitFitProducer_Electrons_cfi.hitFitTtSemiLepEvent.clone()
94  ## replace lepton InputTags in all modules
95  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.makeTtSemiLepEventTask
Initial value:
1 = cms.Task(
2  makeTtSemiLepHypothesesTask,
3  ttSemiLepEvent
4 )

make ttSemiLepEvent

Definition at line 15 of file ttSemiLepEvtBuilder_cff.py.