CMS 3D CMS Logo

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