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