CMS 3D CMS Logo

HistogramManager_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 from DQM.SiPixelPhase1Common.SpecificationBuilder_cfi import Specification, parent
4 
5 SiPixelPhase1Geometry = cms.PSet(
6  # SPixel*Name and friends use the isUpgrade flag, so we also have it as a setting here.
7  upgradePhase = cms.int32(1),
8 
9  # module geometry. The phase1 detector has only one sort, so this is easy.
10  # the values are assumed to be 0-based, unlike most others.
11  # TODO: maybe we can use the SiPixelFrameReverter and friends to do these
12  # conversions without these parameters here.
13  module_rows = cms.int32(160),
14  module_cols = cms.int32(416),
15  roc_rows = cms.int32(80),
16  roc_cols = cms.int32(52),
17  n_rocs = cms.int32(16), # two-row geometry is assumed
18 
19  # "time geometry" parameters
20  max_lumisection = cms.int32(5000),
21  max_bunchcrossing = cms.int32(3600),
22 
23  # to select a different cabling map (for pilotBlade)
24  CablingMapLabel = cms.string(""),
25 
26  # online-specific things
27  onlineblock = cms.int32(20), # #LS after which histograms are reset
28  n_onlineblocks = cms.int32(100), # #blocks to keep for histograms with history
29 
30  # lumiblock - for coarse temporal splitting
31  lumiblock = cms.int32(10), # Number of LS to include in a block
32 
33  # other geometry parameters (n_layers, n_ladders per layer, etc.) are inferred.
34  # there are lots of geometry assuptions in the code.
35 )
36 
37 # the wrapping here is necessary to switch 'enabled' later.
38 PerModule = cms.PSet(enabled = cms.bool(True)) # normal histos per module
39 PerLadder = cms.PSet(enabled = cms.bool(True)) # histos per ladder, profiles
40 PerLayer2D = cms.PSet(enabled = cms.bool(True)) # 2D maps/profiles of layers
41 PerLayer1D = cms.PSet(enabled = cms.bool(True)) # normal histos per layer
42 PerReadout = cms.PSet(enabled = cms.bool(False)) # "Readout view", also for initial timing
43 OverlayCurvesForTiming= cms.PSet(enabled = cms.bool(False)) #switch to overlay digi/clusters curves for timing scan
44 IsOffline = cms.PSet(enabled = cms.bool(True)) # should be switch off for Online
45 
46 # Default histogram configuration. This is _not_ used automatically, but you
47 # can import and pass this (or clones of it) in the plugin config.
48 DefaultHisto = cms.PSet(
49  # Setting this to False hides all plots of this HistogramManager. It does not even record any data.
50  enabled = cms.bool(True),
51 
52  # If this is set to False Overflows will not be used for statistics evaluation (i.e. Mean,RMS)
53  statsOverflows = cms.bool(True),
54 
55  # a.k.a. online harvesting. Might be useful in offline for custom harvesting,
56  # but the main purpose is online, where this is on by default.
57  perLumiHarvesting = cms.bool(False),
58 
59  # If False, no histograms are booked for DetIds where any column is undefined.
60  # since or-columns are not supported any longer, this has to be False, otherwise
61  # you will see a PXBarrel_UNDEFINED with endcap modules and the other way round.
62  # It could still be useful for debugging, to see if there is more UNDEFINED
63  # than expected.
64  bookUndefined = cms.bool(False),
65 
66  # where the plots should go.
67  topFolderName = cms.string("PixelPhase1"),
68 
69  # Histogram parameters
70  name = cms.string("unnamed"),
71  title = cms.string("Histogram of Something"),
72  xlabel = cms.string("something"),
73  ylabel = cms.string("count"),
74  dimensions = cms.int32(1),
75  range_min = cms.double(0),
76  range_max = cms.double(100),
77  range_nbins = cms.int32(100),
78  range_y_min = cms.double(0),
79  range_y_max = cms.double(100),
80  range_y_nbins = cms.int32(100),
81 
82  # This structure is output by the SpecficationBuilder.
83  specs = cms.VPSet()
84  # cms.PSet(spec =
85  # cms.VPset(
86  # cms.PSet(
87  # type = GROUPBY,
88  # stage = FIRST,
89  # columns = cms.vstring("P1PXBBarrel|P1PXECEndcap", "DetId"),
90  # arg = cms.string("")
91  # ),
92  # cms.PSet(
93  # type = SAVE,
94  # stage = STAGE1,
95  # columns = cms.vstring(),
96  # arg = cms.string("")
97  # )
98  # )
99  # )
100  #)
101 )
102 
103 DefaultHistoDigiCluster=DefaultHisto.clone(
104  topFolderName = "PixelPhase1/Phase1_MechanicalView"
105 )
106 
107 DefaultHistoSummary=DefaultHisto.clone(
108  topFolderName = "PixelPhase1/Summary"
109 )
110 
111 DefaultHistoTrack=DefaultHisto.clone(
112  topFolderName = "PixelPhase1/Tracks"
113 )
114 
115 DefaultHistoReadout=DefaultHisto.clone(
116  topFolderName = "PixelPhase1/FED/Readout"
117 )
118 
119 # Commonly used specifications.
120 StandardSpecifications1D = [
121  # The column names are either defined in the GeometryInterface.cc or read from TrackerTopology.
122  # Endcap names side by side. The "/" separates columns and also defines how the output folders are nested.
123 
124  # per-ladder and profiles
125  Specification(PerLadder).groupBy("PXBarrel/Shell/PXLayer/SignedLadder")
126  .save()
127  .reduce("MEAN")
128  .groupBy("PXBarrel/Shell/PXLayer", "EXTEND_X")
129  .save(),
130  Specification(PerLadder).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade")
131  .save()
132  .reduce("MEAN")
133  .groupBy("PXForward/HalfCylinder/PXRing/PXDisk", "EXTEND_X")
134  .save()
135  .groupBy("PXForward/HalfCylinder/PXRing/", "EXTEND_X")
136  .save(),
137  Specification().groupBy("PXBarrel").save(),
138  Specification().groupBy("PXForward").save(),
139  Specification(PerLayer1D).groupBy("PXBarrel/Shell/PXLayer").save(),
140  Specification(PerLayer1D).groupBy("PXForward/HalfCylinder/PXRing/PXDisk").save(),
141 
142  Specification(PerModule).groupBy("PXBarrel/Shell/PXLayer/SignedLadder/PXModuleName").save(),
143  Specification(PerModule).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/PXModuleName").save(),
144 
145  Specification(PerLadder).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/PXPanel")
146  .reduce("MEAN")
147  .groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade","EXTEND_X")
148  .save(),
149  Specification(PerLadder).groupBy("PXBarrel/Shell/PXLayer/SignedLadder/SignedModule")
150  .reduce("MEAN")
151  .groupBy("PXBarrel/Shell/PXLayer/SignedLadder", "EXTEND_X")
152  .save(),
153  Specification().groupBy("PXBarrel/PXLayer")
154  .save(),
155  Specification().groupBy("PXForward/PXDisk")
156  .save()
157 
158 
159 ]
160 
161 StandardSpecificationTrend = [
162  Specification(PerModule).groupBy("PXBarrel/Lumisection")
163  .reduce("MEAN")
164  .groupBy("PXBarrel", "EXTEND_X")
165  .save(),
166  Specification(PerModule).groupBy("PXForward/Lumisection")
167  .reduce("MEAN")
168  .groupBy("PXForward", "EXTEND_X")
169  .save(),
170  Specification(IsOffline).groupBy("PXBarrel/LumiBlock")
171  .reduce("MEAN")
172  .groupBy("PXBarrel", "EXTEND_X")
173  .save(),
174  Specification(IsOffline).groupBy("PXForward/LumiBlock")
175  .reduce("MEAN")
176  .groupBy("PXForward", "EXTEND_X")
177  .save()
178 ]
179 
180 StandardSpecificationTrend2D = [
181  Specification(PerModule).groupBy("PXBarrel/PXLayer/Lumisection")
182  .reduce("MEAN")
183  .groupBy("PXBarrel/PXLayer", "EXTEND_X")
184  .groupBy("PXBarrel", "EXTEND_Y")
185  .save(),
186  Specification(PerModule).groupBy("PXForward/PXDisk/Lumisection")
187  .reduce("MEAN")
188  .groupBy("PXForward/PXDisk","EXTEND_X")
189  .groupBy("PXForward", "EXTEND_Y")
190  .save(),
191  Specification(IsOffline).groupBy("PXBarrel/PXLayer/LumiBlock")
192  .reduce("MEAN")
193  .groupBy("PXBarrel/PXLayer", "EXTEND_X")
194  .groupBy("PXBarrel", "EXTEND_Y")
195  .save(),
196  Specification(IsOffline).groupBy("PXForward/PXDisk/LumiBlock")
197  .reduce("MEAN")
198  .groupBy("PXForward/PXDisk","EXTEND_X")
199  .groupBy("PXForward", "EXTEND_Y")
200  .save()
201 ]
202 
203 StandardSpecification2DProfile = [
204  Specification(PerLayer2D)
205  .groupBy("PXBarrel/PXLayer/SignedLadder/SignedModule")
206  .groupBy("PXBarrel/PXLayer/SignedLadder", "EXTEND_X")
207  .groupBy("PXBarrel/PXLayer", "EXTEND_Y")
208  .reduce("MEAN")
209  .save(),
210  Specification(PerLayer2D)
211  .groupBy("PXForward/PXRing/SignedBladePanel/PXDisk")
212  .groupBy("PXForward/PXRing/SignedBladePanel", "EXTEND_X")
213  .groupBy("PXForward/PXRing", "EXTEND_Y")
214  .reduce("MEAN")
215  .save(),
216 ]
217 
218 StandardSpecification2DOccupancy = [
219  Specification(PerLayer2D)
220  .groupBy("PXBarrel/PXLayer/SignedLadder/SignedModule")
221  .groupBy("PXBarrel/PXLayer/SignedLadder", "EXTEND_X")
222  .groupBy("PXBarrel/PXLayer", "EXTEND_Y")
223  .save(),
224  Specification(PerLayer2D)
225  .groupBy("PXForward/PXRing/SignedBladePanel/PXDisk")
226  .groupBy("PXForward/PXRing/SignedBladePanel", "EXTEND_X")
227  .groupBy("PXForward/PXRing", "EXTEND_Y")
228  .save(),
229 ]
230 
231 StandardSpecificationPixelmapProfile = [#produces pixel map with the mean (TProfile)
232  Specification(PerLayer2D)
233  .groupBy("PXBarrel/PXLayer/SignedLadderCoord/SignedModuleCoord")
234  .groupBy("PXBarrel/PXLayer/SignedLadderCoord", "EXTEND_X")
235  .groupBy("PXBarrel/PXLayer", "EXTEND_Y")
236  .reduce("MEAN")
237  .save(),
238  Specification(PerLayer2D)
239  .groupBy("PXForward/PXRing/SignedBladePanelCoord/SignedDiskCoord")
240  .groupBy("PXForward/PXRing/SignedBladePanelCoord", "EXTEND_X")
241  .groupBy("PXForward/PXRing", "EXTEND_Y")
242  .reduce("MEAN")
243  .save(),
244 ]
245 
246 StandardSpecificationOccupancy = [ #this produces pixel maps with counting
247  Specification(PerLayer2D)
248  .groupBy("PXBarrel/PXLayer/SignedLadderCoord/SignedModuleCoord")
249  .groupBy("PXBarrel/PXLayer/SignedLadderCoord", "EXTEND_X")
250  .groupBy("PXBarrel/PXLayer", "EXTEND_Y")
251  .save(),
252  Specification(PerLayer2D)
253  .groupBy("PXForward/PXRing/SignedBladePanelCoord/SignedDiskCoord")
254  .groupBy("PXForward/PXRing/SignedBladePanelCoord", "EXTEND_X")
255  .groupBy("PXForward/PXRing", "EXTEND_Y")
256  .save()
257  #Specification(PerLayer2D) # FPIX as one plot
258  # .groupBy("PXForward/SignedShiftedBladePanelCoord/SignedDiskRingCoord")
259  # .groupBy("PXForward/SignedShiftedBladePanelCoord", "EXTEND_X")
260  # .groupBy("PXForward", "EXTEND_Y")
261  # .save(),
262 ]
263 
264 # the same for NDigis and friends. Needed due to technical limitations...
265 StandardSpecifications1D_Num = [
266  Specification(PerLadder).groupBy("PXBarrel/Shell/PXLayer/SignedLadder/DetId/Event")
267  .reduce("COUNT") # per-event counting
268  .groupBy("PXBarrel/Shell/PXLayer/SignedLadder").save()
269  .reduce("MEAN")
270  .groupBy("PXBarrel/Shell/PXLayer", "EXTEND_X")
271  .save(),
272  Specification(PerModule).groupBy("PXBarrel/Shell/PXLayer/SignedLadder/PXModuleName/Event")
273  .reduce("COUNT")
274  .groupBy("PXBarrel/Shell/PXLayer/SignedLadder/PXModuleName")
275  .save(),
276  Specification(PerLadder).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/DetId/Event")
277  .reduce("COUNT") # per-event counting
278  .groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade").save()
279  .reduce("MEAN")
280  .groupBy("PXForward/HalfCylinder/PXRing/PXDisk/", "EXTEND_X")
281  .save()
282  .groupBy("PXForward/HalfCylinder/PXRing/", "EXTEND_X")
283  .save(),
284  Specification(PerModule).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/PXModuleName/Event")
285  .reduce("COUNT")
286  .groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/PXModuleName")
287  .save(),
288 
289  Specification(PerLadder).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/PXPanel/Event")
290  .reduce("COUNT")
291  .groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/PXPanel")
292  .reduce("MEAN")
293  .groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade","EXTEND_X")
294  .save(),
295  Specification(PerLadder).groupBy("PXBarrel/Shell/PXLayer/SignedLadder/PXBModule/Event")
296  .reduce("COUNT")
297  .groupBy("PXBarrel/Shell/PXLayer/SignedLadder/PXBModule")
298  .reduce("MEAN")
299  .groupBy("PXBarrel/Shell/PXLayer/SignedLadder", "EXTEND_X")
300  .save(),
301 ]
302 
303 
304 StandardSpecificationInclusive_Num = [#to count inclusively objects in substructures (BPix, FPix)
305  Specification().groupBy("PXBarrel/Event")
306  .reduce("COUNT")
307  .groupBy("PXBarrel")
308  .save(),
309  Specification().groupBy("PXForward/Event")
310  .reduce("COUNT")
311  .groupBy("PXForward")
312  .save(),
313  Specification().groupBy("PXAll/Event")
314  .reduce("COUNT")
315  .groupBy("PXAll")
316  .save(),
317 ]
318 
319 StandardSpecificationTrend_Num = [
320  Specification(PerModule).groupBy("PXBarrel/PXLayer/Event")
321  .reduce("COUNT")
322  .groupBy("PXBarrel/PXLayer/Lumisection")
323  .reduce("MEAN")
324  .groupBy("PXBarrel/PXLayer","EXTEND_X")
325  .groupBy("PXBarrel", "EXTEND_Y")
326  .save(),
327  Specification(PerModule).groupBy("PXBarrel/Event")
328  .reduce("COUNT")
329  .groupBy("PXBarrel/Lumisection")
330  .reduce("MEAN")
331  .groupBy("PXBarrel", "EXTEND_X")
332  .save(),
333  Specification(PerModule).groupBy("PXForward/PXDisk/Event")
334  .reduce("COUNT")
335  .groupBy("PXForward/PXDisk/Lumisection")
336  .reduce("MEAN")
337  .groupBy("PXForward/PXDisk","EXTEND_X")
338  .groupBy("PXForward", "EXTEND_Y")
339  .save(),
340  Specification(PerModule).groupBy("PXForward/Event")
341  .reduce("COUNT")
342  .groupBy("PXForward/Lumisection")
343  .reduce("MEAN")
344  .groupBy("PXForward", "EXTEND_X")
345  .save(),
346  Specification(PerModule).groupBy("PXAll/Event")
347  .reduce("COUNT")
348  .groupBy("PXAll/Lumisection")
349  .reduce("MEAN")
350  .groupBy("PXAll", "EXTEND_X")
351  .save(),
352  Specification(IsOffline).groupBy("PXBarrel/PXLayer/Event")
353  .reduce("COUNT")
354  .groupBy("PXBarrel/PXLayer/LumiBlock")
355  .reduce("MEAN")
356  .groupBy("PXBarrel/PXLayer","EXTEND_X")
357  .groupBy("PXBarrel", "EXTEND_Y")
358  .save(),
359  Specification(IsOffline).groupBy("PXBarrel/Event")
360  .reduce("COUNT")
361  .groupBy("PXBarrel/LumiBlock")
362  .reduce("MEAN")
363  .groupBy("PXBarrel", "EXTEND_X")
364  .save(),
365  Specification(IsOffline).groupBy("PXForward/PXDisk/Event")
366  .reduce("COUNT")
367  .groupBy("PXForward/PXDisk/LumiBlock")
368  .reduce("MEAN")
369  .groupBy("PXForward/PXDisk","EXTEND_X")
370  .groupBy("PXForward", "EXTEND_Y")
371  .save(),
372  Specification(IsOffline).groupBy("PXForward/Event")
373  .reduce("COUNT")
374  .groupBy("PXForward/LumiBlock")
375  .reduce("MEAN")
376  .groupBy("PXForward", "EXTEND_X")
377  .save(),
378  Specification(IsOffline).groupBy("PXAll/Event")
379  .reduce("COUNT")
380  .groupBy("PXAll/LumiBlock")
381  .reduce("MEAN")
382  .groupBy("PXAll", "EXTEND_X")
383  .save(),
384 ]
385 
386 
387 StandardSpecification2DProfile_Num = [
388 
389  Specification(PerLayer2D)
390  .groupBy("PXBarrel/PXLayer/SignedLadder/SignedModule" + "/DetId/Event")
391  .reduce("COUNT")
392  .groupBy("PXBarrel/PXLayer/SignedLadder/SignedModule")
393  .reduce("MEAN")
394  .groupBy("PXBarrel/PXLayer/SignedLadder", "EXTEND_X")
395  .groupBy("PXBarrel/PXLayer", "EXTEND_Y")
396  .save(),
397  Specification(PerLayer2D)
398  .groupBy("DetId/Event")
399  .reduce("COUNT")
400  .groupBy("PXForward/PXRing/PXDisk/SignedBladePanel")
401  .reduce("MEAN")
402  .groupBy("PXForward/PXRing/PXDisk", "EXTEND_Y")
403  .groupBy("PXForward/PXRing", "EXTEND_X")
404  .save(),
405 ]
406 
407 # function that makes a VPSet but flattens the argument list if needed
408 def VPSet(*args):
409  l = []
410  for a in args:
411  if isinstance(a, cms.VPSet) or isinstance(a, Specification):
412  e = [a]
413  else:
414  e = list(a)
415  l = l+e
416  return cms.VPSet(l)
T reduce(std::vector< T > x, Op op)
Definition: conifer.h:31
save
Definition: cuy.py:1164