CMS 3D CMS Logo

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

Functions

def setVertexGeneratorPileUpProducer
 

Function Documentation

def MixingModule_Full2Fast.setVertexGeneratorPileUpProducer (   process)

Definition at line 6 of file MixingModule_Full2Fast.py.

References ConfigBuilder.dumpPython().

6 
8 
9  # get right vertex generator parameters
10  if not hasattr(process,"VtxSmeared"):
11  "WARNING: no vtx smearing applied (ok for steps other than SIM)"
12  return process
13 
14  vertexGenerator = process.VtxSmeared
15  vertexGeneratorParameterNames = vertexGenerator.parameterNames_()
16  vertexGeneratorType = vertexGenerator.type_()
17 
18  # set vertex generator parameters in PileUpProducer
19  vertexParameters = cms.PSet()
20  for name in vertexGeneratorParameterNames:
21  exec("vertexParameters.{0} = {1}".format(name,getattr(vertexGenerator,name).dumpPython()))
22 
23  if vertexGeneratorType.find("Betafunc") == 0:
24  vertexParameters.type = cms.string("BetaFunc")
25  elif vertexGeneratorType.find("Flat") == 0:
26  vertexParameters.type = cms.string("Flat")
27  elif vertexGeneratorType.find("Gauss"):
28  vertexParameters.type = cms.string("Gaussian")
29  else:
30  raise Error("WARNING: given vertex generator type for vertex smearing is not supported")
31 
32  # add parameters to PileUpProducer
33  process.famosPileUp.VertexGenerator = vertexParameters
34 
35  return process
36 
37