CMS 3D CMS Logo

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

Functions

def ExtVar
 
def OVar
 
def Var
 

Variables

tuple CandVars
 
tuple P3Vars
 
tuple P4Vars
 
tuple PTVars
 

Function Documentation

def common_cff.ExtVar (   tag,
  valtype,
  compression = None,
  doc = None,
  mcOnly = False,
  precision = -1 
)
Create a PSet for a variable read from the event

   tag is the InputTag to the variable. 

   see OVar in common_cff for all the other arguments

Definition at line 31 of file common_cff.py.

References clone(), and OVar().

31 
32 def ExtVar(tag, valtype, compression=None, doc=None, mcOnly=False,precision=-1):
33  """Create a PSet for a variable read from the event
34 
35  tag is the InputTag to the variable.
36 
37  see OVar in common_cff for all the other arguments
38  """
39  return OVar(valtype, compression=compression,precision=precision, doc=(doc if doc else tag.encode()), mcOnly=mcOnly).clone(
40  src = tag if isinstance(tag, cms.InputTag) else cms.InputTag(tag),
41  )
42 
def ExtVar
Definition: common_cff.py:31
def OVar
Definition: common_cff.py:2
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
def common_cff.OVar (   valtype,
  compression = None,
  doc = None,
  mcOnly = False,
  precision = -1 
)
Create a PSet for a variable in the tree (without specifying how it is computed)

       valtype is the type of the value (float, int, bool, or a string that the table producer understands),
       compression is not currently used,
       doc is a docstring, that will be passed to the table producer,
       mcOnly can be set to True for variables that exist only in MC samples and not in data ones. 

Definition at line 2 of file common_cff.py.

Referenced by ExtVar(), and Var().

2 
3 def OVar(valtype, compression=None, doc=None, mcOnly=False,precision=-1):
4  """ Create a PSet for a variable in the tree (without specifying how it is computed)
5 
6  valtype is the type of the value (float, int, bool, or a string that the table producer understands),
7  compression is not currently used,
8  doc is a docstring, that will be passed to the table producer,
9  mcOnly can be set to True for variables that exist only in MC samples and not in data ones.
10  """
11  if valtype == float: valtype = "float"
12  elif valtype == int: valtype = "int"
13  elif valtype == bool: valtype = "bool"
14  return cms.PSet(
15  type = cms.string(valtype),
16  compression = cms.string(compression if compression else "none"),
17  doc = cms.string(doc if doc else expr),
18  mcOnly = cms.bool(mcOnly),
19  precision=cms.string(precision) if type(precision)==str else cms.int32(precision)
)
def OVar
Definition: common_cff.py:2
def common_cff.Var (   expr,
  valtype,
  compression = None,
  doc = None,
  mcOnly = False,
  precision = -1 
)
Create a PSet for a variable computed with the string parser

   expr is the expression to evaluate to compute the variable 
   (in case of bools, it's a cut and not a function)

   see OVar above for all the other arguments

Definition at line 20 of file common_cff.py.

References clone(), and OVar().

Referenced by taus_cff._tauIdWPMask(), custom_jme_cff.AddJetID(), custom_jme_cff.AddVariablesForAK8PuppiJets(), nanogen_cff.customizeNanoGENFromMini(), EcalPhiSymRecoSequence_cff.ecal_phisym_flattables(), JetVertexMain.Main(), custom_jme_cff.ReclusterAK4CHSJets(), and custom_jme_cff.SavePatJets().

20 
21 def Var(expr, valtype, compression=None, doc=None, mcOnly=False,precision=-1):
22  """Create a PSet for a variable computed with the string parser
23 
24  expr is the expression to evaluate to compute the variable
25  (in case of bools, it's a cut and not a function)
26 
27  see OVar above for all the other arguments
28  """
29  return OVar(valtype, compression=compression, doc=(doc if doc else expr), mcOnly=mcOnly,precision=precision).clone(
30  expr = cms.string(expr))
def OVar
Definition: common_cff.py:2
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135

Variable Documentation

tuple common_cff.CandVars
Initial value:
1 = cms.PSet(P4Vars,
2  pdgId = Var("pdgId", int, doc="PDG code assigned by the event reconstruction (not by MC truth)"),
3  charge = Var("charge", int, doc="electric charge"),
4 )

Definition at line 53 of file common_cff.py.

tuple common_cff.P3Vars
Initial value:
1 = cms.PSet(PTVars,
2  eta = Var("eta", float,precision=12),
3 )

Definition at line 47 of file common_cff.py.

tuple common_cff.P4Vars
Initial value:
1 = cms.PSet(P3Vars,
2  mass = Var("mass", float,precision=10),
3 )

Definition at line 50 of file common_cff.py.

tuple common_cff.PTVars
Initial value:
1 = cms.PSet(
2  pt = Var("pt", float, precision=-1),
3  phi = Var("phi", float, precision=12),
4 )

Definition at line 43 of file common_cff.py.