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 DefaultHistoDigiCluster.topFolderName= cms.string("PixelPhase1/Phase1_MechanicalView")
105 
106 DefaultHistoSummary=DefaultHisto.clone()
107 DefaultHistoSummary.topFolderName= cms.string("PixelPhase1/Summary")
108 
109 DefaultHistoTrack=DefaultHisto.clone()
110 DefaultHistoTrack.topFolderName= cms.string("PixelPhase1/Tracks")
111 
112 DefaultHistoReadout=DefaultHisto.clone()
113 DefaultHistoReadout.topFolderName= cms.string("PixelPhase1/FED/Readout")
114 
115 # Commonly used specifications.
116 StandardSpecifications1D = [
117  # The column names are either defined in the GeometryInterface.cc or read from TrackerTopology.
118  # Endcap names side by side. The "/" separates columns and also defines how the output folders are nested.
119 
120  # per-ladder and profiles
121  Specification(PerLadder).groupBy("PXBarrel/Shell/PXLayer/SignedLadder")
122  .save()
123  .reduce("MEAN")
124  .groupBy("PXBarrel/Shell/PXLayer", "EXTEND_X")
125  .save(),
126  Specification(PerLadder).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade")
127  .save()
128  .reduce("MEAN")
129  .groupBy("PXForward/HalfCylinder/PXRing/PXDisk", "EXTEND_X")
130  .save()
131  .groupBy("PXForward/HalfCylinder/PXRing/", "EXTEND_X")
132  .save(),
133  Specification().groupBy("PXBarrel").save(),
134  Specification().groupBy("PXForward").save(),
135  Specification(PerLayer1D).groupBy("PXBarrel/Shell/PXLayer").save(),
136  Specification(PerLayer1D).groupBy("PXForward/HalfCylinder/PXRing/PXDisk").save(),
137 
138  Specification(PerModule).groupBy("PXBarrel/Shell/PXLayer/SignedLadder/PXModuleName").save(),
139  Specification(PerModule).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/PXModuleName").save(),
140 
141  Specification(PerLadder).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/PXPanel")
142  .reduce("MEAN")
143  .groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade","EXTEND_X")
144  .save(),
145  Specification(PerLadder).groupBy("PXBarrel/Shell/PXLayer/SignedLadder/SignedModule")
146  .reduce("MEAN")
147  .groupBy("PXBarrel/Shell/PXLayer/SignedLadder", "EXTEND_X")
148  .save(),
149  Specification().groupBy("PXBarrel/PXLayer")
150  .save(),
151  Specification().groupBy("PXForward/PXDisk")
152  .save()
153 
154 
155 ]
156 
157 StandardSpecificationTrend = [
158  Specification(PerModule).groupBy("PXBarrel/Lumisection")
159  .reduce("MEAN")
160  .groupBy("PXBarrel", "EXTEND_X")
161  .save(),
162  Specification(PerModule).groupBy("PXForward/Lumisection")
163  .reduce("MEAN")
164  .groupBy("PXForward", "EXTEND_X")
165  .save(),
166  Specification(IsOffline).groupBy("PXBarrel/LumiBlock")
167  .reduce("MEAN")
168  .groupBy("PXBarrel", "EXTEND_X")
169  .save(),
170  Specification(IsOffline).groupBy("PXForward/LumiBlock")
171  .reduce("MEAN")
172  .groupBy("PXForward", "EXTEND_X")
173  .save()
174 ]
175 
176 StandardSpecificationTrend2D = [
177  Specification(PerModule).groupBy("PXBarrel/PXLayer/Lumisection")
178  .reduce("MEAN")
179  .groupBy("PXBarrel/PXLayer", "EXTEND_X")
180  .groupBy("PXBarrel", "EXTEND_Y")
181  .save(),
182  Specification(PerModule).groupBy("PXForward/PXDisk/Lumisection")
183  .reduce("MEAN")
184  .groupBy("PXForward/PXDisk","EXTEND_X")
185  .groupBy("PXForward", "EXTEND_Y")
186  .save(),
187  Specification(IsOffline).groupBy("PXBarrel/PXLayer/LumiBlock")
188  .reduce("MEAN")
189  .groupBy("PXBarrel/PXLayer", "EXTEND_X")
190  .groupBy("PXBarrel", "EXTEND_Y")
191  .save(),
192  Specification(IsOffline).groupBy("PXForward/PXDisk/LumiBlock")
193  .reduce("MEAN")
194  .groupBy("PXForward/PXDisk","EXTEND_X")
195  .groupBy("PXForward", "EXTEND_Y")
196  .save()
197 ]
198 
199 StandardSpecification2DProfile = [
200  Specification(PerLayer2D)
201  .groupBy("PXBarrel/PXLayer/SignedLadder/SignedModule")
202  .groupBy("PXBarrel/PXLayer/SignedLadder", "EXTEND_X")
203  .groupBy("PXBarrel/PXLayer", "EXTEND_Y")
204  .reduce("MEAN")
205  .save(),
206  Specification(PerLayer2D)
207  .groupBy("PXForward/PXRing/SignedBladePanel/PXDisk")
208  .groupBy("PXForward/PXRing/SignedBladePanel", "EXTEND_X")
209  .groupBy("PXForward/PXRing", "EXTEND_Y")
210  .reduce("MEAN")
211  .save(),
212 ]
213 
214 StandardSpecification2DOccupancy = [
215  Specification(PerLayer2D)
216  .groupBy("PXBarrel/PXLayer/SignedLadder/SignedModule")
217  .groupBy("PXBarrel/PXLayer/SignedLadder", "EXTEND_X")
218  .groupBy("PXBarrel/PXLayer", "EXTEND_Y")
219  .save(),
220  Specification(PerLayer2D)
221  .groupBy("PXForward/PXRing/SignedBladePanel/PXDisk")
222  .groupBy("PXForward/PXRing/SignedBladePanel", "EXTEND_X")
223  .groupBy("PXForward/PXRing", "EXTEND_Y")
224  .save(),
225 ]
226 
227 StandardSpecificationPixelmapProfile = [#produces pixel map with the mean (TProfile)
228  Specification(PerLayer2D)
229  .groupBy("PXBarrel/PXLayer/SignedLadderCoord/SignedModuleCoord")
230  .groupBy("PXBarrel/PXLayer/SignedLadderCoord", "EXTEND_X")
231  .groupBy("PXBarrel/PXLayer", "EXTEND_Y")
232  .reduce("MEAN")
233  .save(),
234  Specification(PerLayer2D)
235  .groupBy("PXForward/PXRing/SignedBladePanelCoord/SignedDiskCoord")
236  .groupBy("PXForward/PXRing/SignedBladePanelCoord", "EXTEND_X")
237  .groupBy("PXForward/PXRing", "EXTEND_Y")
238  .reduce("MEAN")
239  .save(),
240 ]
241 
242 StandardSpecificationOccupancy = [ #this produces pixel maps with counting
243  Specification(PerLayer2D)
244  .groupBy("PXBarrel/PXLayer/SignedLadderCoord/SignedModuleCoord")
245  .groupBy("PXBarrel/PXLayer/SignedLadderCoord", "EXTEND_X")
246  .groupBy("PXBarrel/PXLayer", "EXTEND_Y")
247  .save(),
248  Specification(PerLayer2D)
249  .groupBy("PXForward/PXRing/SignedBladePanelCoord/SignedDiskCoord")
250  .groupBy("PXForward/PXRing/SignedBladePanelCoord", "EXTEND_X")
251  .groupBy("PXForward/PXRing", "EXTEND_Y")
252  .save()
253  #Specification(PerLayer2D) # FPIX as one plot
254  # .groupBy("PXForward/SignedShiftedBladePanelCoord/SignedDiskRingCoord")
255  # .groupBy("PXForward/SignedShiftedBladePanelCoord", "EXTEND_X")
256  # .groupBy("PXForward", "EXTEND_Y")
257  # .save(),
258 ]
259 
260 # the same for NDigis and friends. Needed due to technical limitations...
261 StandardSpecifications1D_Num = [
262  Specification(PerLadder).groupBy("PXBarrel/Shell/PXLayer/SignedLadder/DetId/Event")
263  .reduce("COUNT") # per-event counting
264  .groupBy("PXBarrel/Shell/PXLayer/SignedLadder").save()
265  .reduce("MEAN")
266  .groupBy("PXBarrel/Shell/PXLayer", "EXTEND_X")
267  .save(),
268  Specification(PerModule).groupBy("PXBarrel/Shell/PXLayer/SignedLadder/PXModuleName/Event")
269  .reduce("COUNT")
270  .groupBy("PXBarrel/Shell/PXLayer/SignedLadder/PXModuleName")
271  .save(),
272  Specification(PerLadder).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/DetId/Event")
273  .reduce("COUNT") # per-event counting
274  .groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade").save()
275  .reduce("MEAN")
276  .groupBy("PXForward/HalfCylinder/PXRing/PXDisk/", "EXTEND_X")
277  .save()
278  .groupBy("PXForward/HalfCylinder/PXRing/", "EXTEND_X")
279  .save(),
280  Specification(PerModule).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/PXModuleName/Event")
281  .reduce("COUNT")
282  .groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/PXModuleName")
283  .save(),
284 
285  Specification(PerLadder).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/PXPanel/Event")
286  .reduce("COUNT")
287  .groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/PXPanel")
288  .reduce("MEAN")
289  .groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade","EXTEND_X")
290  .save(),
291  Specification(PerLadder).groupBy("PXBarrel/Shell/PXLayer/SignedLadder/PXBModule/Event")
292  .reduce("COUNT")
293  .groupBy("PXBarrel/Shell/PXLayer/SignedLadder/PXBModule")
294  .reduce("MEAN")
295  .groupBy("PXBarrel/Shell/PXLayer/SignedLadder", "EXTEND_X")
296  .save(),
297 ]
298 
299 
300 StandardSpecificationInclusive_Num = [#to count inclusively objects in substructures (BPix, FPix)
301  Specification().groupBy("PXBarrel/Event")
302  .reduce("COUNT")
303  .groupBy("PXBarrel")
304  .save(),
305  Specification().groupBy("PXForward/Event")
306  .reduce("COUNT")
307  .groupBy("PXForward")
308  .save(),
309  Specification().groupBy("PXAll/Event")
310  .reduce("COUNT")
311  .groupBy("PXAll")
312  .save(),
313 ]
314 
315 StandardSpecificationTrend_Num = [
316  Specification(PerModule).groupBy("PXBarrel/PXLayer/Event")
317  .reduce("COUNT")
318  .groupBy("PXBarrel/PXLayer/Lumisection")
319  .reduce("MEAN")
320  .groupBy("PXBarrel/PXLayer","EXTEND_X")
321  .groupBy("PXBarrel", "EXTEND_Y")
322  .save(),
323  Specification(PerModule).groupBy("PXBarrel/Event")
324  .reduce("COUNT")
325  .groupBy("PXBarrel/Lumisection")
326  .reduce("MEAN")
327  .groupBy("PXBarrel", "EXTEND_X")
328  .save(),
329  Specification(PerModule).groupBy("PXForward/PXDisk/Event")
330  .reduce("COUNT")
331  .groupBy("PXForward/PXDisk/Lumisection")
332  .reduce("MEAN")
333  .groupBy("PXForward/PXDisk","EXTEND_X")
334  .groupBy("PXForward", "EXTEND_Y")
335  .save(),
336  Specification(PerModule).groupBy("PXForward/Event")
337  .reduce("COUNT")
338  .groupBy("PXForward/Lumisection")
339  .reduce("MEAN")
340  .groupBy("PXForward", "EXTEND_X")
341  .save(),
342  Specification(PerModule).groupBy("PXAll/Event")
343  .reduce("COUNT")
344  .groupBy("PXAll/Lumisection")
345  .reduce("MEAN")
346  .groupBy("PXAll", "EXTEND_X")
347  .save(),
348  Specification(IsOffline).groupBy("PXBarrel/PXLayer/Event")
349  .reduce("COUNT")
350  .groupBy("PXBarrel/PXLayer/LumiBlock")
351  .reduce("MEAN")
352  .groupBy("PXBarrel/PXLayer","EXTEND_X")
353  .groupBy("PXBarrel", "EXTEND_Y")
354  .save(),
355  Specification(IsOffline).groupBy("PXBarrel/Event")
356  .reduce("COUNT")
357  .groupBy("PXBarrel/LumiBlock")
358  .reduce("MEAN")
359  .groupBy("PXBarrel", "EXTEND_X")
360  .save(),
361  Specification(IsOffline).groupBy("PXForward/PXDisk/Event")
362  .reduce("COUNT")
363  .groupBy("PXForward/PXDisk/LumiBlock")
364  .reduce("MEAN")
365  .groupBy("PXForward/PXDisk","EXTEND_X")
366  .groupBy("PXForward", "EXTEND_Y")
367  .save(),
368  Specification(IsOffline).groupBy("PXForward/Event")
369  .reduce("COUNT")
370  .groupBy("PXForward/LumiBlock")
371  .reduce("MEAN")
372  .groupBy("PXForward", "EXTEND_X")
373  .save(),
374  Specification(IsOffline).groupBy("PXAll/Event")
375  .reduce("COUNT")
376  .groupBy("PXAll/LumiBlock")
377  .reduce("MEAN")
378  .groupBy("PXAll", "EXTEND_X")
379  .save(),
380 ]
381 
382 
383 StandardSpecification2DProfile_Num = [
384 
385  Specification(PerLayer2D)
386  .groupBy("PXBarrel/PXLayer/SignedLadder/SignedModule" + "/DetId/Event")
387  .reduce("COUNT")
388  .groupBy("PXBarrel/PXLayer/SignedLadder/SignedModule")
389  .reduce("MEAN")
390  .groupBy("PXBarrel/PXLayer/SignedLadder", "EXTEND_X")
391  .groupBy("PXBarrel/PXLayer", "EXTEND_Y")
392  .save(),
393  Specification(PerLayer2D)
394  .groupBy("DetId/Event")
395  .reduce("COUNT")
396  .groupBy("PXForward/PXRing/PXDisk/SignedBladePanel")
397  .reduce("MEAN")
398  .groupBy("PXForward/PXRing/PXDisk", "EXTEND_Y")
399  .groupBy("PXForward/PXRing", "EXTEND_X")
400  .save(),
401 ]
402 
403 # function that makes a VPSet but flattens the argument list if needed
404 def VPSet(*args):
405  l = []
406  for a in args:
407  if isinstance(a, cms.VPSet) or isinstance(a, Specification):
408  e = [a]
409  else:
410  e = list(a)
411  l = l+e
412  return cms.VPSet(l)
HistogramManager_cfi.VPSet
def VPSet(*args)
Definition: HistogramManager_cfi.py:404
cuy.save
save
Definition: cuy.py:1165