CMS 3D CMS Logo

offsetAnalyzerDQM_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 import Validation.RecoParticleFlow.defaults_cfi as default
3 from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
4 from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
5 
6 def plotPSet(name, title, dir, nx, x0, x1, ny=0, y0=0, y1=0, vx=[0], vy=[0]):
7  return cms.PSet(
8  name = cms.string(name),
9  title = cms.string(title),
10  dir = cms.string(dir),
11  nx = cms.uint32(nx),
12  x0 = cms.double(x0),
13  x1 = cms.double(x1),
14  ny = cms.uint32(ny),
15  y0 = cms.double(y0),
16  y1 = cms.double(y1),
17  vx = cms.vdouble(vx),
18  vy = cms.vdouble(vy)
19  )
20 
22  plots = []
23  murange = range( default.muLowOffset, default.muHighOffset )
24  npvrange = range( default.npvLowOffset, default.npvHighOffset )
25 
26  for pftype in default.candidateType :
27  for mu in murange :
28  name = default.offset_name( "mu", mu, pftype )
29  plots += [ plotPSet(
30  name,
31  name+";#eta;<Offset Energy_{T}> [GeV]",
32  "{0}muPlots/mu{1}".format(default.offsetDir, mu),
33  #variable xbinning
34  0, 0, 0, default.eBinsOffset, default.eLowOffset, default.eHighOffset,
35  default.etaBinsOffset
36  )]
37 
38  for npv in npvrange :
39  name = default.offset_name( "npv", npv, pftype )
40  plots += [ plotPSet(
41  name,
42  name+";#eta;<Offset Energy_{T}> [GeV]",
43  "{0}npvPlots/npv{1}".format(default.offsetDir, npv),
44  #variable xbinning
45  0, 0, 0, default.eBinsOffset, default.eLowOffset, default.eHighOffset,
46  default.etaBinsOffset
47  )]
48  return plots
49 
51  plots = []
52  #hname, title, xmax
53  toplot = ( ("mu", "#mu", default.muHighOffset), ("npv", "N_{PV}", default.npvHighOffset) )
54 
55  for hname, title, xmax in toplot :
56  plots += [ plotPSet(
57  hname,
58  hname + ";" + title,
59  default.offsetDir,
60  xmax, 0, xmax
61  )]
62  return plots
63 
64 offsetAnalyzerDQM = DQMEDAnalyzer("OffsetAnalyzerDQM",
65 
66  pvTag = cms.InputTag('offlineSlimmedPrimaryVertices'),
67  muTag = cms.InputTag('slimmedAddPileupInfo'),
68  pfTag = cms.InputTag('packedPFCandidates'),
69 
70  pdgKeys = cms.vuint32( default.candidateDict.keys() ),
71  pdgStrs = cms.vstring( default.candidateDict.values() ),
72 
73  offsetPlotBaseName = cms.string(default.offsetPlotBaseName),
74  offsetPlots = cms.VPSet( createOffsetVPSet() ),
75  th1dPlots = cms.VPSet( createTH1DVPSet() ),
76 
77  pftypes = cms.vstring( default.candidateType ),
78  etabins = cms.vdouble( default.etaBinsOffset ),
79  muHigh = cms.untracked.int32( default.muHighOffset ),
80  npvHigh = cms.untracked.int32( default.npvHighOffset )
81 
82 )
83 
84 offsetDQMPostProcessor = DQMEDHarvester("OffsetDQMPostProcessor",
85 
86  offsetPlotBaseName = cms.string( default.offsetPlotBaseName ),
87  offsetDir = cms.string( default.offsetDir ),
88  offsetVariableTypes = cms.vstring( default.offsetVariableType ),
89  offsetR = cms.untracked.double( default.offsetR ),
90  pftypes = cms.vstring( default.candidateType ),
91  muHigh = cms.untracked.int32( default.muHighOffset ),
92  npvHigh = cms.untracked.int32( default.npvHighOffset )
93 
94 )
95 
def plotPSet(name, title, dir, nx, x0, x1, ny=0, y0=0, y1=0, vx=[0], vy=[0])