CMS 3D CMS Logo

Classes | Functions | Variables
common_cff Namespace Reference

Classes

class  DEFAULT_VAL
 

Functions

def DetIdVar (expr, type, doc=None, lazyEval=False)
 
def ExtVar (tag, valtype, doc=None, precision=-1)
 
def GlobGeomVar (expr, doc=None, precision=-1, lazyEval=False)
 
def OVar (valtype, doc=None, precision=-1)
 
def Var (expr, valtype, doc=None, precision=-1, lazyEval=False)
 

Variables

 CandVars
 
 charge
 
 defaults
 
 doc
 
 eta
 
 float
 
 int
 
 mass
 
 P3Vars
 
 P4Vars
 
 pdgId
 
 phi
 
 precision
 
 pt
 
 PTVars
 

Function Documentation

◆ DetIdVar()

def common_cff.DetIdVar (   expr,
  type,
  doc = None,
  lazyEval = False 
)
Create a PSet for a DetId variable in the tree:
    - expr is the expression to evaluate to compute the variable,
    - type of the value (int, bool, or a string that the table producer understands),
    - doc is a docstring, that will be passed to the table producer

Definition at line 13 of file common_cff.py.

13 def DetIdVar(expr, type, doc=None, lazyEval=False):
14  """ Create a PSet for a DetId variable in the tree:
15  - expr is the expression to evaluate to compute the variable,
16  - type of the value (int, bool, or a string that the table producer understands),
17  - doc is a docstring, that will be passed to the table producer
18  """
19  if type == float: type = "float"
20  elif type == bool: type = "bool"
21  elif type == int: type = "int"
22  return cms.PSet(
23  type = cms.string(type),
24  expr = cms.string(expr),
25  doc = cms.string(doc if doc else expr),
26  lazyEval = cms.untracked.bool(lazyEval)
27  )
28 
def DetIdVar(expr, type, doc=None, lazyEval=False)
Definition: common_cff.py:13

◆ ExtVar()

def common_cff.ExtVar (   tag,
  valtype,
  doc = None,
  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 28 of file common_cff.py.

References clone(), and OVar().

Referenced by customisers.customiseNanoAOD(), and jetsAK4_CHS_cff.nanoAOD_refineFastSim_bTagDeepFlav().

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

◆ GlobGeomVar()

def common_cff.GlobGeomVar (   expr,
  doc = None,
  precision = -1,
  lazyEval = False 
)
Create a PSet for a Global position/direction variable in the tree ,
    - expr is the expression to evaluate to compute the variable,
    - doc is a docstring, that will be passed to the table producer,
    - precision is an int handling mantissa reduction.

Definition at line 29 of file common_cff.py.

29 def GlobGeomVar(expr, doc=None, precision=-1, lazyEval=False):
30  """ Create a PSet for a Global position/direction variable in the tree ,
31  - expr is the expression to evaluate to compute the variable,
32  - doc is a docstring, that will be passed to the table producer,
33  - precision is an int handling mantissa reduction.
34  """
35  return cms.PSet(
36  expr = cms.string(expr),
37  doc = cms.string(doc if doc else expr),
38  precision = cms.string(precision) if type(precision)==str else cms.int32(precision),
39  lazyEval = cms.untracked.bool(lazyEval)
40  )
41 
42 
43 
44 
45 
def GlobGeomVar(expr, doc=None, precision=-1, lazyEval=False)
Definition: common_cff.py:29

◆ OVar()

def common_cff.OVar (   valtype,
  doc = None,
  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),
       doc is a docstring, that will be passed to the table producer,

Definition at line 2 of file common_cff.py.

Referenced by ExtVar(), and Var().

2 def OVar(valtype, doc=None, precision=-1):
3  """ Create a PSet for a variable in the tree (without specifying how it is computed)
4 
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,
7  """
8  if valtype == float: valtype = "float"
9  elif valtype == int: valtype = "int"
10  elif valtype == bool: valtype = "bool"
11  return cms.PSet(
12  type = cms.string(valtype),
13  doc = cms.string(doc if doc else expr),
14  precision=cms.optional.allowed(cms.string, cms.int32, default = (cms.string(precision) if type(precision)==str else cms.int32(precision)))
15  )
16 
def OVar(valtype, doc=None, precision=-1)
Definition: common_cff.py:2

◆ Var()

def common_cff.Var (   expr,
  valtype,
  doc = None,
  precision = -1,
  lazyEval = False 
)
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 17 of file common_cff.py.

References clone(), and OVar().

Referenced by taus_cff._tauIdWPMask(), custom_btv_cff.add_BTV(), custom_jme_cff.AddBTaggingScores(), leptonTimeLifeInfo_common_cff.addExtendVertexInfo(), custom_jme_cff.AddJetID(), custom_btv_cff.addPFCands(), custom_muon_cff.AddPFTracks(), custom_jme_cff.AddVariablesForAK8PuppiJets(), custom_muon_cff.AddVariablesForMuon(), nanogen_cff.customizeNanoGENFromMini(), EcalPhiSymRecoSequence_cff.ecal_phisym_flattables(), custom_btv_cff.get_DDX_vars(), custom_btv_cff.get_DeepCSV_vars(), custom_btv_cff.get_DeepJet_outputs(), custom_btv_cff.get_ParticleNetAK4_outputs(), custom_btv_cff.get_ParticleTransformerAK4_outputs(), custom_muon_cff.IncreaseGenPrecesion(), JetVertexMain.Main(), and custom_jme_cff.ReclusterAK4CHSJets().

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

Variable Documentation

◆ CandVars

common_cff.CandVars

Definition at line 50 of file common_cff.py.

◆ charge

common_cff.charge

Definition at line 52 of file common_cff.py.

◆ defaults

◆ doc

common_cff.doc

Definition at line 51 of file common_cff.py.

◆ eta

common_cff.eta

Definition at line 45 of file common_cff.py.

◆ float

common_cff.float

Definition at line 41 of file common_cff.py.

◆ int

common_cff.int

Definition at line 51 of file common_cff.py.

◆ mass

common_cff.mass

Definition at line 48 of file common_cff.py.

◆ P3Vars

common_cff.P3Vars

Definition at line 44 of file common_cff.py.

◆ P4Vars

common_cff.P4Vars

Definition at line 47 of file common_cff.py.

◆ pdgId

common_cff.pdgId

Definition at line 51 of file common_cff.py.

◆ phi

common_cff.phi

Definition at line 42 of file common_cff.py.

◆ precision

common_cff.precision

Definition at line 41 of file common_cff.py.

◆ pt

common_cff.pt

Definition at line 41 of file common_cff.py.

◆ PTVars

common_cff.PTVars

Definition at line 40 of file common_cff.py.