CMS 3D CMS Logo

hgcalPlots.py
Go to the documentation of this file.
1 from __future__ import print_function
2 import os
3 import sys
4 import copy
5 import collections
6 
7 import six
8 import ROOT
9 from ROOT import TFile, TString
10 from ROOT import gDirectory
11 ROOT.gROOT.SetBatch(True)
12 ROOT.PyConfig.IgnoreCommandLineOptions = True
13 
14 from Validation.RecoTrack.plotting.plotting import Plot, PlotGroup, PlotFolder, Plotter, PlotOnSideGroup
15 from Validation.RecoTrack.plotting.html import PlotPurpose
16 import Validation.RecoTrack.plotting.plotting as plotting
17 import Validation.RecoTrack.plotting.validation as validation
18 import Validation.RecoTrack.plotting.html as html
19 
20 #To be able to spot any issues both in -z and +z a layer id was introduced
21 #that spans from 0 to 103 for hgcal_v9 geometry. The mapping for hgcal_v9 is:
22 #-z: 0->51
23 #+z: 52->103
24 #while for V10 is:
25 #-z: 0->49
26 #+z: 50->99
27 '''
28 layerscheme = { 'lastLayerEEzm': 0, 'lastLayerFHzm': 0, 'maxlayerzm': 0, 'lastLayerEEzp': 0, 'lastLayerFHzp': 0, 'maxlayerzp': 0 }
29 
30 #Let's take the relevant values of layerscheme from the dqm file.
31 theDQMfile = "DQM_V0001_R000000001__Global__CMSSW_X_Y_Z__RECO.root"
32 if not os.path.isfile(theDQMfile):
33  print("Error: file", theDQMfile, "not found, exit")
34  sys.exit(0)
35 
36 
37 #Take general info from the first file is sufficient.
38 thefile = TFile( theDQMfile )
39 GeneralInfoDirectory = 'DQMData/Run 1/HGCAL/Run summary/HGCalValidator/GeneralInfo'
40 
41 if not gDirectory.GetDirectory( GeneralInfoDirectory ):
42  print("Error: GeneralInfo directory not found in DQM file, exit")
43  sys.exit(0)
44 
45 keys = gDirectory.GetDirectory( GeneralInfoDirectory ).GetListOfKeys()
46 key = keys[0]
47 layvalue = 0
48 while key:
49  obj = key.ReadObj()
50  for laykey in layerscheme.keys():
51  if laykey in obj.GetName():
52  layvalue = obj.GetName()[len("<"+laykey+">i="):-len("</"+laykey+">")]
53  layerscheme[laykey] = layvalue
54  #print(layvalue)
55  key = keys.After(key)
56 
57 thefile.Close()
58 
59 print(layerscheme)
60 #TODO: Anticipating the fine/coarse layer information in CMSSW we overwrite values from DQM file
61 #For now values returned for
62 # 'lastLayerFHzp': '104', 'lastLayerFHzm': '52'
63 #are not the one expected. Will come back to this when there will be info in CMSSW to put in DQM file.
64 #For V9:
65 #layerscheme = { 'lastLayerEEzm': 28, 'lastLayerFHzm': 40, 'maxlayerzm': 52, 'lastLayerEEzp': 80, 'lastLayerFHzp': 92, 'maxlayerzp': 104 }
66 #For V10:
67 '''
68 layerscheme = { 'lastLayerEEzm': 28, 'lastLayerFHzm': 40, 'maxlayerzm': 50, 'lastLayerEEzp': 78, 'lastLayerFHzp': 90, 'maxlayerzp': 100 }
69 #print(layerscheme)
70 
71 lastLayerEEzm = layerscheme['lastLayerEEzm'] # last layer of EE -z
72 lastLayerFHzm = layerscheme['lastLayerFHzm'] # last layer of FH -z
73 maxlayerzm = layerscheme['maxlayerzm'] # last layer of BH -z
74 lastLayerEEzp = layerscheme['lastLayerEEzp'] # last layer of EE +z
75 lastLayerFHzp = layerscheme['lastLayerFHzp'] # last layer of FH +z
76 maxlayerzp = layerscheme['maxlayerzp'] # last layer of BH +z
77 
78 hitlayerscheme = { 'EE_min': 1,'EE_max': 28, 'HESilicon_min': 1, 'HESilicon_max': 22, 'HEScintillator_min': 9 , 'HEScintillator_max': 22 }
79 #print(hitlayerscheme)
80 
81 EE_min = hitlayerscheme['EE_min']
82 EE_max = hitlayerscheme['EE_max']
83 HESilicon_min = hitlayerscheme['HESilicon_min']
84 HESilicon_max = hitlayerscheme['HESilicon_max']
85 HEScintillator_min = hitlayerscheme['HEScintillator_min']
86 HEScintillator_max = hitlayerscheme['HEScintillator_max']
87 
88 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
89 _legend_common = {"legendDx": -0.3,
90  "legendDy": -0.05,
91  "legendDw": 0.1}
92 
93 _SelectedCaloParticles = PlotGroup("SelectedCaloParticles", [
94  Plot("num_caloparticle_eta", xtitle="", **_common),
95  Plot("caloparticle_energy", xtitle="", **_common),
96  Plot("caloparticle_pt", xtitle="", **_common),
97  Plot("caloparticle_phi", xtitle="", **_common),
98  Plot("Eta vs Zorigin", xtitle="", **_common),
99  ])
100 
101 #Need to adjust the statbox to see better the plot
102 _common = {"stat": True, "drawStyle": "hist", "statx": 0.38, "staty": 0.68 }
103 _num_reco_cluster_eta = PlotGroup("num_reco_cluster_eta", [
104  Plot("num_reco_cluster_eta", xtitle="", **_common),
105 ],ncols=1)
106 #Back to normal
107 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
108 
109 _mixedhitsclusters = PlotGroup("mixedhitsclusters", [
110  Plot("mixedhitscluster_zminus", xtitle="", **_common),
111  Plot("mixedhitscluster_zplus", xtitle="", **_common),
112 ],ncols=2)
113 
114 _mixedhitssimclusters = PlotGroup("mixedhitssimclusters", [
115  Plot("mixedhitssimcluster_zminus", xtitle="", **_common),
116  Plot("mixedhitssimcluster_zplus", xtitle="", **_common),
117 ],ncols=2)
118 
119 #Just to prevent the stabox covering the plot
120 _common = {"stat": True, "drawStyle": "hist", "statx": 0.45, "staty": 0.65 }
121 
122 _energyclustered = PlotGroup("energyclustered", [
123  Plot("energyclustered_zminus", xtitle="", **_common),
124  Plot("energyclustered_zplus", xtitle="", **_common),
125 ],ncols=2)
126 
127 #Coming back to the usual box definition
128 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
129 
130 _longdepthbarycentre = PlotGroup("longdepthbarycentre", [
131  Plot("longdepthbarycentre_zminus", xtitle="", **_common),
132  Plot("longdepthbarycentre_zplus", xtitle="", **_common),
133 ],ncols=2)
134 
135 _common_layerperthickness = {}
136 _common_layerperthickness.update(_common)
137 _common_layerperthickness['xmin'] = 0.
138 _common_layerperthickness['xmax'] = 100
139 
140 _totclusternum_thick = PlotGroup("totclusternum_thick", [
141  Plot("totclusternum_thick_120", xtitle="", **_common_layerperthickness),
142  Plot("totclusternum_thick_200", xtitle="", **_common_layerperthickness),
143  Plot("totclusternum_thick_300", xtitle="", **_common_layerperthickness),
144  Plot("totclusternum_thick_-1", xtitle="", **_common_layerperthickness),
145  Plot("mixedhitscluster", xtitle="", **_common_layerperthickness),
146 ])
147 
148 _totsimclusternum_thick = PlotGroup("totsimclusternum_thick", [
149  Plot("totsimclusternum_thick_120", xtitle="", **_common_layerperthickness),
150  Plot("totsimclusternum_thick_200", xtitle="", **_common_layerperthickness),
151  Plot("totsimclusternum_thick_300", xtitle="", **_common_layerperthickness),
152  Plot("totsimclusternum_thick_-1", xtitle="", **_common_layerperthickness),
153  Plot("mixedhitssimcluster", xtitle="", **_common_layerperthickness),
154 ])
155 
156 #We will plot the density in logy scale.
157 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65, "ylog": True}
158 
159 _cellsenedens_thick = PlotGroup("cellsenedens_thick", [
160  Plot("cellsenedens_thick_120", xtitle="", **_common),
161  Plot("cellsenedens_thick_200", xtitle="", **_common),
162  Plot("cellsenedens_thick_300", xtitle="", **_common),
163  Plot("cellsenedens_thick_-1", xtitle="", **_common),
164 ])
165 
166 #Coming back to the usual box definition
167 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
168 
169 
170 #--------------------------------------------------------------------------------------------
171 # z-
172 #--------------------------------------------------------------------------------------------
173 _totclusternum_layer_EE_zminus = PlotGroup("totclusternum_layer_EE", [
174  Plot("totclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
175 ], ncols=7)
176 
177 _totclusternum_layer_FH_zminus = PlotGroup("totclusternum_layer_FH", [
178  Plot("totclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
179 ], ncols=7)
180 
181 _totclusternum_layer_BH_zminus = PlotGroup("totclusternum_layer_BH", [
182  Plot("totclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
183 ], ncols=7)
184 
185 _totsimclusternum_layer_EE_zminus = PlotGroup("totsimclusternum_layer_EE_zminus", [
186  Plot("totsimclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
187 ], ncols=4)
188 
189 _totsimclusternum_layer_FH_zminus = PlotGroup("totsimclusternum_layer_FH_zminus", [
190  Plot("totsimclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
191 ], ncols=4)
192 
193 _totsimclusternum_layer_BH_zminus = PlotGroup("totsimclusternum_layer_BH_zminus", [
194  Plot("totsimclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
195 ], ncols=4)
196 
197 _energyclustered_perlayer_EE_zminus = PlotGroup("energyclustered_perlayer_EE", [
198  Plot("energyclustered_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
199 ], ncols=7)
200 
201 _energyclustered_perlayer_FH_zminus = PlotGroup("energyclustered_perlayer_FH", [
202  Plot("energyclustered_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
203 ], ncols=7)
204 
205 _energyclustered_perlayer_BH_zminus = PlotGroup("energyclustered_perlayer_BH", [
206  Plot("energyclustered_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
207 ], ncols=7)
208 
209 #----------------------------------------------------------------------------------------------------------------
210 #120 um
211 _common_cells = {}
212 _common_cells.update(_common)
213 _common_cells["xmin"] = 0
214 _common_cells["xmax"] = 50
215 _common_cells["ymin"] = 0.1
216 _common_cells["ymax"] = 10000
217 _common_cells["ylog"] = True
218 _cellsnum_perthick_perlayer_120_EE_zminus = PlotGroup("cellsnum_perthick_perlayer_120_EE", [
219  Plot("cellsnum_perthick_perlayer_120_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm)
220 ], ncols=7)
221 
222 _cellsnum_perthick_perlayer_120_FH_zminus = PlotGroup("cellsnum_perthick_perlayer_120_FH", [
223  Plot("cellsnum_perthick_perlayer_120_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm,lastLayerFHzm)
224 ], ncols=7)
225 
226 _cellsnum_perthick_perlayer_120_BH_zminus = PlotGroup("cellsnum_perthick_perlayer_120_BH", [
227  Plot("cellsnum_perthick_perlayer_120_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzm,maxlayerzm)
228 ], ncols=7)
229 
230 #200 um
231 _cellsnum_perthick_perlayer_200_EE_zminus = PlotGroup("cellsnum_perthick_perlayer_200_EE", [
232  Plot("cellsnum_perthick_perlayer_200_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm)
233 ], ncols=7)
234 
235 _cellsnum_perthick_perlayer_200_FH_zminus = PlotGroup("cellsnum_perthick_perlayer_200_FH", [
236  Plot("cellsnum_perthick_perlayer_200_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm,lastLayerFHzm)
237 ], ncols=7)
238 
239 _cellsnum_perthick_perlayer_200_BH_zminus = PlotGroup("cellsnum_perthick_perlayer_200_BH", [
240  Plot("cellsnum_perthick_perlayer_200_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzm,maxlayerzm)
241 ], ncols=7)
242 
243 #300 um
244 _cellsnum_perthick_perlayer_300_EE_zminus = PlotGroup("cellsnum_perthick_perlayer_300_EE", [
245  Plot("cellsnum_perthick_perlayer_300_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm)
246 ], ncols=7)
247 
248 _cellsnum_perthick_perlayer_300_FH_zminus = PlotGroup("cellsnum_perthick_perlayer_300_FH", [
249  Plot("cellsnum_perthick_perlayer_300_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm,lastLayerFHzm)
250 ], ncols=7)
251 
252 _cellsnum_perthick_perlayer_300_BH_zminus = PlotGroup("cellsnum_perthick_perlayer_300_BH", [
253  Plot("cellsnum_perthick_perlayer_300_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzm,maxlayerzm)
254 ], ncols=7)
255 
256 #scint um
257 _cellsnum_perthick_perlayer_scint_EE_zminus = PlotGroup("cellsnum_perthick_perlayer_Sci_EE", [
258  Plot("cellsnum_perthick_perlayer_-1_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm)
259 ], ncols=7)
260 
261 _cellsnum_perthick_perlayer_scint_FH_zminus = PlotGroup("cellsnum_perthick_perlayer_Sci_FH", [
262  Plot("cellsnum_perthick_perlayer_-1_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm,lastLayerFHzm)
263 ], ncols=7)
264 
265 _cellsnum_perthick_perlayer_scint_BH_zminus = PlotGroup("cellsnum_perthick_perlayer_Sci_BH", [
266  Plot("cellsnum_perthick_perlayer_-1_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzm,maxlayerzm)
267 ], ncols=7)
268 
269 #----------------------------------------------------------------------------------------------------------------
270 #120 um
271 _common_distance = {}
272 _common_distance.update(_common)
273 _common_distance.update(_legend_common)
274 _common_distance["xmax"] = 150
275 _common_distance["stat"] = False
276 _common_distance["ymin"] = 1e-3
277 _common_distance["ymax"] = 10000
278 _common_distance["ylog"] = True
279 
280 _distancetomaxcell_perthickperlayer_120_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_120_EE", [
281  Plot("distancetomaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
282 ], ncols=7)
283 
284 _distancetomaxcell_perthickperlayer_120_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_120_FH", [
285  Plot("distancetomaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
286 ], ncols=7)
287 
288 _distancetomaxcell_perthickperlayer_120_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_120_BH", [
289  Plot("distancetomaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
290 ], ncols=7)
291 
292 #200 um
293 _distancetomaxcell_perthickperlayer_200_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_200_EE", [
294  Plot("distancetomaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
295 ], ncols=7)
296 
297 _distancetomaxcell_perthickperlayer_200_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_200_FH", [
298  Plot("distancetomaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
299 ], ncols=7)
300 
301 _distancetomaxcell_perthickperlayer_200_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_200_BH", [
302  Plot("distancetomaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
303 ], ncols=7)
304 
305 #300 um
306 _distancetomaxcell_perthickperlayer_300_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_300_EE", [
307  Plot("distancetomaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
308 ], ncols=7)
309 
310 _distancetomaxcell_perthickperlayer_300_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_300_FH", [
311  Plot("distancetomaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
312 ], ncols=7)
313 
314 _distancetomaxcell_perthickperlayer_300_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_300_BH", [
315  Plot("distancetomaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
316 ], ncols=7)
317 
318 #scint um
319 _distancetomaxcell_perthickperlayer_scint_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_Sci_EE", [
320  Plot("distancetomaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
321 ], ncols=7)
322 
323 _distancetomaxcell_perthickperlayer_scint_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_Sci_FH", [
324  Plot("distancetomaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
325 ], ncols=7)
326 
327 _distancetomaxcell_perthickperlayer_scint_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_Sci_BH", [
328  Plot("distancetomaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
329 ], ncols=7)
330 
331 #----------------------------------------------------------------------------------------------------------------
332 #120 um
333 _distancebetseedandmaxcell_perthickperlayer_120_EE_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_120_EE", [
334  Plot("distancebetseedandmaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
335 ], ncols=7)
336 
337 _distancebetseedandmaxcell_perthickperlayer_120_FH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_120_FH", [
338  Plot("distancebetseedandmaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
339 ], ncols=7)
340 
341 _distancebetseedandmaxcell_perthickperlayer_120_BH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_120_BH", [
342  Plot("distancebetseedandmaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
343 ], ncols=7)
344 
345 #200 um
346 _distancebetseedandmaxcell_perthickperlayer_200_EE_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_200_EE", [
347  Plot("distancebetseedandmaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
348 ], ncols=7)
349 
350 _distancebetseedandmaxcell_perthickperlayer_200_FH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_200_FH", [
351  Plot("distancebetseedandmaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
352 ], ncols=7)
353 
354 _distancebetseedandmaxcell_perthickperlayer_200_BH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_200_BH", [
355  Plot("distancebetseedandmaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
356 ], ncols=7)
357 
358 #300 um
359 _distancebetseedandmaxcell_perthickperlayer_300_EE_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_300_EE", [
360  Plot("distancebetseedandmaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
361 ], ncols=7)
362 
363 _distancebetseedandmaxcell_perthickperlayer_300_FH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_300_FH", [
364  Plot("distancebetseedandmaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
365 ], ncols=7)
366 
367 _distancebetseedandmaxcell_perthickperlayer_300_BH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_300_BH", [
368  Plot("distancebetseedandmaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
369 ], ncols=7)
370 
371 #scint um
372 _distancebetseedandmaxcell_perthickperlayer_scint_EE_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_Sci_EE", [
373  Plot("distancebetseedandmaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
374 ], ncols=7)
375 
376 _distancebetseedandmaxcell_perthickperlayer_scint_FH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_Sci_FH", [
377  Plot("distancebetseedandmaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
378 ], ncols=7)
379 
380 _distancebetseedandmaxcell_perthickperlayer_scint_BH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_Sci_BH", [
381  Plot("distancebetseedandmaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
382 ], ncols=7)
383 
384 #----------------------------------------------------------------------------------------------------------------
385 #120 um
386 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_EE_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_EE", [
387  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
388 ], ncols=7)
389 
390 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_FH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_FH", [
391  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
392 ], ncols=7)
393 
394 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_BH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_BH", [
395  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
396 ], ncols=7)
397 
398 #200 um
399 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_EE_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_EE", [
400  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
401 ], ncols=7)
402 
403 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_FH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_FH", [
404  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
405 ], ncols=7)
406 
407 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_BH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_BH", [
408  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
409 ], ncols=7)
410 
411 #300 um
412 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_EE_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_EE", [
413  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
414 ], ncols=7)
415 
416 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_FH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_FH", [
417  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
418 ], ncols=7)
419 
420 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH", [
421  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
422 ], ncols=7)
423 
424 #scint um
425 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_EE_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_Sci_EE", [
426  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
427 ], ncols=7)
428 
429 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_FH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_Sci_FH", [
430  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
431 ], ncols=7)
432 
433 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_BH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_Sci_BH", [
434  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
435 ], ncols=7)
436 
437 #----------------------------------------------------------------------------------------------------------------
438 #120 um
439 _distancetoseedcell_perthickperlayer_120_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_120_EE", [
440  Plot("distancetoseedcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
441 ], ncols=7)
442 
443 _distancetoseedcell_perthickperlayer_120_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_120_FH", [
444  Plot("distancetoseedcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
445 ], ncols=7)
446 
447 _distancetoseedcell_perthickperlayer_120_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_120_BH", [
448  Plot("distancetoseedcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
449 ], ncols=7)
450 
451 #200 um
452 _distancetoseedcell_perthickperlayer_200_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_200_EE", [
453  Plot("distancetoseedcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
454 ], ncols=7)
455 
456 _distancetoseedcell_perthickperlayer_200_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_200_FH", [
457  Plot("distancetoseedcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
458 ], ncols=7)
459 
460 _distancetoseedcell_perthickperlayer_200_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_200_BH", [
461  Plot("distancetoseedcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
462 ], ncols=7)
463 
464 #300 um
465 _distancetoseedcell_perthickperlayer_300_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_300_EE", [
466  Plot("distancetoseedcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
467 ], ncols=7)
468 
469 _distancetoseedcell_perthickperlayer_300_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_300_FH", [
470  Plot("distancetoseedcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
471 ], ncols=7)
472 
473 _distancetoseedcell_perthickperlayer_300_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_300_BH", [
474  Plot("distancetoseedcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
475 ], ncols=7)
476 
477 #scint um
478 _distancetoseedcell_perthickperlayer_scint_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_Sci_EE", [
479  Plot("distancetoseedcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
480 ], ncols=7)
481 
482 _distancetoseedcell_perthickperlayer_scint_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_Sci_FH", [
483  Plot("distancetoseedcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
484 ], ncols=7)
485 
486 _distancetoseedcell_perthickperlayer_scint_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_Sci_BH", [
487  Plot("distancetoseedcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
488 ], ncols=7)
489 
490 #=====================================================================================================================
491 #----------------------------------------------------------------------------------------------------------------
492 #We need points for the weighted plots
493 _common = {"stat": True, "drawStyle": "EP", "staty": 0.65 }
494 #120 um
495 _distancetomaxcell_perthickperlayer_eneweighted_120_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_120_EE", [
496  Plot("distancetomaxcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
497 ], ncols=7)
498 
499 _distancetomaxcell_perthickperlayer_eneweighted_120_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_120_FH", [
500  Plot("distancetomaxcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
501 ], ncols=7)
502 
503 _distancetomaxcell_perthickperlayer_eneweighted_120_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_120_BH", [
504  Plot("distancetomaxcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
505 ], ncols=7)
506 
507 #200 um
508 _distancetomaxcell_perthickperlayer_eneweighted_200_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_200_EE", [
509  Plot("distancetomaxcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
510 ], ncols=7)
511 
512 _distancetomaxcell_perthickperlayer_eneweighted_200_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_200_FH", [
513  Plot("distancetomaxcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
514 ], ncols=7)
515 
516 _distancetomaxcell_perthickperlayer_eneweighted_200_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_200_BH", [
517  Plot("distancetomaxcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
518 ], ncols=7)
519 
520 #300 um
521 _distancetomaxcell_perthickperlayer_eneweighted_300_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_300_EE", [
522  Plot("distancetomaxcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
523 ], ncols=7)
524 
525 _distancetomaxcell_perthickperlayer_eneweighted_300_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_300_FH", [
526  Plot("distancetomaxcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
527 ], ncols=7)
528 
529 _distancetomaxcell_perthickperlayer_eneweighted_300_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_300_BH", [
530  Plot("distancetomaxcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
531 ], ncols=7)
532 #scint um
533 _distancetomaxcell_perthickperlayer_eneweighted_scint_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_Sci_EE", [
534  Plot("distancetomaxcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
535 ], ncols=7)
536 
537 _distancetomaxcell_perthickperlayer_eneweighted_scint_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_Sci_FH", [
538  Plot("distancetomaxcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
539 ], ncols=7)
540 
541 _distancetomaxcell_perthickperlayer_eneweighted_scint_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_Sci_BH", [
542  Plot("distancetomaxcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
543 ], ncols=7)
544 
545 
546 #----------------------------------------------------------------------------------------------------------------
547 #120 um
548 _distancetoseedcell_perthickperlayer_eneweighted_120_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_120_EE", [
549  Plot("distancetoseedcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
550 ], ncols=7)
551 
552 _distancetoseedcell_perthickperlayer_eneweighted_120_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_120_FH", [
553  Plot("distancetoseedcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
554 ], ncols=7)
555 
556 _distancetoseedcell_perthickperlayer_eneweighted_120_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_120_BH", [
557  Plot("distancetoseedcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
558 ], ncols=7)
559 
560 #200 um
561 _distancetoseedcell_perthickperlayer_eneweighted_200_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_200_EE", [
562  Plot("distancetoseedcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
563 ], ncols=7)
564 
565 _distancetoseedcell_perthickperlayer_eneweighted_200_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_200_FH", [
566  Plot("distancetoseedcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
567 ], ncols=7)
568 
569 _distancetoseedcell_perthickperlayer_eneweighted_200_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_200_BH", [
570  Plot("distancetoseedcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
571 ], ncols=7)
572 
573 #300 um
574 _distancetoseedcell_perthickperlayer_eneweighted_300_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_300_EE", [
575  Plot("distancetoseedcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
576 ], ncols=7)
577 
578 _distancetoseedcell_perthickperlayer_eneweighted_300_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_300_FH", [
579  Plot("distancetoseedcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
580 ], ncols=7)
581 
582 _distancetoseedcell_perthickperlayer_eneweighted_300_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_300_BH", [
583  Plot("distancetoseedcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
584 ], ncols=7)
585 
586 #scint um
587 _distancetoseedcell_perthickperlayer_eneweighted_scint_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_Sci_EE", [
588  Plot("distancetoseedcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
589 ], ncols=7)
590 
591 _distancetoseedcell_perthickperlayer_eneweighted_scint_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_Sci_FH", [
592  Plot("distancetoseedcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
593 ], ncols=7)
594 
595 _distancetoseedcell_perthickperlayer_eneweighted_scint_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_Sci_BH", [
596  Plot("distancetoseedcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
597 ], ncols=7)
598 
599 #Coming back to the usual definition
600 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
601 
602 #--------------------------------------------------------------------------------------------
603 # z+
604 #--------------------------------------------------------------------------------------------
605 _totclusternum_layer_EE_zplus = PlotGroup("totclusternum_layer_EE", [
606  Plot("totclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
607 ], ncols=7)
608 
609 _totclusternum_layer_FH_zplus = PlotGroup("totclusternum_layer_FH", [
610  Plot("totclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
611 ], ncols=7)
612 
613 _totclusternum_layer_BH_zplus = PlotGroup("totclusternum_layer_BH", [
614  Plot("totclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
615 ], ncols=7)
616 
617 _totsimclusternum_layer_EE_zplus = PlotGroup("totsimclusternum_layer_EE_zplus", [
618  Plot("totsimclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
619 ], ncols=4)
620 
621 _totsimclusternum_layer_FH_zplus = PlotGroup("totsimclusternum_layer_FH_zplus", [
622  Plot("totsimclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
623 ], ncols=4)
624 
625 _totsimclusternum_layer_BH_zplus = PlotGroup("totsimclusternum_layer_BH_zplus", [
626  Plot("totsimclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
627 ], ncols=4)
628 
629 _energyclustered_perlayer_EE_zplus = PlotGroup("energyclustered_perlayer_EE", [
630  Plot("energyclustered_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
631 ], ncols=7)
632 
633 _energyclustered_perlayer_FH_zplus = PlotGroup("energyclustered_perlayer_FH", [
634  Plot("energyclustered_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
635 ], ncols=7)
636 
637 _energyclustered_perlayer_BH_zplus = PlotGroup("energyclustered_perlayer_BH", [
638  Plot("energyclustered_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
639 ], ncols=7)
640 
641 #----------------------------------------------------------------------------------------------------------------
642 #120 um
643 _cellsnum_perthick_perlayer_120_EE_zplus = PlotGroup("cellsnum_perthick_perlayer_120_EE", [
644  Plot("cellsnum_perthick_perlayer_120_{:02d}".format(i), xtitle="", **_common_cells) for i in range(maxlayerzm,lastLayerEEzp)
645 ], ncols=7)
646 
647 _cellsnum_perthick_perlayer_120_FH_zplus = PlotGroup("cellsnum_perthick_perlayer_120_FH", [
648  Plot("cellsnum_perthick_perlayer_120_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzp,lastLayerFHzp)
649 ], ncols=7)
650 _cellsnum_perthick_perlayer_120_BH_zplus = PlotGroup("cellsnum_perthick_perlayer_120_BH", [
651  Plot("cellsnum_perthick_perlayer_120_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzp,maxlayerzp)
652 ], ncols=7)
653 
654 #200 um
655 _cellsnum_perthick_perlayer_200_EE_zplus = PlotGroup("cellsnum_perthick_perlayer_200_EE", [
656  Plot("cellsnum_perthick_perlayer_200_{:02d}".format(i), xtitle="", **_common_cells) for i in range(maxlayerzm,lastLayerEEzp)
657 ], ncols=7)
658 
659 _cellsnum_perthick_perlayer_200_FH_zplus = PlotGroup("cellsnum_perthick_perlayer_200_FH", [
660  Plot("cellsnum_perthick_perlayer_200_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzp,lastLayerFHzp)
661 ], ncols=7)
662 
663 _cellsnum_perthick_perlayer_200_BH_zplus = PlotGroup("cellsnum_perthick_perlayer_200_BH", [
664  Plot("cellsnum_perthick_perlayer_200_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzp,maxlayerzp)
665 ], ncols=7)
666 #300 um
667 _cellsnum_perthick_perlayer_300_EE_zplus = PlotGroup("cellsnum_perthick_perlayer_300_EE", [
668  Plot("cellsnum_perthick_perlayer_300_{:02d}".format(i), xtitle="", **_common_cells) for i in range(maxlayerzm,lastLayerEEzp)
669 ], ncols=7)
670 
671 _cellsnum_perthick_perlayer_300_FH_zplus = PlotGroup("cellsnum_perthick_perlayer_300_FH", [
672  Plot("cellsnum_perthick_perlayer_300_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzp,lastLayerFHzp)
673 ], ncols=7)
674 _cellsnum_perthick_perlayer_300_BH_zplus = PlotGroup("cellsnum_perthick_perlayer_300_BH", [
675  Plot("cellsnum_perthick_perlayer_300_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzp,maxlayerzp)
676 ], ncols=7)
677 
678 #scint um
679 _cellsnum_perthick_perlayer_scint_EE_zplus = PlotGroup("cellsnum_perthick_perlayer_Sci_EE", [
680  Plot("cellsnum_perthick_perlayer_-1_{:02d}".format(i), xtitle="", **_common_cells) for i in range(maxlayerzm,lastLayerEEzp)
681 ], ncols=7)
682 
683 _cellsnum_perthick_perlayer_scint_FH_zplus = PlotGroup("cellsnum_perthick_perlayer_Sci_FH", [
684  Plot("cellsnum_perthick_perlayer_-1_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzp,lastLayerFHzp)
685 ], ncols=7)
686 
687 _cellsnum_perthick_perlayer_scint_BH_zplus = PlotGroup("cellsnum_perthick_perlayer_Sci_BH", [
688  Plot("cellsnum_perthick_perlayer_-1_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzp,maxlayerzp)
689 ], ncols=7)
690 
691 #----------------------------------------------------------------------------------------------------------------
692 #120 um
693 _common_distance = {}
694 _common_distance.update(_common)
695 _common_distance.update(_legend_common)
696 _common_distance["xmax"] = 150
697 _common_distance["stat"] = False
698 _common_distance["ymin"] = 1e-3
699 _common_distance["ymax"] = 10000
700 _common_distance["ylog"] = True
701 
702 _distancetomaxcell_perthickperlayer_120_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_120_EE", [
703  Plot("distancetomaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
704 ], ncols=7)
705 
706 _distancetomaxcell_perthickperlayer_120_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_120_FH", [
707  Plot("distancetomaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
708 ], ncols=7)
709 
710 _distancetomaxcell_perthickperlayer_120_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_120_BH", [
711  Plot("distancetomaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
712 ], ncols=7)
713 
714 #200 um
715 _distancetomaxcell_perthickperlayer_200_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_200_EE", [
716  Plot("distancetomaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
717 ], ncols=7)
718 
719 _distancetomaxcell_perthickperlayer_200_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_200_FH", [
720  Plot("distancetomaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
721 ], ncols=7)
722 
723 _distancetomaxcell_perthickperlayer_200_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_200_BH", [
724  Plot("distancetomaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
725 ], ncols=7)
726 
727 #300 um
728 _distancetomaxcell_perthickperlayer_300_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_300_EE", [
729  Plot("distancetomaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
730 ], ncols=7)
731 
732 _distancetomaxcell_perthickperlayer_300_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_300_FH", [
733  Plot("distancetomaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
734 ], ncols=7)
735 
736 _distancetomaxcell_perthickperlayer_300_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_300_BH", [
737  Plot("distancetomaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
738 ], ncols=7)
739 
740 #scint um
741 _distancetomaxcell_perthickperlayer_scint_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_Sci_EE", [
742  Plot("distancetomaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
743 ], ncols=7)
744 
745 _distancetomaxcell_perthickperlayer_scint_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_Sci_FH", [
746  Plot("distancetomaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
747 ], ncols=7)
748 
749 _distancetomaxcell_perthickperlayer_scint_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_Sci_BH", [
750  Plot("distancetomaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
751 ], ncols=7)
752 
753 #----------------------------------------------------------------------------------------------------------------
754 #120 um
755 _distancebetseedandmaxcell_perthickperlayer_120_EE_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_120_EE", [
756  Plot("distancebetseedandmaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
757 ], ncols=7)
758 
759 _distancebetseedandmaxcell_perthickperlayer_120_FH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_120_FH", [
760  Plot("distancebetseedandmaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
761 ], ncols=7)
762 
763 _distancebetseedandmaxcell_perthickperlayer_120_BH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_120_BH", [
764  Plot("distancebetseedandmaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
765 ], ncols=7)
766 
767 #200 um
768 _distancebetseedandmaxcell_perthickperlayer_200_EE_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_200_EE", [
769  Plot("distancebetseedandmaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
770 ], ncols=7)
771 
772 _distancebetseedandmaxcell_perthickperlayer_200_FH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_200_FH", [
773  Plot("distancebetseedandmaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
774 ], ncols=7)
775 
776 _distancebetseedandmaxcell_perthickperlayer_200_BH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_200_BH", [
777  Plot("distancebetseedandmaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
778 ], ncols=7)
779 
780 #300 um
781 _distancebetseedandmaxcell_perthickperlayer_300_EE_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_300_EE", [
782  Plot("distancebetseedandmaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
783 ], ncols=7)
784 
785 _distancebetseedandmaxcell_perthickperlayer_300_FH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_300_FH", [
786  Plot("distancebetseedandmaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
787 ], ncols=7)
788 
789 _distancebetseedandmaxcell_perthickperlayer_300_BH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_300_BH", [
790  Plot("distancebetseedandmaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
791 ], ncols=7)
792 
793 #scint um
794 _distancebetseedandmaxcell_perthickperlayer_scint_EE_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_Sci_EE", [
795  Plot("distancebetseedandmaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
796 ], ncols=7)
797 
798 _distancebetseedandmaxcell_perthickperlayer_scint_FH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_Sci_FH", [
799  Plot("distancebetseedandmaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
800 ], ncols=7)
801 
802 _distancebetseedandmaxcell_perthickperlayer_scint_BH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_Sci_BH", [
803  Plot("distancebetseedandmaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
804 ], ncols=7)
805 
806 #----------------------------------------------------------------------------------------------------------------
807 #120 um
808 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_EE_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_EE", [
809  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
810 ], ncols=7)
811 
812 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_FH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_FH", [
813  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
814 ], ncols=7)
815 
816 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_BH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_BH", [
817  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
818 ], ncols=7)
819 
820 #200 um
821 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_EE_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_EE", [
822  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
823 ], ncols=7)
824 
825 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_FH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_FH", [
826  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
827 ], ncols=7)
828 
829 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_BH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_BH", [
830  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
831 ], ncols=7)
832 
833 #300 um
834 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_EE_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_EE", [
835  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
836 ], ncols=7)
837 
838 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_FH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_FH", [
839  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
840 ], ncols=7)
841 
842 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH", [
843  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
844 ], ncols=7)
845 
846 #scint um
847 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_EE_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_Sci_EE", [
848  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
849 ], ncols=7)
850 
851 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_FH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_Sci_FH", [
852  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
853 ], ncols=7)
854 
855 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_BH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_Sci_BH", [
856  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
857 ], ncols=7)
858 
859 
860 #----------------------------------------------------------------------------------------------------------------
861 #120 um
862 _distancetoseedcell_perthickperlayer_120_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_120_EE", [
863  Plot("distancetoseedcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
864 ], ncols=7)
865 
866 _distancetoseedcell_perthickperlayer_120_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_120_FH", [
867  Plot("distancetoseedcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
868 ], ncols=7)
869 
870 _distancetoseedcell_perthickperlayer_120_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_120_BH", [
871  Plot("distancetoseedcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
872 ], ncols=7)
873 
874 #200 um
875 _distancetoseedcell_perthickperlayer_200_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_200_EE", [
876  Plot("distancetoseedcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
877 ], ncols=7)
878 
879 _distancetoseedcell_perthickperlayer_200_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_200_FH", [
880  Plot("distancetoseedcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
881 ], ncols=7)
882 
883 _distancetoseedcell_perthickperlayer_200_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_200_BH", [
884  Plot("distancetoseedcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
885 ], ncols=7)
886 
887 #300 um
888 _distancetoseedcell_perthickperlayer_300_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_300_EE", [
889  Plot("distancetoseedcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
890 ], ncols=7)
891 
892 _distancetoseedcell_perthickperlayer_300_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_300_FH", [
893  Plot("distancetoseedcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
894 ], ncols=7)
895 
896 _distancetoseedcell_perthickperlayer_300_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_300_BH", [
897  Plot("distancetoseedcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
898 ], ncols=7)
899 
900 #scint um
901 _distancetoseedcell_perthickperlayer_scint_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_Sci_EE", [
902  Plot("distancetoseedcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
903 ], ncols=7)
904 
905 _distancetoseedcell_perthickperlayer_scint_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_Sci_FH", [
906  Plot("distancetoseedcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
907 ], ncols=7)
908 
909 _distancetoseedcell_perthickperlayer_scint_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_Sci_BH", [
910  Plot("distancetoseedcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
911 ], ncols=7)
912 
913 #=====================================================================================================================
914 #----------------------------------------------------------------------------------------------------------------
915 #We need points for the weighted plots
916 _common = {"stat": True, "drawStyle": "EP", "staty": 0.65 }
917 
918 #120 um
919 _distancetomaxcell_perthickperlayer_eneweighted_120_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_120_EE", [
920  Plot("distancetomaxcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
921 ], ncols=7)
922 
923 _distancetomaxcell_perthickperlayer_eneweighted_120_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_120_FH", [
924  Plot("distancetomaxcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
925 ], ncols=7)
926 
927 _distancetomaxcell_perthickperlayer_eneweighted_120_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_120_BH", [
928  Plot("distancetomaxcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
929 ], ncols=7)
930 
931 #200 um
932 _distancetomaxcell_perthickperlayer_eneweighted_200_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_200_EE", [
933  Plot("distancetomaxcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
934 ], ncols=7)
935 _distancetomaxcell_perthickperlayer_eneweighted_200_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_200_FH", [
936  Plot("distancetomaxcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
937 ], ncols=7)
938 
939 _distancetomaxcell_perthickperlayer_eneweighted_200_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_200_BH", [
940  Plot("distancetomaxcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
941 ], ncols=7)
942 
943 #300 um
944 _distancetomaxcell_perthickperlayer_eneweighted_300_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_300_EE", [
945  Plot("distancetomaxcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
946 ], ncols=7)
947 
948 _distancetomaxcell_perthickperlayer_eneweighted_300_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_300_FH", [
949  Plot("distancetomaxcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
950 ], ncols=7)
951 
952 _distancetomaxcell_perthickperlayer_eneweighted_300_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_300_BH", [
953  Plot("distancetomaxcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
954 ], ncols=7)
955 
956 #scint um
957 _distancetomaxcell_perthickperlayer_eneweighted_scint_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_Sci_EE", [
958  Plot("distancetomaxcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
959 ], ncols=7)
960 
961 _distancetomaxcell_perthickperlayer_eneweighted_scint_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_Sci_FH", [
962  Plot("distancetomaxcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
963 ], ncols=7)
964 
965 _distancetomaxcell_perthickperlayer_eneweighted_scint_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_Sci_BH", [
966  Plot("distancetomaxcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
967 ], ncols=7)
968 
969 #----------------------------------------------------------------------------------------------------------------
970 #120 um
971 _distancetoseedcell_perthickperlayer_eneweighted_120_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_120_EE", [
972  Plot("distancetoseedcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
973 ], ncols=7)
974 
975 _distancetoseedcell_perthickperlayer_eneweighted_120_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_120_FH", [
976  Plot("distancetoseedcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
977 ], ncols=7)
978 
979 _distancetoseedcell_perthickperlayer_eneweighted_120_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_120_BH", [
980  Plot("distancetoseedcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
981 ], ncols=7)
982 
983 #200 um
984 _distancetoseedcell_perthickperlayer_eneweighted_200_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_200_EE", [
985  Plot("distancetoseedcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
986 ], ncols=7)
987 
988 _distancetoseedcell_perthickperlayer_eneweighted_200_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_200_FH", [
989  Plot("distancetoseedcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
990 ], ncols=7)
991 
992 _distancetoseedcell_perthickperlayer_eneweighted_200_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_200_BH", [
993  Plot("distancetoseedcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
994 ], ncols=7)
995 
996 #300 um
997 _distancetoseedcell_perthickperlayer_eneweighted_300_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_300_EE", [
998  Plot("distancetoseedcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
999 ], ncols=7)
1000 
1001 _distancetoseedcell_perthickperlayer_eneweighted_300_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_300_FH", [
1002  Plot("distancetoseedcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
1003 ], ncols=7)
1004 
1005 _distancetoseedcell_perthickperlayer_eneweighted_300_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_300_BH", [
1006  Plot("distancetoseedcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
1007 ], ncols=7)
1008 
1009 #scint um
1010 _distancetoseedcell_perthickperlayer_eneweighted_scint_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_Sci_EE", [
1011  Plot("distancetoseedcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
1012 ], ncols=7)
1013 
1014 _distancetoseedcell_perthickperlayer_eneweighted_scint_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_Sci_FH", [
1015  Plot("distancetoseedcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
1016 ], ncols=7)
1017 
1018 _distancetoseedcell_perthickperlayer_eneweighted_scint_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_Sci_BH", [
1019  Plot("distancetoseedcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
1020 ], ncols=7)
1021 #Just in case we add some plots below to be on the safe side.
1022 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
1023 
1024 #--------------------------------------------------------------------------------------------
1025 # z-
1026 #--------------------------------------------------------------------------------------------
1027 
1028 _common_score = {"title": "Score CaloParticle to LayerClusters in z-",
1029  "stat": False,
1030  "ymin": 0.1,
1031  "ymax": 1000,
1032  "xmin": 0,
1033  "xmax": 1,
1034  "drawStyle": "hist",
1035  "lineWidth": 1,
1036  "ylog": True
1037  }
1038 _common_score.update(_legend_common)
1039 _score_caloparticle_to_layerclusters_zminus = PlotGroup("score_caloparticle_to_layercluster", [
1040  Plot("Score_caloparticle2layercl_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_score) for i in range(0,maxlayerzm)
1041  ], ncols=10 )
1042 
1043 _common_score = {"title": "Score LayerCluster to CaloParticles in z-",
1044  "stat": False,
1045  "ymin": 0.1,
1046  "ymax": 1000,
1047  "xmin": 0,
1048  "xmax": 1,
1049  "drawStyle": "hist",
1050  "lineWidth": 1,
1051  "ylog": True
1052  }
1053 _common_score.update(_legend_common)
1054 _score_layercluster_to_caloparticles_zminus = PlotGroup("score_layercluster_to_caloparticle", [
1055  Plot("Score_layercl2caloparticle_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_score) for i in range(0,maxlayerzm)
1056  ], ncols=8 )
1057 
1058 _common_shared= {"title": "Shared Energy CaloParticle To Layer Cluster in z-",
1059  "stat": False,
1060  "legend": False,
1061  }
1062 _common_shared.update(_legend_common)
1063 _shared_plots_zminus = [Plot("SharedEnergy_caloparticle2layercl_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(0,maxlayerzm)]
1064 _shared_plots_zminus.extend([Plot("SharedEnergy_caloparticle2layercl_vs_eta_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(0,maxlayerzm)])
1065 _shared_plots_zminus.extend([Plot("SharedEnergy_caloparticle2layercl_vs_phi_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(0,maxlayerzm)])
1066 _sharedEnergy_caloparticle_to_layercluster_zminus = PlotGroup("sharedEnergy_caloparticle_to_layercluster", _shared_plots_zminus, ncols=8)
1067 
1068 _common_shared= {"title": "Shared Energy Layer Cluster To CaloParticle in z-",
1069  "stat": False,
1070  "legend": False,
1071  }
1072 _common_shared.update(_legend_common)
1073 _shared_plots2_zminus = [Plot("SharedEnergy_layercluster2caloparticle_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(0,maxlayerzm)]
1074 _common_shared= {"title": "Shared Energy Layer Cluster To Best CaloParticle in z-",
1075  "stat": False,
1076  "legend": False,
1077  "ymin": 0,
1078  "ymax": 1
1079  }
1080 _common_shared.update(_legend_common)
1081 _shared_plots2_zminus.extend([Plot("SharedEnergy_layercl2caloparticle_vs_eta_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(0,maxlayerzm)])
1082 _shared_plots2_zminus.extend([Plot("SharedEnergy_layercl2caloparticle_vs_phi_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(0,maxlayerzm)])
1083 _sharedEnergy_layercluster_to_caloparticle_zminus = PlotGroup("sharedEnergy_layercluster_to_caloparticle", _shared_plots2_zminus, ncols=8)
1084 
1085 
1086 _common_assoc = {#"title": "Cell Association Table in z-",
1087  "stat": False,
1088  "legend": False,
1089  "xbinlabels": ["", "TN(pur)", "FN(ineff.)", "FP(fake)", "TP(eff)"],
1090  "xbinlabeloption": "h",
1091  "drawStyle": "hist",
1092  "ymin": 0.1,
1093  "ymax": 10000,
1094  "ylog": True}
1095 _common_assoc.update(_legend_common)
1096 _cell_association_table_zminus = PlotGroup("cellAssociation_table", [
1097  Plot("cellAssociation_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_assoc) for i in range(0,maxlayerzm)
1098  ], ncols=8 )
1099 
1100 _bin_count = 0
1101 _xbinlabels = [ "{:02d}".format(i+1) for i in range(0,maxlayerzm) ]
1102 _xtitle = "Layer Numbers in z-"
1103 _common_eff = {"stat": False, "legend": False, "ymin": 0.0, "ymax": 1.1, "xbinlabeloption": "d"}
1104 _effplots_zminus_eta = [Plot("effic_eta_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(0,maxlayerzm)]
1105 _effplots_zminus_phi = [Plot("effic_phi_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(0,maxlayerzm)]
1106 _common_eff = {"stat": False, "legend": False, "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1107 _common_eff["xmin"] = _bin_count
1108 _common_eff["xmax"] = maxlayerzm
1109 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1110 _effplots_zminus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Efficiency", **_common_eff)]
1111 _efficiencies_zminus_eta = PlotGroup("Efficiencies_vs_eta", _effplots_zminus_eta, ncols=10)
1112 _efficiencies_zminus_phi = PlotGroup("Efficiencies_vs_phi", _effplots_zminus_phi, ncols=10)
1113 _efficiencies_zminus = PlotGroup("Efficiencies_vs_layer", _effplots_zminus, ncols=1)
1114 
1115 _common_dup = {"stat": False, "legend": False, "ymin":0.0, "ymax":1.1}
1116 _dupplots_zminus_eta = [Plot("duplicate_eta_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(0,maxlayerzm)]
1117 _dupplots_zminus_phi = [Plot("duplicate_phi_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(0,maxlayerzm)]
1118 _common_dup = {"stat": False, "legend": False, "title": "Global Duplicates in z-", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1119 _common_dup["xmin"] = _bin_count
1120 _common_dup["xmax"] = _common_dup["xmin"] + maxlayerzm
1121 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1122 _dupplots_zminus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Duplicates", **_common_dup)]
1123 _duplicates_zminus_eta = PlotGroup("Duplicates_vs_eta", _dupplots_zminus_eta, ncols=10)
1124 _duplicates_zminus_phi = PlotGroup("Duplicates_vs_phi", _dupplots_zminus_phi, ncols=10)
1125 _duplicates_zminus = PlotGroup("Duplicates_vs_layer", _dupplots_zminus, ncols=1)
1126 
1127 _common_fake = {"stat": False, "legend": False, "ymin":0.0, "ymax":1.1}
1128 _fakeplots_zminus_eta = [Plot("fake_eta_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(0,maxlayerzm)]
1129 _fakeplots_zminus_phi = [Plot("fake_phi_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(0,maxlayerzm)]
1130 _common_fake = {"stat": False, "legend": False, "title": "Global Fake Rates in z-", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1131 _common_fake["xmin"] = _bin_count
1132 _common_fake["xmax"] = _common_fake["xmin"] + maxlayerzm
1133 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1134 _common_fake["xbinlabelsize"] = 10.
1135 _fakeplots_zminus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Fake Rate", **_common_fake)]
1136 _fakes_zminus_eta = PlotGroup("FakeRate_vs_eta", _fakeplots_zminus_eta, ncols=10)
1137 _fakes_zminus_phi = PlotGroup("FakeRate_vs_phi", _fakeplots_zminus_phi, ncols=10)
1138 _fakes_zminus = PlotGroup("FakeRate_vs_layer", _fakeplots_zminus, ncols=1)
1139 
1140 _common_merge = {"stat": False, "legend": False, "ymin":0.0, "ymax":1.1}
1141 _mergeplots_zminus_eta = [Plot("merge_eta_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(0,maxlayerzm)]
1142 _mergeplots_zminus_phi = [Plot("merge_phi_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(0,maxlayerzm)]
1143 _common_merge = {"stat": False, "legend": False, "title": "Global Merge Rates in z-", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1144 _common_merge["xmin"] = _bin_count
1145 _common_merge["xmax"] = _common_merge["xmin"] + maxlayerzm
1146 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1147 _common_merge["xbinlabelsize"] = 10.
1148 _mergeplots_zminus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Merge Rate", **_common_merge)]
1149 _merges_zminus_eta = PlotGroup("MergeRate_vs_eta", _mergeplots_zminus_eta, ncols=10)
1150 _merges_zminus_phi = PlotGroup("MergeRate_vs_phi", _mergeplots_zminus_phi, ncols=10)
1151 _merges_zminus = PlotGroup("MergeRate_vs_layer", _mergeplots_zminus, ncols=1)
1152 
1153 
1154 _common_energy_score = dict(removeEmptyBins=False, xbinlabelsize=10,
1155  stat=True,
1156  xbinlabeloption="d",
1157  ncols=1,
1158  xmin=0.001,
1159  xmax=1.,
1160  ymin=0.01,
1161  ymax=1.)
1162 _energyscore_cp2lc_zminus = PlotGroup("Energy_vs_Score_CP2LC", [Plot("Energy_vs_Score_caloparticle2layer_perlayer{:02d}".format(i), title="Energy_vs_Score_CP2LC",
1163  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(0, maxlayerzm)
1164  ], ncols=10)
1165 
1166 _energyscore_cp2lc_zplus = PlotGroup("Energy_vs_Score_CP2LC", [Plot("Energy_vs_Score_caloparticle2layer_perlayer{:02d}".format(i), title="Energy_vs_Score_CP2LC",
1167  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(maxlayerzm,maxlayerzp)
1168  ], ncols=10)
1169 _common_energy_score["xmin"]=-0.1
1170 _energyscore_lc2cp_zminus = PlotGroup("Energy_vs_Score_LC2CP", [Plot("Energy_vs_Score_layer2caloparticle_perlayer{:02d}".format(i), title="Energy_vs_Score_LC2CP",
1171  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(0, maxlayerzm)
1172  ], ncols=10)
1173 _energyscore_lc2cp_zplus = PlotGroup("Energy_vs_Score_LC2CP", [Plot("Energy_vs_Score_layer2caloparticle_perlayer{:02d}".format(i), title="Energy_vs_Score_LC2CP",
1174  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(maxlayerzm,maxlayerzp)
1175  ], ncols=10)
1176 
1177 #--------------------------------------------------------------------------------------------
1178 # z+
1179 #--------------------------------------------------------------------------------------------
1180 _common_score = {"title": "Score CaloParticle to LayerClusters in z+",
1181  "stat": False,
1182  "ymin": 0.1,
1183  "ymax": 1000,
1184  "xmin": 0,
1185  "xmax": 1,
1186  "drawStyle": "hist",
1187  "lineWidth": 1,
1188  "ylog": True
1189  }
1190 _common_score.update(_legend_common)
1191 _score_caloparticle_to_layerclusters_zplus = PlotGroup("score_caloparticle_to_layercluster", [
1192  Plot("Score_caloparticle2layercl_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_score) for i in range(maxlayerzm,maxlayerzp)
1193  ], ncols=10 )
1194 
1195 _common_score = {"title": "Score LayerCluster to CaloParticles in z+",
1196  "stat": False,
1197  "ymin": 0.1,
1198  "ymax": 1000,
1199  "xmin": 0,
1200  "xmax": 1,
1201  "drawStyle": "hist",
1202  "lineWidth": 1,
1203  "ylog": True
1204  }
1205 _common_score.update(_legend_common)
1206 _score_layercluster_to_caloparticles_zplus = PlotGroup("score_layercluster_to_caloparticle", [
1207  Plot("Score_layercl2caloparticle_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_score) for i in range(maxlayerzm,maxlayerzp)
1208  ], ncols=8 )
1209 
1210 _common_shared= {"title": "Shared Energy CaloParticle To Layer Cluster in z+",
1211  "stat": False,
1212  "legend": False,
1213  }
1214 _common_shared.update(_legend_common)
1215 _shared_plots_zplus = [Plot("SharedEnergy_caloparticle2layercl_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(maxlayerzm,maxlayerzp)]
1216 _shared_plots_zplus.extend([Plot("SharedEnergy_caloparticle2layercl_vs_eta_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(maxlayerzm,maxlayerzp)])
1217 _shared_plots_zplus.extend([Plot("SharedEnergy_caloparticle2layercl_vs_phi_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(maxlayerzm,maxlayerzp)])
1218 _sharedEnergy_caloparticle_to_layercluster_zplus = PlotGroup("sharedEnergy_caloparticle_to_layercluster", _shared_plots_zplus, ncols=8)
1219 
1220 _common_shared= {"title": "Shared Energy Layer Cluster To CaloParticle in z+",
1221  "stat": False,
1222  "legend": False,
1223  }
1224 _common_shared.update(_legend_common)
1225 _shared_plots2_zplus = [Plot("SharedEnergy_layercluster2caloparticle_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(maxlayerzm,maxlayerzp)]
1226 _common_shared= {"title": "Shared Energy Layer Cluster To Best CaloParticle in z+",
1227  "stat": False,
1228  "legend": False,
1229  "ymin": 0,
1230  "ymax": 1,
1231  }
1232 _common_shared.update(_legend_common)
1233 _shared_plots2_zplus.extend([Plot("SharedEnergy_layercl2caloparticle_vs_eta_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(maxlayerzm,maxlayerzp)])
1234 _shared_plots2_zplus.extend([Plot("SharedEnergy_layercl2caloparticle_vs_phi_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(maxlayerzm,maxlayerzp)])
1235 _sharedEnergy_layercluster_to_caloparticle_zplus = PlotGroup("sharedEnergy_layercluster_to_caloparticle", _shared_plots2_zplus, ncols=8)
1236 
1237 
1238 _common_assoc = {#"title": "Cell Association Table in z+",
1239  "stat": False,
1240  "legend": False,
1241  "xbinlabels": ["", "TN(pur)", "FN(ineff.)", "FP(fake)", "TP(eff)"],
1242  "xbinlabeloption": "h",
1243  "drawStyle": "hist",
1244  "ymin": 0.1,
1245  "ymax": 10000,
1246  "ylog": True}
1247 _common_assoc.update(_legend_common)
1248 _cell_association_table_zplus = PlotGroup("cellAssociation_table", [
1249  Plot("cellAssociation_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_assoc) for i in range(maxlayerzm,maxlayerzp)
1250  ], ncols=8 )
1251 
1252 
1253 _bin_count = 50
1254 _xtitle = "Layer Numbers in z+"
1255 _common_eff = {"stat": False, "legend": False, "ymin":0.0, "ymax":1.1}
1256 _effplots_zplus_eta = [Plot("effic_eta_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(maxlayerzm,maxlayerzp)]
1257 _effplots_zplus_phi = [Plot("effic_phi_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(maxlayerzm,maxlayerzp)]
1258 _common_eff = {"stat": False, "legend": False, "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1259 _common_eff["xmin"] = _bin_count
1260 _common_eff["xmax"] = _common_eff["xmin"] + maxlayerzm
1261 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1262 _effplots_zplus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Efficiency", **_common_eff)]
1263 _efficiencies_zplus_eta = PlotGroup("Efficiencies_vs_eta", _effplots_zplus_eta, ncols=10)
1264 _efficiencies_zplus_phi = PlotGroup("Efficiencies_vs_phi", _effplots_zplus_phi, ncols=10)
1265 _efficiencies_zplus = PlotGroup("Efficiencies_vs_layer", _effplots_zplus, ncols=1)
1266 
1267 _common_dup = {"stat": False, "legend": False, "ymin": 0.0, "ymax": 1.1}
1268 _dupplots_zplus_eta = [Plot("duplicate_eta_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(maxlayerzm,maxlayerzp)]
1269 _dupplots_zplus_phi = [Plot("duplicate_phi_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(maxlayerzm,maxlayerzp)]
1270 _common_dup = {"stat": False, "legend": False, "title": "Global Duplicates in z+", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1271 _common_dup["xmin"] = _bin_count
1272 _common_dup["xmax"] = _common_dup["xmin"] + maxlayerzm
1273 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1274 _dupplots_zplus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Duplicates", **_common_dup)]
1275 _duplicates_zplus_eta = PlotGroup("Duplicates_vs_eta", _dupplots_zplus_eta, ncols=10)
1276 _duplicates_zplus_phi = PlotGroup("Duplicates_vs_phi", _dupplots_zplus_phi, ncols=10)
1277 _duplicates_zplus = PlotGroup("Duplicates_vs_layer", _dupplots_zplus, ncols=1)
1278 
1279 _common_fake = {"stat": False, "legend": False, "ymin": 0.0, "ymax": 1.1}
1280 _fakeplots_zplus_eta = [Plot("fake_eta_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(maxlayerzm,maxlayerzp)]
1281 _fakeplots_zplus_phi = [Plot("fake_phi_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(maxlayerzm,maxlayerzp)]
1282 _common_fake = {"stat": False, "legend": False, "title": "Global Fake Rates in z+", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1283 _common_fake["xmin"] = _bin_count
1284 _common_fake["xmax"] = _common_fake["xmin"] + maxlayerzm
1285 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1286 _fakeplots_zplus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Fake Rate", **_common_fake)]
1287 _fakes_zplus_eta = PlotGroup("FakeRate_vs_eta", _fakeplots_zplus_eta, ncols=10)
1288 _fakes_zplus_phi = PlotGroup("FakeRate_vs_phi", _fakeplots_zplus_phi, ncols=10)
1289 _fakes_zplus = PlotGroup("FakeRate_vs_layer", _fakeplots_zplus, ncols=1)
1290 
1291 _common_merge = {"stat": False, "legend": False, "ymin": 0.0, "ymax": 1.1}
1292 _mergeplots_zplus_eta = [Plot("merge_eta_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(maxlayerzm,maxlayerzp)]
1293 _mergeplots_zplus_phi = [Plot("merge_phi_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(maxlayerzm,maxlayerzp)]
1294 _common_merge = {"stat": False, "legend": False, "title": "Global Merge Rates in z+", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1295 _common_merge["xmin"] = _bin_count
1296 _common_merge["xmax"] = _common_merge["xmin"] + maxlayerzm
1297 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1298 _mergeplots_zplus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Merge Rate", **_common_merge)]
1299 _merges_zplus_eta = PlotGroup("MergeRate_vs_eta", _mergeplots_zplus_eta, ncols=10)
1300 _merges_zplus_phi = PlotGroup("MergeRate_vs_phi", _mergeplots_zplus_phi, ncols=10)
1301 _merges_zplus = PlotGroup("MergeRate_vs_layer", _mergeplots_zplus, ncols=1)
1302 
1303 #--------------------------------------------------------------------------------------------
1304 # SIMCLUSTERS
1305 #--------------------------------------------------------------------------------------------
1306 
1307 _common_sc_score = {"title": "Score SimCluster to LayerClusters in z-",
1308  "stat": False,
1309  "ymin": 0.1,
1310  "ymax": 10**6,
1311  "xmin": 0,
1312  "xmax": 1,
1313  "drawStyle": "hist",
1314  "lineWidth": 1,
1315  "ylog": True
1316  }
1317 _common_sc_score.update(_legend_common)
1318 _score_simcluster_to_layerclusters_zminus = PlotGroup("score_simcluster_to_layercluster_zminus", [
1319  Plot("Score_simcluster2layercl_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_score) for i in range(0,maxlayerzm)
1320  ], ncols=10 )
1321 
1322 _common_sc_score = {"title": "Score LayerCluster to SimClusters in z-",
1323  "stat": False,
1324  "ymin": 0.1,
1325  "ymax": 10**6,
1326  "xmin": 0,
1327  "xmax": 1,
1328  "drawStyle": "hist",
1329  "lineWidth": 1,
1330  "ylog": True
1331  }
1332 _common_sc_score.update(_legend_common)
1333 _score_layercluster_to_simclusters_zminus = PlotGroup("score_layercluster_to_simcluster_zminus", [
1334  Plot("Score_layercl2simcluster_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_score) for i in range(0,maxlayerzm)
1335  ], ncols=8 )
1336 
1337 _common_sc_shared= {"title": "Shared Energy SimCluster To Layer Cluster in z-",
1338  "stat": False,
1339  "legend": False,
1340  }
1341 _common_sc_shared.update(_legend_common)
1342 _shared_sc_plots_zminus = [Plot("SharedEnergy_simcluster2layercl_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(0,maxlayerzm)]
1343 _shared_sc_plots_zminus.extend([Plot("SharedEnergy_simcluster2layercl_vs_eta_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(0,maxlayerzm)])
1344 _shared_sc_plots_zminus.extend([Plot("SharedEnergy_simcluster2layercl_vs_phi_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(0,maxlayerzm)])
1345 _sharedEnergy_simcluster_to_layercluster_zminus = PlotGroup("sharedEnergy_simcluster_to_layercluster_zminus", _shared_sc_plots_zminus, ncols=8)
1346 
1347 _common_sc_shared= {"title": "Shared Energy Layer Cluster To SimCluster in z-",
1348  "stat": False,
1349  "legend": False,
1350  }
1351 _common_sc_shared.update(_legend_common)
1352 _shared_plots2_sc_zminus = [Plot("SharedEnergy_layercluster2simcluster_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(0,maxlayerzm)]
1353 _common_sc_shared= {"title": "Shared Energy Layer Cluster To Best SimCluster in z-",
1354  "stat": False,
1355  "legend": False,
1356  "ymin": 0,
1357  "ymax": 1
1358  }
1359 _common_sc_shared.update(_legend_common)
1360 _shared_plots2_sc_zminus.extend([Plot("SharedEnergy_layercl2simcluster_vs_eta_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(0,maxlayerzm)])
1361 _shared_plots2_sc_zminus.extend([Plot("SharedEnergy_layercl2simcluster_vs_phi_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(0,maxlayerzm)])
1362 _sharedEnergy_layercluster_to_simcluster_zminus = PlotGroup("sharedEnergy_layercluster_to_simcluster_zminus", _shared_plots2_sc_zminus, ncols=8)
1363 
1364 _bin_count = 0
1365 _xbinlabels = [ "L{:02d}".format(i+1) for i in range(0,maxlayerzm) ]
1366 _common_eff = {"stat": False, "legend": False}
1367 _effplots_sc_zminus_eta = [Plot("effic_eta_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(0,maxlayerzm)]
1368 _effplots_sc_zminus_phi = [Plot("effic_phi_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(0,maxlayerzm)]
1369 _common_eff = {"stat": False, "legend": False, "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1370 _common_eff["xmin"] = _bin_count
1371 _common_eff["xmax"] = maxlayerzm
1372 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1373 _effplots_sc_zminus = [Plot("globalEfficiencies_zminus", xtitle="Global Efficiencies in z-", **_common_eff)]
1374 _efficiencies_sc_zminus_eta = PlotGroup("Efficiencies_vs_eta_zminus", _effplots_sc_zminus_eta, ncols=10)
1375 _efficiencies_sc_zminus_phi = PlotGroup("Efficiencies_vs_phi_zminus", _effplots_sc_zminus_phi, ncols=10)
1376 _efficiencies_sc_zminus = PlotGroup("Eff_Dup_Fake_Merge_Global_zminus", _effplots_sc_zminus, ncols=4)
1377 
1378 _common_dup = {"stat": False, "legend": False}
1379 _dupplots_sc_zminus_eta = [Plot("duplicate_eta_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(0,maxlayerzm)]
1380 _dupplots_sc_zminus_phi = [Plot("duplicate_phi_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(0,maxlayerzm)]
1381 _common_dup = {"stat": False, "legend": False, "title": "Global Duplicates in z-", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1382 _common_dup["xmin"] = _bin_count
1383 _common_dup["xmax"] = _common_dup["xmin"] + maxlayerzm
1384 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1385 _dupplots_sc_zminus = [Plot("globalDublicates_zminus", xtitle="Global Duplicates in z-", **_common_dup)]
1386 _duplicates_sc_zminus_eta = PlotGroup("Duplicates_vs_eta_zminus", _dupplots_sc_zminus_eta, ncols=10)
1387 _duplicates_sc_zminus_phi = PlotGroup("Duplicates_vs_phi_zminus", _dupplots_sc_zminus_phi, ncols=10)
1388 _duplicates_sc_zminus = PlotGroup("Eff_Dup_Fake_Merge_Global_zminus", _dupplots_sc_zminus, ncols=4)
1389 
1390 _common_fake = {"stat": False, "legend": False}
1391 _fakeplots_sc_zminus_eta = [Plot("fake_eta_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(0,maxlayerzm)]
1392 _fakeplots_sc_zminus_phi = [Plot("fake_phi_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(0,maxlayerzm)]
1393 _common_fake = {"stat": False, "legend": False, "title": "Global Fake Rates in z-", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1394 _common_fake["xmin"] = _bin_count
1395 _common_fake["xmax"] = _common_fake["xmin"] + maxlayerzm
1396 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1397 _common_fake["xbinlabels"] = [ "L{:02d}".format(i+1) for i in range(0,maxlayerzm) ]
1398 _common_fake["xbinlabelsize"] = 10.
1399 _fakeplots_sc_zminus = [Plot("globalFakes_zminus", xtitle="Global Fake Rate in z-", **_common_fake)]
1400 _fakes_sc_zminus_eta = PlotGroup("FakeRate_vs_eta_zminus", _fakeplots_sc_zminus_eta, ncols=10)
1401 _fakes_sc_zminus_phi = PlotGroup("FakeRate_vs_phi_zminus", _fakeplots_sc_zminus_phi, ncols=10)
1402 _fakes_sc_zminus = PlotGroup("Eff_Dup_Fake_Merge_Global_zminus", _fakeplots_sc_zminus, ncols=4)
1403 
1404 _common_merge = {"stat": False, "legend": False}
1405 _mergeplots_sc_zminus_eta = [Plot("merge_eta_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(0,maxlayerzm)]
1406 _mergeplots_sc_zminus_phi = [Plot("merge_phi_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(0,maxlayerzm)]
1407 _common_merge = {"stat": False, "legend": False, "title": "Global Merge Rates in z-", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1408 _common_merge["xmin"] = _bin_count
1409 _common_merge["xmax"] = _common_merge["xmin"] + maxlayerzm
1410 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1411 _common_merge["xbinlabels"] = [ "L{:02d}".format(i+1) for i in range(0,maxlayerzm) ]
1412 _common_merge["xbinlabelsize"] = 10.
1413 _mergeplots_sc_zminus = [Plot("globalMergeRate_zminus", xtitle="Global merge Rate in z-", **_common_merge)]
1414 _merges_sc_zminus_eta = PlotGroup("MergeRate_vs_eta_zminus", _mergeplots_sc_zminus_eta, ncols=10)
1415 _merges_sc_zminus_phi = PlotGroup("MergeRate_vs_phi_zminus", _mergeplots_sc_zminus_phi, ncols=10)
1416 _merges_sc_zminus = PlotGroup("Eff_Dup_Fake_Merge_Global_zminus", _mergeplots_sc_zminus, ncols=4)
1417 
1418 _common_energy_score = dict(removeEmptyBins=False, xbinlabelsize=10,
1419  stat=True,
1420  xbinlabeloption="d",
1421  ncols=1,
1422  ylog=True,
1423  xlog=True,
1424  xmin=0.001,
1425  xmax=1.,
1426  ymin=0.01,
1427  ymax=1.)
1428 _energyscore_sc2lc_zminus = PlotGroup("Energy_vs_Score_SC2LC_zminus", [Plot("Energy_vs_Score_simcluster2layer_perlayer{:02d}".format(i), title="Energy_vs_Score_SC2LC",
1429  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(0, maxlayerzm)
1430  ], ncols=10)
1431 
1432 _energyscore_sc2lc_zplus = PlotGroup("Energy_vs_Score_SC2LC_zplus", [Plot("Energy_vs_Score_simcluster2layer_perlayer{:02d}".format(i), title="Energy_vs_Score_SC2LC",
1433  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(maxlayerzm,maxlayerzp)
1434  ], ncols=10)
1435 
1436 _common_energy_score["xlog"]=False
1437 _common_energy_score["ylog"]=False
1438 _common_energy_score["xmin"]=-0.1
1439 _energyscore_lc2sc_zminus = PlotGroup("Energy_vs_Score_LC2SC_zminus", [Plot("Energy_vs_Score_layer2simcluster_perlayer{:02d}".format(i), title="Energy_vs_Score_LC2SC",
1440  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(0, maxlayerzm)
1441  ], ncols=10)
1442 _energyscore_lc2sc_zplus = PlotGroup("Energy_vs_Score_LC2SC_zplus", [Plot("Energy_vs_Score_layer2simcluster_perlayer{:02d}".format(i), title="Energy_vs_Score_LC2SC",
1443  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(maxlayerzm,maxlayerzp)
1444  ], ncols=10)
1445 
1446 #--------------------------------------------------------------------------------------------
1447 # z+
1448 #--------------------------------------------------------------------------------------------
1449 _common_sc_score = {"title": "Score SimCluster to LayerClusters in z+",
1450  "stat": False,
1451  "ymin": 0.1,
1452  "ymax": 1000,
1453  "xmin": 0,
1454  "xmax": 1,
1455  "drawStyle": "hist",
1456  "lineWidth": 1,
1457  "ylog": True
1458  }
1459 _common_sc_score.update(_legend_common)
1460 _score_simcluster_to_layerclusters_zplus = PlotGroup("score_simcluster_to_layercluster_zplus", [
1461  Plot("Score_simcluster2layercl_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_score) for i in range(maxlayerzm,maxlayerzp)
1462  ], ncols=10 )
1463 
1464 _common_sc_score = {"title": "Score LayerCluster to SimClusters in z+",
1465  "stat": False,
1466  "ymin": 0.1,
1467  "ymax": 1000,
1468  "xmin": 0,
1469  "xmax": 1,
1470  "drawStyle": "hist",
1471  "lineWidth": 1,
1472  "ylog": True
1473  }
1474 _common_sc_score.update(_legend_common)
1475 _score_layercluster_to_simclusters_zplus = PlotGroup("score_layercluster_to_simcluster_zplus", [
1476  Plot("Score_layercl2simcluster_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_score) for i in range(maxlayerzm,maxlayerzp)
1477  ], ncols=8 )
1478 
1479 _common_sc_shared= {"title": "Shared Energy SimCluster To Layer Cluster in z+",
1480  "stat": False,
1481  "legend": False,
1482  }
1483 _common_sc_shared.update(_legend_common)
1484 _shared_sc_plots_zplus = [Plot("SharedEnergy_simcluster2layercl_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(maxlayerzm,maxlayerzp)]
1485 _shared_sc_plots_zplus.extend([Plot("SharedEnergy_simcluster2layercl_vs_eta_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(maxlayerzm,maxlayerzp)])
1486 _shared_sc_plots_zplus.extend([Plot("SharedEnergy_simcluster2layercl_vs_phi_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(maxlayerzm,maxlayerzp)])
1487 _sharedEnergy_simcluster_to_layercluster_zplus = PlotGroup("sharedEnergy_simcluster_to_layercluster_zplus", _shared_sc_plots_zplus, ncols=8)
1488 
1489 _common_sc_shared= {"title": "Shared Energy Layer Cluster To SimCluster in z+",
1490  "stat": False,
1491  "legend": False,
1492  }
1493 _common_sc_shared.update(_legend_common)
1494 _shared_plots2_sc_zplus = [Plot("SharedEnergy_layercluster2simcluster_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(maxlayerzm,maxlayerzp)]
1495 _common_sc_shared= {"title": "Shared Energy Layer Cluster To Best SimCluster in z+",
1496  "stat": False,
1497  "legend": False,
1498  "ymin": 0,
1499  "ymax": 1,
1500  }
1501 _common_sc_shared.update(_legend_common)
1502 _shared_plots2_sc_zplus.extend([Plot("SharedEnergy_layercl2simcluster_vs_eta_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(maxlayerzm,maxlayerzp)])
1503 _shared_plots2_sc_zplus.extend([Plot("SharedEnergy_layercl2simcluster_vs_phi_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(maxlayerzm,maxlayerzp)])
1504 _sharedEnergy_layercluster_to_simcluster_zplus = PlotGroup("sharedEnergy_layercluster_to_simcluster_zplus", _shared_plots2_sc_zplus, ncols=8)
1505 
1506 
1507 _bin_count = 50
1508 _common_eff = {"stat": False, "legend": False}
1509 _effplots_sc_zplus_eta = [Plot("effic_eta_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(maxlayerzm,maxlayerzp)]
1510 _effplots_sc_zplus_phi = [Plot("effic_phi_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(maxlayerzm,maxlayerzp)]
1511 _common_eff = {"stat": False, "legend": False, "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1512 _common_eff["xmin"] = _bin_count
1513 _common_eff["xmax"] = _common_eff["xmin"] + maxlayerzm
1514 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1515 _effplots_sc_zplus = [Plot("globalEfficiencies_zplus", xtitle="Global Efficiencies in z+", **_common_eff)]
1516 _efficiencies_sc_zplus_eta = PlotGroup("Efficiencies_vs_eta_zplus", _effplots_sc_zplus_eta, ncols=10)
1517 _efficiencies_sc_zplus_phi = PlotGroup("Efficiencies_vs_phi_zplus", _effplots_sc_zplus_phi, ncols=10)
1518 _efficiencies_sc_zplus = PlotGroup("Eff_Dup_Fake_Merge_Global_zplus", _effplots_sc_zplus, ncols=4)
1519 
1520 _common_dup = {"stat": False, "legend": False}
1521 _dupplots_sc_zplus_eta = [Plot("duplicate_eta_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(maxlayerzm,maxlayerzp)]
1522 _dupplots_sc_zplus_phi = [Plot("duplicate_phi_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(maxlayerzm,maxlayerzp)]
1523 _common_dup = {"stat": False, "legend": False, "title": "Global Duplicates in z+", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1524 _common_dup["xmin"] = _bin_count
1525 _common_dup["xmax"] = _common_dup["xmin"] + maxlayerzm
1526 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1527 _dupplots_sc_zplus = [Plot("globalDuplicates_zplus", xtitle="Global Duplicates in z+", **_common_dup)]
1528 _duplicates_sc_zplus_eta = PlotGroup("Duplicates_vs_eta_zplus", _dupplots_sc_zplus_eta, ncols=10)
1529 _duplicates_sc_zplus_phi = PlotGroup("Duplicates_vs_phi_zplus", _dupplots_sc_zplus_phi, ncols=10)
1530 _duplicates_sc_zplus = PlotGroup("Eff_Dup_Fake_Merge_Global_zplus", _dupplots_sc_zplus, ncols=4)
1531 
1532 _common_fake = {"stat": False, "legend": False}
1533 _fakeplots_sc_zplus_eta = [Plot("fake_eta_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(maxlayerzm,maxlayerzp)]
1534 _fakeplots_sc_zplus_phi = [Plot("fake_phi_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(maxlayerzm,maxlayerzp)]
1535 _common_fake = {"stat": False, "legend": False, "title": "Global Fake Rates in z+", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1536 _common_fake["xmin"] = _bin_count
1537 _common_fake["xmax"] = _common_fake["xmin"] + maxlayerzm
1538 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1539 _fakeplots_sc_zplus = [Plot("globalFakeRate_zplus", xtitle="Global Fake Rate in z+", **_common_fake)]
1540 _fakes_sc_zplus_eta = PlotGroup("FakeRate_vs_eta_zplus", _fakeplots_sc_zplus_eta, ncols=10)
1541 _fakes_sc_zplus_phi = PlotGroup("FakeRate_vs_phi_zplus", _fakeplots_sc_zplus_phi, ncols=10)
1542 _fakes_sc_zplus = PlotGroup("Eff_Dup_Fake_Merge_Global_zplus", _fakeplots_sc_zplus, ncols=4)
1543 
1544 _common_merge = {"stat": False, "legend": False}
1545 _mergeplots_sc_zplus_eta = [Plot("merge_eta_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(maxlayerzm,maxlayerzp)]
1546 _mergeplots_sc_zplus_phi = [Plot("merge_phi_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(maxlayerzm,maxlayerzp)]
1547 _common_merge = {"stat": False, "legend": False, "title": "Global Merge Rates in z+", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1548 _common_merge["xmin"] = _bin_count
1549 _common_merge["xmax"] = _common_merge["xmin"] + maxlayerzm
1550 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1551 _mergeplots_sc_zplus = [Plot("globalMergeRate_zplus", xtitle="Global merge Rate in z+", **_common_merge)]
1552 _merges_sc_zplus_eta = PlotGroup("MergeRate_vs_eta_zplus", _mergeplots_sc_zplus_eta, ncols=10)
1553 _merges_sc_zplus_phi = PlotGroup("MergeRate_vs_phi_zplus", _mergeplots_sc_zplus_phi, ncols=10)
1554 _merges_sc_zplus = PlotGroup("Eff_Dup_Fake_Merge_Global_zplus", _mergeplots_sc_zplus, ncols=4)
1555 
1556 #Just in case we add some plots below to be on the safe side.
1557 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
1558 
1559 #--------------------------------------------------------------------------------------------
1560 # MULTICLUSTERS
1561 #--------------------------------------------------------------------------------------------
1562 _common_score = {#"title": "Score CaloParticle to MultiClusters",
1563  "stat": False,
1564  "ymin": 0.1,
1565  "ymax": 100000,
1566  "xmin": 0,
1567  "xmax": 1.0,
1568  "drawStyle": "hist",
1569  "lineWidth": 1,
1570  "ylog": True
1571  }
1572 _common_score.update(_legend_common)
1573 _score_caloparticle_to_multiclusters = PlotGroup("ScoreCaloParticlesToMultiClusters", [
1574  Plot("Score_caloparticle2multicl", **_common_score)
1575  ], ncols=1)
1576 
1577 _common_score = {#"title": "Score MultiCluster to CaloParticles",
1578  "stat": False,
1579  "ymin": 0.1,
1580  "ymax": 100000,
1581  "xmin": 0,
1582  "xmax": 1.0,
1583  "drawStyle": "hist",
1584  "lineWidth": 1,
1585  "ylog": True
1586  }
1587 _common_score.update(_legend_common)
1588 _score_multicluster_to_caloparticles = PlotGroup("ScoreMultiClustersToCaloParticles", [
1589  Plot("Score_multicl2caloparticle", **_common_score)
1590  ], ncols=1)
1591 
1592 _common_shared= {"title": "Shared Energy CaloParticle To Multi Cluster ",
1593  "stat": False,
1594  "legend": True,
1595  "xmin": 0,
1596  "xmax": 1.0,
1597  }
1598 _common_shared.update(_legend_common)
1599 _shared_plots = [ Plot("SharedEnergy_caloparticle2multicl", **_common_shared) ]
1600 _common_shared["xmin"] = -4.0
1601 _common_shared["xmax"] = 4.0
1602 _shared_plots.extend([Plot("SharedEnergy_caloparticle2multicl_vs_eta", xtitle="CaloParticle #eta", **_common_shared)])
1603 _shared_plots.extend([Plot("SharedEnergy_caloparticle2multicl_vs_phi", xtitle="CaloParticle #phi", **_common_shared)])
1604 _sharedEnergy_caloparticle_to_multicluster = PlotGroup("SharedEnergy_CaloParticleToMultiCluster", _shared_plots, ncols=3)
1605 
1606 _common_shared= {"title": "Shared Energy Multi Cluster To CaloParticle ",
1607  "stat": False,
1608  "legend": True,
1609  "xmin": 0,
1610  "xmax": 1.0,
1611  }
1612 _common_shared.update(_legend_common)
1613 _shared_plots2 = [Plot("SharedEnergy_multicluster2caloparticle", **_common_shared)]
1614 _common_shared["xmin"] = -4.0
1615 _common_shared["xmax"] = 4.0
1616 _shared_plots2.extend([Plot("SharedEnergy_multicl2caloparticle_vs_eta", xtitle="MultiCluster #eta", **_common_shared)])
1617 _shared_plots2.extend([Plot("SharedEnergy_multicl2caloparticle_vs_phi", xtitle="MultiCluster #phi", **_common_shared)])
1618 _sharedEnergy_multicluster_to_caloparticle = PlotGroup("SharedEnergy_MultiClusterToCaloParticle", _shared_plots2, ncols=3)
1619 
1620 
1621 _common_assoc = {#"title": "Cell Association Table",
1622  "stat": False,
1623  "legend": False,
1624  "xbinlabels": ["", "TN(pur)", "FN(ineff.)", "FP(fake)", "TP(eff)"],
1625  "xbinlabeloption": "h",
1626  "drawStyle": "hist",
1627  "ymin": 0.1,
1628  "ymax": 10000000,
1629  "ylog": True}
1630 _common_assoc.update(_legend_common)
1631 _cell_association_table = PlotGroup("cellAssociation_table", [
1632  Plot("cellAssociation_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_assoc) for i in range(0,maxlayerzm)
1633  ], ncols=8 )
1634 
1635 _common_eff = {"stat": False, "legend": False, "xbinlabelsize": 14, "xbinlabeloption": "d", "ymin": 0.0, "ymax": 1.1}
1636 _effplots = [Plot("effic_eta", xtitle="", **_common_eff)]
1637 _effplots.extend([Plot("effic_phi", xtitle="", **_common_eff)])
1638 _effplots.extend([Plot("globalEfficiencies", xtitle="", **_common_eff)])
1639 _efficiencies = PlotGroup("Efficiencies", _effplots, ncols=3)
1640 
1641 
1642 _common_dup = {"stat": False, "legend": False, "xbinlabelsize": 14, "xbinlabeloption": "d", "ymin": 0.0, "ymax": 1.1}
1643 _dupplots = [Plot("duplicate_eta", xtitle="", **_common_dup)]
1644 _dupplots.extend([Plot("duplicate_phi", xtitle="", **_common_dup)])
1645 _dupplots.extend([Plot("globalEfficiencies", xtitle="", **_common_dup)])
1646 _duplicates = PlotGroup("Duplicates", _dupplots, ncols=3)
1647 
1648 _common_fake = {"stat": False, "legend": False, "xbinlabelsize": 14, "xbinlabeloption": "d", "ymin": 0.0, "ymax": 1.1}
1649 _fakeplots = [Plot("fake_eta", xtitle="", **_common_fake)]
1650 _fakeplots.extend([Plot("fake_phi", xtitle="", **_common_fake)])
1651 _fakeplots.extend([Plot("globalEfficiencies", xtitle="", **_common_fake)])
1652 _fakes = PlotGroup("FakeRate", _fakeplots, ncols=3)
1653 
1654 _common_merge = {"stat": False, "legend": False, "xbinlabelsize": 14, "xbinlabeloption": "d", "ymin": 0.0, "ymax": 1.1}
1655 _mergeplots = [Plot("merge_eta", xtitle="", **_common_merge)]
1656 _mergeplots.extend([Plot("merge_phi", xtitle="", **_common_merge)])
1657 _mergeplots.extend([Plot("globalEfficiencies", xtitle="", **_common_merge)])
1658 _merges = PlotGroup("MergeRate", _mergeplots, ncols=3)
1659 
1660 _common_energy_score = dict(removeEmptyBins=True, xbinlabelsize=10, xbinlabeloption="d")
1661 _common_energy_score["ymax"] = 1.
1662 _common_energy_score["xmax"] = 1.0
1663 _energyscore_cp2mcl = PlotOnSideGroup("Energy_vs_Score_CaloParticlesToMultiClusters", Plot("Energy_vs_Score_caloparticle2multi", drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score), ncols=1)
1664 _common_energy_score["ymax"] = 1.
1665 _common_energy_score["xmax"] = 1.0
1666 _energyscore_mcl2cp = PlotOnSideGroup("Energy_vs_Score_MultiClustersToCaloParticles", Plot("Energy_vs_Score_multi2caloparticle", drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score), ncols=1)
1667 
1668 #Coming back to the usual box definition
1669 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
1670 
1671 _totmulticlusternum = PlotGroup("TotalNumberofMultiClusters", [
1672  Plot("totmulticlusternum", xtitle="", **_common)
1673 ],ncols=1)
1674 
1675 _multicluster_layernum_plots = [Plot("multicluster_firstlayer", xtitle="MultiCluster First Layer", **_common)]
1676 _multicluster_layernum_plots.extend([Plot("multicluster_lastlayer", xtitle="MultiCluster Last Layer", **_common)])
1677 _multicluster_layernum_plots.extend([Plot("multicluster_layersnum", xtitle="MultiCluster Number of Layers", **_common)])
1678 _multicluster_layernum = PlotGroup("LayerNumbersOfMultiCluster", _multicluster_layernum_plots, ncols=3)
1679 
1680 _common["xmax"] = 50
1681 _clusternum_in_multicluster = PlotGroup("NumberofLayerClustersinMultiCluster",[
1682  Plot("clusternum_in_multicluster", xtitle="", **_common)
1683 ],ncols=1)
1684 
1685 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65}
1686 _common = {"stat": True, "drawStyle": "pcolz", "staty": 0.65}
1687 
1688 _clusternum_in_multicluster_vs_layer = PlotGroup("NumberofLayerClustersinMultiClusterPerLayer",[
1689  Plot("clusternum_in_multicluster_vs_layer", xtitle="Layer number", ytitle = "<2d Layer Clusters in Multicluster>", **_common)
1690 ],ncols=1)
1691 
1692 _common["scale"] = 100.
1693 #, ztitle = "% of clusters" normalizeToUnitArea=True
1694 _multiplicity_numberOfEventsHistogram = "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM/multiplicity_numberOfEventsHistogram"
1695 _multiplicity_zminus_numberOfEventsHistogram = "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM/multiplicity_zminus_numberOfEventsHistogram"
1696 _multiplicity_zplus_numberOfEventsHistogram = "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM/multiplicity_zplus_numberOfEventsHistogram"
1697 
1698 _multiplicityOfLCinMCL_plots = [Plot("multiplicityOfLCinMCL", xtitle="Layer Cluster multiplicity in Multiclusters", ytitle = "Cluster size (n_{hit})",
1699  drawCommand = "colz text45", normalizeToNumberOfEvents = True, **_common)]
1700 _multiplicityOfLCinMCL_plots.extend([Plot("multiplicityOfLCinMCL_vs_layerclusterenergy", xtitle="Layer Cluster multiplicity in Multiclusters", ytitle = "Cluster Energy (GeV)",
1701  drawCommand = "colz text45", normalizeToNumberOfEvents = True, **_common)])
1702 _multiplicityOfLCinMCL_plots.extend([Plot("multiplicityOfLCinMCL_vs_layercluster_zplus", xtitle="Layer Cluster multiplicity in Multiclusters", ytitle = "Layer Number",
1703  drawCommand = "colz text45", normalizeToNumberOfEvents = True, **_common)])
1704 _multiplicityOfLCinMCL_plots.extend([Plot("multiplicityOfLCinMCL_vs_layercluster_zminus", xtitle="Layer Cluster multiplicity in Multiclusters", ytitle = "Layer Number",
1705  drawCommand = "colz text45", normalizeToNumberOfEvents = True, **_common)])
1706 _multiplicityOfLCinMCL = PlotGroup("MultiplcityofLCinMLC", _multiplicityOfLCinMCL_plots, ncols=2)
1707 
1708 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65}
1709 #--------------------------------------------------------------------------------------------
1710 # z-
1711 #--------------------------------------------------------------------------------------------
1712 _clusternum_in_multicluster_perlayer_zminus_EE = PlotGroup("NumberofLayerClustersinMultiClusterPerLayer_zminus_EE", [
1713  Plot("clusternum_in_multicluster_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
1714 ], ncols=7)
1715 
1716 _clusternum_in_multicluster_perlayer_zminus_FH = PlotGroup("NumberofLayerClustersinMultiClusterPerLayer_zminus_FH", [
1717  Plot("clusternum_in_multicluster_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
1718 ], ncols=7)
1719 
1720 _clusternum_in_multicluster_perlayer_zminus_BH = PlotGroup("NumberofLayerClustersinMultiClusterPerLayer_zminus_BH", [
1721  Plot("clusternum_in_multicluster_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
1722 ], ncols=7)
1723 
1724 #--------------------------------------------------------------------------------------------
1725 # z+
1726 #--------------------------------------------------------------------------------------------
1727 _clusternum_in_multicluster_perlayer_zplus_EE = PlotGroup("NumberofLayerClustersinMultiClusterPerLayer_zplus_EE", [
1728  Plot("clusternum_in_multicluster_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
1729 ], ncols=7)
1730 
1731 _clusternum_in_multicluster_perlayer_zplus_FH = PlotGroup("NumberofLayerClustersinMultiClusterPerLayer_zplus_FH", [
1732  Plot("clusternum_in_multicluster_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
1733 ], ncols=7)
1734 
1735 _clusternum_in_multicluster_perlayer_zplus_BH = PlotGroup("NumberofLayerClustersinMultiClusterPerLayer_zplus_BH", [
1736  Plot("clusternum_in_multicluster_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
1737 ], ncols=7)
1738 
1739 #Coming back to the usual box definition
1740 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
1741 
1742 #Some multiclusters quantities
1743 _multicluster_eppe_plots = [Plot("multicluster_eta", xtitle="MultiCluster #eta", **_common)]
1744 _multicluster_eppe_plots.extend([Plot("multicluster_phi", xtitle="MultiCluster #phi", **_common)])
1745 _multicluster_eppe_plots.extend([Plot("multicluster_pt", xtitle="MultiCluster p_{T}", **_common)])
1746 _multicluster_eppe_plots.extend([Plot("multicluster_energy", xtitle="MultiCluster Energy", **_common)])
1747 _multicluster_eppe = PlotGroup("EtaPhiPtEnergy", _multicluster_eppe_plots, ncols=2)
1748 
1749 _multicluster_xyz_plots = [Plot("multicluster_x", xtitle="MultiCluster x", **_common)]
1750 _multicluster_xyz_plots.extend([Plot("multicluster_y", xtitle="MultiCluster y", **_common)])
1751 _multicluster_xyz_plots.extend([Plot("multicluster_z", xtitle="MultiCluster z", **_common)])
1752 _multicluster_xyz = PlotGroup("XYZ", _multicluster_xyz_plots, ncols=3)
1753 
1754 #--------------------------------------------------------------------------------------------
1755 # SIMHITS, DIGIS, RECHITS
1756 #--------------------------------------------------------------------------------------------
1757 
1758 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65, "ymin": 0.1, "ylog": True}
1759 
1760 _HitValidation = PlotGroup("HitValidation", [
1761  Plot("heeEnSim", title="SimHits_EE_Energy", **_common),
1762  Plot("hebEnSim", title="SimHits_HE_Silicon_Energy", **_common),
1763  Plot("hefEnSim", title="SimHits_HE_Scintillator_Energy", **_common),
1764  ])
1765 
1766 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65}
1767 
1768 _Occupancy_EE_zplus = PlotGroup("Occupancy_EE_zplus", [Plot("HitOccupancy_Plus_layer_{:02d}".format(i), title="Occupancy_EE_zplus",
1769  xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1770  ], ncols=7)
1771 
1772 _Occupancy_HE_Silicon_zplus = PlotGroup("Occupancy_HE_Silicon_zplus", [Plot("HitOccupancy_Plus_layer_{:02d}".format(i), title="Occupancy_HE_zplus",
1773  xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1774  ], ncols=7)
1775 
1776 _Occupancy_HE_Scintillator_zplus = PlotGroup("Occupancy_HE_Scintillator_zplus", [Plot("HitOccupancy_Plus_layer_{:02d}".format(i), title="Occupancy_HE_Scintillator_zplus",
1777  xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1778  ], ncols=7)
1779 
1780 _Occupancy_EE_zminus = PlotGroup("Occupancy_EE_zminus", [Plot("HitOccupancy_Minus_layer_{:02d}".format(i), title="Occupancy_EE_zminus",
1781  xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1782  ], ncols=7)
1783 
1784 _Occupancy_HE_Silicon_zminus = PlotGroup("Occupancy_HE_Silicon_zminus", [Plot("HitOccupancy_Minus_layer_{:02d}".format(i), title="Occupancy_HE_Silicon_zminus",
1785  xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1786  ], ncols=7)
1787 
1788 _Occupancy_HE_Scintillator_zminus = PlotGroup("Occupancy_HE_Scintillator_zminus", [Plot("HitOccupancy_Minus_layer_{:02d}".format(i), title="Occupancy_HE_Scintillator_zminus",
1789  xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1790  ], ncols=7)
1791 
1792 _common_etaphi = dict(removeEmptyBins=False, xbinlabelsize=10, xbinlabeloption="d", ymin=None)
1793 
1794 _EtaPhi_EE_zplus = PlotGroup("EtaPhi_EE_zplus", [Plot("EtaPhi_Plus_layer_{:02d}".format(i), title="EtaPhi_EE_zplus",
1795  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_etaphi) for i in range(EE_min,EE_max+1)
1796  ], ncols=7)
1797 
1798 _EtaPhi_HE_Silicon_zplus = PlotGroup("EtaPhi_HE_Silicon_zplus", [Plot("EtaPhi_Plus_layer_{:02d}".format(i), title="EtaPhi_HE_Silicon_zplus",
1799  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_etaphi) for i in range(HESilicon_min,HESilicon_max+1)
1800  ], ncols=7)
1801 
1802 _EtaPhi_HE_Scintillator_zplus = PlotGroup("EtaPhi_HE_Scintillator_zplus", [Plot("EtaPhi_Plus_layer_{:02d}".format(i), title="EtaPhi_HE_Scintillator_zplus",
1803  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_etaphi) for i in range(HEScintillator_min,HEScintillator_max+1)
1804  ], ncols=7)
1805 
1806 _EtaPhi_EE_zminus = PlotGroup("EtaPhi_EE_zminus", [Plot("EtaPhi_Minus_layer_{:02d}".format(i), title="EtaPhi_EE_zminus",
1807  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_etaphi) for i in range(EE_min,EE_max+1)
1808  ], ncols=7)
1809 
1810 _EtaPhi_HE_Silicon_zminus = PlotGroup("EtaPhi_HE_Silicon_zminus", [Plot("EtaPhi_Minus_layer_{:02d}".format(i), title="EtaPhi_HE_Silicon_zminus",
1811  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_etaphi) for i in range(HESilicon_min,HESilicon_max+1)
1812  ], ncols=7)
1813 
1814 _EtaPhi_HE_Scintillator_zminus = PlotGroup("EtaPhi_HE_Scintillator_zminus", [Plot("EtaPhi_Minus_layer_{:02d}".format(i), title="EtaPhi_HE_Scintillator_zminus",
1815  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_etaphi) for i in range(HEScintillator_min,HEScintillator_max+1)
1816  ], ncols=7)
1817 
1818 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65, "ymin": 0.1, "ylog": True}
1819 
1820 _Energy_EE_0 = PlotGroup("Energy_Time_0_EE", [Plot("energy_time_0_layer_{:02d}".format(i), title="Energy_Time_0_EE",
1821  xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1822  ], ncols=7)
1823 
1824 _Energy_HE_Silicon_0 = PlotGroup("Energy_Time_0_HE_Silicon", [Plot("energy_time_0_layer_{:02d}".format(i), title="Energy_Time_0_HE_Silicon",
1825  xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1826  ], ncols=7)
1827 
1828 _Energy_HE_Scintillator_0 = PlotGroup("Energy_Time_0_HE_Scintillator", [Plot("energy_time_0_layer_{:02d}".format(i), title="Energy_Time_0_HE_Scintillator",
1829  xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1830  ], ncols=7)
1831 
1832 _Energy_EE_1 = PlotGroup("Energy_Time_1_EE", [Plot("energy_time_1_layer_{:02d}".format(i), title="Energy_Time_1_EE",
1833  xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1834  ], ncols=7)
1835 
1836 _Energy_HE_Silicon_1 = PlotGroup("Energy_Time_1_HE_Silicon", [Plot("energy_time_1_layer_{:02d}".format(i), title="Energy_Time_1_HE_Silicon",
1837  xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1838  ], ncols=7)
1839 
1840 _Energy_HE_Scintillator_1 = PlotGroup("Energy_Time_1_HE_Scintillator", [Plot("energy_time_1_layer_{:02d}".format(i), title="Energy_Time_1_HE_Scintillator",
1841  xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1842  ], ncols=7)
1843 
1844 _Energy_EE = PlotGroup("Energy_EE", [Plot("energy_layer_{:02d}".format(i), title="Energy_EE",
1845  xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1846  ], ncols=7)
1847 
1848 _Energy_HE_Silicon = PlotGroup("Energy_HE_Silicon", [Plot("energy_layer_{:02d}".format(i), title="Energy_HE_Silicon",
1849  xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1850  ], ncols=7)
1851 
1852 _Energy_HE_Scintillator = PlotGroup("Energy_HE_Scintillator", [Plot("energy_layer_{:02d}".format(i), title="Energy_HE_Scintillator",
1853  xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1854  ], ncols=7)
1855 
1856 _DigiHits_ADC_EE = PlotGroup("ADC_EE", [Plot("ADC_layer_{:02d}".format(i), title="DigiHits_ADC_EE",
1857  xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1858  ], ncols=7)
1859 
1860 _DigiHits_ADC_HE_Silicon = PlotGroup("ADC_HE_Silicon", [Plot("ADC_layer_{:02d}".format(i), title="DigiHits_ADC_HE_Silicon",
1861  xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1862  ], ncols=7)
1863 
1864 _DigiHits_ADC_HE_Scintillator = PlotGroup("ADC_HE_Scintillator", [Plot("ADC_layer_{:02d}".format(i), title="DigiHits_ADC_HE_Scintillator",
1865  xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1866  ], ncols=7)
1867 
1868 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65}
1869 
1870 _DigiHits_Occupancy_EE_zplus = PlotGroup("Occupancy_EE_zplus", [Plot("DigiOccupancy_Plus_layer_{:02d}".format(i), title="DigiHits_Occupancy_EE_zplus",
1871  xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1872  ], ncols=7)
1873 
1874 _DigiHits_Occupancy_HE_Silicon_zplus = PlotGroup("Occupancy_HE_Silicon_zplus", [Plot("DigiOccupancy_Plus_layer_{:02d}".format(i), title="DigiHits_Occupancy_HE_Silicon_zplus",
1875  xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1876  ], ncols=7)
1877 
1878 _DigiHits_Occupancy_HE_Scintillator_zplus = PlotGroup("Occupancy_HE_Scintillator_zplus", [Plot("DigiOccupancy_Plus_layer_{:02d}".format(i), title="DigiHits_Occupancy_HE_Scintillator_zplus",
1879  xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1880  ], ncols=7)
1881 
1882 _DigiHits_Occupancy_EE_zminus = PlotGroup("Occupancy_EE_zminus", [Plot("DigiOccupancy_Minus_layer_{:02d}".format(i), title="DigiHits_Occupancy_EE_zminus",
1883  xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1884  ], ncols=7)
1885 
1886 _DigiHits_Occupancy_HE_Silicon_zminus = PlotGroup("Occupancy_HE_Silicon_zminus", [Plot("DigiOccupancy_Minus_layer_{:02d}".format(i), title="DigiHits_Occupancy_HE_Silicon_zminus",
1887  xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1888  ], ncols=7)
1889 
1890 _DigiHits_Occupancy_HE_Scintillator_zminus = PlotGroup("Occupancy_HE_Scintillator_zminus", [Plot("DigiOccupancy_Minus_layer_{:02d}".format(i), title="DigiHits_Occupancy_HE_Scintillator_zminus",
1891  xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1892  ], ncols=7)
1893 
1894 _common_XY = dict(removeEmptyBins=True, xbinlabelsize=10, xbinlabeloption="d", ymin=None)
1895 
1896 _DigiHits_Occupancy_XY_EE = PlotGroup("Occupancy_XY_EE", [Plot("DigiOccupancy_XY_layer_{:02d}".format(i), title="DigiHits_Occupancy_XY_EE",
1897  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_XY) for i in range(EE_min,EE_max+1)
1898  ], ncols=7)
1899 
1900 _DigiHits_Occupancy_XY_HE_Silicon = PlotGroup("Occupancy_XY_HE_Silicon", [Plot("DigiOccupancy_XY_layer_{:02d}".format(i), title="DigiHits_Occupancy_XY_HE_Silicon",
1901  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_XY) for i in range(HESilicon_min,HESilicon_max+1)
1902  ], ncols=7)
1903 
1904 _DigiHits_Occupancy_XY_HE_Scintillator = PlotGroup("Occupancy_XY_HE_Scintillator", [Plot("DigiOccupancy_XY_layer_{:02d}".format(i), title="DigiHits_Occupancy_XY_HE_Scintillator",
1905  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_XY) for i in range(HEScintillator_min,HEScintillator_max+1)
1906  ], ncols=7)
1907 
1908 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65, "ymin": 0.1, "ylog": True}
1909 
1910 _DigiHits_TOA_EE = PlotGroup("TOA_EE", [
1911  Plot("TOA_layer_{:02d}".format(i), title="TOA_EE", xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1912  ], ncols=7)
1913 
1914 _DigiHits_TOA_HE_Silicon = PlotGroup("TOA_HE_Silicon", [
1915  Plot("TOA_layer_{:02d}".format(i), title="TOA_HE_Silicon", xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1916  ], ncols=7)
1917 
1918 _DigiHits_TOA_HE_Scintillator = PlotGroup("TOA_HE_Scintillator", [
1919  Plot("TOA_layer_{:02d}".format(i), title="TOA_HE_Scintillator", xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1920  ], ncols=7)
1921 
1922 _DigiHits_TOT_EE = PlotGroup("TOT_EE", [
1923  Plot("TOT_layer_{:02d}".format(i), title="TOT_EE", xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1924  ], ncols=7)
1925 
1926 _DigiHits_TOT_HE_Silicon = PlotGroup("TOT_HE_Silicon", [
1927  Plot("TOT_layer_{:02d}".format(i), title="TOT_HE_Silicon", xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1928  ], ncols=7)
1929 
1930 _DigiHits_TOT_HE_Scintillator = PlotGroup("TOT_HE_Scintillator", [
1931  Plot("TOT_layer_{:02d}".format(i), title="TOT_HE_Scintillator", xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1932  ], ncols=7)
1933 
1934 #===================================================================================================================
1935 #Plot definition for HitCalibration
1936 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65, "ymin": 0.1, "ylog": False}
1937 
1938 _LayerOccupancy = PlotGroup("LayerOccupancy", [
1939  Plot("LayerOccupancy", title="LayerOccupancy", **_common)], ncols=1)
1940 
1941 _ReconstructableEnergyOverCPenergy = PlotGroup("ReconstructableEnergyOverCPenergy", [
1942  Plot("h_EoP_CPene_100_calib_fraction", title="EoP_CPene_100_calib_fraction", **_common),
1943  Plot("h_EoP_CPene_200_calib_fraction", title="EoP_CPene_200_calib_fraction", **_common),
1944  Plot("h_EoP_CPene_300_calib_fraction", title="EoP_CPene_300_calib_fraction", **_common),
1945  Plot("h_EoP_CPene_scint_calib_fraction", title="EoP_CPene_scint_calib_fraction", **_common),
1946 ])
1947 
1948 _ParticleFlowClusterHGCalFromMultiCl_Closest_EoverCPenergy = PlotGroup("ParticleFlowClusterHGCalFromMultiCl", [
1949  Plot("hgcal_EoP_CPene_100_calib_fraction", title="hgcal_EoP_CPene_100_calib_fraction", **_common),
1950  Plot("hgcal_EoP_CPene_200_calib_fraction", title="hgcal_EoP_CPene_200_calib_fraction", **_common),
1951  Plot("hgcal_EoP_CPene_300_calib_fraction", title="hgcal_EoP_CPene_300_calib_fraction", **_common),
1952  Plot("hgcal_EoP_CPene_scint_calib_fraction", title="hgcal_EoP_CPene_scint_calib_fraction", **_common),
1953 ])
1954 
1955 _EcalDrivenGsfElectronsFromMultiCl_Closest_EoverCPenergy = PlotGroup("EcalDrivenGsfElectronsFromMultiCl", [
1956  Plot("hgcal_ele_EoP_CPene_100_calib_fraction", title="hgcal_ele_EoP_CPene_100_calib_fraction", **_common),
1957  Plot("hgcal_ele_EoP_CPene_200_calib_fraction", title="hgcal_ele_EoP_CPene_200_calib_fraction", **_common),
1958  Plot("hgcal_ele_EoP_CPene_300_calib_fraction", title="hgcal_ele_EoP_CPene_300_calib_fraction", **_common),
1959  Plot("hgcal_ele_EoP_CPene_scint_calib_fraction", title="hgcal_ele_EoP_CPene_scint_calib_fraction", **_common),
1960 ])
1961 
1962 _PhotonsFromMultiCl_Closest_EoverCPenergy = PlotGroup("PhotonsFromMultiCl", [
1963  Plot("hgcal_photon_EoP_CPene_100_calib_fraction", title="hgcal_photon_EoP_CPene_100_calib_fraction", **_common),
1964  Plot("hgcal_photon_EoP_CPene_200_calib_fraction", title="hgcal_photon_EoP_CPene_200_calib_fraction", **_common),
1965  Plot("hgcal_photon_EoP_CPene_300_calib_fraction", title="hgcal_photon_EoP_CPene_300_calib_fraction", **_common),
1966  Plot("hgcal_photon_EoP_CPene_scint_calib_fraction", title="hgcal_photon_EoP_CPene_scint_calib_fraction", **_common),
1967 ])
1968 
1969 #=================================================================================================
1970 hgcalLayerClustersPlotter = Plotter()
1971 layerClustersLabel = 'Layer Clusters'
1972 
1973 lc_general_clusterlevel = [
1974  # number of layer clusters per event in a) 120um, b) 200um, c) 300um, d) scint
1975  # (one entry per event in each of the four histos)
1976  _totclusternum_thick,
1977  # Miscellaneous plots:
1978  # longdepthbarycentre: The longitudinal depth barycentre. One entry per event.
1979  # mixedhitscluster: Number of clusters per event with hits in different thicknesses.
1980  # num_reco_cluster_eta: Number of reco clusters vs eta
1981  _num_reco_cluster_eta,
1982  _energyclustered,
1983  _mixedhitsclusters,
1984  _longdepthbarycentre,
1985  # calculated "energy density" for cells in a) 120um, b) 200um, c) 300um, d) scint
1986  # (one entry per rechit, in the appropriate histo)
1987  _cellsenedens_thick
1988 ]
1989 
1990 lc_clusterlevel_zminus = [
1991  # number of layer clusters per layer (one entry per event in each histo)
1992  _totclusternum_layer_EE_zminus,
1993  _totclusternum_layer_FH_zminus,
1994  _totclusternum_layer_BH_zminus,
1995  # Looking at the fraction of true energy that has been clustered; by layer and overall
1996  _energyclustered_perlayer_EE_zminus,
1997  _energyclustered_perlayer_FH_zminus,
1998  _energyclustered_perlayer_BH_zminus
1999 ]
2000 
2001 lc_cellevel_zminus = [
2002  # For each layer cluster:
2003  # number of cells in layer cluster, by layer - separate histos in each layer for 120um Si, 200/300um Si, Scint
2004  # NB: not all combinations exist; e.g. no 120um Si in layers with scint.
2005  # (One entry in the appropriate histo per layer cluster).
2006  _cellsnum_perthick_perlayer_120_EE_zminus,
2007  _cellsnum_perthick_perlayer_120_FH_zminus,
2008  _cellsnum_perthick_perlayer_120_BH_zminus,
2009  _cellsnum_perthick_perlayer_200_EE_zminus,
2010  _cellsnum_perthick_perlayer_200_FH_zminus,
2011  _cellsnum_perthick_perlayer_200_BH_zminus,
2012  _cellsnum_perthick_perlayer_300_EE_zminus,
2013  _cellsnum_perthick_perlayer_300_FH_zminus,
2014  _cellsnum_perthick_perlayer_300_BH_zminus,
2015  _cellsnum_perthick_perlayer_scint_EE_zminus,
2016  _cellsnum_perthick_perlayer_scint_FH_zminus,
2017  _cellsnum_perthick_perlayer_scint_BH_zminus,
2018  # Cell Association per Layer
2019  _cell_association_table_zminus
2020 ]
2021 
2022 lc_cp_association_zminus = [
2023  # Efficiency Plots
2024  _efficiencies_zminus,
2025  _efficiencies_zminus_eta,
2026  _efficiencies_zminus_phi,
2027  # Duplicate Plots
2028  _duplicates_zminus,
2029  _duplicates_zminus_eta,
2030  _duplicates_zminus_phi,
2031  # Fake Rate Plots
2032  _fakes_zminus,
2033  _fakes_zminus_eta,
2034  _fakes_zminus_phi,
2035  # Merge Rate Plots
2036  _merges_zminus,
2037  _merges_zminus_eta,
2038  _merges_zminus_phi,
2039  # Score of CaloParticles wrt Layer Clusters
2040  _score_caloparticle_to_layerclusters_zminus,
2041  # Score of LayerClusters wrt CaloParticles
2042  _score_layercluster_to_caloparticles_zminus,
2043  # Shared Energy between CaloParticle and LayerClusters
2044  _sharedEnergy_caloparticle_to_layercluster_zminus,
2045  # Shared Energy between LayerClusters and CaloParticle
2046  _sharedEnergy_layercluster_to_caloparticle_zminus,
2047  # Energy vs Score 2D plots CP to LC
2048  _energyscore_cp2lc_zminus,
2049  # Energy vs Score 2D plots LC to CP
2050  _energyscore_lc2cp_zminus
2051 ]
2052 
2053 lc_zminus_extended = [
2054  # For each layer cluster:
2055  # distance of cells from a) seed cell, b) max cell; and c), d): same with entries weighted by cell energy
2056  # separate histos in each layer for 120um Si, 200/300um Si, Scint
2057  # NB: not all combinations exist; e.g. no 120um Si in layers with scint.
2058  # (One entry in each of the four appropriate histos per cell in a layer cluster)
2059  _distancetomaxcell_perthickperlayer_120_EE_zminus,
2060  _distancetomaxcell_perthickperlayer_120_FH_zminus,
2061  _distancetomaxcell_perthickperlayer_120_BH_zminus,
2062  _distancetomaxcell_perthickperlayer_200_EE_zminus,
2063  _distancetomaxcell_perthickperlayer_200_FH_zminus,
2064  _distancetomaxcell_perthickperlayer_200_BH_zminus,
2065  _distancetomaxcell_perthickperlayer_300_EE_zminus,
2066  _distancetomaxcell_perthickperlayer_300_FH_zminus,
2067  _distancetomaxcell_perthickperlayer_300_BH_zminus,
2068  _distancetomaxcell_perthickperlayer_scint_EE_zminus,
2069  _distancetomaxcell_perthickperlayer_scint_FH_zminus,
2070  _distancetomaxcell_perthickperlayer_scint_BH_zminus,
2071  _distancetoseedcell_perthickperlayer_120_EE_zminus,
2072  _distancetoseedcell_perthickperlayer_120_FH_zminus,
2073  _distancetoseedcell_perthickperlayer_120_BH_zminus,
2074  _distancetoseedcell_perthickperlayer_200_EE_zminus,
2075  _distancetoseedcell_perthickperlayer_200_FH_zminus,
2076  _distancetoseedcell_perthickperlayer_200_BH_zminus,
2077  _distancetoseedcell_perthickperlayer_300_EE_zminus,
2078  _distancetoseedcell_perthickperlayer_300_FH_zminus,
2079  _distancetoseedcell_perthickperlayer_300_BH_zminus,
2080  _distancetoseedcell_perthickperlayer_scint_EE_zminus,
2081  _distancetoseedcell_perthickperlayer_scint_FH_zminus,
2082  _distancetoseedcell_perthickperlayer_scint_BH_zminus,
2083  _distancetomaxcell_perthickperlayer_eneweighted_120_EE_zminus,
2084  _distancetomaxcell_perthickperlayer_eneweighted_120_FH_zminus,
2085  _distancetomaxcell_perthickperlayer_eneweighted_120_BH_zminus,
2086  _distancetomaxcell_perthickperlayer_eneweighted_200_EE_zminus,
2087  _distancetomaxcell_perthickperlayer_eneweighted_200_FH_zminus,
2088  _distancetomaxcell_perthickperlayer_eneweighted_200_BH_zminus,
2089  _distancetomaxcell_perthickperlayer_eneweighted_300_EE_zminus,
2090  _distancetomaxcell_perthickperlayer_eneweighted_300_FH_zminus,
2091  _distancetomaxcell_perthickperlayer_eneweighted_300_BH_zminus,
2092  _distancetomaxcell_perthickperlayer_eneweighted_scint_EE_zminus,
2093  _distancetomaxcell_perthickperlayer_eneweighted_scint_FH_zminus,
2094  _distancetomaxcell_perthickperlayer_eneweighted_scint_BH_zminus,
2095  _distancetoseedcell_perthickperlayer_eneweighted_120_EE_zminus,
2096  _distancetoseedcell_perthickperlayer_eneweighted_120_FH_zminus,
2097  _distancetoseedcell_perthickperlayer_eneweighted_120_BH_zminus,
2098  _distancetoseedcell_perthickperlayer_eneweighted_200_EE_zminus,
2099  _distancetoseedcell_perthickperlayer_eneweighted_200_FH_zminus,
2100  _distancetoseedcell_perthickperlayer_eneweighted_200_BH_zminus,
2101  _distancetoseedcell_perthickperlayer_eneweighted_300_EE_zminus,
2102  _distancetoseedcell_perthickperlayer_eneweighted_300_FH_zminus,
2103  _distancetoseedcell_perthickperlayer_eneweighted_300_BH_zminus,
2104  _distancetoseedcell_perthickperlayer_eneweighted_scint_EE_zminus,
2105  _distancetoseedcell_perthickperlayer_eneweighted_scint_FH_zminus,
2106  _distancetoseedcell_perthickperlayer_eneweighted_scint_BH_zminus,
2107  _distancebetseedandmaxcell_perthickperlayer_120_EE_zminus,
2108  _distancebetseedandmaxcell_perthickperlayer_120_FH_zminus,
2109  _distancebetseedandmaxcell_perthickperlayer_120_BH_zminus,
2110  _distancebetseedandmaxcell_perthickperlayer_200_EE_zminus,
2111  _distancebetseedandmaxcell_perthickperlayer_200_FH_zminus,
2112  _distancebetseedandmaxcell_perthickperlayer_200_BH_zminus,
2113  _distancebetseedandmaxcell_perthickperlayer_300_EE_zminus,
2114  _distancebetseedandmaxcell_perthickperlayer_300_FH_zminus,
2115  _distancebetseedandmaxcell_perthickperlayer_300_BH_zminus,
2116  _distancebetseedandmaxcell_perthickperlayer_scint_EE_zminus,
2117  _distancebetseedandmaxcell_perthickperlayer_scint_FH_zminus,
2118  _distancebetseedandmaxcell_perthickperlayer_scint_BH_zminus,
2119  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_EE_zminus,
2120  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_FH_zminus,
2121  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_BH_zminus,
2122  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_EE_zminus,
2123  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_FH_zminus,
2124  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_BH_zminus,
2125  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_EE_zminus,
2126  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_FH_zminus,
2127  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH_zminus,
2128  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_EE_zminus,
2129  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_FH_zminus,
2130  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_BH_zminus
2131 ]
2132 
2133 lc_clusterlevel_zplus = [
2134  # number of layer clusters per layer (one entry per event in each histo)
2135  _totclusternum_layer_EE_zplus,
2136  _totclusternum_layer_FH_zplus,
2137  _totclusternum_layer_BH_zplus,
2138  # Looking at the fraction of true energy that has been clustered; by layer and overall
2139  _energyclustered_perlayer_EE_zplus,
2140  _energyclustered_perlayer_FH_zplus,
2141  _energyclustered_perlayer_BH_zplus
2142 ]
2143 
2144 lc_cellevel_zplus = [
2145  # number of cells in layer cluster, by layer - separate histos in each layer for 120um Si, 200/300um Si, Scint
2146  _cellsnum_perthick_perlayer_120_EE_zplus,
2147  _cellsnum_perthick_perlayer_120_FH_zplus,
2148  _cellsnum_perthick_perlayer_120_BH_zplus,
2149  _cellsnum_perthick_perlayer_200_EE_zplus,
2150  _cellsnum_perthick_perlayer_200_FH_zplus,
2151  _cellsnum_perthick_perlayer_200_BH_zplus,
2152  _cellsnum_perthick_perlayer_300_EE_zplus,
2153  _cellsnum_perthick_perlayer_300_FH_zplus,
2154  _cellsnum_perthick_perlayer_300_BH_zplus,
2155  _cellsnum_perthick_perlayer_scint_EE_zplus,
2156  _cellsnum_perthick_perlayer_scint_FH_zplus,
2157  _cellsnum_perthick_perlayer_scint_BH_zplus,
2158  # Cell Association per Layer
2159  _cell_association_table_zplus
2160 ]
2161 
2162 lc_cp_association_zplus = [
2163  # Efficiency Plots
2164  _efficiencies_zplus,
2165  _efficiencies_zplus_eta,
2166  _efficiencies_zplus_phi,
2167  # Duplicate Plots
2168  _duplicates_zplus,
2169  _duplicates_zplus_eta,
2170  _duplicates_zplus_phi,
2171  # Fake Rate Plots
2172  _fakes_zplus,
2173  _fakes_zplus_eta,
2174  _fakes_zplus_phi,
2175  # Merge Rate Plots
2176  _merges_zplus,
2177  _merges_zplus_eta,
2178  _merges_zplus_phi,
2179  # Score of CaloParticles wrt Layer Clusters
2180  _score_caloparticle_to_layerclusters_zplus,
2181  # Score of LayerClusters wrt CaloParticles
2182  _score_layercluster_to_caloparticles_zplus,
2183  # Shared Energy between CaloParticle and LayerClusters
2184  _sharedEnergy_caloparticle_to_layercluster_zplus,
2185  # Shared Energy between LayerClusters and CaloParticle
2186  _sharedEnergy_layercluster_to_caloparticle_zplus,
2187  _energyscore_cp2lc_zplus,
2188  _energyscore_lc2cp_zplus
2189 ]
2190 
2191 lc_zplus_extended = [
2192  # distance of cells from a) seed cell, b) max cell; and c), d): same with entries weighted by cell energy
2193  _distancetomaxcell_perthickperlayer_120_EE_zplus,
2194  _distancetomaxcell_perthickperlayer_120_FH_zplus,
2195  _distancetomaxcell_perthickperlayer_120_BH_zplus,
2196  _distancetomaxcell_perthickperlayer_200_EE_zplus,
2197  _distancetomaxcell_perthickperlayer_200_FH_zplus,
2198  _distancetomaxcell_perthickperlayer_200_BH_zplus,
2199  _distancetomaxcell_perthickperlayer_300_EE_zplus,
2200  _distancetomaxcell_perthickperlayer_300_FH_zplus,
2201  _distancetomaxcell_perthickperlayer_300_BH_zplus,
2202  _distancetomaxcell_perthickperlayer_scint_EE_zplus,
2203  _distancetomaxcell_perthickperlayer_scint_FH_zplus,
2204  _distancetomaxcell_perthickperlayer_scint_BH_zplus,
2205  _distancetoseedcell_perthickperlayer_120_EE_zplus,
2206  _distancetoseedcell_perthickperlayer_120_FH_zplus,
2207  _distancetoseedcell_perthickperlayer_120_BH_zplus,
2208  _distancetoseedcell_perthickperlayer_200_EE_zplus,
2209  _distancetoseedcell_perthickperlayer_200_FH_zplus,
2210  _distancetoseedcell_perthickperlayer_200_BH_zplus,
2211  _distancetoseedcell_perthickperlayer_300_EE_zplus,
2212  _distancetoseedcell_perthickperlayer_300_FH_zplus,
2213  _distancetoseedcell_perthickperlayer_300_BH_zplus,
2214  _distancetoseedcell_perthickperlayer_scint_EE_zplus,
2215  _distancetoseedcell_perthickperlayer_scint_FH_zplus,
2216  _distancetoseedcell_perthickperlayer_scint_BH_zplus,
2217  _distancetomaxcell_perthickperlayer_eneweighted_120_EE_zplus,
2218  _distancetomaxcell_perthickperlayer_eneweighted_120_FH_zplus,
2219  _distancetomaxcell_perthickperlayer_eneweighted_120_BH_zplus,
2220  _distancetomaxcell_perthickperlayer_eneweighted_200_EE_zplus,
2221  _distancetomaxcell_perthickperlayer_eneweighted_200_FH_zplus,
2222  _distancetomaxcell_perthickperlayer_eneweighted_200_BH_zplus,
2223  _distancetomaxcell_perthickperlayer_eneweighted_300_EE_zplus,
2224  _distancetomaxcell_perthickperlayer_eneweighted_300_FH_zplus,
2225  _distancetomaxcell_perthickperlayer_eneweighted_300_BH_zplus,
2226  _distancetomaxcell_perthickperlayer_eneweighted_scint_EE_zplus,
2227  _distancetomaxcell_perthickperlayer_eneweighted_scint_FH_zplus,
2228  _distancetomaxcell_perthickperlayer_eneweighted_scint_BH_zplus,
2229  _distancetoseedcell_perthickperlayer_eneweighted_120_EE_zplus,
2230  _distancetoseedcell_perthickperlayer_eneweighted_120_FH_zplus,
2231  _distancetoseedcell_perthickperlayer_eneweighted_120_BH_zplus,
2232  _distancetoseedcell_perthickperlayer_eneweighted_200_EE_zplus,
2233  _distancetoseedcell_perthickperlayer_eneweighted_200_FH_zplus,
2234  _distancetoseedcell_perthickperlayer_eneweighted_200_BH_zplus,
2235  _distancetoseedcell_perthickperlayer_eneweighted_300_EE_zplus,
2236  _distancetoseedcell_perthickperlayer_eneweighted_300_FH_zplus,
2237  _distancetoseedcell_perthickperlayer_eneweighted_300_BH_zplus,
2238  _distancetoseedcell_perthickperlayer_eneweighted_scint_EE_zplus,
2239  _distancetoseedcell_perthickperlayer_eneweighted_scint_FH_zplus,
2240  _distancetoseedcell_perthickperlayer_eneweighted_scint_BH_zplus,
2241  _distancebetseedandmaxcell_perthickperlayer_120_EE_zplus,
2242  _distancebetseedandmaxcell_perthickperlayer_120_FH_zplus,
2243  _distancebetseedandmaxcell_perthickperlayer_120_BH_zplus,
2244  _distancebetseedandmaxcell_perthickperlayer_200_EE_zplus,
2245  _distancebetseedandmaxcell_perthickperlayer_200_FH_zplus,
2246  _distancebetseedandmaxcell_perthickperlayer_200_BH_zplus,
2247  _distancebetseedandmaxcell_perthickperlayer_300_EE_zplus,
2248  _distancebetseedandmaxcell_perthickperlayer_300_FH_zplus,
2249  _distancebetseedandmaxcell_perthickperlayer_300_BH_zplus,
2250  _distancebetseedandmaxcell_perthickperlayer_scint_EE_zplus,
2251  _distancebetseedandmaxcell_perthickperlayer_scint_FH_zplus,
2252  _distancebetseedandmaxcell_perthickperlayer_scint_BH_zplus,
2253  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_EE_zplus,
2254  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_FH_zplus,
2255  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_BH_zplus,
2256  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_EE_zplus,
2257  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_FH_zplus,
2258  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_BH_zplus,
2259  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_EE_zplus,
2260  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_FH_zplus,
2261  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH_zplus,
2262  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_EE_zplus,
2263  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_FH_zplus,
2264  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_BH_zplus
2265 ]
2266 
2267 def append_hgcalLayerClustersPlots(collection = "hgcalLayerClusters", name_collection = layerClustersLabel, extended = False):
2268  print('extended : ',extended)
2269  regions_ClusterLevel = ["General: Cluster Level", "Z-minus: Cluster Level", "Z-plus: Cluster Level"]
2270  regions_CellLevel = ["Z-minus: Cell Level", "Z-plus: Cell Level"]
2271  regions_LCtoCP_association = ["Z-minus: LC_CP association", "Z-plus: LC_CP association"]
2272 
2273  plots_lc_general_clusterlevel = lc_general_clusterlevel
2274  plots_lc_clusterlevel_zminus = lc_clusterlevel_zminus
2275  plots_lc_cellevel_zminus = lc_cellevel_zminus
2276  plots_lc_clusterlevel_zplus = lc_clusterlevel_zplus
2277  plots_lc_cellevel_zplus = lc_cellevel_zplus
2278  plots_lc_cp_association_zminus = lc_cp_association_zminus
2279  plots_lc_cp_association_zplus = lc_cp_association_zplus
2280 
2281  if extended :
2282  #plots_lc_clusterlevel_zminus = lc_clusterlevel_zminus
2283  #plots_lc_clusterlevel_zplus = lc_clusterlevel_zplus
2284  plots_lc_cellevel_zminus = lc_cellevel_zminus + lc_zminus_extended
2285  plots_lc_cellevel_zplus = lc_cellevel_zplus + lc_zplus_extended
2286  #plots_lc_cp_association_zminus = lc_cp_association_zminus
2287  #plots_lc_cp_association_zplus = lc_cp_association_zplus
2288 
2289  setPlots_ClusterLevel = [plots_lc_general_clusterlevel, plots_lc_clusterlevel_zminus, plots_lc_clusterlevel_zplus]
2290  setPlots_CellLevel = [plots_lc_cellevel_zminus, plots_lc_cellevel_zplus]
2291  setPlots_LCtoCP_association = [plots_lc_cp_association_zminus, plots_lc_cp_association_zplus]
2292  for reg, setPlot in zip(regions_ClusterLevel, setPlots_ClusterLevel):
2293  hgcalLayerClustersPlotter.append(collection+"_"+reg, [
2294  _hgcalFolders(collection + "/ClusterLevel")
2295  ], PlotFolder(
2296  *setPlot,
2297  loopSubFolders=False,
2298  purpose=PlotPurpose.Timing, page=layerClustersLabel, section=reg))
2299  for reg, setPlot in zip(regions_CellLevel, setPlots_CellLevel):
2300  hgcalLayerClustersPlotter.append(collection+"_"+reg, [
2301  _hgcalFolders(collection + "/CellLevel")
2302  ], PlotFolder(
2303  *setPlot,
2304  loopSubFolders=False,
2305  purpose=PlotPurpose.Timing, page=layerClustersLabel, section=reg))
2306  for reg, setPlot in zip(regions_LCtoCP_association, setPlots_LCtoCP_association):
2307  hgcalLayerClustersPlotter.append(collection+"_"+reg, [
2308  _hgcalFolders(collection + "/LCtoCP_association")
2309  ], PlotFolder(
2310  *setPlot,
2311  loopSubFolders=False,
2312  purpose=PlotPurpose.Timing, page=layerClustersLabel, section=reg))
2313 
2314 #=================================================================================================
2315 def _hgcalsimClustersFolders(lastDirName):
2316  return "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/simClusters/"+lastDirName
2317 
2318 sc_clusterlevel = [
2319  # number of layer clusters per event in a) 120um, b) 200um, c) 300um, d) scint
2320  # (one entry per event in each of the four histos) ([B] above)
2321  _totsimclusternum_thick,
2322  # number of simclusters per layer (one entry per event in each histo) ([C] above)
2323  # z-
2324  _totsimclusternum_layer_EE_zminus,
2325  _totsimclusternum_layer_FH_zminus,
2326  _totsimclusternum_layer_BH_zminus,
2327  # z+
2328  _totsimclusternum_layer_EE_zplus,
2329  _totsimclusternum_layer_FH_zplus,
2330  _totsimclusternum_layer_BH_zplus,
2331  # Miscellaneous plots ([G] above):
2332  # mixedhitscluster: Number of clusters per event with hits in different thicknesses.
2333  _mixedhitssimclusters,
2334 ]
2335 
2336 sc_ticltracksters = [
2337  # Score of SimClusters wrt Layer Clusters
2338  # z-
2339  _score_simcluster_to_layerclusters_zminus,
2340  # z+
2341  _score_simcluster_to_layerclusters_zplus,
2342  # Score of LayerClusters wrt SimClusters
2343  # z-
2344  _score_layercluster_to_simclusters_zminus,
2345  # z+
2346  _score_layercluster_to_simclusters_zplus,
2347  # Shared Energy between SimCluster and LayerClusters
2348  # z-
2349  _sharedEnergy_simcluster_to_layercluster_zminus,
2350  # z+
2351  _sharedEnergy_simcluster_to_layercluster_zplus,
2352  # Shared Energy between LayerClusters and SimCluster
2353  # z-
2354  _sharedEnergy_layercluster_to_simcluster_zminus,
2355  # z+
2356  _sharedEnergy_layercluster_to_simcluster_zplus,
2357  # Efficiency Plots
2358  # z-
2359  _efficiencies_sc_zminus,
2360  _duplicates_sc_zminus,
2361  _fakes_sc_zminus,
2362  _merges_sc_zminus,
2363  _efficiencies_sc_zminus_eta,
2364  _efficiencies_sc_zminus_phi,
2365  # z+
2366  _efficiencies_sc_zplus,
2367  _duplicates_sc_zplus,
2368  _fakes_sc_zplus,
2369  _merges_sc_zplus,
2370  _efficiencies_sc_zplus_eta,
2371  _efficiencies_sc_zplus_phi,
2372  # Duplicate Plots
2373  # z-
2374  _duplicates_sc_zminus_eta,
2375  _duplicates_sc_zminus_phi,
2376  # z+
2377  _duplicates_sc_zplus_eta,
2378  _duplicates_sc_zplus_phi,
2379  # Fake Rate Plots
2380  # z-
2381  _fakes_sc_zminus_eta,
2382  _fakes_sc_zminus_phi,
2383  # z+
2384  _fakes_sc_zplus_eta,
2385  _fakes_sc_zplus_phi,
2386  # Merge Rate Plots
2387  # z-
2388  _merges_sc_zminus_eta,
2389  _merges_sc_zminus_phi,
2390  # z+
2391  _merges_sc_zplus_eta,
2392  _merges_sc_zplus_phi,
2393  # Energy vs Score 2D plots SC to LC
2394  # z-
2395  _energyscore_sc2lc_zminus,
2396  # z+
2397  _energyscore_sc2lc_zplus,
2398  # Energy vs Score 2D plots LC to SC
2399  # z-
2400  _energyscore_lc2sc_zminus,
2401  # z+
2402  _energyscore_lc2sc_zplus
2403 ]
2404 
2405 hgcalSimClustersPlotter = Plotter()
2406 
2407 def append_hgcalSimClustersPlots(collection, name_collection):
2408  if collection == "ClusterLevel":
2409  hgcalSimClustersPlotter.append(collection, [
2410  _hgcalsimClustersFolders(collection)
2411  ], PlotFolder(
2412  *sc_clusterlevel,
2413  loopSubFolders=False,
2414  purpose=PlotPurpose.Timing, page="SimClusters", section=name_collection))
2415  else:
2416  hgcalSimClustersPlotter.append(collection, [
2417  _hgcalsimClustersFolders(collection)
2418  ], PlotFolder(
2419  *sc_ticltracksters,
2420  loopSubFolders=False,
2421  purpose=PlotPurpose.Timing, page="SimClusters", section=name_collection))
2422 
2423 
2424 #=================================================================================================
2425 def _hgcalFolders(lastDirName="hgcalLayerClusters"):
2426  return "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/"+lastDirName
2427 
2428 _multiclustersAllPlots = [
2429  _efficiencies,
2430  _duplicates,
2431  _fakes,
2432  _merges,
2433  _multicluster_eppe,
2434  _multicluster_xyz,
2435  _totmulticlusternum,
2436  _score_caloparticle_to_multiclusters,
2437  _score_multicluster_to_caloparticles,
2438  _sharedEnergy_caloparticle_to_multicluster,
2439  _sharedEnergy_multicluster_to_caloparticle,
2440  #_energyscore_cp2mcl_mcl2cp,
2441  _energyscore_cp2mcl,
2442  _energyscore_mcl2cp,
2443  _clusternum_in_multicluster,
2444  _clusternum_in_multicluster_vs_layer,
2445  _clusternum_in_multicluster_perlayer_zminus_EE,
2446  _clusternum_in_multicluster_perlayer_zminus_FH,
2447  _clusternum_in_multicluster_perlayer_zminus_BH,
2448  _clusternum_in_multicluster_perlayer_zplus_EE,
2449  _clusternum_in_multicluster_perlayer_zplus_FH,
2450  _clusternum_in_multicluster_perlayer_zplus_BH,
2451  _multicluster_layernum,
2452  _multiplicityOfLCinMCL,
2453 ]
2454 
2455 hgcalMultiClustersPlotter = Plotter()
2456 def append_hgcalMultiClustersPlots(collection = 'ticlMultiClustersFromTrackstersMerge', name_collection = "MultiClustersMerge"):
2457  # Appending all plots for MCs
2458  hgcalMultiClustersPlotter.append(collection, [
2459  _hgcalFolders(collection)
2460  ], PlotFolder(
2461  *_multiclustersAllPlots,
2462  loopSubFolders=False,
2463  purpose=PlotPurpose.Timing, page="MultiClusters", section=name_collection))
2464 
2465  #We append here two PlotFolder because we want the text to be in percent
2466  #and the number of events are different in zplus and zminus
2467  #hgcalMultiClustersPlotter.append("Multiplicity", [
2468  # dqmfolder
2469  # ], PlotFolder(
2470  # _multiplicityOfLCinMCL_vs_layercluster_zminus,
2471  # loopSubFolders=False,
2472  # purpose=PlotPurpose.Timing, page=collection,
2473  # numberOfEventsHistogram=_multiplicity_zminus_numberOfEventsHistogram
2474  # ))
2475  #
2476  #hgcalMultiClustersPlotter.append("Multiplicity", [
2477  # dqmfolder
2478  # ], PlotFolder(
2479  # _multiplicityOfLCinMCL_vs_layercluster_zplus,
2480  # loopSubFolders=False,
2481  # purpose=PlotPurpose.Timing, page=collection,
2482  # numberOfEventsHistogram=_multiplicity_zplus_numberOfEventsHistogram
2483  # ))
2484 
2485 #=================================================================================================
2486 _common_Calo = {"stat": False, "drawStyle": "hist", "staty": 0.65, "ymin": 0.0, "ylog": False}
2487 
2488 hgcalCaloParticlesPlotter = Plotter()
2489 def append_hgcalCaloParticlesPlots(files, collection = '-211', name_collection = "pion-"):
2490 
2491  list_2D_histos = ["Energy of Rec-matched Hits vs layer",
2492  "Energy of Rec-matched Hits vs layer (1SC)",
2493  "Rec-matched Hits Sum Energy vs layer"]
2494 
2495  dqmfolder = "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/SelectedCaloParticles/" + collection
2496  templateFile = ROOT.TFile.Open(files[0]) # assuming all files have same structure
2497  if not gDirectory.GetDirectory(dqmfolder):
2498  print("Error: GeneralInfo directory %s not found in DQM file, exit"%dqmfolder)
2499  return hgcalTrackstersPlotter
2500 
2501  keys = gDirectory.GetDirectory(dqmfolder,True).GetListOfKeys()
2502  key = keys[0]
2503  while key:
2504  obj = key.ReadObj()
2505  name = obj.GetName()
2506  fileName = TString(name)
2507  fileName.ReplaceAll(" ","_")
2508  pg= PlotGroup(fileName.Data(),[
2509  Plot(name,
2510  xtitle=obj.GetXaxis().GetTitle(), ytitle=obj.GetYaxis().GetTitle(),
2511  drawCommand = "",
2512  normalizeToNumberOfEvents = True, **_common_Calo)
2513  ],
2514  ncols=1)
2515 
2516  if name in list_2D_histos :
2517  pg= PlotOnSideGroup(plotName.Data(),
2518  Plot(name,
2519  xtitle=obj.GetXaxis().GetTitle(), ytitle=obj.GetYaxis().GetTitle(),
2520  drawCommand = "COLZ",
2521  normalizeToNumberOfEvents = True, **_common_Calo)
2522  ,
2523  ncols=1)
2524 
2525  hgcalCaloParticlesPlotter.append("CaloParticles_"+name_collection, [
2526  dqmfolder
2527  ], PlotFolder(
2528  pg,
2529  loopSubFolders=False,
2530  purpose=PlotPurpose.Timing, page="CaloParticles", section=name_collection)
2531  )
2532 
2533  key = keys.After(key)
2534 
2535  templateFile.Close()
2536 
2537  return hgcalCaloParticlesPlotter
2538 
2539 #=================================================================================================
2540 def create_hgcalTrackstersPlotter(files, collection = 'ticlTrackstersMerge', name_collection = "MultiClustersMerge"):
2541  grouped = {"cosAngle Beta": PlotGroup("cosAngle_Beta_per_layer",[],ncols=10), "cosAngle Beta Weighted": PlotGroup("cosAngle_Beta_Weighted_per_layer",[],ncols=10)}
2542  groupingFlag = " on Layer "
2543 
2544  hgcalTrackstersPlotter = Plotter()
2545  dqmfolder = "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/" + collection
2546  #_multiplicity_tracksters_numberOfEventsHistogram = dqmfolder+"/Number of Trackster per Event"
2547 
2548  _common["ymin"] = 0.0
2549  _common["staty"] = 0.85
2550  templateFile = ROOT.TFile.Open(files[0]) # assuming all files have same structure
2551  if not gDirectory.GetDirectory(dqmfolder):
2552  print("Error: GeneralInfo directory %s not found in DQM file, exit"%dqmfolder)
2553  return hgcalTrackstersPlotter
2554 
2555  keys = gDirectory.GetDirectory(dqmfolder,True).GetListOfKeys()
2556  key = keys[0]
2557  while key:
2558  obj = key.ReadObj()
2559  name = obj.GetName()
2560  plotName = TString(name)
2561  plotName.ReplaceAll(" ","_")
2562 
2563  if groupingFlag in name:
2564  for group in grouped:
2565  if group+groupingFlag in name:
2566  grouped[group].append(Plot(name,
2567  xtitle=obj.GetXaxis().GetTitle(), ytitle=obj.GetYaxis().GetTitle(),
2568  **_common)
2569  )
2570  else:
2571  pg = None
2572  if obj.InheritsFrom("TH2"):
2573  pg = PlotOnSideGroup(plotName.Data(),
2574  Plot(name,
2575  xtitle=obj.GetXaxis().GetTitle(), ytitle=obj.GetYaxis().GetTitle(),
2576  drawCommand = "COLZ",
2577  **_common),
2578  ncols=1)
2579  else:
2580  pg = PlotGroup(plotName.Data(),
2581  [Plot(name,
2582  xtitle=obj.GetXaxis().GetTitle(), ytitle=obj.GetYaxis().GetTitle(),
2583  drawCommand = "COLZ", # ineffective for TH1
2584  **_common)
2585  ],
2586  ncols=1, legendDh=-0.03 * len(files))
2587 
2588  hgcalTrackstersPlotter.append(name_collection+"_TICLDebugger",
2589  [dqmfolder], PlotFolder(pg,
2590  loopSubFolders=False,
2591  purpose=PlotPurpose.Timing, page="MultiClusters", section=name_collection)
2592  #numberOfEventsHistogram=_multiplicity_tracksters_numberOfEventsHistogram)
2593  )
2594 
2595  key = keys.After(key)
2596 
2597  for group in grouped:
2598  hgcalTrackstersPlotter.append(name_collection+"_TICLDebugger",
2599  [dqmfolder], PlotFolder(grouped[group],
2600  loopSubFolders=False,
2601  purpose=PlotPurpose.Timing, page="MultiClusters", section=name_collection)
2602  #numberOfEventsHistogram=_multiplicity_tracksters_numberOfEventsHistogram)
2603  )
2604 
2605  templateFile.Close()
2606 
2607  return hgcalTrackstersPlotter
2608 
2609 #=================================================================================================
2610 _common_Calo = {"stat": False, "drawStyle": "hist", "staty": 0.65, "ymin": 0.0, "ylog": False}
2611 
2612 hgcalCaloParticlesPlotter = Plotter()
2613 
2614 def append_hgcalCaloParticlesPlots(files, collection = '-211', name_collection = "pion-"):
2615  dqmfolder = "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/SelectedCaloParticles/" + collection
2616  print(dqmfolder)
2617 # _common["ymin"] = 0.0
2618  templateFile = ROOT.TFile.Open(files[0]) # assuming all files have same structure
2619  keys = gDirectory.GetDirectory(dqmfolder,True).GetListOfKeys()
2620  key = keys[0]
2621  while key:
2622  obj = key.ReadObj()
2623  name = obj.GetName()
2624  plotName = TString(name)
2625  plotName.ReplaceAll(" ","_")
2626  pg= PlotGroup(plotName.Data(),[
2627  Plot(name,
2628  xtitle=obj.GetXaxis().GetTitle(), ytitle=obj.GetYaxis().GetTitle(),
2629  drawCommand = "", # may want to customize for TH2 (colz, etc.)
2630  normalizeToNumberOfEvents = True, **_common_Calo)
2631  ],
2632  ncols=1)
2633 
2634  if obj.InheritsFrom("TH2"):
2635  pg= PlotOnSideGroup(plotName.Data(),
2636  Plot(name,
2637  xtitle=obj.GetXaxis().GetTitle(), ytitle=obj.GetYaxis().GetTitle(),
2638  drawCommand = "COLZ",
2639  normalizeToNumberOfEvents = True, **_common_Calo),
2640  ncols=1)
2641 
2642  hgcalCaloParticlesPlotter.append("CaloParticles_"+name_collection, [
2643  dqmfolder
2644  ], PlotFolder(
2645  pg,
2646  loopSubFolders=False,
2647  purpose=PlotPurpose.Timing, page="CaloParticles", section=name_collection)
2648  )
2649 
2650  key = keys.After(key)
2651 
2652  templateFile.Close()
2653 
2654  return hgcalCaloParticlesPlotter
2655 
2656 #=================================================================================================
2657 # hitValidation
2658 def _hgcalHitFolders(dirName="HGCalSimHitsV/HGCalEESensitive"):
2659  return "DQMData/Run 1/HGCAL/Run summary/"+dirName
2660 
2661 hgcalHitPlotter = Plotter()
2662 hitsLabel = 'Hits'
2663 simHitsLabel = 'Simulated Hits'
2664 
2665 hgcalHitPlotter.append("SimHits_Validation", [
2666  "DQMData/Run 1/HGCAL/Run summary/HGCalSimHitsV/HitValidation",
2667  ], PlotFolder(
2668  _HitValidation,
2669  loopSubFolders=False,
2670  purpose=PlotPurpose.Timing, page=hitsLabel, section=simHitsLabel
2671  ))
2672 
2673 def append_hgcalHitsPlots(collection = "HGCalSimHitsV", name_collection = "Simulated Hits"):
2674  _hitsCommonPlots_EE = [
2675  _Occupancy_EE_zplus,
2676  _Occupancy_EE_zminus,
2677  _EtaPhi_EE_zminus,
2678  _EtaPhi_EE_zplus
2679  ]
2680  _hitsCommonPlots_HE_Sil = [
2681  _Occupancy_HE_Silicon_zplus,
2682  _Occupancy_HE_Silicon_zminus,
2683  _EtaPhi_HE_Silicon_zminus,
2684  _EtaPhi_HE_Silicon_zplus
2685  ]
2686  _hitsCommonPlots_HE_Sci = [
2687  _Occupancy_HE_Scintillator_zplus,
2688  _Occupancy_HE_Scintillator_zminus,
2689  _EtaPhi_HE_Scintillator_zminus,
2690  _EtaPhi_HE_Scintillator_zplus
2691  ]
2692 
2693  regions = ["HGCalEESensitive", "HGCalHESiliconSensitive", "HGCalHEScintillatorSensitive"]
2694  setPlots = [_hitsCommonPlots_EE, _hitsCommonPlots_HE_Sil, _hitsCommonPlots_HE_Sci]
2695  if "SimHits" in collection :
2696  _hitsCommonPlots_EE.append(_Energy_EE_0)
2697  _hitsCommonPlots_EE.append(_Energy_EE_1)
2698  _hitsCommonPlots_HE_Sil.append(_Energy_HE_Silicon_0)
2699  _hitsCommonPlots_HE_Sil.append( _Energy_HE_Silicon_1)
2700  _hitsCommonPlots_HE_Sil.append(_Energy_HE_Scintillator_0)
2701  _hitsCommonPlots_HE_Sil.append(_Energy_HE_Scintillator_1)
2702  if "RecHits" in collection :
2703  _hitsCommonPlots_EE.append(_Energy_EE)
2704  _hitsCommonPlots_HE_Sil.append(_Energy_HE_Silicon)
2705  _hitsCommonPlots_HE_Sil.append(_Energy_HE_Scintillator)
2706 
2707  for reg, setPlot in zip(regions, setPlots):
2708  dirName = collection+"/"+reg
2709  print(dirName)
2710  hgcalHitPlotter.append(collection, [
2711  _hgcalHitFolders(dirName)
2712  ], PlotFolder(
2713  *setPlot,
2714  loopSubFolders=False,
2715  purpose=PlotPurpose.Timing, page=hitsLabel, section=name_collection))
2716 
2717 _digisCommonPlots_EE = [
2718  _DigiHits_Occupancy_EE_zplus,
2719  _DigiHits_Occupancy_EE_zminus,
2720  _DigiHits_Occupancy_XY_EE,
2721  _DigiHits_ADC_EE,
2722  _DigiHits_TOA_EE,
2723  _DigiHits_TOT_EE,
2724 ]
2725 _digisCommonPlots_HE_Sil = [
2726  _DigiHits_Occupancy_HE_Silicon_zplus,
2727  _DigiHits_Occupancy_HE_Silicon_zminus,
2728  _DigiHits_Occupancy_XY_HE_Silicon,
2729  _DigiHits_ADC_HE_Silicon,
2730  _DigiHits_TOA_HE_Silicon,
2731  _DigiHits_TOT_HE_Silicon,
2732 ]
2733 _digisCommonPlots_HE_Sci = [
2734  _DigiHits_Occupancy_HE_Scintillator_zplus,
2735  _DigiHits_Occupancy_HE_Scintillator_zminus,
2736  _DigiHits_Occupancy_XY_HE_Scintillator,
2737  _DigiHits_ADC_HE_Scintillator,
2738  _DigiHits_TOA_HE_Scintillator,
2739  _DigiHits_TOT_HE_Scintillator,
2740 ]
2741 
2742 def append_hgcalDigisPlots(collection = "HGCalDigisV", name_collection = "Digis"):
2743  regions = ["HGCalEESensitive", "HGCalHESiliconSensitive", "HGCalHEScintillatorSensitive"]
2744  setPlots = [_digisCommonPlots_EE, _digisCommonPlots_HE_Sil, _digisCommonPlots_HE_Sci]
2745  for reg, setPlot in zip(regions, setPlots):
2746  dirName = collection+"/"+reg
2747  print(dirName)
2748  hgcalHitPlotter.append(name_collection, [
2749  _hgcalHitFolders(dirName)
2750  ], PlotFolder(
2751  *setPlot,
2752  loopSubFolders=False,
2753  purpose=PlotPurpose.Timing, page=hitsLabel, section=name_collection))
2754 
2755 #=================================================================================================
2756 # hitCalibration
2757 hgcalHitCalibPlotter = Plotter()
2758 hitCalibrationLabel = 'Calibrated RecHits'
2759 
2760 hgcalHitCalibPlotter.append("Layer_Occupancy", [
2761  "DQMData/Run 1/HGCalHitCalibration/Run summary",
2762  ], PlotFolder(
2763  _LayerOccupancy,
2764  loopSubFolders=False,
2765  purpose=PlotPurpose.Timing, page=hitCalibrationLabel, section=hitCalibrationLabel
2766  ))
2767 hgcalHitCalibPlotter.append("ReconstructableEnergyOverCPenergy", [
2768  "DQMData/Run 1/HGCalHitCalibration/Run summary",
2769  ], PlotFolder(
2770  _ReconstructableEnergyOverCPenergy,
2771  loopSubFolders=False,
2772  purpose=PlotPurpose.Timing, page=hitCalibrationLabel, section=hitCalibrationLabel
2773  ))
2774 
2775 hgcalHitCalibPlotter.append("ParticleFlowClusterHGCalFromMultiCl_Closest_EoverCPenergy", [
2776  "DQMData/Run 1/HGCalHitCalibration/Run summary",
2777  ], PlotFolder(
2778  _ParticleFlowClusterHGCalFromMultiCl_Closest_EoverCPenergy,
2779  loopSubFolders=False,
2780  purpose=PlotPurpose.Timing, page=hitCalibrationLabel, section=hitCalibrationLabel
2781  ))
2782 
2783 hgcalHitCalibPlotter.append("PhotonsFromMultiCl_Closest_EoverCPenergy", [
2784  "DQMData/Run 1/HGCalHitCalibration/Run summary",
2785  ], PlotFolder(
2786  _PhotonsFromMultiCl_Closest_EoverCPenergy,
2787  loopSubFolders=False,
2788  purpose=PlotPurpose.Timing, page=hitCalibrationLabel, section=hitCalibrationLabel
2789  ))
2790 
2791 hgcalHitCalibPlotter.append("EcalDrivenGsfElectronsFromMultiCl_Closest_EoverCPenergy", [
2792  "DQMData/Run 1/HGCalHitCalibration/Run summary",
2793  ], PlotFolder(
2794  _EcalDrivenGsfElectronsFromMultiCl_Closest_EoverCPenergy,
2795  loopSubFolders=False,
2796  purpose=PlotPurpose.Timing, page=hitCalibrationLabel, section=hitCalibrationLabel
2797  ))
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
hgcalPlots.append_hgcalCaloParticlesPlots
def append_hgcalCaloParticlesPlots(files, collection='-211', name_collection="pion-")
Definition: hgcalPlots.py:2489
hgcalPlots.append_hgcalDigisPlots
def append_hgcalDigisPlots(collection="HGCalDigisV", name_collection="Digis")
Definition: hgcalPlots.py:2742
hgcalPlots.append_hgcalMultiClustersPlots
def append_hgcalMultiClustersPlots(collection='ticlMultiClustersFromTrackstersMerge', name_collection="MultiClustersMerge")
Definition: hgcalPlots.py:2456
hgcalPlots.append_hgcalSimClustersPlots
def append_hgcalSimClustersPlots(collection, name_collection)
Definition: hgcalPlots.py:2407
hgcalPlots._hgcalHitFolders
def _hgcalHitFolders(dirName="HGCalSimHitsV/HGCalEESensitive")
Definition: hgcalPlots.py:2658
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
hgcalPlots.append_hgcalHitsPlots
def append_hgcalHitsPlots(collection="HGCalSimHitsV", name_collection="Simulated Hits")
Definition: hgcalPlots.py:2673
mps_setup.append
append
Definition: mps_setup.py:85
ComparisonHelper::zip
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
Definition: L1TStage2CaloLayer1.h:41
hgcalPlots._hgcalFolders
def _hgcalFolders(lastDirName="hgcalLayerClusters")
Definition: hgcalPlots.py:2425
hgcalPlots.create_hgcalTrackstersPlotter
def create_hgcalTrackstersPlotter(files, collection='ticlTrackstersMerge', name_collection="MultiClustersMerge")
Definition: hgcalPlots.py:2540
hgcalPlots._hgcalsimClustersFolders
def _hgcalsimClustersFolders(lastDirName)
Definition: hgcalPlots.py:2315
format
hgcalPlots.append_hgcalLayerClustersPlots
def append_hgcalLayerClustersPlots(collection="hgcalLayerClusters", name_collection=layerClustersLabel, extended=False)
Definition: hgcalPlots.py:2267