CMS 3D CMS Logo

nanoDQM_tools_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 def NoPlot(name):
4  return cms.PSet( name = cms.string(name), kind = cms.string("none")) # name is actually a parameter that is not used in the code, but used in python for modifications
5 
6 def Count1D(name, nbins, xmin, xmax, title=""):
7  return cms.PSet( name = cms.string(name), kind = cms.string("count1d"), nbins = cms.uint32(nbins), min = cms.double(xmin), max = cms.double(xmax), title = cms.string(title) )
8 
9 def Plot1D(name, column, nbins, xmin, xmax, title=""):
10  return cms.PSet( name = cms.string(name), kind = cms.string("hist1d"), column = cms.string(column), nbins = cms.uint32(nbins), min = cms.double(xmin), max = cms.double(xmax), title = cms.string(title) )
11 
12 def Profile1D(name, ycolumn, xcolumn, nbins, xmin, xmax, title=""):
13  return cms.PSet( name = cms.string(name), kind = cms.string("prof1d"), ycolumn = cms.string(ycolumn), xcolumn = cms.string(xcolumn), nbins = cms.uint32(nbins), min = cms.double(xmin), max = cms.double(xmax), title = cms.string(title) )
14 
15 def shortDump(pset):
16  kind = pset.kind.value()
17  if kind == "none":
18  return "NoPlot(%r)" % (pset.name.value())
19  elif kind == "count1d":
20  return ("Count1D(%r, %d, %g, %g%s)" % (pset.name.value(), pset.nbins.value(), pset.min.value(), pset.max.value(), ", %r" % pset.title.value() if pset.title.value() else ""))
21  elif kind == "hist1d":
22  return ("Plot1D(%r, %r, %d, %g, %g%s)" % (pset.name.value(), pset.column.value(), pset.nbins.value(), pset.min.value(), pset.max.value(), ", %r" % pset.title.value() if pset.title.value() else ""))
23  elif kind == "prof1d":
24  return ("Profile1D(%r, %r, %r, %d, %g, %g%s)" % (pset.name.value(), pset.ycolumn.value(), pset.xcolumn.value(), pset.nbins.value(), pset.min.value(), pset.max.value(), ", %r" % pset.title.value() if pset.title.value() else ""))
25 
26 
def Count1D(name, nbins, xmin, xmax, title="")
def Plot1D(name, column, nbins, xmin, xmax, title="")
def Profile1D(name, ycolumn, xcolumn, nbins, xmin, xmax, title="")