1 import FWCore.ParameterSet.Config
as cms
2 def OVar(valtype, doc=None, precision=-1):
3 """ Create a PSet for a variable in the tree (without specifying how it is computed) 5 valtype is the type of the value (float, int, bool, or a string that the table producer understands), 6 doc is a docstring, that will be passed to the table producer, 8 if valtype == float: valtype =
"float" 9 elif valtype == int: valtype =
"int" 10 elif valtype == bool: valtype =
"bool" 12 type = cms.string(valtype),
13 doc = cms.string(doc
if doc
else expr),
14 precision=cms.string(precision)
if type(precision)==str
else cms.int32(precision)
16 def Var(expr, valtype, doc=None, precision=-1):
17 """Create a PSet for a variable computed with the string parser 19 expr is the expression to evaluate to compute the variable 20 (in case of bools, it's a cut and not a function) 22 see OVar above for all the other arguments 24 return OVar(valtype, doc=(doc
if doc
else expr), precision=precision).
clone(
25 expr = cms.string(expr))
27 def ExtVar(tag, valtype, doc=None, precision=-1):
28 """Create a PSet for a variable read from the event 30 tag is the InputTag to the variable. 32 see OVar in common_cff for all the other arguments 34 return OVar(valtype, precision=precision, doc=(doc
if doc
else tag.encode())).
clone(
35 src = tag
if isinstance(tag, cms.InputTag)
else cms.InputTag(tag),
40 pt =
Var(
"pt", float, precision=-1),
41 phi =
Var(
"phi", float, precision=12),
43 P3Vars = cms.PSet(PTVars,
44 eta =
Var(
"eta", float,precision=12),
46 P4Vars = cms.PSet(P3Vars,
47 mass =
Var(
"mass", float,precision=10),
49 CandVars = cms.PSet(P4Vars,
50 pdgId =
Var(
"pdgId", int, doc=
"PDG code assigned by the event reconstruction (not by MC truth)"),
51 charge =
Var(
"charge", int, doc=
"electric charge"),
def ExtVar(tag, valtype, doc=None, precision=-1)
def Var(expr, valtype, doc=None, precision=-1)
def OVar(valtype, doc=None, precision=-1)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)